[Vtigercrm-developers] [PATCH] 5.1_jens vs. jens' private

Enrico Weigelt weigelt at metux.de
Thu May 10 08:19:20 PDT 2007


Hi folks,

here's a bunch of patches between the 5.1_jens branch and jens's
private tree, cleaned up a little bit.

cu  
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact at metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------
-------------- next part --------------
diff -ruN orig/include/database/Postgres8.php htdocs/include/database/Postgres8.php
--- orig/include/database/Postgres8.php	2007-05-04 16:11:49.000000000 +0200
+++ htdocs/include/database/Postgres8.php	2007-05-07 14:23:49.000000000 +0200
@@ -1,144 +1,144 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-
-//Fix postgres queries
-function fixPostgresQuery($query,$log,$debug)
-{
-    // First select the query fields from the remaining query
-    $queryFields = substr($query, strlen('select'), strpos($query,'FROM')-strlen('select'));
-    $queryRecord = substr($query, strpos($query,'FROM'), strlen($query));
-    $groupClause = "";
-    $orderClause = "";
-
-    if( $debug)
-	$log->info( "fixPostgresQuery: ".$query);
-
-    // If we already have an order or group cluase separate ist for later use
-    if( strpos($queryRecord,'GROUP') > 0)
-    {
-	$groupClause = substr($queryRecord, strpos($queryRecord,'GROUP')+strlen('GROUP BY'), strlen($queryRecord));
-	if( strpos($groupClause,'ORDER') > 0)
-	{
-	    $orderClause = substr($groupClause, strpos($groupClause,'ORDER'), strlen($groupClause));
-	    $groupClause = substr($groupClause, 0, strpos($groupClause,'ORDER'));
-	}
-	$queryRecord = substr($queryRecord, 0, strpos($queryRecord,'GROUP'));
-    }
-
-    if( strpos($queryRecord,'ORDER') > 0)
-    {
-	$orderClause = substr($queryRecord, strpos($queryRecord,'ORDER'), strlen($queryRecord));
-	$queryRecord = substr($queryRecord, 0, strpos($queryRecord,'ORDER'));
-    }
-
-    // Construkt the privateGroupList from the filed list by separating combined
-    // record.field entries
-    $privateGroupList = array();
-    $token = strtok( $queryFields, ", ()	");
-    while( $token !== false) {
-	if( strpos( $token, ".") !== false) {
-	    array_push( $privateGroupList, $token);
-	}
-	$token = strtok( ", ()	");
-    }
-    sort( $privateGroupList);
-    $groupFields = "";
-    $last = "";
-    for( $i = 0; $i < count($privateGroupList); $i++) {
-	if( $last != $privateGroupList[$i]) {
-	    if( $groupFields == "")
-		$groupFields = $privateGroupList[$i];
-	    else
-		$groupFields .= ",".$privateGroupList[$i];
-	}
-	$last = $privateGroupList[$i];
-    }
-
-    // Rebuild the query
-    $query = "SELECT ".$queryFields.$queryRecord." GROUP BY ";
-    if( $groupClause != "" )
-	$groupClause = $groupClause.",".$groupFields;
-    else
-	$groupClause = $groupFields;
-    $query .= expandStar($groupClause,$log)." ".$orderClause;
-
-    if( $debug)
-	$log->info( "fixPostgresQuery result: ".$query);
-
-    return( $query);
-}
-
-// Postgres8 will not accept a "tablename.*" entry in the GROUP BY clause
-function expandStar($fieldlist,$log)
-{
-    $expanded="";
-    $field = strtok( $fieldlist, ",");
-    while( $field != "")
-    {
-	//remove leading and trailing spaces
-	$field = trim( $field);
-
-	//still spaces in the field indicate a complex structure
-	if( strpos( $field, " ") == 0)
-	{
-
-	    //locate table- and fieldname
-	    $pos = strpos( $field, ".");
-	    if( $pos > 0)
-	    {
-		$table = substr( $field, 0, $pos);
-		$subfield = substr( $field, $pos+1, strlen($field)-$pos);
-
-		//do we need to expand?
-		if( $subfield == "*") 
-		    $field = expandRecord($table,$log);
-	    }
-
-	    //add the propably expanded field to the querylist
-	    if( $expanded == "")
-		$expanded = $field;
-	    else
-		$expanded .= ",".$field;
-	}
-
-	//next field
-	$field = strtok(",");
-    }
-
-    //return the expanded fieldlist
-    return( $expanded);
-}
-
-//return an expanded table field list
-function expandRecord($table,$log)
-{
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+
+//Fix postgres queries
+function fixPostgresQuery($query,$log,$debug)
+{
+    // First select the query fields from the remaining query
+    $queryFields = substr($query, strlen('select'), strpos($query,'FROM')-strlen('select'));
+    $queryRecord = substr($query, strpos($query,'FROM'), strlen($query));
+    $groupClause = "";
+    $orderClause = "";
+
+    if( $debug)
+	$log->info( "fixPostgresQuery: ".$query);
+
+    // If we already have an order or group cluase separate ist for later use
+    if( strpos($queryRecord,'GROUP') > 0)
+    {
+	$groupClause = substr($queryRecord, strpos($queryRecord,'GROUP')+strlen('GROUP BY'), strlen($queryRecord));
+	if( strpos($groupClause,'ORDER') > 0)
+	{
+	    $orderClause = substr($groupClause, strpos($groupClause,'ORDER'), strlen($groupClause));
+	    $groupClause = substr($groupClause, 0, strpos($groupClause,'ORDER'));
+	}
+	$queryRecord = substr($queryRecord, 0, strpos($queryRecord,'GROUP'));
+    }
+
+    if( strpos($queryRecord,'ORDER') > 0)
+    {
+	$orderClause = substr($queryRecord, strpos($queryRecord,'ORDER'), strlen($queryRecord));
+	$queryRecord = substr($queryRecord, 0, strpos($queryRecord,'ORDER'));
+    }
+
+    // Construkt the privateGroupList from the filed list by separating combined
+    // record.field entries
+    $privateGroupList = array();
+    $token = strtok( $queryFields, ", ()	");
+    while( $token !== false) {
+	if( strpos( $token, ".") !== false) {
+	    array_push( $privateGroupList, $token);
+	}
+	$token = strtok( ", ()	");
+    }
+    sort( $privateGroupList);
+    $groupFields = "";
+    $last = "";
+    for( $i = 0; $i < count($privateGroupList); $i++) {
+	if( $last != $privateGroupList[$i]) {
+	    if( $groupFields == "")
+		$groupFields = $privateGroupList[$i];
+	    else
+		$groupFields .= ",".$privateGroupList[$i];
+	}
+	$last = $privateGroupList[$i];
+    }
+
+    // Rebuild the query
+    $query = "SELECT ".$queryFields.$queryRecord." GROUP BY ";
+    if( $groupClause != "" )
+	$groupClause = $groupClause.",".$groupFields;
+    else
+	$groupClause = $groupFields;
+    $query .= expandStar($groupClause,$log)." ".$orderClause;
+
+    if( $debug)
+	$log->info( "fixPostgresQuery result: ".$query);
+
+    return( $query);
+}
+
+// Postgres8 will not accept a "tablename.*" entry in the GROUP BY clause
+function expandStar($fieldlist,$log)
+{
+    $expanded="";
+    $field = strtok( $fieldlist, ",");
+    while( $field != "")
+    {
+	//remove leading and trailing spaces
+	$field = trim( $field);
+
+	//still spaces in the field indicate a complex structure
+	if( strpos( $field, " ") == 0)
+	{
+
+	    //locate table- and fieldname
+	    $pos = strpos( $field, ".");
+	    if( $pos > 0)
+	    {
+		$table = substr( $field, 0, $pos);
+		$subfield = substr( $field, $pos+1, strlen($field)-$pos);
+
+		//do we need to expand?
+		if( $subfield == "*") 
+		    $field = expandRecord($table,$log);
+	    }
+
+	    //add the propably expanded field to the querylist
+	    if( $expanded == "")
+		$expanded = $field;
+	    else
+		$expanded .= ",".$field;
+	}
+
+	//next field
+	$field = strtok(",");
+    }
+
+    //return the expanded fieldlist
+    return( $expanded);
+}
+
+//return an expanded table field list
+function expandRecord($table,$log)
+{
     global $adb;
     $result = "";
     $subfields = $adb->getColumnNames($table);
-
-    //construct an entity string
-    for( $i=0; $i<count($subfields); $i++)
-    {
-	$result .= $table.".".$subfields[$i].",";
-    }
-
-    //remove the trailiung ,
-    if( strlen( $result) > 0)
-	$result = substr( $result, 0, strlen( $result) -1);
-    
-    //return out new string
-    return( $result);
-}
-?>
+
+    //construct an entity string
+    for( $i=0; $i<count($subfields); $i++)
+    {
+	$result .= $table.".".$subfields[$i].",";
+    }
+
+    //remove the trailiung ,
+    if( strlen( $result) > 0)
+	$result = substr( $result, 0, strlen( $result) -1);
+    
+    //return out new string
+    return( $result);
+}
+?>
-------------- next part --------------
diff -ruN orig/data/SugarBean.php htdocs/data/SugarBean.php
--- orig/data/SugarBean.php	2007-05-04 16:11:47.000000000 +0200
+++ htdocs/data/SugarBean.php	2007-05-07 14:40:44.000000000 +0200
@@ -1,451 +1,451 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the 
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/data/SugarBean.php,v 1.70 2005/03/16 10:25:16 shaw Exp $
- * Description:  Defines the base class for all data entities used throughout the 
- * application.  The base class including its methods and variables is designed to 
- * be overloaded with module-specific methods and variables particular to the 
- * module's base entity class. 
- ********************************************************************************/
-
-include_once('config.php');
-require_once('include/logging.php');
-require_once('data/Tracker.php');
-require_once('include/utils/utils.php');
-require_once('include/utils/UserInfoUtil.php');
-require_once('include/database/PearDatabase.php');
-
-class SugarBean
-{
-    /**
-     * This method implements a generic insert and update logic for any SugarBean
-     * This method only works for subclasses that implement the same variable names.
-     * This method uses the presence of an id vtiger_field that is not null to signify and update.
-     * The id vtiger_field should not be set otherwise.
-     * todo - Add support for vtiger_field type validation and encoding of parameters.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
-     */
-	
-
-	function save($module_name= '') 
-	{
-         global $adb; 
-          global $current_user;
-		$isUpdate = true;
-
-		if(!isset($this->id) || $this->id == "")
-		{
-			$isUpdate = false;
-		}
-
-		if ( $this->new_with_id == true )
-		{
-			$isUpdate = false;
-		}
-
-		//$this->date_modified = $this->db->formatDate(date('YmdHis'));
-		$this->date_modified = date('YmdHis');
-		if (isset($current_user)) $this->modified_user_id = $current_user->id;
-		
-		if($isUpdate)
-		{
-    			$query = "Update ".$this->table_name." set ";
-		}
-		else
-		{
-    			//$this->date_entered = $this->db->formatDate(date('YmdHis'));
-			$this->date_entered = date('YmdHis');
-
-			if($this->new_schema && 
-				$this->new_with_id == false)
-			{
-                          $this->id = $this->db->getUniqueID("vtiger_users");
-			}
-                        
-			$query = "INSERT into ".$this->table_name;
-		}
-		// todo - add date modified to the list.
-
-		// write out the SQL statement.
-		//$query .= $this->table_name." set ";
-
-		$firstPass = 0;
-		$insKeys = '(';
-		$insValues = '(';
-		$updKeyValues='';
-		foreach($this->column_fields as $field)
-		{
-			// Do not write out the id vtiger_field on the update statement.
-			// We are not allowed to change ids.
-			if($isUpdate && ('id' == $field))
-				continue;
-
-			// Only assign variables that have been set.
-			if(isset($this->$field))
-			{				
-				// Try comparing this element with the head element.
-				if(0 == $firstPass)
-				{
-					$firstPass = 1;
-				}
-				else
-				{
-					if($isUpdate)
-					{
-						$updKeyValues = $updKeyValues.", ";
-					}
-					else
-					{
-						$insKeys = $insKeys.", ";
-						$insValues = $insValues.", ";
-					}
-				}
-				/*else
-					$query = $query.", ";
-	
-				$query = $query.$field."='".$adb->quote(from_html($this->$field,$isUpdate))."'";
-				*/
-				if($isUpdate)
-				{
-					$updKeyValues = $updKeyValues.$field."=".$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate));
-				}
-				else
-				{
-					$insKeys = $insKeys.$field;
-					$insValues = $insValues.$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate));
-				}
-			}
-		}
-
-		if($isUpdate)
-		{
-			$query = $query.$updKeyValues." WHERE ID = '$this->id'";
-			$this->log->info("Update $this->object_name: ".$query);
-		}
-		else
-		{
-			$query = $query.$insKeys.") VALUES ".$insValues.")";
-	        	$this->log->info("Insert: ".$query);
-		}
-
-		$this->db->query($query, true);
-
-		// If this is not an update then store the id for later.
-		if(!$isUpdate && !$this->new_schema && !$this->new_with_id)
-		{
-			$this->db->println("Illegal Access - SugarBean");
-			//this is mysql specific
-	        	$this->id = $this->db->getOne("SELECT LAST_INSERT_ID()" );
-		}
-	        
-		return $this->id;
-	}
-
-    
-    /**
-     * This function retrieves a record of the appropriate type from the DB.
-     * It fills in all of the vtiger_fields from the DB into the object it was called on.
-     * param $id - If ID is specified, it overrides the current value of $this->id.  If not specified the current value of $this->id will be used.
-     * returns this - The object that it was called apon or null if exactly 1 record was not found.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
-	 function retrieve($id = -1, $encodeThis=true) {
-		if ($id == -1) {
-			$id = $this->id;
-		}
-		if($id == '') {
-			return null;
-		}
-// GS porting vtiger_crmentity
-$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'";
-//		$query = "SELECT * FROM $this->table_name WHERE ID = '$id'";
-		$this->log->debug("Retrieve $this->object_name: ".$query);
-
-		$result =& $this->db->requireSingleResult($query, true, "Retrieving record by id $this->table_name:$id found ");
-
-		if(empty($result))
-		{
-			return null;
-		}
-				
-		$row = $this->db->fetchByAssoc($result, -1, $encodeThis);
-
-		foreach($this->column_fields as $field)
-		{
-			if(isset($row[$field]))
-			{
-				$this->$field = $row[$field];
-			}
-		}
-		return $this;
-	}
-     */
-
-	function get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1) {
-		$this->log->debug("get_list:  order_by = '$order_by' and where = '$where' and limit = '$limit'");
-		
-		$query = $this->create_list_query($order_by, $where);
-		
-		return $this->process_list_query($query, $row_offset, $limit, $max);
-	}
-
-	/**
-	 * This function returns a full (ie non-paged) list of the current object type.  
-	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
-	 * All Rights Reserved..
-	 * Contributor(s): ______________________________________..
-	 */
-	function get_full_list($order_by = "", $where = "") {
-		$this->log->debug("get_full_list:  order_by = '$order_by' and where = '$where'");
-		$query = "SELECT * FROM $this->table_name ";
-		
-		if($where != "")
-			$query .= "where ($where) AND deleted=0";
-		else
-			$query .= "where deleted=0";
-
-		if(!empty($order_by))
-			$query .= " ORDER BY $order_by";
-
-		$result =& $this->db->query($query, false);
-
-		if($this->db->getRowCount($result) > 0){
-		
-			// We have some data.
-			while ($row = $this->db->fetchByAssoc($result)) {
-				foreach($this->list_fields as $field)
-				{
-					if (isset($row[$field])) {
-						$this->$field = $row[$field];
-						
-						$this->log->debug("process_full_list: $this->object_name({$row['id']}): ".$field." = ".$this->$field);
-					}
-					else {
- 	                                                $this->$field = '';   
-					}
-				}
-
-
-				$list[] = clone($this);         //added clone tosupport PHP5
-			}
-		}
-
-		if (isset($list)) return $list;
-		else return null;
-
-	}
-
-	function create_list_query($order_by, $where)
-	{
-		$query = "SELECT * FROM $this->table_name ";
-		
-		if($where != "")
-			$query .= "where ($where) AND deleted=0";
-		else
-			$query .= "where deleted=0";
-
-		if(!empty($order_by))
-			$query .= " ORDER BY $order_by";
-
-		return $query;
-	}
-	
-
-	function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1)
-	{
-		global $list_max_entries_per_page;
-		$this->log->debug("process_list_query: ".$query);
-		if(!empty($limit) && $limit != -1){
-			$result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: ");
-		}else{
-			$result =& $this->db->query($query,true,"Error retrieving $this->object_name list: ");
-		}
-
-		$list = Array();
-		if($max_per_page == -1){
-			$max_per_page 	= $list_max_entries_per_page;
-		}
-		$rows_found =  $this->db->getRowCount($result);
-
-		$this->log->debug("Found $rows_found ".$this->object_name."s");
-                
-		$previous_offset = $row_offset - $max_per_page;
-		$next_offset = $row_offset + $max_per_page;
-
-		if($rows_found != 0)
-		{
-
-			// We have some data.
-
-			for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){
-				foreach($this->list_fields as $field)
-				{
-					if (isset($row[$field])) {
-						$this->$field = $row[$field];
-						
-						
-						$this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field);
-					}
-					else 
-					{
-						$this->$field = "";
-					}
-				}
-
-
-				$list[] = clone($this);   //added clone to support PHP5
-			}
-		}
-
-		$response = Array();
-		$response['list'] = $list;
-		$response['row_count'] = $rows_found;
-		$response['next_offset'] = $next_offset;
-		$response['previous_offset'] = $previous_offset;
-
-		return $response;
-	}
-
-	
-	/**
-	 * Track the viewing of a detail record.  This leverages get_summary_text() which is object specific
-	 * params $user_id - The user that is viewing the record.
-	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
-	 * All Rights Reserved..
-	 * Contributor(s): ______________________________________..
-	 */
-	function track_view($user_id, $current_module,$id='')
-	{
-		$this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)");
-
-		$tracker = new Tracker();
-		$tracker->track_view($user_id, $current_module, $id, '');
-	}
-
-
-	/** This function should be overridden in each module.  It marks an item as deleted.
-	* If it is not overridden, then marking this type of item is not allowed
-	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
-	 * All Rights Reserved..
-	 * Contributor(s): ______________________________________..
-	*/
-	function mark_deleted($id)
-	{
-		$query = "UPDATE $this->table_name set deleted=1 where id='$id'";
-		$this->db->query($query, true,"Error marking record deleted: ");
-
-		$this->mark_relationships_deleted($id);
-
-		// Take the item off of the recently viewed lists.
-		$tracker = new Tracker();
-		$tracker->delete_item_history($id);
-
-	}
-
-
-	/* This is to allow subclasses to fill in row specific columns of a list view form 
-	function list_view_parse_additional_sections(&$list_form)
-	{
-	}
-	*/
-	/* This function assigns all of the values into the template for the list view 
-	function get_list_view_array(){
-		$return_array = Array();
-		
-		foreach($this->list_fields as $field)
-		{
-			$return_array[strtoupper($field)] = $this->$field;
-		}
-		
-		return $return_array;	
-	}
-	function get_list_view_data()
-	{
-		
-		return $this->get_list_view_array();
-	}
-
-	function get_where(&$fields_array)
-	{ 
-		$where_clause = "WHERE "; 
-		$first = 1; 
-		foreach ($fields_array as $name=>$value) 
-		{ 
-			if ($first) 
-			{ 
-				$first = 0;
-			} 
-			else 
-			{ 
-				$where_clause .= " AND ";
-			} 
-
-			$where_clause .= "$name = ".$adb->quote($value)."";
-		} 
-
-		$where_clause .= " AND deleted=0";
-		return $where_clause;
-	}
-
-
-	function retrieve_by_string_fields($fields_array, $encode=true) 
-	{ 
-		$where_clause = $this->get_where($fields_array);
-		
-		$query = "SELECT * FROM $this->table_name $where_clause";
-		$this->log->debug("Retrieve $this->object_name: ".$query);
-		$result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:");
-		if( empty($result)) 
-		{ 
-		 	return null; 
-		} 
-
-		 $row = $this->db->fetchByAssoc($result,-1, $encode);
-
-		foreach($this->column_fields as $field) 
-		{ 
-			if(isset($row[$field])) 
-			{ 
-				$this->$field = $row[$field];
-			}
-		} 
-		return $this;
-	}
-
-	// this method is called during an import before inserting a bean
-	// define an associative array called $special_fields
-	// the keys are user defined, and don't directly map to the bean's vtiger_fields
-	// the value is the method name within that bean that will do extra
-	// processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name'
-
-	function process_special_fields() 
-	{ 
-		foreach ($this->special_functions as $func_name) 
-		{ 
-			if ( method_exists($this,$func_name) ) 
-			{ 
-				$this->$func_name(); 
-			} 
-		} 
-	}
-
-	*/
-}
-
-
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the 
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/data/SugarBean.php,v 1.70 2005/03/16 10:25:16 shaw Exp $
+ * Description:  Defines the base class for all data entities used throughout the 
+ * application.  The base class including its methods and variables is designed to 
+ * be overloaded with module-specific methods and variables particular to the 
+ * module's base entity class. 
+ ********************************************************************************/
+
+include_once('config.php');
+require_once('include/logging.php');
+require_once('data/Tracker.php');
+require_once('include/utils/utils.php');
+require_once('include/utils/UserInfoUtil.php');
+require_once('include/database/PearDatabase.php');
+
+class SugarBean
+{
+    /**
+     * This method implements a generic insert and update logic for any SugarBean
+     * This method only works for subclasses that implement the same variable names.
+     * This method uses the presence of an id vtiger_field that is not null to signify and update.
+     * The id vtiger_field should not be set otherwise.
+     * todo - Add support for vtiger_field type validation and encoding of parameters.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+     */
+	
+
+	function save($module_name= '') 
+	{
+         global $adb; 
+          global $current_user;
+		$isUpdate = true;
+
+		if(!isset($this->id) || $this->id == "")
+		{
+			$isUpdate = false;
+		}
+
+		if ( $this->new_with_id == true )
+		{
+			$isUpdate = false;
+		}
+
+		//$this->date_modified = $this->db->formatDate(date('YmdHis'));
+		$this->date_modified = date('YmdHis');
+		if (isset($current_user)) $this->modified_user_id = $current_user->id;
+		
+		if($isUpdate)
+		{
+    			$query = "Update ".$this->table_name." set ";
+		}
+		else
+		{
+    			//$this->date_entered = $this->db->formatDate(date('YmdHis'));
+			$this->date_entered = date('YmdHis');
+
+			if($this->new_schema && 
+				$this->new_with_id == false)
+			{
+                          $this->id = $this->db->getUniqueID("vtiger_users");
+			}
+                        
+			$query = "INSERT into ".$this->table_name;
+		}
+		// todo - add date modified to the list.
+
+		// write out the SQL statement.
+		//$query .= $this->table_name." set ";
+
+		$firstPass = 0;
+		$insKeys = '(';
+		$insValues = '(';
+		$updKeyValues='';
+		foreach($this->column_fields as $field)
+		{
+			// Do not write out the id vtiger_field on the update statement.
+			// We are not allowed to change ids.
+			if($isUpdate && ('id' == $field))
+				continue;
+
+			// Only assign variables that have been set.
+			if(isset($this->$field))
+			{				
+				// Try comparing this element with the head element.
+				if(0 == $firstPass)
+				{
+					$firstPass = 1;
+				}
+				else
+				{
+					if($isUpdate)
+					{
+						$updKeyValues = $updKeyValues.", ";
+					}
+					else
+					{
+						$insKeys = $insKeys.", ";
+						$insValues = $insValues.", ";
+					}
+				}
+				/*else
+					$query = $query.", ";
+	
+				$query = $query.$field."='".$adb->quote(from_html($this->$field,$isUpdate))."'";
+				*/
+				if($isUpdate)
+				{
+					$updKeyValues = $updKeyValues.$field."=".$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate));
+				}
+				else
+				{
+					$insKeys = $insKeys.$field;
+					$insValues = $insValues.$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate));
+				}
+			}
+		}
+
+		if($isUpdate)
+		{
+			$query = $query.$updKeyValues." WHERE ID = '$this->id'";
+			$this->log->info("Update $this->object_name: ".$query);
+		}
+		else
+		{
+			$query = $query.$insKeys.") VALUES ".$insValues.")";
+	        	$this->log->info("Insert: ".$query);
+		}
+
+		$this->db->query($query, true);
+
+		// If this is not an update then store the id for later.
+		if(!$isUpdate && !$this->new_schema && !$this->new_with_id)
+		{
+			$this->db->println("Illegal Access - SugarBean");
+			//this is mysql specific
+	        	$this->id = $this->db->getOne("SELECT LAST_INSERT_ID()" );
+		}
+	        
+		return $this->id;
+	}
+
+    
+    /**
+     * This function retrieves a record of the appropriate type from the DB.
+     * It fills in all of the vtiger_fields from the DB into the object it was called on.
+     * param $id - If ID is specified, it overrides the current value of $this->id.  If not specified the current value of $this->id will be used.
+     * returns this - The object that it was called apon or null if exactly 1 record was not found.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+	 function retrieve($id = -1, $encodeThis=true) {
+		if ($id == -1) {
+			$id = $this->id;
+		}
+		if($id == '') {
+			return null;
+		}
+// GS porting vtiger_crmentity
+$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'";
+//		$query = "SELECT * FROM $this->table_name WHERE ID = '$id'";
+		$this->log->debug("Retrieve $this->object_name: ".$query);
+
+		$result =& $this->db->requireSingleResult($query, true, "Retrieving record by id $this->table_name:$id found ");
+
+		if(empty($result))
+		{
+			return null;
+		}
+				
+		$row = $this->db->fetchByAssoc($result, -1, $encodeThis);
+
+		foreach($this->column_fields as $field)
+		{
+			if(isset($row[$field]))
+			{
+				$this->$field = $row[$field];
+			}
+		}
+		return $this;
+	}
+     */
+
+	function get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1) {
+		$this->log->debug("get_list:  order_by = '$order_by' and where = '$where' and limit = '$limit'");
+		
+		$query = $this->create_list_query($order_by, $where);
+		
+		return $this->process_list_query($query, $row_offset, $limit, $max);
+	}
+
+	/**
+	 * This function returns a full (ie non-paged) list of the current object type.  
+	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
+	 * All Rights Reserved..
+	 * Contributor(s): ______________________________________..
+	 */
+	function get_full_list($order_by = "", $where = "") {
+		$this->log->debug("get_full_list:  order_by = '$order_by' and where = '$where'");
+		$query = "SELECT * FROM $this->table_name ";
+		
+		if($where != "")
+			$query .= "where ($where) AND deleted=0";
+		else
+			$query .= "where deleted=0";
+
+		if(!empty($order_by))
+			$query .= " ORDER BY $order_by";
+
+		$result =& $this->db->query($query, false);
+
+		if($this->db->getRowCount($result) > 0){
+		
+			// We have some data.
+			while ($row = $this->db->fetchByAssoc($result)) {
+				foreach($this->list_fields as $field)
+				{
+					if (isset($row[$field])) {
+						$this->$field = $row[$field];
+						
+						$this->log->debug("process_full_list: $this->object_name({$row['id']}): ".$field." = ".$this->$field);
+					}
+					else {
+ 	                                                $this->$field = '';   
+					}
+				}
+
+
+				$list[] = clone($this);         //added clone tosupport PHP5
+			}
+		}
+
+		if (isset($list)) return $list;
+		else return null;
+
+	}
+
+	function create_list_query($order_by, $where)
+	{
+		$query = "SELECT * FROM $this->table_name ";
+		
+		if($where != "")
+			$query .= "where ($where) AND deleted=0";
+		else
+			$query .= "where deleted=0";
+
+		if(!empty($order_by))
+			$query .= " ORDER BY $order_by";
+
+		return $query;
+	}
+	
+
+	function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1)
+	{
+		global $list_max_entries_per_page;
+		$this->log->debug("process_list_query: ".$query);
+		if(!empty($limit) && $limit != -1){
+			$result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: ");
+		}else{
+			$result =& $this->db->query($query,true,"Error retrieving $this->object_name list: ");
+		}
+
+		$list = Array();
+		if($max_per_page == -1){
+			$max_per_page 	= $list_max_entries_per_page;
+		}
+		$rows_found =  $this->db->getRowCount($result);
+
+		$this->log->debug("Found $rows_found ".$this->object_name."s");
+                
+		$previous_offset = $row_offset - $max_per_page;
+		$next_offset = $row_offset + $max_per_page;
+
+		if($rows_found != 0)
+		{
+
+			// We have some data.
+
+			for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){
+				foreach($this->list_fields as $field)
+				{
+					if (isset($row[$field])) {
+						$this->$field = $row[$field];
+						
+						
+						$this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field);
+					}
+					else 
+					{
+						$this->$field = "";
+					}
+				}
+
+
+				$list[] = clone($this);   //added clone to support PHP5
+			}
+		}
+
+		$response = Array();
+		$response['list'] = $list;
+		$response['row_count'] = $rows_found;
+		$response['next_offset'] = $next_offset;
+		$response['previous_offset'] = $previous_offset;
+
+		return $response;
+	}
+
+	
+	/**
+	 * Track the viewing of a detail record.  This leverages get_summary_text() which is object specific
+	 * params $user_id - The user that is viewing the record.
+	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
+	 * All Rights Reserved..
+	 * Contributor(s): ______________________________________..
+	 */
+	function track_view($user_id, $current_module,$id='')
+	{
+		$this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)");
+
+		$tracker = new Tracker();
+		$tracker->track_view($user_id, $current_module, $id, '');
+	}
+
+
+	/** This function should be overridden in each module.  It marks an item as deleted.
+	* If it is not overridden, then marking this type of item is not allowed
+	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
+	 * All Rights Reserved..
+	 * Contributor(s): ______________________________________..
+	*/
+	function mark_deleted($id)
+	{
+		$query = "UPDATE $this->table_name set deleted=1 where id='$id'";
+		$this->db->query($query, true,"Error marking record deleted: ");
+
+		$this->mark_relationships_deleted($id);
+
+		// Take the item off of the recently viewed lists.
+		$tracker = new Tracker();
+		$tracker->delete_item_history($id);
+
+	}
+
+
+	/* This is to allow subclasses to fill in row specific columns of a list view form 
+	function list_view_parse_additional_sections(&$list_form)
+	{
+	}
+	*/
+	/* This function assigns all of the values into the template for the list view 
+	function get_list_view_array(){
+		$return_array = Array();
+		
+		foreach($this->list_fields as $field)
+		{
+			$return_array[strtoupper($field)] = $this->$field;
+		}
+		
+		return $return_array;	
+	}
+	function get_list_view_data()
+	{
+		
+		return $this->get_list_view_array();
+	}
+
+	function get_where(&$fields_array)
+	{ 
+		$where_clause = "WHERE "; 
+		$first = 1; 
+		foreach ($fields_array as $name=>$value) 
+		{ 
+			if ($first) 
+			{ 
+				$first = 0;
+			} 
+			else 
+			{ 
+				$where_clause .= " AND ";
+			} 
+
+			$where_clause .= "$name = ".$adb->quote($value)."";
+		} 
+
+		$where_clause .= " AND deleted=0";
+		return $where_clause;
+	}
+
+
+	function retrieve_by_string_fields($fields_array, $encode=true) 
+	{ 
+		$where_clause = $this->get_where($fields_array);
+		
+		$query = "SELECT * FROM $this->table_name $where_clause";
+		$this->log->debug("Retrieve $this->object_name: ".$query);
+		$result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:");
+		if( empty($result)) 
+		{ 
+		 	return null; 
+		} 
+
+		 $row = $this->db->fetchByAssoc($result,-1, $encode);
+
+		foreach($this->column_fields as $field) 
+		{ 
+			if(isset($row[$field])) 
+			{ 
+				$this->$field = $row[$field];
+			}
+		} 
+		return $this;
+	}
+
+	// this method is called during an import before inserting a bean
+	// define an associative array called $special_fields
+	// the keys are user defined, and don't directly map to the bean's vtiger_fields
+	// the value is the method name within that bean that will do extra
+	// processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name'
+
+	function process_special_fields() 
+	{ 
+		foreach ($this->special_functions as $func_name) 
+		{ 
+			if ( method_exists($this,$func_name) ) 
+			{ 
+				$this->$func_name(); 
+			} 
+		} 
+	}
+
+	*/
+}
+
+
+?>
-------------- next part --------------
diff -ruN orig/include/utils/EditViewUtils.php htdocs/include/utils/EditViewUtils.php
--- orig/include/utils/EditViewUtils.php	2007-05-04 16:11:48.000000000 +0200
+++ htdocs/include/utils/EditViewUtils.php	2007-05-07 14:45:15.000000000 +0200
@@ -157,7 +157,7 @@
 		}
 		$fieldvalue [] = $options;
 	}
-	elseif($uitype == 17)
+	elseif($uitype == 17 || $uitype == 18)
 	{
 		$editview_label[]=$mod_strings[$fieldlabel];
 		$fieldvalue [] = $value;
@@ -1194,6 +1194,11 @@
 			$fieldvalue[] = $value;
 	}
 
+	// For inheritance
+	if ( in_array($uitype,array(3,4,18,31,32)) ) {
+	    $fieldvalue[] = $col_fields[$fieldname."@##@"];
+	}
+
 	// Mike Crowe Mod --------------------------------------------------------force numerics right justified.
 	if ( !eregi("id=",$custfld) )
 		$custfld = preg_replace("/<input/iS","<input id='$fieldname' ",$custfld);
@@ -1206,6 +1211,7 @@
 	$final_arr[]=$editview_label;
 	$final_arr[]=$editview_fldname;
 	$final_arr[]=$fieldvalue;
+	$final_arr[]=$inherit;
 	$log->debug("Exiting getOutputHtml method ...");
 	return $final_arr;
 }
@@ -1883,4 +1889,104 @@
 }
 
 
+/** This function returns the detailed list of organization units associated to 
+*   the selected organization
+* Param $organization - organization object 
+*/
+
+function getOrgUnits($organization,$orgunitid="")
+{
+    // The array we're about to build
+    $orgunittab = array();
+    $fields = "orgunitid,type,name,address,city,state,country,code,phone,fax,website";
+    $fields .= ",logoname,quote_template,so_template,po_template,invoice_template";
+    global $adb;
+
+    // Parameter check
+    if( !isset( $organization) || $organization == '' ||
+	!isset( $organization->id) || $organization->id == '')
+	return $orgunittab;
+
+    // Database query
+    if( $orgunitid != "0")
+	$query = "SELECT vtiger_orgunit.orgunitid AS orgunitid,";
+    else
+	$query = "SELECT 0 AS orgunitid,";
+
+    // logoname is only defined in the organization record.
+    $query .= "'@##@' AS logoname, vtiger_organizationdetails.logoname AS org_logoname";
+
+    foreach( split( ',', $fields) as $field) {
+	if( $field != "orgunitid" && $field != "logoname") {
+	    if( $orgunitid != "0")
+		$query .= ",vtiger_orgunit.".$field." AS ".$field;
+	    else
+		$query .= ",NULL AS ".$field;
+	    if( $field != "type" && $field != "name")
+		$query .= ",vtiger_organizationdetails.".$field." AS org_".$field;
+	}
+    }
+
+    if( $orgunitid != "0" ) {
+	// database joins
+	$query .= " FROM vtiger_orgunit 
+			LEFT JOIN vtiger_organizationdetails
+			    ON vtiger_orgunit.organizationname=vtiger_organizationdetails.organizationname ";
+
+	// single or list query?
+	if( $orgunitid == "")
+	    $query .= "WHERE vtiger_orgunit.organizationname='".$organization->id."' ";
+	else
+	    $query .= "WHERE vtiger_orgunit.orgunitid=".$orgunitid." ";
+
+	// do not return deleted orgunits
+	$query .= "AND vtiger_orgunit.deleted=0";
+    }
+
+    else {
+	$query .= " FROM vtiger_organizationdetails ";
+	$query .= " WHERE vtiger_organizationdetails.organizationname='".$organization->id."' ";
+    }
+
+    // Do not return deleted organizations
+    $query .= " AND vtiger_organizationdetails.deleted=0";
+
+    $result = $adb->query( $query);
+    $noofrows = $adb->num_rows($result);
+
+    // Get all rows from database
+    for($j = 0; $j < $noofrows; $j++) {
+	$orgunit = array();
+	foreach( split( ',', $fields) as $field) {
+	    if( $orgunitid != "0") {
+		$orgunit[$field] = $adb->query_result($result,$j,$field);
+
+		// Inherited and extended fields
+		if( substr( $orgunit[$field], 0, 4) == "@##@") {
+		    if( $field == "name") {
+			$orgunit[$field] = substr($orgunit[$field], 4, strlen( $orgunit[$field])-4);
+			if( $orgunitid != "") 
+			    $orgunit[$field] = $organization->id."
".$orgunit[$field];
+		    } else {
+			$orgunit[$field] = $adb->query_result($result,$j,"org_".$field);
+		    }
+		}
+	    }
+
+	    // no orgunit selected
+	    else {
+		if( $field == "name") 
+		    $orgunit[$field] = $organization->id;
+		elseif( $field == "orgunitid")
+		    $orgunit[$field] = 0;
+		else
+		    $orgunit[$field] = $adb->query_result($result,$j,"org_".$field);
+	    }
+	}
+	$id = $orgunit["orgunitid"];
+	$orgunittab[$id] = $orgunit;
+    }
+    // Return what we've found
+    return $orgunittab;
+}
 ?>
-------------- next part --------------
diff -ruN orig/modules/Accounts/language/en_us.lang.php htdocs/modules/Accounts/language/en_us.lang.php
--- orig/modules/Accounts/language/en_us.lang.php	2007-05-07 14:52:56.000000000 +0200
+++ htdocs/modules/Accounts/language/en_us.lang.php	2007-05-04 15:04:43.000000000 +0200
@@ -1,217 +1,217 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/language/en_us.lang.php,v 1.18 2005/03/19 08:59:20 rank Exp $
- * Description:  Defines the English language pack 
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
- ********************************************************************************/
- 
-$mod_strings = Array(
-'LBL_MODULE_NAME'=>'Accounts',
-'LBL_MODULE_TITLE'=>'Accounts: Home',
-'LBL_SEARCH_FORM_TITLE'=>'Account Search',
-'LBL_LIST_FORM_TITLE'=>'Account List',
-'LBL_NEW_FORM_TITLE'=>'New Account',
-'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations',
-// Label for Top Accounts in Home Page, added for 4.2 GA
-'LBL_TOP_ACCOUNTS'=>'My Top Accounts', 
-'LBL_TOP_AMOUNT'=>'Amount',
-'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
-'LBL_LIST_CITY'=>'City',
-'LBL_LIST_WEBSITE'=>'Website',
-'LBL_LIST_STATE'=>'State',
-'LBL_LIST_PHONE'=>'Phone',
-'LBL_LIST_EMAIL_ADDRESS'=>'Email Address',
-'LBL_LIST_CONTACT_NAME'=>'Contact Name',
-'LBL_LIST_AMOUNT' => 'Total Opportunities',
-
-//DON'T CONVERT THESE THEY ARE MAPPINGS
-'db_name' => 'LBL_LIST_ACCOUNT_NAME',
-'db_website' => 'LBL_LIST_WEBSITE',
-'db_billing_address_city' => 'LBL_LIST_CITY',
-
-//END DON'T CONVERT
-
-'LBL_ACCOUNT'=>'Account:',
-'LBL_ACCOUNT_NAME'=>'Account Name:',
-'LBL_PHONE'=>'Phone:',
-'LBL_WEBSITE'=>'Website:',
-'LBL_FAX'=>'Fax:',
-'LBL_TICKER_SYMBOL'=>'Ticker Symbol:',
-'LBL_OTHER_PHONE'=>'Other Phone:',
-'LBL_ANY_PHONE'=>'Any Phone:',
-'LBL_MEMBER_OF'=>'Member of:',
-'LBL_EMAIL'=>'Email:',
-'LBL_EMPLOYEES'=>'Employees:',
-'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:',
-'LBL_ANY_EMAIL'=>'Any Email:',
-'LBL_OWNERSHIP'=>'Ownership:',
-'LBL_RATING'=>'Rating:',
-'LBL_INDUSTRY'=>'Industry:',
-'LBL_SIC_CODE'=>'SIC Code:',
-'LBL_TYPE'=>'Type:',
-'LBL_ANNUAL_REVENUE'=>'Annual Revenue:',
-'LBL_ADDRESS_INFORMATION'=>'Address Information',
-'LBL_ACCOUNT_INFORMATION'=>'Account Information',
-'LBL_CUSTOM_INFORMATION'=>'Custom Information',
-'LBL_BILLING_ADDRESS'=>'Billing Address:',
-'LBL_SHIPPING_ADDRESS'=>'Shipping Address:',
-'LBL_ANY_ADDRESS'=>'Any Address:',
-'LBL_CITY'=>'City:',
-'LBL_STATE'=>'State:',
-'LBL_POSTAL_CODE'=>'Postal Code:',
-'LBL_COUNTRY'=>'Country:',
-'LBL_DESCRIPTION_INFORMATION'=>'Description Information',
-'LBL_DESCRIPTION'=>'Description:',
-'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address',
-'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address',
-'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?',
-'LBL_DUPLICATE'=>'Potential Duplicate Accounts',
-'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.',
-
-'LBL_INVITEE'=>'Contacts',
-'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.",
-
-'LBL_SELECT_ACCOUNT'=>'Select Account',
-'LBL_GENERAL_INFORMATION'=>'General Information',
-
-//for v4 release added
-'LBL_NEW_POTENTIAL'=>'New Potential',
-'LBL_POTENTIAL_TITLE'=>'Potentials',
-
-'LBL_NEW_TASK'=>'New Task',
-'LBL_TASK_TITLE'=>'Tasks',
-'LBL_NEW_CALL'=>'New Call',
-'LBL_CALL_TITLE'=>'Calls',
-'LBL_NEW_MEETING'=>'New Meeting',
-'LBL_MEETING_TITLE'=>'Meetings',
-'LBL_NEW_EMAIL'=>'New Email',
-'LBL_EMAIL_TITLE'=>'Emails',
-'LBL_NEW_CONTACT'=>'New Contact',
-'LBL_CONTACT_TITLE'=>'Contacts',
-
-//Added vtiger_fields after RC1 - Release
-'LBL_ALL'=>'All',
-'LBL_PROSPECT'=>'Prospect',
-'LBL_INVESTOR'=>'Investor',
-'LBL_RESELLER'=>'Reseller',
-'LBL_PARTNER'=>'Partner',
-
-// Added for 4GA
-'LBL_TOOL_FORM_TITLE'=>'Account Tools',
-//Added for 4GA
-'Account Name'=>'Account Name',
-'Phone'=>'Phone',
-'Website'=>'Website',
-'Fax'=>'Fax',
-'Ticker Symbol'=>'Ticker Symbol',
-'Other Phone'=>'Other Phone',
-'Member Of'=>'Member Of',
-'Email'=>'Email',
-'Employees'=>'Employees',
-'Other Email'=>'Other Email',
-'Ownership'=>'Ownership',
-'Rating'=>'Rating',
-'industry'=>'Industry',
-'SIC Code'=>'SIC Code',
-'Type'=>'Type',
-'Annual Revenue'=>'Annual Revenue',
-'Assigned To'=>'Assigned To',
-'Billing Address'=>'Billing Address',
-'Shipping Address'=>'Shipping Address',
-'Billing City'=>'Billing City',
-'Shipping City'=>'Shipping City',
-'Billing State'=>'Billing State',
-'Shipping State'=>'Shipping State',
-'Billing Code'=>'Billing Postal Code',
-'Shipping Code'=>'Shipping Postal Code',
-'Billing Country'=>'Billing Country',
-'Shipping Country'=>'Shipping Country',
-'Created Time'=>'Created Time',
-'Modified Time'=>'Modified Time',
-'Description'=>'Description',
-'Shipping Po Box'=>'Shipping PO Box',
-'Billing Po Box'=>'Billing PO Box',
-
-//Added after 4.2 patch 2
-'Email Opt Out'=>'Email Opt Out',
-'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:',
-
-//Added after 5Alpha5
-'Notify Owner'=>'Notify Owner',
-
-//Added for existing picklist entries
-
-'--None--'=>'--None--',
-
-'Acquired'=>'Acquired',
-'Active'=>'Active',
-'Market Failed'=>'Market Failed',
-'Project Cancelled'=>'Project Cancelled',
-'Shutdown'=>'Shutdown',
-
-'Apparel'=>'Apparel',
-'Banking'=>'Banking',
-'Biotechnology'=>'Biotechnology',
-'Chemicals'=>'Chemicals',
-'Communications'=>'Communications',
-'Construction'=>'Construction',
-'Consulting'=>'Consulting',
-'Education'=>'Education',
-'Electronics'=>'Electronics',
-'Energy'=>'Energy',
-'Engineering'=>'Engineering',
-'Entertainment'=>'Entertainment',
-'Environmental'=>'Environmental',
-'Finance'=>'Finance',
-'Food & Beverage'=>'Food & Beverage',
-'Government'=>'Government',
-'Healthcare'=>'Healthcare',
-'Hospitality'=>'Hospitality',
-'Insurance'=>'Insurance',
-'Machinery'=>'Machinery',
-'Manufacturing'=>'Manufacturing',
-'Media'=>'Media',
-'Not For Profit'=>'Not For Profit',
-'Recreation'=>'Recreation',
-'Retail'=>'Retail',
-'Shipping'=>'Shipping',
-'Technology'=>'Technology',
-'Telecommunications'=>'Telecommunications',
-'Transportation'=>'Transportation',
-'Utilities'=>'Utilities',
-'Other'=>'Other',
-
-'Analyst'=>'Analyst',
-'Competitor'=>'Competitor',
-'Customer'=>'Customer',
-'Integrator'=>'Integrator',
-'Investor'=>'Investor',
-'Partner'=>'Partner',
-'Press'=>'Press',
-'Prospect'=>'Prospect',
-'Reseller'=>'Reseller',
-'LBL_START_DATE' => 'Start Date',
-'LBL_END_DATE' => 'End Date',
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/language/en_us.lang.php,v 1.18 2005/03/19 08:59:20 rank Exp $
+ * Description:  Defines the English language pack 
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+ ********************************************************************************/
+ 
+$mod_strings = Array(
+'LBL_MODULE_NAME'=>'Accounts',
+'LBL_MODULE_TITLE'=>'Accounts: Home',
+'LBL_SEARCH_FORM_TITLE'=>'Account Search',
+'LBL_LIST_FORM_TITLE'=>'Account List',
+'LBL_NEW_FORM_TITLE'=>'New Account',
+'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations',
+// Label for Top Accounts in Home Page, added for 4.2 GA
+'LBL_TOP_ACCOUNTS'=>'My Top Accounts', 
+'LBL_TOP_AMOUNT'=>'Amount',
+'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
+'LBL_LIST_CITY'=>'City',
+'LBL_LIST_WEBSITE'=>'Website',
+'LBL_LIST_STATE'=>'State',
+'LBL_LIST_PHONE'=>'Phone',
+'LBL_LIST_EMAIL_ADDRESS'=>'Email Address',
+'LBL_LIST_CONTACT_NAME'=>'Contact Name',
+'LBL_LIST_AMOUNT' => 'Total Opportunities',
+
+//DON'T CONVERT THESE THEY ARE MAPPINGS
+'db_name' => 'LBL_LIST_ACCOUNT_NAME',
+'db_website' => 'LBL_LIST_WEBSITE',
+'db_billing_address_city' => 'LBL_LIST_CITY',
+
+//END DON'T CONVERT
+
+'LBL_ACCOUNT'=>'Account:',
+'LBL_ACCOUNT_NAME'=>'Account Name:',
+'LBL_PHONE'=>'Phone:',
+'LBL_WEBSITE'=>'Website:',
+'LBL_FAX'=>'Fax:',
+'LBL_TICKER_SYMBOL'=>'Ticker Symbol:',
+'LBL_OTHER_PHONE'=>'Other Phone:',
+'LBL_ANY_PHONE'=>'Any Phone:',
+'LBL_MEMBER_OF'=>'Member of:',
+'LBL_EMAIL'=>'Email:',
+'LBL_EMPLOYEES'=>'Employees:',
+'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:',
+'LBL_ANY_EMAIL'=>'Any Email:',
+'LBL_OWNERSHIP'=>'Ownership:',
+'LBL_RATING'=>'Rating:',
+'LBL_INDUSTRY'=>'Industry:',
+'LBL_SIC_CODE'=>'SIC Code:',
+'LBL_TYPE'=>'Type:',
+'LBL_ANNUAL_REVENUE'=>'Annual Revenue:',
+'LBL_ADDRESS_INFORMATION'=>'Address Information',
+'LBL_ACCOUNT_INFORMATION'=>'Account Information',
+'LBL_CUSTOM_INFORMATION'=>'Custom Information',
+'LBL_BILLING_ADDRESS'=>'Billing Address:',
+'LBL_SHIPPING_ADDRESS'=>'Shipping Address:',
+'LBL_ANY_ADDRESS'=>'Any Address:',
+'LBL_CITY'=>'City:',
+'LBL_STATE'=>'State:',
+'LBL_POSTAL_CODE'=>'Postal Code:',
+'LBL_COUNTRY'=>'Country:',
+'LBL_DESCRIPTION_INFORMATION'=>'Description Information',
+'LBL_DESCRIPTION'=>'Description:',
+'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address',
+'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address',
+'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?',
+'LBL_DUPLICATE'=>'Potential Duplicate Accounts',
+'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.',
+
+'LBL_INVITEE'=>'Contacts',
+'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.",
+
+'LBL_SELECT_ACCOUNT'=>'Select Account',
+'LBL_GENERAL_INFORMATION'=>'General Information',
+
+//for v4 release added
+'LBL_NEW_POTENTIAL'=>'New Potential',
+'LBL_POTENTIAL_TITLE'=>'Potentials',
+
+'LBL_NEW_TASK'=>'New Task',
+'LBL_TASK_TITLE'=>'Tasks',
+'LBL_NEW_CALL'=>'New Call',
+'LBL_CALL_TITLE'=>'Calls',
+'LBL_NEW_MEETING'=>'New Meeting',
+'LBL_MEETING_TITLE'=>'Meetings',
+'LBL_NEW_EMAIL'=>'New Email',
+'LBL_EMAIL_TITLE'=>'Emails',
+'LBL_NEW_CONTACT'=>'New Contact',
+'LBL_CONTACT_TITLE'=>'Contacts',
+
+//Added vtiger_fields after RC1 - Release
+'LBL_ALL'=>'All',
+'LBL_PROSPECT'=>'Prospect',
+'LBL_INVESTOR'=>'Investor',
+'LBL_RESELLER'=>'Reseller',
+'LBL_PARTNER'=>'Partner',
+
+// Added for 4GA
+'LBL_TOOL_FORM_TITLE'=>'Account Tools',
+//Added for 4GA
+'Account Name'=>'Account Name',
+'Phone'=>'Phone',
+'Website'=>'Website',
+'Fax'=>'Fax',
+'Ticker Symbol'=>'Ticker Symbol',
+'Other Phone'=>'Other Phone',
+'Member Of'=>'Member Of',
+'Email'=>'Email',
+'Employees'=>'Employees',
+'Other Email'=>'Other Email',
+'Ownership'=>'Ownership',
+'Rating'=>'Rating',
+'industry'=>'Industry',
+'SIC Code'=>'SIC Code',
+'Type'=>'Type',
+'Annual Revenue'=>'Annual Revenue',
+'Assigned To'=>'Assigned To',
+'Billing Address'=>'Billing Address',
+'Shipping Address'=>'Shipping Address',
+'Billing City'=>'Billing City',
+'Shipping City'=>'Shipping City',
+'Billing State'=>'Billing State',
+'Shipping State'=>'Shipping State',
+'Billing Code'=>'Billing Postal Code',
+'Shipping Code'=>'Shipping Postal Code',
+'Billing Country'=>'Billing Country',
+'Shipping Country'=>'Shipping Country',
+'Created Time'=>'Created Time',
+'Modified Time'=>'Modified Time',
+'Description'=>'Description',
+'Shipping Po Box'=>'Shipping PO Box',
+'Billing Po Box'=>'Billing PO Box',
+
+//Added after 4.2 patch 2
+'Email Opt Out'=>'Email Opt Out',
+'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:',
+
+//Added after 5Alpha5
+'Notify Owner'=>'Notify Owner',
+
+//Added for existing picklist entries
+
+'--None--'=>'--None--',
+
+'Acquired'=>'Acquired',
+'Active'=>'Active',
+'Market Failed'=>'Market Failed',
+'Project Cancelled'=>'Project Cancelled',
+'Shutdown'=>'Shutdown',
+
+'Apparel'=>'Apparel',
+'Banking'=>'Banking',
+'Biotechnology'=>'Biotechnology',
+'Chemicals'=>'Chemicals',
+'Communications'=>'Communications',
+'Construction'=>'Construction',
+'Consulting'=>'Consulting',
+'Education'=>'Education',
+'Electronics'=>'Electronics',
+'Energy'=>'Energy',
+'Engineering'=>'Engineering',
+'Entertainment'=>'Entertainment',
+'Environmental'=>'Environmental',
+'Finance'=>'Finance',
+'Food & Beverage'=>'Food & Beverage',
+'Government'=>'Government',
+'Healthcare'=>'Healthcare',
+'Hospitality'=>'Hospitality',
+'Insurance'=>'Insurance',
+'Machinery'=>'Machinery',
+'Manufacturing'=>'Manufacturing',
+'Media'=>'Media',
+'Not For Profit'=>'Not For Profit',
+'Recreation'=>'Recreation',
+'Retail'=>'Retail',
+'Shipping'=>'Shipping',
+'Technology'=>'Technology',
+'Telecommunications'=>'Telecommunications',
+'Transportation'=>'Transportation',
+'Utilities'=>'Utilities',
+'Other'=>'Other',
+
+'Analyst'=>'Analyst',
+'Competitor'=>'Competitor',
+'Customer'=>'Customer',
+'Integrator'=>'Integrator',
+'Investor'=>'Investor',
+'Partner'=>'Partner',
+'Press'=>'Press',
+'Prospect'=>'Prospect',
+'Reseller'=>'Reseller',
+'LBL_START_DATE' => 'Start Date',
+'LBL_END_DATE' => 'End Date',
 
 // Added for multi organization support TRAC #2035
 'LBL_COMPANY_ASSIGNMENT'=>'Organization Assignment',
 'Organization Assignment'=>'Assigned to',
 
-);
-
-?>
+);
+
+?>
-------------- next part --------------
diff -ruN orig/modules/Accounts/Delete.php htdocs/modules/Accounts/Delete.php
--- orig/modules/Accounts/Delete.php	2007-05-04 16:12:05.000000000 +0200
+++ htdocs/modules/Accounts/Delete.php	2007-05-07 17:04:15.000000000 +0200
@@ -1,37 +1,37 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the 
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/Delete.php,v 1.5 2005/03/10 09:28:34 shaw Exp $
- * Description:  Deletes an Account record and then redirects the browser to the 
- * defined return URL.
- ********************************************************************************/
-
-require_once('modules/Accounts/Accounts.php');
-global $mod_strings;
-
-require_once('include/logging.php');
-$log = LoggerManager::getLogger('contact_delete');
-
-$focus = new Accounts();
-
-if(!isset($_REQUEST['record']))
-	die($mod_strings['ERR_DELETE_RECORD']);
-
-DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
-
-if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
-
-header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']."&parenttab=".$parenttab."&relmodule=".$_REQUEST['module']);
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the 
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/Delete.php,v 1.5 2005/03/10 09:28:34 shaw Exp $
+ * Description:  Deletes an Account record and then redirects the browser to the 
+ * defined return URL.
+ ********************************************************************************/
+
+require_once('modules/Accounts/Accounts.php');
+global $mod_strings;
+
+require_once('include/logging.php');
+$log = LoggerManager::getLogger('contact_delete');
+
+$focus = new Accounts();
+
+if(!isset($_REQUEST['record']))
+	die($mod_strings['ERR_DELETE_RECORD']);
+
+DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
+
+if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
+
+header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']."&parenttab=".$parenttab."&relmodule=".$_REQUEST['module']);
+?>
-------------- next part --------------
diff -ruN orig/modules/Accounts/DetailViewAjax.php htdocs/modules/Accounts/DetailViewAjax.php
--- orig/modules/Accounts/DetailViewAjax.php	2007-05-04 16:12:05.000000000 +0200
+++ htdocs/modules/Accounts/DetailViewAjax.php	2007-05-07 17:09:50.000000000 +0200
@@ -1,50 +1,50 @@
-<?php
-/*********************************************************************************
- ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-  * ("License"); You may not use this file except in compliance with the License
-  * The Original Code is:  vtiger CRM Open Source
-  * The Initial Developer of the Original Code is vtiger.
-  * Portions created by vtiger are Copyright (C) vtiger.
-  * All Rights Reserved.
- *
-  ********************************************************************************/
-
-require_once('include/logging.php');
-require_once('modules/Accounts/Accounts.php');
-require_once('include/database/PearDatabase.php');
-global $adb;
-
-$local_log =& LoggerManager::getLogger('AccountsAjax');
-
-$ajaxaction = $_REQUEST["ajxaction"];
-if($ajaxaction == "DETAILVIEW")
-{
-     $crmid = $_REQUEST["recordid"];
-     $tablename = $_REQUEST["tableName"];
-     $fieldname = $_REQUEST["fldName"];
-     $fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
-     if($crmid != "")
-	 {
-	     $acntObj = new Accounts();
-	     $acntObj->retrieve_entity_info($crmid,"Accounts");
-	     $acntObj->column_fields[$fieldname] = $fieldvalue;
-	     if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving
-	     {
-		     $acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);
-	     }	     
-	     $acntObj->id = $crmid;
-  	     $acntObj->mode = "edit";
-       	     $acntObj->save("Accounts");
-             if($acntObj->id != "")
-	     {
-			echo ":#:SUCCESS";
-	     }else
-	     {
-			echo ":#:FAILURE";
-	     }   
-	}else
-	{
-         echo ":#:FAILURE";
-    }
-}
-?>
+<?php
+/*********************************************************************************
+ ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+  * ("License"); You may not use this file except in compliance with the License
+  * The Original Code is:  vtiger CRM Open Source
+  * The Initial Developer of the Original Code is vtiger.
+  * Portions created by vtiger are Copyright (C) vtiger.
+  * All Rights Reserved.
+ *
+  ********************************************************************************/
+
+require_once('include/logging.php');
+require_once('modules/Accounts/Accounts.php');
+require_once('include/database/PearDatabase.php');
+global $adb;
+
+$local_log =& LoggerManager::getLogger('AccountsAjax');
+
+$ajaxaction = $_REQUEST["ajxaction"];
+if($ajaxaction == "DETAILVIEW")
+{
+     $crmid = $_REQUEST["recordid"];
+     $tablename = $_REQUEST["tableName"];
+     $fieldname = $_REQUEST["fldName"];
+     $fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
+     if($crmid != "")
+	 {
+	     $acntObj = new Accounts();
+	     $acntObj->retrieve_entity_info($crmid,"Accounts");
+	     $acntObj->column_fields[$fieldname] = $fieldvalue;
+	     if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving
+	     {
+		     $acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);
+	     }	     
+	     $acntObj->id = $crmid;
+  	     $acntObj->mode = "edit";
+       	     $acntObj->save("Accounts");
+             if($acntObj->id != "")
+	     {
+			echo ":#:SUCCESS";
+	     }else
+	     {
+			echo ":#:FAILURE";
+	     }   
+	}else
+	{
+         echo ":#:FAILURE";
+    }
+}
+?>
-------------- next part --------------
diff -ruN orig/Smarty/templates/RelatedLists.tpl htdocs/Smarty/templates/RelatedLists.tpl
--- orig/Smarty/templates/RelatedLists.tpl	2007-05-04 16:12:15.000000000 +0200
+++ htdocs/Smarty/templates/RelatedLists.tpl	2007-05-08 22:57:59.000000000 +0200
@@ -122,8 +122,21 @@
                 		                        <td class="dvtUnSelectedCell" align=center nowrap><a href="index.php?action={$action}&module={$MODULE}&record={$ID}&parenttab={$CATEGORY}">{$SINGLE_MOD} {$APP.LBL_INFORMATION}</a></td>
                                 		        {/if}
 							<td class="dvtTabCache" style="width:10px">&nbsp;</td>
-							<td class="dvtSelectedCell" align=center nowrap>{$APP.LBL_MORE} {$APP.LBL_INFORMATION}</td>
-							<td class="dvtTabCache" style="width:100%">&nbsp;</td>
+							{if $MODULE eq 'Products'}
+							    {if $RELATEDLISTS ne ''}
+								<td class="dvtUnSelectedCell" align=center nowrap><a href="index.php?action=CallDependencyList&module={$MODULE}&record={$ID}&parenttab={$CATEGORY}">{$APP.LBL_DEPLIST} {$APP.LBL_INFORMATION}</a></td>
+								<td class="dvtTabCache" style="width:10px">&nbsp;</td>
+								<td class="dvtSelectedCell" align=center nowrap>{$APP.LBL_MORE} {$APP.LBL_INFORMATION}</td>
+							    {else}
+								<td class="dvtSelectedCell" align=center nowrap>{$APP.LBL_DEPLIST} {$APP.LBL_INFORMATION}</td>
+								<td class="dvtTabCache" style="width:10px">&nbsp;</td>
+								<td class="dvtUnSelectedCell" align=center nowrap><a href="index.php?action=CallRelatedList&module={$MODULE}&record={$ID}&parenttab={$CATEGORY}">{$APP.LBL_MORE} {$APP.LBL_INFORMATION}</a></td>
+							    {/if}
+							    <td class="dvtTabCache" style="width:100%">&nbsp;</td>
+							{else}
+							    <td class="dvtSelectedCell" align=center nowrap>{$APP.LBL_MORE} {$APP.LBL_INFORMATION}</td>
+							    <td class="dvtTabCache" style="width:100%">&nbsp;</td>
+							{/if}
 						</tr>
 					</table>
 				</td>
@@ -137,12 +150,12 @@
 								<table border=0 cellspacing=0 cellpadding=0 width=100%>
 									<tr>
 										<td style="padding:10px">
-										   <!-- General details -->
-												{include file='RelatedListsHidden.tpl'}
-												<div id="RLContents">
-					                                                        {include file='RelatedListContents.tpl'}
-                                        						        </div>
-												</form>
+										    <!-- General details -->
+										    {include file='RelatedListsHidden.tpl'}
+										    <div id="RLContents">
+										    {include file='RelatedListContents.tpl'}
+										    </div>
+										    </form>
 										  {*-- End of Blocks--*} 
 										</td>
 									</tr>
-------------- next part --------------
diff -ruN orig/modules/Accounts/language/en_us.lang.php htdocs/modules/Accounts/language/en_us.lang.php
--- orig/modules/Accounts/language/en_us.lang.php	2007-05-07 15:43:12.000000000 +0200
+++ htdocs/modules/Accounts/language/en_us.lang.php	2007-05-09 00:28:57.000000000 +0200
@@ -1,217 +1,217 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/language/en_us.lang.php,v 1.18 2005/03/19 08:59:20 rank Exp $
- * Description:  Defines the English language pack 
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
- ********************************************************************************/
- 
-$mod_strings = Array(
-'LBL_MODULE_NAME'=>'Accounts',
-'LBL_MODULE_TITLE'=>'Accounts: Home',
-'LBL_SEARCH_FORM_TITLE'=>'Account Search',
-'LBL_LIST_FORM_TITLE'=>'Account List',
-'LBL_NEW_FORM_TITLE'=>'New Account',
-'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations',
-// Label for Top Accounts in Home Page, added for 4.2 GA
-'LBL_TOP_ACCOUNTS'=>'My Top Accounts', 
-'LBL_TOP_AMOUNT'=>'Amount',
-'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
-'LBL_LIST_CITY'=>'City',
-'LBL_LIST_WEBSITE'=>'Website',
-'LBL_LIST_STATE'=>'State',
-'LBL_LIST_PHONE'=>'Phone',
-'LBL_LIST_EMAIL_ADDRESS'=>'Email Address',
-'LBL_LIST_CONTACT_NAME'=>'Contact Name',
-'LBL_LIST_AMOUNT' => 'Total Opportunities',
-
-//DON'T CONVERT THESE THEY ARE MAPPINGS
-'db_name' => 'LBL_LIST_ACCOUNT_NAME',
-'db_website' => 'LBL_LIST_WEBSITE',
-'db_billing_address_city' => 'LBL_LIST_CITY',
-
-//END DON'T CONVERT
-
-'LBL_ACCOUNT'=>'Account:',
-'LBL_ACCOUNT_NAME'=>'Account Name:',
-'LBL_PHONE'=>'Phone:',
-'LBL_WEBSITE'=>'Website:',
-'LBL_FAX'=>'Fax:',
-'LBL_TICKER_SYMBOL'=>'Ticker Symbol:',
-'LBL_OTHER_PHONE'=>'Other Phone:',
-'LBL_ANY_PHONE'=>'Any Phone:',
-'LBL_MEMBER_OF'=>'Member of:',
-'LBL_EMAIL'=>'Email:',
-'LBL_EMPLOYEES'=>'Employees:',
-'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:',
-'LBL_ANY_EMAIL'=>'Any Email:',
-'LBL_OWNERSHIP'=>'Ownership:',
-'LBL_RATING'=>'Rating:',
-'LBL_INDUSTRY'=>'Industry:',
-'LBL_SIC_CODE'=>'SIC Code:',
-'LBL_TYPE'=>'Type:',
-'LBL_ANNUAL_REVENUE'=>'Annual Revenue:',
-'LBL_ADDRESS_INFORMATION'=>'Address Information',
-'LBL_ACCOUNT_INFORMATION'=>'Account Information',
-'LBL_CUSTOM_INFORMATION'=>'Custom Information',
-'LBL_BILLING_ADDRESS'=>'Billing Address:',
-'LBL_SHIPPING_ADDRESS'=>'Shipping Address:',
-'LBL_ANY_ADDRESS'=>'Any Address:',
-'LBL_CITY'=>'City:',
-'LBL_STATE'=>'State:',
-'LBL_POSTAL_CODE'=>'Postal Code:',
-'LBL_COUNTRY'=>'Country:',
-'LBL_DESCRIPTION_INFORMATION'=>'Description Information',
-'LBL_DESCRIPTION'=>'Description:',
-'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address',
-'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address',
-'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?',
-'LBL_DUPLICATE'=>'Potential Duplicate Accounts',
-'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.',
-
-'LBL_INVITEE'=>'Contacts',
-'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.",
-
-'LBL_SELECT_ACCOUNT'=>'Select Account',
-'LBL_GENERAL_INFORMATION'=>'General Information',
-
-//for v4 release added
-'LBL_NEW_POTENTIAL'=>'New Potential',
-'LBL_POTENTIAL_TITLE'=>'Potentials',
-
-'LBL_NEW_TASK'=>'New Task',
-'LBL_TASK_TITLE'=>'Tasks',
-'LBL_NEW_CALL'=>'New Call',
-'LBL_CALL_TITLE'=>'Calls',
-'LBL_NEW_MEETING'=>'New Meeting',
-'LBL_MEETING_TITLE'=>'Meetings',
-'LBL_NEW_EMAIL'=>'New Email',
-'LBL_EMAIL_TITLE'=>'Emails',
-'LBL_NEW_CONTACT'=>'New Contact',
-'LBL_CONTACT_TITLE'=>'Contacts',
-
-//Added vtiger_fields after RC1 - Release
-'LBL_ALL'=>'All',
-'LBL_PROSPECT'=>'Prospect',
-'LBL_INVESTOR'=>'Investor',
-'LBL_RESELLER'=>'Reseller',
-'LBL_PARTNER'=>'Partner',
-
-// Added for 4GA
-'LBL_TOOL_FORM_TITLE'=>'Account Tools',
-//Added for 4GA
-'Account Name'=>'Account Name',
-'Phone'=>'Phone',
-'Website'=>'Website',
-'Fax'=>'Fax',
-'Ticker Symbol'=>'Ticker Symbol',
-'Other Phone'=>'Other Phone',
-'Member Of'=>'Member Of',
-'Email'=>'Email',
-'Employees'=>'Employees',
-'Other Email'=>'Other Email',
-'Ownership'=>'Ownership',
-'Rating'=>'Rating',
-'industry'=>'Industry',
-'SIC Code'=>'SIC Code',
-'Type'=>'Type',
-'Annual Revenue'=>'Annual Revenue',
-'Assigned To'=>'Assigned To',
-'Billing Address'=>'Billing Address',
-'Shipping Address'=>'Shipping Address',
-'Billing City'=>'Billing City',
-'Shipping City'=>'Shipping City',
-'Billing State'=>'Billing State',
-'Shipping State'=>'Shipping State',
-'Billing Code'=>'Billing Postal Code',
-'Shipping Code'=>'Shipping Postal Code',
-'Billing Country'=>'Billing Country',
-'Shipping Country'=>'Shipping Country',
-'Created Time'=>'Created Time',
-'Modified Time'=>'Modified Time',
-'Description'=>'Description',
-'Shipping Po Box'=>'Shipping PO Box',
-'Billing Po Box'=>'Billing PO Box',
-
-//Added after 4.2 patch 2
-'Email Opt Out'=>'Email Opt Out',
-'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:',
-
-//Added after 5Alpha5
-'Notify Owner'=>'Notify Owner',
-
-//Added for existing picklist entries
-
-'--None--'=>'--None--',
-
-'Acquired'=>'Acquired',
-'Active'=>'Active',
-'Market Failed'=>'Market Failed',
-'Project Cancelled'=>'Project Cancelled',
-'Shutdown'=>'Shutdown',
-
-'Apparel'=>'Apparel',
-'Banking'=>'Banking',
-'Biotechnology'=>'Biotechnology',
-'Chemicals'=>'Chemicals',
-'Communications'=>'Communications',
-'Construction'=>'Construction',
-'Consulting'=>'Consulting',
-'Education'=>'Education',
-'Electronics'=>'Electronics',
-'Energy'=>'Energy',
-'Engineering'=>'Engineering',
-'Entertainment'=>'Entertainment',
-'Environmental'=>'Environmental',
-'Finance'=>'Finance',
-'Food & Beverage'=>'Food & Beverage',
-'Government'=>'Government',
-'Healthcare'=>'Healthcare',
-'Hospitality'=>'Hospitality',
-'Insurance'=>'Insurance',
-'Machinery'=>'Machinery',
-'Manufacturing'=>'Manufacturing',
-'Media'=>'Media',
-'Not For Profit'=>'Not For Profit',
-'Recreation'=>'Recreation',
-'Retail'=>'Retail',
-'Shipping'=>'Shipping',
-'Technology'=>'Technology',
-'Telecommunications'=>'Telecommunications',
-'Transportation'=>'Transportation',
-'Utilities'=>'Utilities',
-'Other'=>'Other',
-
-'Analyst'=>'Analyst',
-'Competitor'=>'Competitor',
-'Customer'=>'Customer',
-'Integrator'=>'Integrator',
-'Investor'=>'Investor',
-'Partner'=>'Partner',
-'Press'=>'Press',
-'Prospect'=>'Prospect',
-'Reseller'=>'Reseller',
-'LBL_START_DATE' => 'Start Date',
-'LBL_END_DATE' => 'End Date',
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Accounts/language/en_us.lang.php,v 1.18 2005/03/19 08:59:20 rank Exp $
+ * Description:  Defines the English language pack 
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+ ********************************************************************************/
+ 
+$mod_strings = Array(
+'LBL_MODULE_NAME'=>'Accounts',
+'LBL_MODULE_TITLE'=>'Accounts: Home',
+'LBL_SEARCH_FORM_TITLE'=>'Account Search',
+'LBL_LIST_FORM_TITLE'=>'Account List',
+'LBL_NEW_FORM_TITLE'=>'New Account',
+'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations',
+// Label for Top Accounts in Home Page, added for 4.2 GA
+'LBL_TOP_ACCOUNTS'=>'My Top Accounts', 
+'LBL_TOP_AMOUNT'=>'Amount',
+'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
+'LBL_LIST_CITY'=>'City',
+'LBL_LIST_WEBSITE'=>'Website',
+'LBL_LIST_STATE'=>'State',
+'LBL_LIST_PHONE'=>'Phone',
+'LBL_LIST_EMAIL_ADDRESS'=>'Email Address',
+'LBL_LIST_CONTACT_NAME'=>'Contact Name',
+'LBL_LIST_AMOUNT' => 'Total Opportunities',
+
+//DON'T CONVERT THESE THEY ARE MAPPINGS
+'db_name' => 'LBL_LIST_ACCOUNT_NAME',
+'db_website' => 'LBL_LIST_WEBSITE',
+'db_billing_address_city' => 'LBL_LIST_CITY',
+
+//END DON'T CONVERT
+
+'LBL_ACCOUNT'=>'Account:',
+'LBL_ACCOUNT_NAME'=>'Account Name:',
+'LBL_PHONE'=>'Phone:',
+'LBL_WEBSITE'=>'Website:',
+'LBL_FAX'=>'Fax:',
+'LBL_TICKER_SYMBOL'=>'Ticker Symbol:',
+'LBL_OTHER_PHONE'=>'Other Phone:',
+'LBL_ANY_PHONE'=>'Any Phone:',
+'LBL_MEMBER_OF'=>'Member of:',
+'LBL_EMAIL'=>'Email:',
+'LBL_EMPLOYEES'=>'Employees:',
+'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:',
+'LBL_ANY_EMAIL'=>'Any Email:',
+'LBL_OWNERSHIP'=>'Ownership:',
+'LBL_RATING'=>'Rating:',
+'LBL_INDUSTRY'=>'Industry:',
+'LBL_SIC_CODE'=>'SIC Code:',
+'LBL_TYPE'=>'Type:',
+'LBL_ANNUAL_REVENUE'=>'Annual Revenue:',
+'LBL_ADDRESS_INFORMATION'=>'Address Information',
+'LBL_ACCOUNT_INFORMATION'=>'Account Information',
+'LBL_CUSTOM_INFORMATION'=>'Custom Information',
+'LBL_BILLING_ADDRESS'=>'Billing Address:',
+'LBL_SHIPPING_ADDRESS'=>'Shipping Address:',
+'LBL_ANY_ADDRESS'=>'Any Address:',
+'LBL_CITY'=>'City:',
+'LBL_STATE'=>'State:',
+'LBL_POSTAL_CODE'=>'Postal Code:',
+'LBL_COUNTRY'=>'Country:',
+'LBL_DESCRIPTION_INFORMATION'=>'Description Information',
+'LBL_DESCRIPTION'=>'Description:',
+'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address',
+'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address',
+'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?',
+'LBL_DUPLICATE'=>'Potential Duplicate Accounts',
+'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.',
+
+'LBL_INVITEE'=>'Contacts',
+'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.",
+
+'LBL_SELECT_ACCOUNT'=>'Select Account',
+'LBL_GENERAL_INFORMATION'=>'General Information',
+
+//for v4 release added
+'LBL_NEW_POTENTIAL'=>'New Potential',
+'LBL_POTENTIAL_TITLE'=>'Potentials',
+
+'LBL_NEW_TASK'=>'New Task',
+'LBL_TASK_TITLE'=>'Tasks',
+'LBL_NEW_CALL'=>'New Call',
+'LBL_CALL_TITLE'=>'Calls',
+'LBL_NEW_MEETING'=>'New Meeting',
+'LBL_MEETING_TITLE'=>'Meetings',
+'LBL_NEW_EMAIL'=>'New Email',
+'LBL_EMAIL_TITLE'=>'Emails',
+'LBL_NEW_CONTACT'=>'New Contact',
+'LBL_CONTACT_TITLE'=>'Contacts',
+
+//Added vtiger_fields after RC1 - Release
+'LBL_ALL'=>'All',
+'LBL_PROSPECT'=>'Prospect',
+'LBL_INVESTOR'=>'Investor',
+'LBL_RESELLER'=>'Reseller',
+'LBL_PARTNER'=>'Partner',
+
+// Added for 4GA
+'LBL_TOOL_FORM_TITLE'=>'Account Tools',
+//Added for 4GA
+'Account Name'=>'Account Name',
+'Phone'=>'Phone',
+'Website'=>'Website',
+'Fax'=>'Fax',
+'Ticker Symbol'=>'Ticker Symbol',
+'Other Phone'=>'Other Phone',
+'Member Of'=>'Member Of',
+'Email'=>'Email',
+'Employees'=>'Employees',
+'Other Email'=>'Other Email',
+'Ownership'=>'Ownership',
+'Rating'=>'Rating',
+'industry'=>'Industry',
+'SIC Code'=>'SIC Code',
+'Type'=>'Type',
+'Annual Revenue'=>'Annual Revenue',
+'Assigned To'=>'Assigned To',
+'Billing Address'=>'Billing Address',
+'Shipping Address'=>'Shipping Address',
+'Billing City'=>'Billing City',
+'Shipping City'=>'Shipping City',
+'Billing State'=>'Billing State',
+'Shipping State'=>'Shipping State',
+'Billing Code'=>'Billing Postal Code',
+'Shipping Code'=>'Shipping Postal Code',
+'Billing Country'=>'Billing Country',
+'Shipping Country'=>'Shipping Country',
+'Created Time'=>'Created Time',
+'Modified Time'=>'Modified Time',
+'Description'=>'Description',
+'Shipping Po Box'=>'Shipping PO Box',
+'Billing Po Box'=>'Billing PO Box',
+
+//Added after 4.2 patch 2
+'Email Opt Out'=>'Email Opt Out',
+'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:',
+
+//Added after 5Alpha5
+'Notify Owner'=>'Notify Owner',
+
+//Added for existing picklist entries
+
+'--None--'=>'--None--',
+
+'Acquired'=>'Acquired',
+'Active'=>'Active',
+'Market Failed'=>'Market Failed',
+'Project Cancelled'=>'Project Cancelled',
+'Shutdown'=>'Shutdown',
+
+'Apparel'=>'Apparel',
+'Banking'=>'Banking',
+'Biotechnology'=>'Biotechnology',
+'Chemicals'=>'Chemicals',
+'Communications'=>'Communications',
+'Construction'=>'Construction',
+'Consulting'=>'Consulting',
+'Education'=>'Education',
+'Electronics'=>'Electronics',
+'Energy'=>'Energy',
+'Engineering'=>'Engineering',
+'Entertainment'=>'Entertainment',
+'Environmental'=>'Environmental',
+'Finance'=>'Finance',
+'Food & Beverage'=>'Food & Beverage',
+'Government'=>'Government',
+'Healthcare'=>'Healthcare',
+'Hospitality'=>'Hospitality',
+'Insurance'=>'Insurance',
+'Machinery'=>'Machinery',
+'Manufacturing'=>'Manufacturing',
+'Media'=>'Media',
+'Not For Profit'=>'Not For Profit',
+'Recreation'=>'Recreation',
+'Retail'=>'Retail',
+'Shipping'=>'Shipping',
+'Technology'=>'Technology',
+'Telecommunications'=>'Telecommunications',
+'Transportation'=>'Transportation',
+'Utilities'=>'Utilities',
+'Other'=>'Other',
+
+'Analyst'=>'Analyst',
+'Competitor'=>'Competitor',
+'Customer'=>'Customer',
+'Integrator'=>'Integrator',
+'Investor'=>'Investor',
+'Partner'=>'Partner',
+'Press'=>'Press',
+'Prospect'=>'Prospect',
+'Reseller'=>'Reseller',
+'LBL_START_DATE' => 'Start Date',
+'LBL_END_DATE' => 'End Date',
 
 // Added for multi organization support TRAC #2035
 'LBL_COMPANY_ASSIGNMENT'=>'Organization Assignment',
 'Organization Assignment'=>'Assigned to',
 
-);
-
-?>
+);
+
+?>
-------------- next part --------------
diff -ruN orig/modules/Emails/EmailsAjax.php htdocs/modules/Emails/EmailsAjax.php
--- orig/modules/Emails/EmailsAjax.php	2007-05-04 16:12:10.000000000 +0200
+++ htdocs/modules/Emails/EmailsAjax.php	2007-05-09 00:55:09.000000000 +0200
@@ -1,54 +1,54 @@
-<?php
-/*********************************************************************************
- ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-  * ("License"); You may not use this file except in compliance with the License
-  * The Original Code is:  vtiger CRM Open Source
-  * The Initial Developer of the Original Code is vtiger.
-  * Portions created by vtiger are Copyright (C) vtiger.
-  * All Rights Reserved.
- *
-  ********************************************************************************/
-
-require_once('include/logging.php');
-require_once('modules/Emails/Emails.php');
-require_once('include/database/PearDatabase.php');
-global $adb;
-
-$local_log =& LoggerManager::getLogger('EmailsAjax');
-
-$ajaxaction = $_REQUEST["ajxaction"];
-if($ajaxaction == "DETAILVIEW")
-{
-	$crmid = $_REQUEST["recordid"];
-	$tablename = $_REQUEST["tableName"];
-	$fieldname = $_REQUEST["fldName"];
-	$fieldvalue = $_REQUEST["fieldValue"];
-	if($crmid != "")
-	{
-		$modObj = new Emails();
-		$modObj->retrieve_entity_info($crmid,"Emails");
-		$modObj->column_fields[$fieldname] = $fieldvalue;
-		$modObj->id = $crmid;
-		$modObj->mode = "edit";
-		$modObj->save("Emails");
-		if($modObj->id != "")
-		{
-			echo ":#:SUCCESS";
-		}else
-		{
-			echo ":#:FAILURE";
-		}   
-	}else
-	{
-		echo ":#:FAILURE";
-	}
-}
-elseif($_REQUEST['ajaxmode'] == 'qcreate')
-{
-        require_once('quickcreate.php');
-}
-else
-{
-        require_once('include/Ajax/CommonAjax.php');
-}
-?>
+<?php
+/*********************************************************************************
+ ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+  * ("License"); You may not use this file except in compliance with the License
+  * The Original Code is:  vtiger CRM Open Source
+  * The Initial Developer of the Original Code is vtiger.
+  * Portions created by vtiger are Copyright (C) vtiger.
+  * All Rights Reserved.
+ *
+  ********************************************************************************/
+
+require_once('include/logging.php');
+require_once('modules/Emails/Emails.php');
+require_once('include/database/PearDatabase.php');
+global $adb;
+
+$local_log =& LoggerManager::getLogger('EmailsAjax');
+
+$ajaxaction = $_REQUEST["ajxaction"];
+if($ajaxaction == "DETAILVIEW")
+{
+	$crmid = $_REQUEST["recordid"];
+	$tablename = $_REQUEST["tableName"];
+	$fieldname = $_REQUEST["fldName"];
+	$fieldvalue = $_REQUEST["fieldValue"];
+	if($crmid != "")
+	{
+		$modObj = new Emails();
+		$modObj->retrieve_entity_info($crmid,"Emails");
+		$modObj->column_fields[$fieldname] = $fieldvalue;
+		$modObj->id = $crmid;
+		$modObj->mode = "edit";
+		$modObj->save("Emails");
+		if($modObj->id != "")
+		{
+			echo ":#:SUCCESS";
+		}else
+		{
+			echo ":#:FAILURE";
+		}   
+	}else
+	{
+		echo ":#:FAILURE";
+	}
+}
+elseif($_REQUEST['ajaxmode'] == 'qcreate')
+{
+        require_once('quickcreate.php');
+}
+else
+{
+        require_once('include/Ajax/CommonAjax.php');
+}
+?>
-------------- next part --------------
diff -ruN htdocs.orig/modules/Notes/Delete.php htdocs/modules/Notes/Delete.php
--- htdocs.orig/modules/Notes/Delete.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Notes/Delete.php	2007-05-09 00:57:22.000000000 +0200
@@ -1,35 +1,35 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the 
- * License. You may obtain a copy of the License at http://www.mozilla.org/MPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Notes/Delete.php,v 1.6 2005/03/10 09:30:13 shaw Exp $
- * Description:  TODO: To be written.
- ********************************************************************************/
-
-require_once('modules/Notes/Notes.php');
-
-require_once('include/logging.php');
-$log = LoggerManager::getLogger('note_delete');
-
-$focus = new Notes();
-
-if(!isset($_REQUEST['record']))
-	die("A record number must be specified to delete the note.");
-
-DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
-
-if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
-
-header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']."&parenttab=$parenttab"."&relmodule=".$_REQUEST['module']);
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the 
+ * License. You may obtain a copy of the License at http://www.mozilla.org/MPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Notes/Delete.php,v 1.6 2005/03/10 09:30:13 shaw Exp $
+ * Description:  TODO: To be written.
+ ********************************************************************************/
+
+require_once('modules/Notes/Notes.php');
+
+require_once('include/logging.php');
+$log = LoggerManager::getLogger('note_delete');
+
+$focus = new Notes();
+
+if(!isset($_REQUEST['record']))
+	die("A record number must be specified to delete the note.");
+
+DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
+
+if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
+
+header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']."&parenttab=$parenttab"."&relmodule=".$_REQUEST['module']);
+?>
-------------- next part --------------
diff -ruN htdocs.orig/modules/Portal/Popup.php htdocs/modules/Portal/Popup.php
--- htdocs.orig/modules/Portal/Popup.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Portal/Popup.php	2007-05-09 00:58:36.000000000 +0200
@@ -1,68 +1,68 @@
-<?php
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-* ("License"); You may not use this file except in compliance with the License
-* The Original Code is:  vtiger CRM Open Source
-* The Initial Developer of the Original Code is vtiger.
-* Portions created by vtiger are Copyright (C) vtiger.
-* All Rights Reserved.
-*
-********************************************************************************/
-
-require_once('modules/Portal/Portal.php');
-global $app_strings;
-global $app_list_strings;
-global $mod_strings;
-global $adb;
-
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
-{
-	$portalid = $_REQUEST['record'];
-	$query="select * from vtiger_portal where portalid =$portalid";
-	$result=$adb->query($query);
-	$portalname = $adb->query_result($result,0,'portalname');
-        $portalurl = $adb->query_result($result,0,'portalurl');		
-}
-$portal_inputs='';
-$portal_inputs.='<div style="display:block;position:relative;" id="orgLay" class="layerPopup">
-		<table border="0" cellpadding="3" cellspacing="0" width="100%" class="layerHeadingULine">
-		<tr>
-			<td class="layerPopupHeading" align="left" width="60%">' .$mod_strings['LBL_ADD'] .' '.$mod_strings['LBL_BOOKMARK'].'</td>
-			<td align="right" width="40%"><a href="javascript:fninvsh(\'orgLay\');"><img src="'.$image_path.'close.gif" align="absmiddle" border="0"></a></td>
-		</tr>
-		</table>
-<table border="0" cellspacing="0" cellpadding="5" width="95%" align="center"> 
-	<tr>
-	<td class="small" >
-		<table border="0" celspacing="0" cellpadding="5" width="100%" align="center" bgcolor="white">
-		
-		<tr>
-
-			<td align="right" width="40%" ><b>'.$mod_strings['LBL_BOOKMARK'].' ' .$mod_strings['LBL_URL'] .' </b></td>
-			<td align="left" width="60%">http://<input name="portalurl" id="portalurl" class="txtBox" value="'.$portalurl.'" type="text" onkeyup="OnUrlChange();"></td>
-		</tr>
-		<tr>
-			<td align="right" width="40%"> <b>'.$mod_strings['LBL_BOOKMARK'].' ' .$mod_strings['LBL_NAME'] .' </b></td>
-			<td align="left" width="60%"><input name="portalname" id="portalname" value="'.$portalname.'" class="txtBox" type="text"></td>
-		</tr>
-		</table>
-	</td>
-	</tr>
-</table>
-<table border="0" cellspacing="0" cellpadding="5" width="100%" class="layerPopupTransport">
-	<tr>
-	<td align="center">
-			<input name="save" value=" &nbsp;'.$app_strings['LBL_SAVE_BUTTON_LABEL'].'&nbsp; " class="crmbutton small save" onClick="OnUrlChange(); SaveSite(\''.$portalid.'\')" type="button">&nbsp;&nbsp;
-			<input name="cancel" value=" '.$app_strings['LBL_CANCEL_BUTTON_LABEL'].' " class="crmbutton small cancel" onclick="fninvsh(\'orgLay\');" type="button">
-	</td>
-	</tr>
-</table>
-</div>';
-	
-echo $portal_inputs;
-
-
-?>
+<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+* ("License"); You may not use this file except in compliance with the License
+* The Original Code is:  vtiger CRM Open Source
+* The Initial Developer of the Original Code is vtiger.
+* Portions created by vtiger are Copyright (C) vtiger.
+* All Rights Reserved.
+*
+********************************************************************************/
+
+require_once('modules/Portal/Portal.php');
+global $app_strings;
+global $app_list_strings;
+global $mod_strings;
+global $adb;
+
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
+{
+	$portalid = $_REQUEST['record'];
+	$query="select * from vtiger_portal where portalid =$portalid";
+	$result=$adb->query($query);
+	$portalname = $adb->query_result($result,0,'portalname');
+        $portalurl = $adb->query_result($result,0,'portalurl');		
+}
+$portal_inputs='';
+$portal_inputs.='<div style="display:block;position:relative;" id="orgLay" class="layerPopup">
+		<table border="0" cellpadding="3" cellspacing="0" width="100%" class="layerHeadingULine">
+		<tr>
+			<td class="layerPopupHeading" align="left" width="60%">' .$mod_strings['LBL_ADD'] .' '.$mod_strings['LBL_BOOKMARK'].'</td>
+			<td align="right" width="40%"><a href="javascript:fninvsh(\'orgLay\');"><img src="'.$image_path.'close.gif" align="absmiddle" border="0"></a></td>
+		</tr>
+		</table>
+<table border="0" cellspacing="0" cellpadding="5" width="95%" align="center"> 
+	<tr>
+	<td class="small" >
+		<table border="0" celspacing="0" cellpadding="5" width="100%" align="center" bgcolor="white">
+		
+		<tr>
+
+			<td align="right" width="40%" ><b>'.$mod_strings['LBL_BOOKMARK'].' ' .$mod_strings['LBL_URL'] .' </b></td>
+			<td align="left" width="60%">http://<input name="portalurl" id="portalurl" class="txtBox" value="'.$portalurl.'" type="text" onkeyup="OnUrlChange();"></td>
+		</tr>
+		<tr>
+			<td align="right" width="40%"> <b>'.$mod_strings['LBL_BOOKMARK'].' ' .$mod_strings['LBL_NAME'] .' </b></td>
+			<td align="left" width="60%"><input name="portalname" id="portalname" value="'.$portalname.'" class="txtBox" type="text"></td>
+		</tr>
+		</table>
+	</td>
+	</tr>
+</table>
+<table border="0" cellspacing="0" cellpadding="5" width="100%" class="layerPopupTransport">
+	<tr>
+	<td align="center">
+			<input name="save" value=" &nbsp;'.$app_strings['LBL_SAVE_BUTTON_LABEL'].'&nbsp; " class="crmbutton small save" onClick="OnUrlChange(); SaveSite(\''.$portalid.'\')" type="button">&nbsp;&nbsp;
+			<input name="cancel" value=" '.$app_strings['LBL_CANCEL_BUTTON_LABEL'].' " class="crmbutton small cancel" onclick="fninvsh(\'orgLay\');" type="button">
+	</td>
+	</tr>
+</table>
+</div>';
+	
+echo $portal_inputs;
+
+
+?>
diff -ruN htdocs.orig/modules/Portal/Portal.php htdocs/modules/Portal/Portal.php
--- htdocs.orig/modules/Portal/Portal.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Portal/Portal.php	2007-05-09 00:58:36.000000000 +0200
@@ -1,45 +1,45 @@
-<?php
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-* ("License"); You may not use this file except in compliance with the License
-* The Original Code is:  vtiger CRM Open Source
-* The Initial Developer of the Original Code is vtiger.
-* Portions created by vtiger are Copyright (C) vtiger.
-* All Rights Reserved.
-*
-********************************************************************************/
-
-
-/** Function to save the portal in database 
- *  @param $portalname : Type String
- *  @param $portalurl : Type String
- *  This function saves the portal with the given $portalname,$portalurl
- *  This Returns $portalid 
- */
-function SavePortal($portalname,$portalurl)
-{
-	global $adb;
-	$adb->println("just entered the SavePortal method");
-	$portalid=$adb->getUniqueID('vtiger_portal');
-	$query="insert into vtiger_portal values(".$portalid.",'".$portalname."','".$portalurl."',0)";
-	$adb->println($query);
-	$result=$adb->query($query);
-	return $portalid;
-}
-/** Function to update the portal in database 
- *  @param $portalname : Type String
- *  @param $portalurl : Type String
- *  @param $portalid : Type Integer 
- *  This function updates the portal with the given $portalname,$portalurl
- *  This Returns $portalid 
- */
-function UpdatePortal($portalname,$portalurl,$portalid)
-{
-	global $adb;
-	$adb->println("just entered the SavePortal method");
-	$query="update vtiger_portal set portalname='$portalname' ,portalurl='$portalurl' where portalid=$portalid";
-	$adb->println($query);
-	$result=$adb->query($query);
-	return $portalid;
-}
-?>
+<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+* ("License"); You may not use this file except in compliance with the License
+* The Original Code is:  vtiger CRM Open Source
+* The Initial Developer of the Original Code is vtiger.
+* Portions created by vtiger are Copyright (C) vtiger.
+* All Rights Reserved.
+*
+********************************************************************************/
+
+
+/** Function to save the portal in database 
+ *  @param $portalname : Type String
+ *  @param $portalurl : Type String
+ *  This function saves the portal with the given $portalname,$portalurl
+ *  This Returns $portalid 
+ */
+function SavePortal($portalname,$portalurl)
+{
+	global $adb;
+	$adb->println("just entered the SavePortal method");
+	$portalid=$adb->getUniqueID('vtiger_portal');
+	$query="insert into vtiger_portal values(".$portalid.",'".$portalname."','".$portalurl."',0)";
+	$adb->println($query);
+	$result=$adb->query($query);
+	return $portalid;
+}
+/** Function to update the portal in database 
+ *  @param $portalname : Type String
+ *  @param $portalurl : Type String
+ *  @param $portalid : Type Integer 
+ *  This function updates the portal with the given $portalname,$portalurl
+ *  This Returns $portalid 
+ */
+function UpdatePortal($portalname,$portalurl,$portalid)
+{
+	global $adb;
+	$adb->println("just entered the SavePortal method");
+	$query="update vtiger_portal set portalname='$portalname' ,portalurl='$portalurl' where portalid=$portalid";
+	$adb->println($query);
+	$result=$adb->query($query);
+	return $portalid;
+}
+?>
-------------- next part --------------
diff -ruN htdocs.orig/modules/Settings/TaxConfig.php htdocs/modules/Settings/TaxConfig.php
--- htdocs.orig/modules/Settings/TaxConfig.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Settings/TaxConfig.php	2007-05-09 01:00:29.000000000 +0200
@@ -1,244 +1,244 @@
-<?php
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-
-
-require_once('Smarty_setup.php');
-global $mod_strings;
-global $app_strings;
-global $adb;
-global $log;
-
-$smarty = new vtigerCRM_Smarty;
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-require_once($theme_path.'layout_utils.php');
-
-$tax_details = getAllTaxes();
-$sh_tax_details = getAllTaxes('all','sh');
-
-
-//To save the edited value
-if($_REQUEST['save_tax'] == 'true')
-{
-	for($i=0;$i<count($tax_details);$i++)
-	{
-     		$new_labels[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxlabel']];
-		$new_percentages[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxname']];
-	}
-	updateTaxPercentages($new_percentages);
-	updateTaxLabels($new_labels);
-	$getlist = true;
-}
-elseif($_REQUEST['sh_save_tax'] == 'true')
-{
- 
-	for($i=0;$i<count($sh_tax_details);$i++)
-	{
-	  $new_labels[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxlabel']];
-		$new_percentages[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxname']];
-	}
-	
-	updateTaxPercentages($new_percentages,'sh');
-	updateTaxLabels($new_labels,'sh');
-	$getlist = true;
-}
-
-//To edit
-if($_REQUEST['edit_tax'] == 'true')
-{
-	$smarty->assign("EDIT_MODE", 'true');
-}
-elseif($_REQUEST['sh_edit_tax'] == 'true')
-{
-	$smarty->assign("SH_EDIT_MODE", 'true');
-}
-
-//To add tax
-if($_REQUEST['add_tax_type'] == 'true')
-{
-	//Add the given tax name and value as a new tax type
-	echo addTaxType($_REQUEST['addTaxLabel'],$_REQUEST['addTaxValue']);
-	$getlist = true;
-}
-elseif($_REQUEST['sh_add_tax_type'] == 'true')
-{
-	echo addTaxType($_REQUEST['sh_addTaxLabel'],$_REQUEST['sh_addTaxValue'],'sh');
-	$getlist = true;
-}
-
-//To Disable ie., delete or enable
-if(($_REQUEST['disable'] == 'true' || $_REQUEST['enable'] == 'true') && $_REQUEST['taxname'] != '')
-{
-	if($_REQUEST['disable'] == 'true')
-		changeDeleted($_REQUEST['taxname'],1);
-	else
-		changeDeleted($_REQUEST['taxname'],0);
-	$getlist = true;
-}
-elseif(($_REQUEST['sh_disable'] == 'true' || $_REQUEST['sh_enable'] == 'true') && $_REQUEST['sh_taxname'] != '')
-{
-	if($_REQUEST['sh_disable'] == 'true')
-		changeDeleted($_REQUEST['sh_taxname'],1,'sh');
-	else
-		changeDeleted($_REQUEST['sh_taxname'],0,'sh');
-	$getlist = true;
-}
-
-//after done save or enable/disable or added new tax the list will be retrieved again from db
-if($getlist)
-{
-	$tax_details = getAllTaxes();
-	$sh_tax_details = getAllTaxes('all','sh');
-}
-
-$smarty->assign("TAX_COUNT", count($tax_details));
-$smarty->assign("SH_TAX_COUNT", count($sh_tax_details));
-
-if(count($tax_details) == 0)
-	$smarty->assign("TAX_COUNT", 0);
-if(count($sh_tax_details) == 0)
-	$smarty->assign("SH_TAX_COUNT", 0);
-
-$smarty->assign("TAX_VALUES", $tax_details);
-
-$smarty->assign("SH_TAX_VALUES", $sh_tax_details);
-
-$smarty->assign("MOD", return_module_language($current_language,'Settings'));
-$smarty->assign("IMAGE_PATH",$image_path);
-$smarty->assign("APP", $app_strings);
-$smarty->assign("MOD", $mod_strings);
-$smarty->display("Settings/TaxConfig.tpl");
-
-
-/**	Function to update the list of Tax percentages for the passed tax types
- *	@param array $new_percentages - array of tax types and the values like [taxid]=new value ie., [1]=3.56, [2]=11.45
- *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
- *      @return void
- */
-function updateTaxPercentages($new_percentages, $sh='')
-{
-	global $adb, $log;
-	$log->debug("Entering into the function updateTaxPercentages");
-
-	foreach($new_percentages as $taxid => $new_val)
-	{
-		if($new_val != '')
-		{
-			if($sh != '' && $sh == 'sh')
-				$query = "update vtiger_shippingtaxinfo set percentage=\"$new_val\" where taxid=\"$taxid\"";
-			else
-				$query = "update vtiger_inventorytaxinfo set percentage = \"$new_val\" where taxid=\"$taxid\"";
-			$adb->query($query);
-		}
-	}
-
-	$log->debug("Exiting from the function updateTaxPercentages");
-}
-
-/**	Function to update the list of Tax Labels for the taxes
- *	@param array $new_labels - array of tax types and the values like [taxid]=new label ie., [1]=aa, [2]=bb
- *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
- *      @return void
- */
-function updateTaxLabels($new_labels, $sh='')
-{
-	global $adb, $log;
-	$log->debug("Entering into the function updateTaxPercentages");
-
-	foreach($new_labels as $taxid => $new_val)
-	{
-		if($new_val != '')
-		{
-			if($sh != '' && $sh == 'sh')
-				$query = "update vtiger_shippingtaxinfo set taxlabel= \"$new_val\" where taxid=\"$taxid\"";
-			else
-				$query = "update vtiger_inventorytaxinfo set taxlabel = \"$new_val\" where taxid=\"$taxid\"";
-			$adb->query($query);
-		}
-	}
-
-	$log->debug("Exiting from the function updateTaxPercentages");
-}
-/**	Function used to add the tax type which will do database alterations
- *	@param string $taxlabel - tax label name to be added
- *	@param string $taxvalue - tax value to be added
- *      @param string $sh - sh or empty , if sh passed then the tax will be added in shipping and handling related table
- *      @return void
- */
-function addTaxType($taxlabel, $taxvalue, $sh='')
-{
-	global $adb, $log;
-	$log->debug("Entering into function addTaxType($taxlabel, $taxvalue, $sh)");
-
-	//First we will check whether the tax is already available or not
-	if($sh != '' && $sh == 'sh')
-		$check_query = "select taxlabel from vtiger_shippingtaxinfo where taxlabel='".addslashes($taxlabel)."'";
-	else
-		$check_query = "select taxlabel from vtiger_inventorytaxinfo where taxlabel='".addslashes($taxlabel)."'";
-	$check_res = $adb->query($check_query);
-
-	if($adb->num_rows($check_res) > 0)
-		return "<font color='red'>This tax is already available</font>";
-
-	//if the tax is not available then add this tax.
-	//Add this tax as a column in related table	
-	if($sh != '' && $sh == 'sh')
-	{
-		$taxid = $adb->getUniqueID("vtiger_shippingtaxinfo");
-		$taxname = "shtax".$taxid;
-		$query = "alter table vtiger_inventoryshippingrel add column $taxname decimal(7,3) default NULL";
-	}
-	else
-	{
-		$taxid = $adb->getUniqueID("vtiger_inventorytaxinfo");
-		$taxname = "tax".$taxid;
-		$query = "alter table vtiger_inventoryproductrel add column $taxname decimal(7,3) default NULL";
-	}
-	$res = $adb->query($query);
-
-	//if the tax is added as a column then we should add this tax in the list of taxes
-	if($res)
-	{
-		if($sh != '' && $sh == 'sh')
-			$query1 = "insert into vtiger_shippingtaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
-		else
-			$query1 = "insert into vtiger_inventorytaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
-
-		$res1 = $adb->query($query1);
-	}
-
-	$log->debug("Exit from function addTaxType($taxlabel, $taxvalue)");
-	if($res1)
-		return '';
-	else
-		return "There may be some problem in adding the Tax type. Please try again";
-}
-
-/**	Function used to Enable or Disable the tax type 
- *	@param string $taxname - taxname to enable or disble
- *	@param int $deleted - 0 or 1 where 0 to enable and 1 to disable
- *	@param string $sh - sh or empty, if sh passed then the enable/disable will be done in shipping and handling tax table ie.,vtiger_shippingtaxinfo  else this enable/disable will be done in Product tax table ie., in vtiger_inventorytaxinfo
- *	@return void
- */
-function changeDeleted($taxname, $deleted, $sh='')
-{
-	global $log, $adb;
-	$log->debug("Entering into function changeDeleted($taxname, $deleted, $sh)");
-
-	if($sh == 'sh')
-		$adb->query("update vtiger_shippingtaxinfo set deleted=$deleted where taxname=\"$taxname\"");
-	else
-		$adb->query("update vtiger_inventorytaxinfo set deleted=$deleted where taxname=\"$taxname\"");
-	$log->debug("Exit from function changeDeleted($taxname, $deleted, $sh)");
-}
-
-?>
+<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
+
+require_once('Smarty_setup.php');
+global $mod_strings;
+global $app_strings;
+global $adb;
+global $log;
+
+$smarty = new vtigerCRM_Smarty;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+require_once($theme_path.'layout_utils.php');
+
+$tax_details = getAllTaxes();
+$sh_tax_details = getAllTaxes('all','sh');
+
+
+//To save the edited value
+if($_REQUEST['save_tax'] == 'true')
+{
+	for($i=0;$i<count($tax_details);$i++)
+	{
+     		$new_labels[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxlabel']];
+		$new_percentages[$tax_details[$i]['taxid']] = $_REQUEST[$tax_details[$i]['taxname']];
+	}
+	updateTaxPercentages($new_percentages);
+	updateTaxLabels($new_labels);
+	$getlist = true;
+}
+elseif($_REQUEST['sh_save_tax'] == 'true')
+{
+ 
+	for($i=0;$i<count($sh_tax_details);$i++)
+	{
+	  $new_labels[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxlabel']];
+		$new_percentages[$sh_tax_details[$i]['taxid']] = $_REQUEST[$sh_tax_details[$i]['taxname']];
+	}
+	
+	updateTaxPercentages($new_percentages,'sh');
+	updateTaxLabels($new_labels,'sh');
+	$getlist = true;
+}
+
+//To edit
+if($_REQUEST['edit_tax'] == 'true')
+{
+	$smarty->assign("EDIT_MODE", 'true');
+}
+elseif($_REQUEST['sh_edit_tax'] == 'true')
+{
+	$smarty->assign("SH_EDIT_MODE", 'true');
+}
+
+//To add tax
+if($_REQUEST['add_tax_type'] == 'true')
+{
+	//Add the given tax name and value as a new tax type
+	echo addTaxType($_REQUEST['addTaxLabel'],$_REQUEST['addTaxValue']);
+	$getlist = true;
+}
+elseif($_REQUEST['sh_add_tax_type'] == 'true')
+{
+	echo addTaxType($_REQUEST['sh_addTaxLabel'],$_REQUEST['sh_addTaxValue'],'sh');
+	$getlist = true;
+}
+
+//To Disable ie., delete or enable
+if(($_REQUEST['disable'] == 'true' || $_REQUEST['enable'] == 'true') && $_REQUEST['taxname'] != '')
+{
+	if($_REQUEST['disable'] == 'true')
+		changeDeleted($_REQUEST['taxname'],1);
+	else
+		changeDeleted($_REQUEST['taxname'],0);
+	$getlist = true;
+}
+elseif(($_REQUEST['sh_disable'] == 'true' || $_REQUEST['sh_enable'] == 'true') && $_REQUEST['sh_taxname'] != '')
+{
+	if($_REQUEST['sh_disable'] == 'true')
+		changeDeleted($_REQUEST['sh_taxname'],1,'sh');
+	else
+		changeDeleted($_REQUEST['sh_taxname'],0,'sh');
+	$getlist = true;
+}
+
+//after done save or enable/disable or added new tax the list will be retrieved again from db
+if($getlist)
+{
+	$tax_details = getAllTaxes();
+	$sh_tax_details = getAllTaxes('all','sh');
+}
+
+$smarty->assign("TAX_COUNT", count($tax_details));
+$smarty->assign("SH_TAX_COUNT", count($sh_tax_details));
+
+if(count($tax_details) == 0)
+	$smarty->assign("TAX_COUNT", 0);
+if(count($sh_tax_details) == 0)
+	$smarty->assign("SH_TAX_COUNT", 0);
+
+$smarty->assign("TAX_VALUES", $tax_details);
+
+$smarty->assign("SH_TAX_VALUES", $sh_tax_details);
+
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("MOD", $mod_strings);
+$smarty->display("Settings/TaxConfig.tpl");
+
+
+/**	Function to update the list of Tax percentages for the passed tax types
+ *	@param array $new_percentages - array of tax types and the values like [taxid]=new value ie., [1]=3.56, [2]=11.45
+ *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
+ *      @return void
+ */
+function updateTaxPercentages($new_percentages, $sh='')
+{
+	global $adb, $log;
+	$log->debug("Entering into the function updateTaxPercentages");
+
+	foreach($new_percentages as $taxid => $new_val)
+	{
+		if($new_val != '')
+		{
+			if($sh != '' && $sh == 'sh')
+				$query = "update vtiger_shippingtaxinfo set percentage=\"$new_val\" where taxid=\"$taxid\"";
+			else
+				$query = "update vtiger_inventorytaxinfo set percentage = \"$new_val\" where taxid=\"$taxid\"";
+			$adb->query($query);
+		}
+	}
+
+	$log->debug("Exiting from the function updateTaxPercentages");
+}
+
+/**	Function to update the list of Tax Labels for the taxes
+ *	@param array $new_labels - array of tax types and the values like [taxid]=new label ie., [1]=aa, [2]=bb
+ *      @param string $sh - sh or empty, if sh passed then update will be done in shipping and handling related table
+ *      @return void
+ */
+function updateTaxLabels($new_labels, $sh='')
+{
+	global $adb, $log;
+	$log->debug("Entering into the function updateTaxPercentages");
+
+	foreach($new_labels as $taxid => $new_val)
+	{
+		if($new_val != '')
+		{
+			if($sh != '' && $sh == 'sh')
+				$query = "update vtiger_shippingtaxinfo set taxlabel= \"$new_val\" where taxid=\"$taxid\"";
+			else
+				$query = "update vtiger_inventorytaxinfo set taxlabel = \"$new_val\" where taxid=\"$taxid\"";
+			$adb->query($query);
+		}
+	}
+
+	$log->debug("Exiting from the function updateTaxPercentages");
+}
+/**	Function used to add the tax type which will do database alterations
+ *	@param string $taxlabel - tax label name to be added
+ *	@param string $taxvalue - tax value to be added
+ *      @param string $sh - sh or empty , if sh passed then the tax will be added in shipping and handling related table
+ *      @return void
+ */
+function addTaxType($taxlabel, $taxvalue, $sh='')
+{
+	global $adb, $log;
+	$log->debug("Entering into function addTaxType($taxlabel, $taxvalue, $sh)");
+
+	//First we will check whether the tax is already available or not
+	if($sh != '' && $sh == 'sh')
+		$check_query = "select taxlabel from vtiger_shippingtaxinfo where taxlabel='".addslashes($taxlabel)."'";
+	else
+		$check_query = "select taxlabel from vtiger_inventorytaxinfo where taxlabel='".addslashes($taxlabel)."'";
+	$check_res = $adb->query($check_query);
+
+	if($adb->num_rows($check_res) > 0)
+		return "<font color='red'>This tax is already available</font>";
+
+	//if the tax is not available then add this tax.
+	//Add this tax as a column in related table	
+	if($sh != '' && $sh == 'sh')
+	{
+		$taxid = $adb->getUniqueID("vtiger_shippingtaxinfo");
+		$taxname = "shtax".$taxid;
+		$query = "alter table vtiger_inventoryshippingrel add column $taxname decimal(7,3) default NULL";
+	}
+	else
+	{
+		$taxid = $adb->getUniqueID("vtiger_inventorytaxinfo");
+		$taxname = "tax".$taxid;
+		$query = "alter table vtiger_inventoryproductrel add column $taxname decimal(7,3) default NULL";
+	}
+	$res = $adb->query($query);
+
+	//if the tax is added as a column then we should add this tax in the list of taxes
+	if($res)
+	{
+		if($sh != '' && $sh == 'sh')
+			$query1 = "insert into vtiger_shippingtaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
+		else
+			$query1 = "insert into vtiger_inventorytaxinfo values($taxid,'".$taxname."','".$taxlabel."','".$taxvalue."',0)";
+
+		$res1 = $adb->query($query1);
+	}
+
+	$log->debug("Exit from function addTaxType($taxlabel, $taxvalue)");
+	if($res1)
+		return '';
+	else
+		return "There may be some problem in adding the Tax type. Please try again";
+}
+
+/**	Function used to Enable or Disable the tax type 
+ *	@param string $taxname - taxname to enable or disble
+ *	@param int $deleted - 0 or 1 where 0 to enable and 1 to disable
+ *	@param string $sh - sh or empty, if sh passed then the enable/disable will be done in shipping and handling tax table ie.,vtiger_shippingtaxinfo  else this enable/disable will be done in Product tax table ie., in vtiger_inventorytaxinfo
+ *	@return void
+ */
+function changeDeleted($taxname, $deleted, $sh='')
+{
+	global $log, $adb;
+	$log->debug("Entering into function changeDeleted($taxname, $deleted, $sh)");
+
+	if($sh == 'sh')
+		$adb->query("update vtiger_shippingtaxinfo set deleted=$deleted where taxname=\"$taxname\"");
+	else
+		$adb->query("update vtiger_inventorytaxinfo set deleted=$deleted where taxname=\"$taxname\"");
+	$log->debug("Exit from function changeDeleted($taxname, $deleted, $sh)");
+}
+
+?>
-------------- next part --------------
diff -ruN htdocs.orig/modules/Users/DetailViewAjax.php htdocs/modules/Users/DetailViewAjax.php
--- htdocs.orig/modules/Users/DetailViewAjax.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Users/DetailViewAjax.php	2007-05-09 01:01:55.000000000 +0200
@@ -1,35 +1,35 @@
-<?php
-/*********************************************************************************
- ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-  * ("License"); You may not use this file except in compliance with the License
-  * The Original Code is:  vtiger CRM Open Source
-  * The Initial Developer of the Original Code is vtiger.
-  * Portions created by vtiger are Copyright (C) vtiger.
-  * All Rights Reserved.
- *
-  ********************************************************************************/
-	      
-require_once('include/logging.php');
-require_once('modules/Users/Users.php');
-require_once('include/database/PearDatabase.php');
-global $adb;
-
+<?php
+/*********************************************************************************
+ ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+  * ("License"); You may not use this file except in compliance with the License
+  * The Original Code is:  vtiger CRM Open Source
+  * The Initial Developer of the Original Code is vtiger.
+  * Portions created by vtiger are Copyright (C) vtiger.
+  * All Rights Reserved.
+ *
+  ********************************************************************************/
+	      
+require_once('include/logging.php');
+require_once('modules/Users/Users.php');
+require_once('include/database/PearDatabase.php');
+global $adb;
+
 $org_separator = "<br>&nbsp;";
-$local_log =& LoggerManager::getLogger('UsersAjax');
+$local_log =& LoggerManager::getLogger('UsersAjax');
 $my_status = "Failure";
-$ajaxaction = $_REQUEST["ajxaction"];
-if($ajaxaction == "DETAILVIEW")
-{
-	$crmid = $_REQUEST["recordid"];
-	$tablename = $_REQUEST["tableName"];
-	$fieldname = $_REQUEST["fldName"];
-	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
+$ajaxaction = $_REQUEST["ajxaction"];
+if($ajaxaction == "DETAILVIEW")
+{
+	$crmid = $_REQUEST["recordid"];
+	$tablename = $_REQUEST["tableName"];
+	$fieldname = $_REQUEST["fldName"];
+	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
 	$local_log->debug("Entering DetailViewAjax crmid=".$crmid." tab=".$tablename." fld=".$fieldname." val='".$fieldvalue."'");
 
-	if($crmid != "")
-	{
-		$userObj = new Users();
-		$userObj->retrieve_entity_info($crmid,"Users");
+	if($crmid != "")
+	{
+		$userObj = new Users();
+		$userObj->retrieve_entity_info($crmid,"Users");
 
 		//assigned organizations
 		if( $fieldname == 'assigned_org[]') {
@@ -173,30 +173,30 @@
 		    $adb->completeTransaction();
 
 		    //Organization assignment
-		    require('modules/Users/GetUserOrg.php');
+		    require('modules/Users/GetUserOrg.php');
 		}
 
 		//anything else is a field update
 		else {
-		    $userObj->column_fields[$fieldname] = $fieldvalue;
-		    $userObj->id = $crmid;
-		    $userObj->mode = "edit";
-		    $userObj->save("Users");
+		    $userObj->column_fields[$fieldname] = $fieldvalue;
+		    $userObj->id = $crmid;
+		    $userObj->mode = "edit";
+		    $userObj->save("Users");
 		}
 
 		//result would be success as long as the user exists
-		if($userObj->id != "")
-		{
-			echo ":#:SUCCESS";
+		if($userObj->id != "")
+		{
+			echo ":#:SUCCESS";
 			$my_status = "Success";
-		}else
-		{
-			echo ":#:FAILURE";
-		}   
-	}else
-	{
-		echo ":#:FAILURE";
-	}
+		}else
+		{
+			echo ":#:FAILURE";
+		}   
+	}else
+	{
+		echo ":#:FAILURE";
+	}
 	$local_log->debug("Exit DetailViewAjax: ".$my_status);
-}
-?>
+}
+?>
diff -ruN htdocs.orig/modules/Users/EditView.php htdocs/modules/Users/EditView.php
--- htdocs.orig/modules/Users/EditView.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Users/EditView.php	2007-05-09 01:01:55.000000000 +0200
@@ -42,7 +42,7 @@
 	$smarty->assign("ID",$_REQUEST['record']);
 	$mode='edit';
 	if (!is_admin($current_user) && $_REQUEST['record'] != $current_user->id) die ("Unauthorized access to user administration.");
-    $focus->retrieve_entity_info($_REQUEST['record'],'Users');
+	$focus->retrieve_entity_info($_REQUEST['record'],'Users');
 	$smarty->assign("USERNAME",$focus->last_name.' '.$focus->first_name);
 }else
 {
@@ -59,6 +59,11 @@
 	$focus->column_fields['confirm_password']='';
 }
 
+if(is_admin($current_user))
+	$smarty->assign("IS_ADMIN", true);
+else
+	$smarty->assign("IS_ADMIN", false);
+
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
@@ -111,9 +116,57 @@
 
 $smarty->assign("HOMEORDER",$focus->getHomeOrder($focus->id));
 $smarty->assign("DUPLICATE",$_REQUEST['isDuplicate']);
-
 $smarty->assign('PARENTTAB',$_REQUEST['parenttab']);
 
+//Organization assignment
+if( $mode == "create" ) {
+    $orgs = array();
+    $smarty_orgs = array($orgs);
+
+    //all organizations
+    $sql = "SELECT organizationname FROM vtiger_organizationdetails WHERE deleted=0";
+    $result = $adb->query($sql);
+    $allorgs = array();
+    while($org_result = $adb->fetch_array($result)) {
+	$key = $org_result["organizationname"];
+	$allorgs[$key] = '';
+    }
+    $smarty_allorgs = array($allorgs);
+
+    //Organization untis
+    $orgunits = array();
+    $smarty_orgunits = array($orgunits);
+
+    //The remaining field are intentially left blank
+    $curorg = "";
+    $assigned_org = "";
+    $prim_orgunits = "";
+    $org_separator = "<br>&nbsp;";
+
+    //Set up session variables
+    $_SESSION['all_user_organizations'] = $smarty_allorgs;
+    $_SESSION['edit_user_organizations'] = $smarty_orgs;
+    $_SESSION['edit_user_orgunits'] = $smarty_orgunits;
+    $_SESSION['edit_user_primary_organization'] = $curorg;
+    $_SESSION['edit_user_assigned_organization'] = $assigned_org;
+    $_SESSION['edit_user_primary_orgunits'] = $prim_orgunits;
+}
+
+//In case of edit mode use the predefined gathering fuction
+else {
+    $crmid = $focus->id;
+    require('modules/Users/GetUserOrg.php');
+}
+
+//Assign the organization details to the html output
+$smarty->assign("MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING", $org_separator);
+$smarty->assign("ALL_USER_ORGANIZATIONS", $smarty_allorgs);
+$smarty->assign("EDIT_USER_ORGANIZATIONS", $smarty_orgs);
+$smarty->assign("EDIT_USER_ORGUNITS", $smarty_orgunits);
+$smarty->assign("EDIT_USER_PRIMARY_ORGANIZATION", $curorg);
+$smarty->assign("EDIT_USER_ASSIGNED_ORGANIZATIONS", $assigned_org);
+$smarty->assign("EDIT_USER_PRIMARY_ORGUNITS", $prim_orgunits);
+
 $smarty->display('UserEditView.tpl');
 
 ?>
diff -ruN htdocs.orig/modules/Users/ListView.php htdocs/modules/Users/ListView.php
--- htdocs.orig/modules/Users/ListView.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Users/ListView.php	2007-05-09 01:01:55.000000000 +0200
@@ -1,82 +1,82 @@
-<?php
-/*********************************************************************************
-  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-   * ("License"); You may not use this file except in compliance with the License
-   * The Original Code is:  vtiger CRM Open Source
-   * The Initial Developer of the Original Code is vtiger.
-   * Portions created by vtiger are Copyright (C) vtiger.
-   * All Rights Reserved.
-  *
- ********************************************************************************/
-
-require_once('include/utils/utils.php');
-require_once('Smarty_setup.php');
-global $app_strings;
-global $list_max_entries_per_page;
-
-$log = LoggerManager::getLogger('user_list');
-
-global $mod_strings;
-global $currentModule, $current_user;
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-global $current_language;
-$mod_strings = return_module_language($current_language,'Users');
-$category = getParentTab();
-$focus = new Users();
-$smarty = new vtigerCRM_Smarty;
-$no_of_users=UserCount();
-//Retreiving the start value from request
-if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-{
-	        $start = $_REQUEST['start'];
-}
-elseif($_SESSION['user_pagestart'] != '')
-{
-	        $start = $_SESSION['user_pagestart'];
-}
-else
-	$start=1;
-
-$list_query = getListQuery("Users"); 
-
-$_SESSION['user_pagestart'] = $start;
-if($_REQUEST['sorder'] !='')
-	$sorder = $_REQUEST['sorder'];
-elseif($_SESSION['user_sorder'] != '')
-	$sorder = $_SESSION['user_sorder'];
-else
-	$sorder = 'ASC';
-$_SESSION['user_sorder'] = $sorder;
-if($_REQUEST['order_by'] != '')
-	$order_by = $_REQUEST['order_by'];
-elseif($_SESSION['user_orderby'] != '')
-	$order_by = $_SESSION['user_orderby'];
-else
-	$order_by = 'last_name';
-$_SESSION['user_orderby'] = $orderby;
-$list_query .= ' ORDER BY '.$order_by.' '.$sorder;
-$list_result = $adb->query($list_query);
-//Retreive the Navigation array
-$navigation_array = getNavigationValues($start, $adb->num_rows($list_result), $no_of_users['user']);
-
-$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string,"Administration","index",'');
-$smarty->assign("MOD", return_module_language($current_language,'Settings'));
-$smarty->assign("CMOD", $mod_strings);
-$smarty->assign("APP", $app_strings);
-$smarty->assign("CURRENT_USERID", $current_user->id);
-$smarty->assign("IMAGE_PATH",$image_path);
-$smarty->assign("CATEGORY",$category);
-$smarty->assign("LIST_HEADER",getListViewHeader($focus,"Users",$url_string,$sorder,$order_by,"",""));
-$smarty->assign("LIST_ENTRIES",getListViewEntries($focus,"Users",$list_result,$navigation_array,"","","EditView","Delete",""));
-$smarty->assign("USER_COUNT",$no_of_users);
-$smarty->assign("RECORD_COUNTS", $record_string);
-$smarty->assign("NAVIGATION", $navigationOutput);
-$smarty->assign("USER_IMAGES",getUserImageNames());
-if($_REQUEST['ajax'] !='')
-	$smarty->display("UserListViewContents.tpl");
-else
-	$smarty->display("UserListView.tpl");
-
-?>
+<?php
+/*********************************************************************************
+  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+   * ("License"); You may not use this file except in compliance with the License
+   * The Original Code is:  vtiger CRM Open Source
+   * The Initial Developer of the Original Code is vtiger.
+   * Portions created by vtiger are Copyright (C) vtiger.
+   * All Rights Reserved.
+  *
+ ********************************************************************************/
+
+require_once('include/utils/utils.php');
+require_once('Smarty_setup.php');
+global $app_strings;
+global $list_max_entries_per_page;
+
+$log = LoggerManager::getLogger('user_list');
+
+global $mod_strings;
+global $currentModule, $current_user;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+global $current_language;
+$mod_strings = return_module_language($current_language,'Users');
+$category = getParentTab();
+$focus = new Users();
+$smarty = new vtigerCRM_Smarty;
+$no_of_users=UserCount();
+//Retreiving the start value from request
+if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
+{
+	        $start = $_REQUEST['start'];
+}
+elseif($_SESSION['user_pagestart'] != '')
+{
+	        $start = $_SESSION['user_pagestart'];
+}
+else
+	$start=1;
+
+$list_query = getListQuery("Users"); 
+
+$_SESSION['user_pagestart'] = $start;
+if($_REQUEST['sorder'] !='')
+	$sorder = $_REQUEST['sorder'];
+elseif($_SESSION['user_sorder'] != '')
+	$sorder = $_SESSION['user_sorder'];
+else
+	$sorder = 'ASC';
+$_SESSION['user_sorder'] = $sorder;
+if($_REQUEST['order_by'] != '')
+	$order_by = $_REQUEST['order_by'];
+elseif($_SESSION['user_orderby'] != '')
+	$order_by = $_SESSION['user_orderby'];
+else
+	$order_by = 'last_name';
+$_SESSION['user_orderby'] = $orderby;
+$list_query .= ' ORDER BY '.$order_by.' '.$sorder;
+$list_result = $adb->query($list_query);
+//Retreive the Navigation array
+$navigation_array = getNavigationValues($start, $adb->num_rows($list_result), $no_of_users['user']);
+
+$navigationOutput = getTableHeaderNavigation($navigation_array, $url_string,"Administration","index",'');
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("CMOD", $mod_strings);
+$smarty->assign("APP", $app_strings);
+$smarty->assign("CURRENT_USERID", $current_user->id);
+$smarty->assign("IMAGE_PATH",$image_path);
+$smarty->assign("CATEGORY",$category);
+$smarty->assign("LIST_HEADER",getListViewHeader($focus,"Users",$url_string,$sorder,$order_by,"",""));
+$smarty->assign("LIST_ENTRIES",getListViewEntries($focus,"Users",$list_result,$navigation_array,"","","EditView","Delete",""));
+$smarty->assign("USER_COUNT",$no_of_users);
+$smarty->assign("RECORD_COUNTS", $record_string);
+$smarty->assign("NAVIGATION", $navigationOutput);
+$smarty->assign("USER_IMAGES",getUserImageNames());
+if($_REQUEST['ajax'] !='')
+	$smarty->display("UserListViewContents.tpl");
+else
+	$smarty->display("UserListView.tpl");
+
+?>
diff -ruN htdocs.orig/modules/Users/Logout.php htdocs/modules/Users/Logout.php
--- htdocs.orig/modules/Users/Logout.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Users/Logout.php	2007-05-09 01:01:55.000000000 +0200
@@ -1,109 +1,109 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the 
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Users/Logout.php,v 1.8 2005/03/21 04:51:21 ray Exp $
- * Description:  TODO: To be written.
- ********************************************************************************/
-
-require_once('include/logging.php');
-require_once('database/DatabaseConnection.php');
-require_once('modules/Users/LoginHistory.php');
-require_once('modules/Users/Users.php');
-require_once('config.php');
-require_once('include/db_backup/backup.php');
-require_once('include/db_backup/ftp.php');
-require_once('include/database/PearDatabase.php');
-require_once('user_privileges/enable_backup.php');
-
-global $adb, $enable_backup;
-
-if($enable_backup == 'true')
-{
-	$ftpserver = '';
-	$ftpuser = '';
-	$ftppassword = '';
-	$query = "select * from vtiger_systems where server_type='backup'";
-	$result = $adb->query($query);
-	$num_rows = $adb->num_rows($result);
-	if($num_rows > 0)
-	{
-		$ftpserver = $adb->query_result($result,0,'server');
-		$ftpuser = $adb->query_result($result,0,'server_username');
-		$ftppassword = $adb->query_result($result,0,'server_password');
-	}
-
-	//Taking the Backup of DB
-	$currenttime=date("Ymd_His");
-	if($ftpserver != '' && $ftpuser != '' && $ftppassword != '')
-	{	$backupFileName="backup_".$currenttime.".sql";
-	save_structure($backupFileName, $root_directory);
-	$source_file=$backupFileName;	
-	ftpBackupFile($source_file, $ftpserver, $ftpuser, $ftppassword);
-	if(file_exists($source_file)) unlink($source_file);	
-
-	}
-}
-// Recording Logout Info
-	$usip=$_SERVER['REMOTE_ADDR'];
-        $outtime=date("Y/m/d H:i:s");
-        $loghistory=new LoginHistory();
-        $loghistory->user_logout($current_user->user_name,$usip,$outtime);
-
-
-$local_log =& LoggerManager::getLogger('Logout');
-
-//Calendar Logout
-//include('modules/Calendar/logout.php');
-
-// clear out the autthenticating flag
-session_destroy();
-
-define("IN_LOGIN", true);
-	
-// define('IN_PHPBB', true);
-// include($phpbb_root_path . 'extension.inc');
-// include($phpbb_root_path . 'common.'.$phpEx);
-
-//
-// Set page ID for session management
-//
-//$userdata = session_pagestart($user_ip, PAGE_LOGIN);
-//init_userprefs($userdata);
-//
-// End session management
-//
-
-// session id check
-/*
-if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
-{
-        $sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
-}
-else
-{
-        $sid = '';
-}
-if( $userdata['session_logged_in'] )
-	{
-		if( $userdata['session_logged_in'] )
-		{
-			session_end($userdata['session_id'], $userdata['user_id']);
-		}
-
-	}
-*/
-// go to the login screen.
-header("Location: index.php?action=Login&module=Users");
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the 
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Users/Logout.php,v 1.8 2005/03/21 04:51:21 ray Exp $
+ * Description:  TODO: To be written.
+ ********************************************************************************/
+
+require_once('include/logging.php');
+require_once('database/DatabaseConnection.php');
+require_once('modules/Users/LoginHistory.php');
+require_once('modules/Users/Users.php');
+require_once('config.php');
+require_once('include/db_backup/backup.php');
+require_once('include/db_backup/ftp.php');
+require_once('include/database/PearDatabase.php');
+require_once('user_privileges/enable_backup.php');
+
+global $adb, $enable_backup;
+
+if($enable_backup == 'true')
+{
+	$ftpserver = '';
+	$ftpuser = '';
+	$ftppassword = '';
+	$query = "select * from vtiger_systems where server_type='backup'";
+	$result = $adb->query($query);
+	$num_rows = $adb->num_rows($result);
+	if($num_rows > 0)
+	{
+		$ftpserver = $adb->query_result($result,0,'server');
+		$ftpuser = $adb->query_result($result,0,'server_username');
+		$ftppassword = $adb->query_result($result,0,'server_password');
+	}
+
+	//Taking the Backup of DB
+	$currenttime=date("Ymd_His");
+	if($ftpserver != '' && $ftpuser != '' && $ftppassword != '')
+	{	$backupFileName="backup_".$currenttime.".sql";
+	save_structure($backupFileName, $root_directory);
+	$source_file=$backupFileName;	
+	ftpBackupFile($source_file, $ftpserver, $ftpuser, $ftppassword);
+	if(file_exists($source_file)) unlink($source_file);	
+
+	}
+}
+// Recording Logout Info
+	$usip=$_SERVER['REMOTE_ADDR'];
+        $outtime=date("Y/m/d H:i:s");
+        $loghistory=new LoginHistory();
+        $loghistory->user_logout($current_user->user_name,$usip,$outtime);
+
+
+$local_log =& LoggerManager::getLogger('Logout');
+
+//Calendar Logout
+//include('modules/Calendar/logout.php');
+
+// clear out the autthenticating flag
+session_destroy();
+
+define("IN_LOGIN", true);
+	
+// define('IN_PHPBB', true);
+// include($phpbb_root_path . 'extension.inc');
+// include($phpbb_root_path . 'common.'.$phpEx);
+
+//
+// Set page ID for session management
+//
+//$userdata = session_pagestart($user_ip, PAGE_LOGIN);
+//init_userprefs($userdata);
+//
+// End session management
+//
+
+// session id check
+/*
+if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
+{
+        $sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
+}
+else
+{
+        $sid = '';
+}
+if( $userdata['session_logged_in'] )
+	{
+		if( $userdata['session_logged_in'] )
+		{
+			session_end($userdata['session_id'], $userdata['user_id']);
+		}
+
+	}
+*/
+// go to the login screen.
+header("Location: index.php?action=Login&module=Users");
+?>
diff -ruN htdocs.orig/modules/Users/Save.php htdocs/modules/Users/Save.php
--- htdocs.orig/modules/Users/Save.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Users/Save.php	2007-05-09 01:01:55.000000000 +0200
@@ -1,168 +1,168 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the 
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Users/Save.php,v 1.14 2005/03/17 06:37:39 rank Exp $
- * Description:  TODO: To be written.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
- ********************************************************************************/
-
-require_once('modules/Users/Users.php');
-require_once('include/logging.php');
-require_once('include/utils/UserInfoUtil.php');
-$log =& LoggerManager::getLogger('index');
-
-
-global $adb;
-$user_name = $_REQUEST['userName'];
-if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check'] != '')
-{
-        $query = "SELECT user_name FROM vtiger_users WHERE user_name ='".$user_name."'";
-        $result = $adb->query($query);
-        if($adb->num_rows($result) > 0)
-        {
-		echo 'User Name Already Exists!';
-		die;
-	}else
-	{
-	        echo 'SUCCESS';
-	        die;
-	}
-}
-																		
-if (isset($_POST['record']) && !is_admin($current_user) && $_POST['record'] != $current_user->id) echo ("Unauthorized access to user administration.");
-elseif (!isset($_POST['record']) && !is_admin($current_user)) echo ("Unauthorized access to user administration.");
-
-$focus = new Users();
-if(isset($_REQUEST["record"]) && $_REQUEST["record"] != '')
-{
-    $focus->mode='edit';
-	$focus->id = $_REQUEST["record"];
-}
-else
-{
-    $focus->mode='';
-}    
-
-
-if($_REQUEST['changepassword'] == 'true')
-{
-	$focus->retrieve_entity_info($_REQUEST['record'],'Users');
-	$focus->id = $_REQUEST['record'];
-if (isset($_POST['new_password'])) {
-		$new_pass = $_POST['new_password'];
-		$new_passwd = $_POST['new_password'];
-		$new_pass = md5($new_pass);
-		$old_pass = $_POST['old_password'];
-		$uname = $_POST['user_name'];
-		if (!$focus->change_password($_POST['old_password'], $_POST['new_password'])) {
-		
-			header("Location: index.php?action=Error&module=Users&error_string=".urlencode($focus->error_string));
-		exit;
-}
-}
-	
-}	
-
-    
-//save user Image
-if(! $_REQUEST['changepassword'] == 'true')
-{
-	if(strtolower($current_user->is_admin) == 'off'  && $current_user->id != $focus->id)
-	{
-		$log->fatal("SECURITY:Non-Admin ". $current_user->id . " attempted to change settings for user:". $focus->id);
-		header("Location: index.php?module=Users&action=Logout");
-		exit;
-	}
-	if(strtolower($current_user->is_admin) == 'off'  && isset($_POST['is_admin']) && strtolower($_POST['is_admin']) == 'on')
-	{
-		$log->fatal("SECURITY:Non-Admin ". $current_user->id . " attempted to change is_admin settings for user:". $focus->id);
-		header("Location: index.php?module=Users&action=Logout");
-		exit;
-	}
-	
-	if (!isset($_POST['is_admin'])) $_REQUEST["is_admin"] = 'off';
-	//Code contributed by mike crowe for rearrange the home page and tab
-	if (!isset($_POST['deleted'])) $_REQUEST["deleted"] = '0';
-	if (!isset($_POST['homeorder']) || $_POST['homeorder'] == "" ) $_REQUEST["homeorder"] = 'ILTI,QLTQ,ALVT,PLVT,CVLVT,HLT,OLV,GRT,OLTSO';
-
-	setObjectValuesFromRequest(&$focus);
-	$focus->saveentity("Users");
-	//$focus->imagename = $image_upload_array['imagename'];
-	$focus->saveHomeOrder($focus->id);
-	$return_id = $focus->id;
-
-if (isset($_POST['user_name']) && isset($_POST['new_password'])) {
-		$new_pass = $_POST['new_password'];
-		$new_passwd = $_POST['new_password'];
-		$new_pass = md5($new_pass);
-		$uname = $_POST['user_name'];
-		if (!$focus->change_password($_POST['confirm_new_password'], $_POST['new_password'])) {
-		
-			header("Location: index.php?action=Error&module=Users&error_string=".urlencode($focus->error_string));
-		exit;
-}
-}  
-
-if(isset($focus->id) && $focus->id != '')
-{
-
-  if(isset($_POST['user_role']))
-  {
-    updateUser2RoleMapping($_POST['user_role'],$focus->id);
-  }
-  if(isset($_POST['group_name']) && $_POST['group_name'] != '')
-  {
-    updateUsers2GroupMapping($_POST['group_name'],$focus->id);
-  }
-}
-else
-{
-  if(isset($_POST['user_role']))
-  {
-    insertUser2RoleMapping($_POST['user_role'],$focus->id);
-  }
-  if(isset($_POST['group_name']))
-  {
-    insertUsers2GroupMapping($_POST['group_name'],$focus->id);
-  }
-}
-
-//Creating the Privileges Flat File
-require_once('modules/Users/CreateUserPrivilegeFile.php');
-createUserPrivilegesfile($focus->id);
-createUserSharingPrivilegesfile($focus->id);
-
-}
-if(isset($_POST['return_module']) && $_POST['return_module'] != "") $return_module = $_POST['return_module'];
-else $return_module = "Users";
-if(isset($_POST['return_action']) && $_POST['return_action'] != "") $return_action = $_POST['return_action'];
-else $return_action = "DetailView";
-if(isset($_POST['return_id']) && $_POST['return_id'] != "") $return_id = $_POST['return_id'];
-if(isset($_REQUEST['activity_mode']))   $activitymode = '&activity_mode='.$_REQUEST['activity_mode'];
-if(isset($_POST['parenttab'])) $parenttab = $_POST['parenttab'];
-
-$log->debug("Saved record with id of ".$return_id);
-
-
-
-if($_REQUEST['modechk'] == 'prefview')
-	header("Location: index.php?action=$return_action&module=$return_module&record=$return_id");
-else
-	header("Location: index.php?action=$return_action&module=$return_module&record=$return_id&parenttab=$parenttab");
-
-
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the 
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Users/Save.php,v 1.14 2005/03/17 06:37:39 rank Exp $
+ * Description:  TODO: To be written.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+ ********************************************************************************/
+
+require_once('modules/Users/Users.php');
+require_once('include/logging.php');
+require_once('include/utils/UserInfoUtil.php');
+$log =& LoggerManager::getLogger('index');
+
+
+global $adb;
+$user_name = $_REQUEST['userName'];
+if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check'] != '')
+{
+        $query = "SELECT user_name FROM vtiger_users WHERE user_name ='".$user_name."'";
+        $result = $adb->query($query);
+        if($adb->num_rows($result) > 0)
+        {
+		echo 'User Name Already Exists!';
+		die;
+	}else
+	{
+	        echo 'SUCCESS';
+	        die;
+	}
+}
+																		
+if (isset($_POST['record']) && !is_admin($current_user) && $_POST['record'] != $current_user->id) echo ("Unauthorized access to user administration.");
+elseif (!isset($_POST['record']) && !is_admin($current_user)) echo ("Unauthorized access to user administration.");
+
+$focus = new Users();
+if(isset($_REQUEST["record"]) && $_REQUEST["record"] != '')
+{
+    $focus->mode='edit';
+	$focus->id = $_REQUEST["record"];
+}
+else
+{
+    $focus->mode='';
+}    
+
+
+if($_REQUEST['changepassword'] == 'true')
+{
+	$focus->retrieve_entity_info($_REQUEST['record'],'Users');
+	$focus->id = $_REQUEST['record'];
+if (isset($_POST['new_password'])) {
+		$new_pass = $_POST['new_password'];
+		$new_passwd = $_POST['new_password'];
+		$new_pass = md5($new_pass);
+		$old_pass = $_POST['old_password'];
+		$uname = $_POST['user_name'];
+		if (!$focus->change_password($_POST['old_password'], $_POST['new_password'])) {
+		
+			header("Location: index.php?action=Error&module=Users&error_string=".urlencode($focus->error_string));
+		exit;
+}
+}
+	
+}	
+
+    
+//save user Image
+if(! $_REQUEST['changepassword'] == 'true')
+{
+	if(strtolower($current_user->is_admin) == 'off'  && $current_user->id != $focus->id)
+	{
+		$log->fatal("SECURITY:Non-Admin ". $current_user->id . " attempted to change settings for user:". $focus->id);
+		header("Location: index.php?module=Users&action=Logout");
+		exit;
+	}
+	if(strtolower($current_user->is_admin) == 'off'  && isset($_POST['is_admin']) && strtolower($_POST['is_admin']) == 'on')
+	{
+		$log->fatal("SECURITY:Non-Admin ". $current_user->id . " attempted to change is_admin settings for user:". $focus->id);
+		header("Location: index.php?module=Users&action=Logout");
+		exit;
+	}
+	
+	if (!isset($_POST['is_admin'])) $_REQUEST["is_admin"] = 'off';
+	//Code contributed by mike crowe for rearrange the home page and tab
+	if (!isset($_POST['deleted'])) $_REQUEST["deleted"] = '0';
+	if (!isset($_POST['homeorder']) || $_POST['homeorder'] == "" ) $_REQUEST["homeorder"] = 'ILTI,QLTQ,ALVT,PLVT,CVLVT,HLT,OLV,GRT,OLTSO';
+
+	setObjectValuesFromRequest(&$focus);
+	$focus->saveentity("Users");
+	//$focus->imagename = $image_upload_array['imagename'];
+	$focus->saveHomeOrder($focus->id);
+	$return_id = $focus->id;
+
+if (isset($_POST['user_name']) && isset($_POST['new_password'])) {
+		$new_pass = $_POST['new_password'];
+		$new_passwd = $_POST['new_password'];
+		$new_pass = md5($new_pass);
+		$uname = $_POST['user_name'];
+		if (!$focus->change_password($_POST['confirm_new_password'], $_POST['new_password'])) {
+		
+			header("Location: index.php?action=Error&module=Users&error_string=".urlencode($focus->error_string));
+		exit;
+}
+}  
+
+if(isset($focus->id) && $focus->id != '')
+{
+
+  if(isset($_POST['user_role']))
+  {
+    updateUser2RoleMapping($_POST['user_role'],$focus->id);
+  }
+  if(isset($_POST['group_name']) && $_POST['group_name'] != '')
+  {
+    updateUsers2GroupMapping($_POST['group_name'],$focus->id);
+  }
+}
+else
+{
+  if(isset($_POST['user_role']))
+  {
+    insertUser2RoleMapping($_POST['user_role'],$focus->id);
+  }
+  if(isset($_POST['group_name']))
+  {
+    insertUsers2GroupMapping($_POST['group_name'],$focus->id);
+  }
+}
+
+//Creating the Privileges Flat File
+require_once('modules/Users/CreateUserPrivilegeFile.php');
+createUserPrivilegesfile($focus->id);
+createUserSharingPrivilegesfile($focus->id);
+
+}
+if(isset($_POST['return_module']) && $_POST['return_module'] != "") $return_module = $_POST['return_module'];
+else $return_module = "Users";
+if(isset($_POST['return_action']) && $_POST['return_action'] != "") $return_action = $_POST['return_action'];
+else $return_action = "DetailView";
+if(isset($_POST['return_id']) && $_POST['return_id'] != "") $return_id = $_POST['return_id'];
+if(isset($_REQUEST['activity_mode']))   $activitymode = '&activity_mode='.$_REQUEST['activity_mode'];
+if(isset($_POST['parenttab'])) $parenttab = $_POST['parenttab'];
+
+$log->debug("Saved record with id of ".$return_id);
+
+
+
+if($_REQUEST['modechk'] == 'prefview')
+	header("Location: index.php?action=$return_action&module=$return_module&record=$return_id");
+else
+	header("Location: index.php?action=$return_action&module=$return_module&record=$return_id&parenttab=$parenttab");
+
+
+?>
-------------- next part --------------
diff -ruN htdocs.orig/modules/Products/Delete.php htdocs/modules/Products/Delete.php
--- htdocs.orig/modules/Products/Delete.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Products/Delete.php	2007-05-09 01:03:12.000000000 +0200
@@ -1,40 +1,40 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the 
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/vtigercrm/modules/Products/Delete.php,v 1.4 2005/03/22 13:53:55 mickie Exp $
- * Description:  Deletes an Account record and then redirects the browser to the 
- * defined return URL.
- ********************************************************************************/
-
-require_once('modules/Products/Products.php');
-global $mod_strings;
-
-require_once('include/logging.php');
-$log = LoggerManager::getLogger('product_delete');
-
-$focus = new Products();
-
-if(!isset($_REQUEST['record']))
-	die($mod_strings['ERR_DELETE_RECORD']);
-
-DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
-
-if(isset($_REQUEST['activity_mode']))
-	$activitymode = '&activity_mode='.$_REQUEST['activity_mode'];
-
-if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
-
-header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id'].$activitymode."&parenttab=".$parenttab."&relmodule=".$_REQUEST['module']);
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the 
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/vtigercrm/modules/Products/Delete.php,v 1.4 2005/03/22 13:53:55 mickie Exp $
+ * Description:  Deletes an Account record and then redirects the browser to the 
+ * defined return URL.
+ ********************************************************************************/
+
+require_once('modules/Products/Products.php');
+global $mod_strings;
+
+require_once('include/logging.php');
+$log = LoggerManager::getLogger('product_delete');
+
+$focus = new Products();
+
+if(!isset($_REQUEST['record']))
+	die($mod_strings['ERR_DELETE_RECORD']);
+
+DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
+
+if(isset($_REQUEST['activity_mode']))
+	$activitymode = '&activity_mode='.$_REQUEST['activity_mode'];
+
+if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
+
+header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id'].$activitymode."&parenttab=".$parenttab."&relmodule=".$_REQUEST['module']);
+?>
diff -ruN htdocs.orig/modules/Products/DetailViewAjax.php htdocs/modules/Products/DetailViewAjax.php
--- htdocs.orig/modules/Products/DetailViewAjax.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Products/DetailViewAjax.php	2007-05-09 01:03:12.000000000 +0200
@@ -1,50 +1,50 @@
-<?php
-/*********************************************************************************
- ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
-  * ("License"); You may not use this file except in compliance with the License
-  * The Original Code is:  vtiger CRM Open Source
-  * The Initial Developer of the Original Code is vtiger.
-  * Portions created by vtiger are Copyright (C) vtiger.
-  * All Rights Reserved.
- *
-  ********************************************************************************/
-
-require_once('include/logging.php');
-require_once('modules/Products/Products.php');
-require_once('include/database/PearDatabase.php');
-global $adb,$current_user;
-
-$local_log =& LoggerManager::getLogger('ProductsAjax');
-
-$ajaxaction = $_REQUEST["ajxaction"];
-if($ajaxaction == "DETAILVIEW")
-{
-	$crmid = $_REQUEST["recordid"];
-	$tablename = $_REQUEST["tableName"];
-	$fieldname = $_REQUEST["fldName"];
-	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
-	if($crmid != "")
-	{
-		$modObj = new Products();
-		$modObj->retrieve_entity_info($crmid,"Products");
-		$modObj->column_fields[$fieldname] = $fieldvalue;
-		if($fieldname == 'unit_price')//unit price converted to dollar value while saving
-		{
-			$modObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);	
-		}
-		$modObj->id = $crmid;
-		$modObj->mode = "edit";
-		$modObj->save("Products");
-		if($modObj->id != "")
-		{
-			echo ":#:SUCCESS";
-		}else
-		{
-			echo ":#:FAILURE";
-		}   
-	}else
-	{
-		echo ":#:FAILURE";
-	}
-}
-?>
+<?php
+/*********************************************************************************
+ ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+  * ("License"); You may not use this file except in compliance with the License
+  * The Original Code is:  vtiger CRM Open Source
+  * The Initial Developer of the Original Code is vtiger.
+  * Portions created by vtiger are Copyright (C) vtiger.
+  * All Rights Reserved.
+ *
+  ********************************************************************************/
+
+require_once('include/logging.php');
+require_once('modules/Products/Products.php');
+require_once('include/database/PearDatabase.php');
+global $adb,$current_user;
+
+$local_log =& LoggerManager::getLogger('ProductsAjax');
+
+$ajaxaction = $_REQUEST["ajxaction"];
+if($ajaxaction == "DETAILVIEW")
+{
+	$crmid = $_REQUEST["recordid"];
+	$tablename = $_REQUEST["tableName"];
+	$fieldname = $_REQUEST["fldName"];
+	$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]); 
+	if($crmid != "")
+	{
+		$modObj = new Products();
+		$modObj->retrieve_entity_info($crmid,"Products");
+		$modObj->column_fields[$fieldname] = $fieldvalue;
+		if($fieldname == 'unit_price')//unit price converted to dollar value while saving
+		{
+			$modObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue);	
+		}
+		$modObj->id = $crmid;
+		$modObj->mode = "edit";
+		$modObj->save("Products");
+		if($modObj->id != "")
+		{
+			echo ":#:SUCCESS";
+		}else
+		{
+			echo ":#:FAILURE";
+		}   
+	}else
+	{
+		echo ":#:FAILURE";
+	}
+}
+?>
-------------- next part --------------
diff -ruN htdocs.orig/modules/PurchaseOrder/ListTopPurchaseOrder.php htdocs/modules/PurchaseOrder/ListTopPurchaseOrder.php
--- htdocs.orig/modules/PurchaseOrder/ListTopPurchaseOrder.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/PurchaseOrder/ListTopPurchaseOrder.php	2007-05-09 01:04:34.000000000 +0200
@@ -1,125 +1,125 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-
-
-/**	function used to get the top 5 purchase orders from Listview query
- *	@return array $values - array with the title, header and entries like  Array('Title'=>$title,'Header'=>$listview_header,'Entries'=>$listview_entries) where as listview_header and listview_entries are arrays of header and entity values which are returned from function getListViewHeader and getListViewEntries
- */
-function getTopPurchaseOrder()
-{
-	require_once("data/Tracker.php");
-	require_once('modules/PurchaseOrder/PurchaseOrder.php');
-	require_once('include/logging.php');
-	require_once('include/ListView/ListView.php');
-	require_once('include/database/PearDatabase.php');
-	require_once('include/ComboUtil.php');
-	require_once('include/utils/utils.php');
-	require_once('modules/CustomView/CustomView.php');
-
-	global $current_language,$current_user,$list_max_entries_per_page,$theme,$adb;
-	$current_module_strings = return_module_language($current_language, 'PurchaseOrder');
-
-	$log = LoggerManager::getLogger('po_list');
-
-	$url_string = '';
-	$sorder = '';
-	$oCustomView = new CustomView("PurchaseOrder");
-	$customviewcombo_html = $oCustomView->getCustomViewCombo();
-	if(isset($_REQUEST['viewname']) == false || $_REQUEST['viewname']=='')
-	{
-		if($oCustomView->setdefaultviewid != "")
-		{
-			$viewid = $oCustomView->setdefaultviewid;
-		}else
-		{
-			$viewid = "0";
-		}
-	}
-	$focus = new PurchaseOrder();
-
-	$theme_path="themes/".$theme."/";
-	$image_path=$theme_path."images/";
-
-	//Retreive the list from Database
-	//<<<<<<<<<customview>>>>>>>>>
-	$date_var = date('Y-m-d');
-
-	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_purchaseorder.duedate >= \''.$date_var.'\'';
-	$query = getListQuery("PurchaseOrder",$where);
-	$query .=" ORDER BY total DESC";
-
-	//<<<<<<<<customview>>>>>>>>>
-
-	$list_result = $adb->limitQuery($query,0,5);
-
-	//Retreiving the no of rows
-	$noofrows = $adb->num_rows($list_result);
-
-	//Retreiving the start value from request
-	if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
-	{
-		$start = $_REQUEST['start'];
-	}
-	else
-	{
-
-		$start = 1;
-	}
-
-	//Retreive the Navigation array
-	$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
-
-	if ($navigation_array['start'] == 1)
-	{
-		if($noofrows != 0)
-			$start_rec = $navigation_array['start'];
-		else
-			$start_rec = 0;
-		if($noofrows > $list_max_entries_per_page)
-		{
-			$end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
-		}
-		else
-		{
-			$end_rec = $noofrows;
-		}
-
-	}
-	else
-	{
-		if($navigation_array['next'] > $list_max_entries_per_page)
-		{
-			$start_rec = $navigation_array['next'] - $list_max_entries_per_page;
-			$end_rec = $navigation_array['next'] - 1;
-		}
-		else
-		{
-			$start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
-			$end_rec = $noofrows;
-		}
-	}
-
-
-	//Retreive the List View Table Header
-	$title=array('myTopPurchaseOrders.gif',$current_module_strings['LBL_MY_TOP_PO'],'home_mytoppo');
-	$listview_header = getListViewHeader($focus,"PurchaseOrder",$url_string,$sorder,$order_by,"HomePage",$oCustomView);
-
-	$listview_entries = getListViewEntries($focus,"PurchaseOrder",$list_result,$navigation_array,"HomePage","","EditView","Delete",$oCustomView);
-	$values=Array('Title'=>$title,'Header'=>$listview_header,'Entries'=>$listview_entries);
-	if ( ($display_empty_home_blocks && $noofrows == 0 ) || ($noofrows>0) )	
-		return $values;
-}
-?>
-
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+
+
+/**	function used to get the top 5 purchase orders from Listview query
+ *	@return array $values - array with the title, header and entries like  Array('Title'=>$title,'Header'=>$listview_header,'Entries'=>$listview_entries) where as listview_header and listview_entries are arrays of header and entity values which are returned from function getListViewHeader and getListViewEntries
+ */
+function getTopPurchaseOrder()
+{
+	require_once("data/Tracker.php");
+	require_once('modules/PurchaseOrder/PurchaseOrder.php');
+	require_once('include/logging.php');
+	require_once('include/ListView/ListView.php');
+	require_once('include/database/PearDatabase.php');
+	require_once('include/ComboUtil.php');
+	require_once('include/utils/utils.php');
+	require_once('modules/CustomView/CustomView.php');
+
+	global $current_language,$current_user,$list_max_entries_per_page,$theme,$adb;
+	$current_module_strings = return_module_language($current_language, 'PurchaseOrder');
+
+	$log = LoggerManager::getLogger('po_list');
+
+	$url_string = '';
+	$sorder = '';
+	$oCustomView = new CustomView("PurchaseOrder");
+	$customviewcombo_html = $oCustomView->getCustomViewCombo();
+	if(isset($_REQUEST['viewname']) == false || $_REQUEST['viewname']=='')
+	{
+		if($oCustomView->setdefaultviewid != "")
+		{
+			$viewid = $oCustomView->setdefaultviewid;
+		}else
+		{
+			$viewid = "0";
+		}
+	}
+	$focus = new PurchaseOrder();
+
+	$theme_path="themes/".$theme."/";
+	$image_path=$theme_path."images/";
+
+	//Retreive the list from Database
+	//<<<<<<<<<customview>>>>>>>>>
+	$date_var = date('Y-m-d');
+
+	$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and  vtiger_purchaseorder.duedate >= \''.$date_var.'\'';
+	$query = getListQuery("PurchaseOrder",$where);
+	$query .=" ORDER BY total DESC";
+
+	//<<<<<<<<customview>>>>>>>>>
+
+	$list_result = $adb->limitQuery($query,0,5);
+
+	//Retreiving the no of rows
+	$noofrows = $adb->num_rows($list_result);
+
+	//Retreiving the start value from request
+	if(isset($_REQUEST['start']) && $_REQUEST['start'] != '')
+	{
+		$start = $_REQUEST['start'];
+	}
+	else
+	{
+
+		$start = 1;
+	}
+
+	//Retreive the Navigation array
+	$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
+
+	if ($navigation_array['start'] == 1)
+	{
+		if($noofrows != 0)
+			$start_rec = $navigation_array['start'];
+		else
+			$start_rec = 0;
+		if($noofrows > $list_max_entries_per_page)
+		{
+			$end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
+		}
+		else
+		{
+			$end_rec = $noofrows;
+		}
+
+	}
+	else
+	{
+		if($navigation_array['next'] > $list_max_entries_per_page)
+		{
+			$start_rec = $navigation_array['next'] - $list_max_entries_per_page;
+			$end_rec = $navigation_array['next'] - 1;
+		}
+		else
+		{
+			$start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
+			$end_rec = $noofrows;
+		}
+	}
+
+
+	//Retreive the List View Table Header
+	$title=array('myTopPurchaseOrders.gif',$current_module_strings['LBL_MY_TOP_PO'],'home_mytoppo');
+	$listview_header = getListViewHeader($focus,"PurchaseOrder",$url_string,$sorder,$order_by,"HomePage",$oCustomView);
+
+	$listview_entries = getListViewEntries($focus,"PurchaseOrder",$list_result,$navigation_array,"HomePage","","EditView","Delete",$oCustomView);
+	$values=Array('Title'=>$title,'Header'=>$listview_header,'Entries'=>$listview_entries);
+	if ( ($display_empty_home_blocks && $noofrows == 0 ) || ($noofrows>0) )	
+		return $values;
+}
+?>
+
-------------- next part --------------
diff -ruN htdocs.orig/modules/Potentials/language/en_us.lang.php htdocs/modules/Potentials/language/en_us.lang.php
--- htdocs.orig/modules/Potentials/language/en_us.lang.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/modules/Potentials/language/en_us.lang.php	2007-05-09 01:05:32.000000000 +0200
@@ -1,153 +1,153 @@
-<?php
-/*********************************************************************************
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
- * ("License"); You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
- * Software distributed under the License is distributed on an  "AS IS"  basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * The Original Code is:  SugarCRM Open Source
- * The Initial Developer of the Original Code is SugarCRM, Inc.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
- * All Rights Reserved.
- * Contributor(s): ______________________________________.
- ********************************************************************************/
-/*********************************************************************************
- * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Potentials/language/en_us.lang.php,v 1.18 2005/04/28 14:05:53 ray Exp $
- * Description:  Defines the English language pack for the Account module.
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
- * All Rights Reserved.
- * Contributor(s): ______________________________________..
- ********************************************************************************/
-
-$mod_strings = Array(
-'LBL_MODULE_NAME'=>'Potentials',
-'LBL_MODULE_TITLE'=>'Potentials: Home',
-'LBL_SEARCH_FORM_TITLE'=>'Potential Search',
-'LBL_LIST_FORM_TITLE'=>'Potential List',
-'LBL_OPPORTUNITY_NAME'=>'Potential Name:',
-'LBL_OPPORTUNITY'=>'Potential:',
-'LBL_NAME'=>'Potential Name',
-'LBL_INVITEE'=>'Contacts',
-'LBL_LIST_OPPORTUNITY_NAME'=>'Potential',
-'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
-'LBL_PRODUCT_NAME'=>'Product Name',
-'LBL_LIST_AMOUNT'=>'Amount',
-'LBL_LIST_DATE_CLOSED'=>'Expected Close',
-'LBL_LIST_SALES_STAGE'=>'Sales Stage',
-
-'LBL_OPPORTUNITY_NAME'=>'Potential Name:',
-'LBL_ACCOUNT_NAME'=>'Account Name:',
-'LBL_AMOUNT'=>'Amount:',
-'LBL_DATE_CLOSED'=>'Expected Close Date:',
-'LBL_TYPE'=>'Type:',
-'LBL_NEXT_STEP'=>'Next Step:',
-'LBL_LEAD_SOURCE'=>'Lead Source:',
-'LBL_SALES_STAGE'=>'Sales Stage:',
-'LBL_PROBABILITY'=>'Probability (%):',
-'LBL_DESCRIPTION'=>'Description:',
-'LBL_OPPORTUNITY_INFORMATION'=>'Potential Information:',
-'LBL_DESCRIPTION_INFORMATION'=>'Description Information:',
-'LBL_CUSTOM_INFORMATION'=>'Custom Information',
-
-'LBL_NEW_FORM_TITLE'=>'New Potential',
-
-'ERR_DELETE_RECORD'=>"A record number must be specified to delete the opportunity.",
-'LBL_TOP_OPPORTUNITIES'=>"My Top Open Potentials",
-
-'NTC_REMOVE_OPP_CONFIRMATION'=>'Are you sure you want to remove this contact from this opportunity?',
-
-'NTC_NONE_SCHEDULED'=>'None scheduled.',
-
-'LBL_SELECT_OPPOPTUNITY'=>'Select Potential',
-'LBL_GENERAL_INFORMATION'=>'General Information',
-
-
-
-//for v4 release added
-'LBL_NEW_POTENTIAL'=>'New Potential',
-'LBL_POTENTIAL_TITLE'=>'Potentials',
-
-'LBL_NEW_TASK'=>'New Task',
-'LBL_TASK_TITLE'=>'Tasks',
-'LBL_NEW_CALL'=>'New Call',
-'LBL_CALL_TITLE'=>'Calls',
-'LBL_NEW_MEETING'=>'New Meeting',
-'LBL_MEETING_TITLE'=>'Meetings',
-'LBL_NEW_EMAIL'=>'New Email',
-'LBL_EMAIL_TITLE'=>'Emails',
-'LBL_NEW_NOTE'=>'New Note',
-'LBL_NOTE_TITLE'=>'Notes',
-
-'LBL_NEW_ATTACHMENT'=>'New Attachment',
-'LBL_ATTACHMENT_TITLE'=>'Attachments',
-
-'LBL_NEW_CONTACT'=>'New Contact',
-'LBL_CONTACT_TITLE'=>'Contacts',
-
-//Added vtiger_fields after RC1 - Release
-'LBL_ALL'=>'All',
-'LBL_WON'=>'Won',
-'LBL_LOST'=>'Lost',
-'LBL_VALUE_PROPOSITION'=>'Value Proposition',
-'LBL_PROSPECTING'=>'Prospecting',
-
-// Added for 4GA
-'LBL_TOOL_FORM_TITLE'=>'Potential Tools',
-//Added for 4GA
-'Potential Name'=>'Potential Name',
-'Amount'=>'Amount',
-'Account Name'=>'Account Name',
-'Currency'=>'Currency',
-'Expected Close Date'=>'Expected Close Date',
-'Opportunity Type'=>'Opportunity Type',
-'Type'=>'Type',
-'Next Step'=>'Next Step',
-'Lead Source'=>'Lead Source',
-'Sales Stage'=>'Sales Stage',
-'Assigned To'=>'Assigned To',
-'Probability'=>'Probability (%)',
-'Campaign Source'=>'Campaign Source',
-'Description'=>'Description',
-'Created Time'=>'Created Time',
-'Modified Time'=>'Modified Time',
-'Organization unit'=>'Organization unit',
-//Added for 4.2 Release -- CustomView
-'Potential'=>'Potential',
-'Expected Close'=>'Expected Close',
-
-//Added for Existing Picklist Strings
-
-'Prospecting'=>'Prospecting',
-'Qualification'=>'Qualification',
-'Needs Analysis'=>'Needs Analysis',
-'Value Proposition'=>'Value Proposition',
-'Id. Decision Makers'=>'Id. Decision Makers',
-'Perception Analysis'=>'Perception Analysis',
-'Proposal/Price Quote'=>'Proposal/Price Quote',
-'Negotiation/Review'=>'Negotiation/Review',
-'Closed Won'=>'Closed Won',
-'Closed Lost'=>'Closed Lost',
-
-'Cold Call'=>'Cold Call',
-'Existing Customer'=>'Existing Customer',
-'Self Generated'=>'Self Generated',
-'Employee'=>'Employee',
-'Partner'=>'Partner',
-'Public Relations'=>'Public Relations',
-'Direct Mail'=>'Direct Mail',
-'Conference'=>'Conference',
-'Trade Show'=>'Trade Show',
-'Web Site'=>'Web Site',
-'Word of mouth'=>'Word of mouth',
-'Other'=>'Other',
-
-'--None--'=>'--None--',
-'Existing Business'=>'Existing Business',
-'New Business'=>'New Business',
-
-
-
-);
-
-?>
+<?php
+/*********************************************************************************
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+ * ("License"); You may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+ * the specific language governing rights and limitations under the License.
+ * The Original Code is:  SugarCRM Open Source
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ********************************************************************************/
+/*********************************************************************************
+ * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Potentials/language/en_us.lang.php,v 1.18 2005/04/28 14:05:53 ray Exp $
+ * Description:  Defines the English language pack for the Account module.
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+ ********************************************************************************/
+
+$mod_strings = Array(
+'LBL_MODULE_NAME'=>'Potentials',
+'LBL_MODULE_TITLE'=>'Potentials: Home',
+'LBL_SEARCH_FORM_TITLE'=>'Potential Search',
+'LBL_LIST_FORM_TITLE'=>'Potential List',
+'LBL_OPPORTUNITY_NAME'=>'Potential Name:',
+'LBL_OPPORTUNITY'=>'Potential:',
+'LBL_NAME'=>'Potential Name',
+'LBL_INVITEE'=>'Contacts',
+'LBL_LIST_OPPORTUNITY_NAME'=>'Potential',
+'LBL_LIST_ACCOUNT_NAME'=>'Account Name',
+'LBL_PRODUCT_NAME'=>'Product Name',
+'LBL_LIST_AMOUNT'=>'Amount',
+'LBL_LIST_DATE_CLOSED'=>'Expected Close',
+'LBL_LIST_SALES_STAGE'=>'Sales Stage',
+
+'LBL_OPPORTUNITY_NAME'=>'Potential Name:',
+'LBL_ACCOUNT_NAME'=>'Account Name:',
+'LBL_AMOUNT'=>'Amount:',
+'LBL_DATE_CLOSED'=>'Expected Close Date:',
+'LBL_TYPE'=>'Type:',
+'LBL_NEXT_STEP'=>'Next Step:',
+'LBL_LEAD_SOURCE'=>'Lead Source:',
+'LBL_SALES_STAGE'=>'Sales Stage:',
+'LBL_PROBABILITY'=>'Probability (%):',
+'LBL_DESCRIPTION'=>'Description:',
+'LBL_OPPORTUNITY_INFORMATION'=>'Potential Information:',
+'LBL_DESCRIPTION_INFORMATION'=>'Description Information:',
+'LBL_CUSTOM_INFORMATION'=>'Custom Information',
+
+'LBL_NEW_FORM_TITLE'=>'New Potential',
+
+'ERR_DELETE_RECORD'=>"A record number must be specified to delete the opportunity.",
+'LBL_TOP_OPPORTUNITIES'=>"My Top Open Potentials",
+
+'NTC_REMOVE_OPP_CONFIRMATION'=>'Are you sure you want to remove this contact from this opportunity?',
+
+'NTC_NONE_SCHEDULED'=>'None scheduled.',
+
+'LBL_SELECT_OPPOPTUNITY'=>'Select Potential',
+'LBL_GENERAL_INFORMATION'=>'General Information',
+
+
+
+//for v4 release added
+'LBL_NEW_POTENTIAL'=>'New Potential',
+'LBL_POTENTIAL_TITLE'=>'Potentials',
+
+'LBL_NEW_TASK'=>'New Task',
+'LBL_TASK_TITLE'=>'Tasks',
+'LBL_NEW_CALL'=>'New Call',
+'LBL_CALL_TITLE'=>'Calls',
+'LBL_NEW_MEETING'=>'New Meeting',
+'LBL_MEETING_TITLE'=>'Meetings',
+'LBL_NEW_EMAIL'=>'New Email',
+'LBL_EMAIL_TITLE'=>'Emails',
+'LBL_NEW_NOTE'=>'New Note',
+'LBL_NOTE_TITLE'=>'Notes',
+
+'LBL_NEW_ATTACHMENT'=>'New Attachment',
+'LBL_ATTACHMENT_TITLE'=>'Attachments',
+
+'LBL_NEW_CONTACT'=>'New Contact',
+'LBL_CONTACT_TITLE'=>'Contacts',
+
+//Added vtiger_fields after RC1 - Release
+'LBL_ALL'=>'All',
+'LBL_WON'=>'Won',
+'LBL_LOST'=>'Lost',
+'LBL_VALUE_PROPOSITION'=>'Value Proposition',
+'LBL_PROSPECTING'=>'Prospecting',
+
+// Added for 4GA
+'LBL_TOOL_FORM_TITLE'=>'Potential Tools',
+//Added for 4GA
+'Potential Name'=>'Potential Name',
+'Amount'=>'Amount',
+'Account Name'=>'Account Name',
+'Currency'=>'Currency',
+'Expected Close Date'=>'Expected Close Date',
+'Opportunity Type'=>'Opportunity Type',
+'Type'=>'Type',
+'Next Step'=>'Next Step',
+'Lead Source'=>'Lead Source',
+'Sales Stage'=>'Sales Stage',
+'Assigned To'=>'Assigned To',
+'Probability'=>'Probability (%)',
+'Campaign Source'=>'Campaign Source',
+'Description'=>'Description',
+'Created Time'=>'Created Time',
+'Modified Time'=>'Modified Time',
+'Organization unit'=>'Organization unit',
+//Added for 4.2 Release -- CustomView
+'Potential'=>'Potential',
+'Expected Close'=>'Expected Close',
+
+//Added for Existing Picklist Strings
+
+'Prospecting'=>'Prospecting',
+'Qualification'=>'Qualification',
+'Needs Analysis'=>'Needs Analysis',
+'Value Proposition'=>'Value Proposition',
+'Id. Decision Makers'=>'Id. Decision Makers',
+'Perception Analysis'=>'Perception Analysis',
+'Proposal/Price Quote'=>'Proposal/Price Quote',
+'Negotiation/Review'=>'Negotiation/Review',
+'Closed Won'=>'Closed Won',
+'Closed Lost'=>'Closed Lost',
+
+'Cold Call'=>'Cold Call',
+'Existing Customer'=>'Existing Customer',
+'Self Generated'=>'Self Generated',
+'Employee'=>'Employee',
+'Partner'=>'Partner',
+'Public Relations'=>'Public Relations',
+'Direct Mail'=>'Direct Mail',
+'Conference'=>'Conference',
+'Trade Show'=>'Trade Show',
+'Web Site'=>'Web Site',
+'Word of mouth'=>'Word of mouth',
+'Other'=>'Other',
+
+'--None--'=>'--None--',
+'Existing Business'=>'Existing Business',
+'New Business'=>'New Business',
+
+
+
+);
+
+?>
-------------- next part --------------
diff -ruN htdocs.orig/parent_tabdata.php htdocs/parent_tabdata.php
--- htdocs.orig/parent_tabdata.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/parent_tabdata.php	2007-05-09 01:53:46.000000000 +0200
@@ -1,13 +1,21 @@
 <?php
-
+/*********************************************************************************
+  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+   * ("License"); You may not use this file except in compliance with the License
+   * The Original Code is:  vtiger CRM Open Source
+   * The Initial Developer of the Original Code is vtiger.
+   * Portions created by vtiger are Copyright (C) vtiger.
+   * All Rights Reserved.
+  *
+ ********************************************************************************/
 
 //This file contains the commonly used variables 
 
 $parent_tab_info_array=array(1=>'My Home Page',2=>'Marketing',3=>'Sales',4=>'Support',5=>'Analytics',6=>'Inventory',7=>'Tools',8=>'Settings');
 
 
-$parent_child_tab_rel_array=array(1=>array(3,9,28,),2=>array(26,6,4,28,7,9,8,),3=>array(7,6,4,2,20,22,23,14,19,8,9,),4=>array(13,15,6,4,14,8,28,9,),5=>array(1,25,),6=>array(14,18,19,21,22,20,23,),7=>array(24,27,8,),8=>array(30,31,),);
+$parent_child_tab_rel_array=array(1=>array(3,9,10,),2=>array(26,6,4,),3=>array(7,6,4,2,20,22,23,14,19,8,),4=>array(13,15,6,4,14,8,),5=>array(1,25,),6=>array(14,18,19,21,22,20,23,),7=>array(24,27,8,),8=>array(),);
 
 
 
-?>
\ No newline at end of file
+?>
diff -ruN htdocs.orig/tabdata.php htdocs/tabdata.php
--- htdocs.orig/tabdata.php	2007-05-09 00:56:24.000000000 +0200
+++ htdocs/tabdata.php	2007-05-09 01:53:46.000000000 +0200
@@ -1,15 +1,17 @@
 <?php
-
+/*********************************************************************************
+  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+   * ("License"); You may not use this file except in compliance with the License
+   * The Original Code is:  vtiger CRM Open Source
+   * The Initial Developer of the Original Code is vtiger.
+   * Portions created by vtiger are Copyright (C) vtiger.
+   * All Rights Reserved.
+  *
+ ********************************************************************************/
 
 //This file contains the commonly used variables 
 
-$tab_info_array=array('Home'=>3,'Leads'=>7,'Accounts'=>6,'Contacts'=>4,'Potentials'=>2,'Notes'=>8,'Calendar'=>9,'Emails'=>10,'HelpDesk'=>13,'Products'=>14,'Dashboard'=>1,'Faq'=>15,'Events'=>16,'Vendors'=>18,'PriceBooks'=>19,'Quotes'=>20,'PurchaseOrder'=>21,'SalesOrder'=>22,'Invoice'=>23,'Rss'=>24,'Reports'=>25,'Campaigns'=>26,'Portal'=>27,'Webmails'=>28,'Users'=>29,'Organization'=>30,'OrgUnit'=>31,);
-
-$tab_seq_array=array('3'=>0,'7'=>0,'6'=>0,'4'=>0,'2'=>0,'8'=>0,'9'=>0,'10'=>0,'13'=>0,'14'=>0,'1'=>0,'15'=>0,'16'=>2,'18'=>0,'19'=>0,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>0,'25'=>0,'26'=>0,'27'=>0,'28'=>0,'29'=>0,'30'=>0,'31'=>0,);
-
-$tab_ownedby_array=array('3'=>1,'7'=>0,'6'=>0,'4'=>0,'2'=>0,'8'=>1,'9'=>0,'10'=>1,'13'=>0,'14'=>1,'1'=>1,'15'=>1,'16'=>0,'18'=>1,'19'=>1,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>1,'25'=>1,'26'=>0,'27'=>1,'28'=>1,'29'=>1,'30'=>0,'31'=>0,);
-
-$action_id_array=array('Save'=>0,'EditView'=>1,'Delete'=>2,'index'=>3,'DetailView'=>4,'Import'=>5,'Export'=>6,'Merge'=>8,'VendorEditView'=>1,'VendorDetailView'=>4,'SaveVendor'=>0,'DeleteVendor'=>2,'PriceBookEditView'=>1,'PriceBookDetailView'=>4,'SavePriceBook'=>0,'DeletePriceBook'=>2,'ConvertLead'=>9,'DetailViewAjax'=>1,'TagCloud'=>4,'QuickCreate'=>1,'Popup'=>3);
+$tab_info_array=array('Home'=>3,'Leads'=>7,'Accounts'=>6,'Contacts'=>4,'Potentials'=>2,'Notes'=>8,'Calendar'=>9,'Emails'=>10,'HelpDesk'=>13,'Products'=>14,'Dashboard'=>1,'Faq'=>15,'Events'=>16,'Vendors'=>18,'PriceBooks'=>19,'Quotes'=>20,'PurchaseOrder'=>21,'SalesOrder'=>22,'Invoice'=>23,'Rss'=>24,'Reports'=>25,'Campaigns'=>26,'Portal'=>27,'Webmails'=>28,'Users'=>29,);
 
-$action_name_array=array(0=>'Save',1=>'EditView',2=>'Delete',3=>'index',4=>'DetailView',5=>'Import',6=>'Export',8=>'Merge',9=>'ConvertLead');
-?>
\ No newline at end of file
+$tab_seq_array=array('3'=>0,'7'=>0,'6'=>0,'4'=>0,'2'=>0,'8'=>0,'9'=>0,'10'=>0,'13'=>0,'14'=>0,'1'=>0,'15'=>0,'16'=>2,'18'=>0,'19'=>0,'20'=>0,'21'=>0,'22'=>0,'23'=>0,'24'=>0,'25'=>0,'26'=>0,'27'=>0,'28'=>0,);
+?>
-------------- next part --------------
diff -ruN htdocs.orig/themes/alphagrey/header.php htdocs/themes/alphagrey/header.php
--- htdocs.orig/themes/alphagrey/header.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/themes/alphagrey/header.php	2007-05-09 01:56:53.000000000 +0200
@@ -1,90 +1,90 @@
-<?php
-
-/*********************************************************************************
-
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
-
- * ("License"); You may not use this file except in compliance with the
-
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
-
- * Software distributed under the License is distributed on an  "AS IS"  basis,
-
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
-
- * the specific language governing rights and limitations under the License.
-
- * The Original Code is:  SugarCRM Open Source
-
- * The Initial Developer of the Original Code is SugarCRM, Inc.
-
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
-
- * All Rights Reserved.
-
- * Contributor(s): ______________________________________.
-
- ********************************************************************************/
-
-/*********************************************************************************
-
- * $Header$
-
- * Description:  Contains a variety of utility functions used to display UI
-
- * components such as form headers and footers.  Intended to be modified on a per
-
- * theme basis.
-
- ********************************************************************************/
-
-require_once('Smarty_setup.php');
-
-require_once("data/Tracker.php");
-
-require_once("include/utils/utils.php");
-
-require_once("include/calculator/Calc.php");
-
-
-
-global $currentModule;
-global $app_strings;
-global $app_list_strings;
-global $moduleList;
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-require_once($theme_path.'layout_utils.php');
-
-$smarty = new vtigerCRM_Smarty;
-$header_array = getHeaderArray();
-$smarty->assign("HEADERS",$header_array);
-$smarty->assign("THEME",$theme);
-$smarty->assign("IMAGEPATH",$image_path);
-
-$qc_modules = getQuickCreateModules();
-$smarty->assign("QCMODULE", $qc_modules);
-$smarty->assign("APP", $app_strings);
-
-$cnt = count($qc_modules);
-$smarty->assign("CNT", $cnt);
-
-$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
-
-$smarty->assign("MODULE_NAME", $currentModule);
-
-$smarty->assign("DATE", getDisplayDate(date("Y-m-d H:i")));
-
-$smarty->assign("CURRENT_USER", $current_user->user_name);
-
-$smarty->assign("CURRENT_USER_ID", $current_user->id);
-$smarty->assign("MODULELISTS",$app_list_strings['moduleList']);
-$smarty->assign("CATEGORY",getParentTab());
-$smarty->assign("CALC",get_calc($image_path));
-$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
-$smarty->assign("ANNOUNCEMENT",get_announcements());
-
+<?php
+
+/*********************************************************************************
+
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+
+ * ("License"); You may not use this file except in compliance with the
+
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+
+ * the specific language governing rights and limitations under the License.
+
+ * The Original Code is:  SugarCRM Open Source
+
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+
+ * All Rights Reserved.
+
+ * Contributor(s): ______________________________________.
+
+ ********************************************************************************/
+
+/*********************************************************************************
+
+ * $Header$
+
+ * Description:  Contains a variety of utility functions used to display UI
+
+ * components such as form headers and footers.  Intended to be modified on a per
+
+ * theme basis.
+
+ ********************************************************************************/
+
+require_once('Smarty_setup.php');
+
+require_once("data/Tracker.php");
+
+require_once("include/utils/utils.php");
+
+require_once("include/calculator/Calc.php");
+
+
+
+global $currentModule;
+global $app_strings;
+global $app_list_strings;
+global $moduleList;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+require_once($theme_path.'layout_utils.php');
+
+$smarty = new vtigerCRM_Smarty;
+$header_array = getHeaderArray();
+$smarty->assign("HEADERS",$header_array);
+$smarty->assign("THEME",$theme);
+$smarty->assign("IMAGEPATH",$image_path);
+
+$qc_modules = getQuickCreateModules();
+$smarty->assign("QCMODULE", $qc_modules);
+$smarty->assign("APP", $app_strings);
+
+$cnt = count($qc_modules);
+$smarty->assign("CNT", $cnt);
+
+$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
+
+$smarty->assign("MODULE_NAME", $currentModule);
+
+$smarty->assign("DATE", getDisplayDate(date("Y-m-d H:i")));
+
+$smarty->assign("CURRENT_USER", $current_user->user_name);
+
+$smarty->assign("CURRENT_USER_ID", $current_user->id);
+$smarty->assign("MODULELISTS",$app_list_strings['moduleList']);
+$smarty->assign("CATEGORY",getParentTab());
+$smarty->assign("CALC",get_calc($image_path));
+$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
+$smarty->assign("ANNOUNCEMENT",get_announcements());
+
 $smarty->assign("CURRENT_ORGANIZATION",$current_organization);
 $org_array=array();
 $org=strtok( $user_organizations, "|");
@@ -95,28 +95,28 @@
 $smarty->assign("USER_ORGANIZATIONS",$org_array);
 $smarty->assign("USER_ORGANIZATIONS_COUNT",count($org_array));
 $smarty->assign("CHGORGOK",$org_change_ok);
-
-
-if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
-
-
-
-$module_path="modules/".$currentModule."/";
-
-require_once('include/Menu.php');
-
-//Assign the entered global search string to a variable and display it again
-if($_REQUEST['query_string'] != '')
-	$smarty->assign("QUERY_STRING",$_REQUEST['query_string']);
-else
-	$smarty->assign("QUERY_STRING","$app_strings[LBL_SEARCH_STRING]");
-
-global $module_menu;
-
-
-require_once('data/Tracker.php');
-$tracFocus=new Tracker();
-$list = $tracFocus->get_recently_viewed($current_user->id);
-$smarty->assign("TRACINFO",$list);
-$smarty->display("Header.tpl");
-?>
+
+
+if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
+
+
+
+$module_path="modules/".$currentModule."/";
+
+require_once('include/Menu.php');
+
+//Assign the entered global search string to a variable and display it again
+if($_REQUEST['query_string'] != '')
+	$smarty->assign("QUERY_STRING",$_REQUEST['query_string']);
+else
+	$smarty->assign("QUERY_STRING","$app_strings[LBL_SEARCH_STRING]");
+
+global $module_menu;
+
+
+require_once('data/Tracker.php');
+$tracFocus=new Tracker();
+$list = $tracFocus->get_recently_viewed($current_user->id);
+$smarty->assign("TRACINFO",$list);
+$smarty->display("Header.tpl");
+?>
diff -ruN htdocs.orig/themes/bluelagoon/header.php htdocs/themes/bluelagoon/header.php
--- htdocs.orig/themes/bluelagoon/header.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/themes/bluelagoon/header.php	2007-05-09 01:59:13.000000000 +0200
@@ -1,90 +1,90 @@
-<?php
-
-/*********************************************************************************
-
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
-
- * ("License"); You may not use this file except in compliance with the
-
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
-
- * Software distributed under the License is distributed on an  "AS IS"  basis,
-
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
-
- * the specific language governing rights and limitations under the License.
-
- * The Original Code is:  SugarCRM Open Source
-
- * The Initial Developer of the Original Code is SugarCRM, Inc.
-
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
-
- * All Rights Reserved.
-
- * Contributor(s): ______________________________________.
-
- ********************************************************************************/
-
-/*********************************************************************************
-
- * $Header$
-
- * Description:  Contains a variety of utility functions used to display UI
-
- * components such as form headers and footers.  Intended to be modified on a per
-
- * theme basis.
-
- ********************************************************************************/
-
-require_once('Smarty_setup.php');
-
-require_once("data/Tracker.php");
-
-require_once("include/utils/utils.php");
-
-require_once("include/calculator/Calc.php");
-
-
-
-global $currentModule;
-global $app_strings;
-global $app_list_strings;
-global $moduleList;
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-require_once($theme_path.'layout_utils.php');
-
-$smarty = new vtigerCRM_Smarty;
-$header_array = getHeaderArray();
-$smarty->assign("HEADERS",$header_array);
-$smarty->assign("THEME",$theme);
-$smarty->assign("IMAGEPATH",$image_path);
-
-$qc_modules = getQuickCreateModules();
-$smarty->assign("QCMODULE", $qc_modules);
-$smarty->assign("APP", $app_strings);
-
-$cnt = count($qc_modules);
-$smarty->assign("CNT", $cnt);
-
-$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
-
-$smarty->assign("MODULE_NAME", $currentModule);
-
-$smarty->assign("DATE", getDisplayDate(date("Y-m-d H:i")));
-
-$smarty->assign("CURRENT_USER", $current_user->user_name);
-
-$smarty->assign("CURRENT_USER_ID", $current_user->id);
-$smarty->assign("MODULELISTS",$app_list_strings['moduleList']);
-$smarty->assign("CATEGORY",getParentTab());
-$smarty->assign("CALC",get_calc($image_path));
-$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
-$smarty->assign("ANNOUNCEMENT",get_announcements());
-
+<?php
+
+/*********************************************************************************
+
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+
+ * ("License"); You may not use this file except in compliance with the
+
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+
+ * the specific language governing rights and limitations under the License.
+
+ * The Original Code is:  SugarCRM Open Source
+
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+
+ * All Rights Reserved.
+
+ * Contributor(s): ______________________________________.
+
+ ********************************************************************************/
+
+/*********************************************************************************
+
+ * $Header$
+
+ * Description:  Contains a variety of utility functions used to display UI
+
+ * components such as form headers and footers.  Intended to be modified on a per
+
+ * theme basis.
+
+ ********************************************************************************/
+
+require_once('Smarty_setup.php');
+
+require_once("data/Tracker.php");
+
+require_once("include/utils/utils.php");
+
+require_once("include/calculator/Calc.php");
+
+
+
+global $currentModule;
+global $app_strings;
+global $app_list_strings;
+global $moduleList;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+require_once($theme_path.'layout_utils.php');
+
+$smarty = new vtigerCRM_Smarty;
+$header_array = getHeaderArray();
+$smarty->assign("HEADERS",$header_array);
+$smarty->assign("THEME",$theme);
+$smarty->assign("IMAGEPATH",$image_path);
+
+$qc_modules = getQuickCreateModules();
+$smarty->assign("QCMODULE", $qc_modules);
+$smarty->assign("APP", $app_strings);
+
+$cnt = count($qc_modules);
+$smarty->assign("CNT", $cnt);
+
+$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
+
+$smarty->assign("MODULE_NAME", $currentModule);
+
+$smarty->assign("DATE", getDisplayDate(date("Y-m-d H:i")));
+
+$smarty->assign("CURRENT_USER", $current_user->user_name);
+
+$smarty->assign("CURRENT_USER_ID", $current_user->id);
+$smarty->assign("MODULELISTS",$app_list_strings['moduleList']);
+$smarty->assign("CATEGORY",getParentTab());
+$smarty->assign("CALC",get_calc($image_path));
+$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
+$smarty->assign("ANNOUNCEMENT",get_announcements());
+
 $smarty->assign("CURRENT_ORGANIZATION",$current_organization);
 $org_array=array();
 $org=strtok( $user_organizations, "|");
@@ -95,28 +95,28 @@
 $smarty->assign("USER_ORGANIZATIONS",$org_array);
 $smarty->assign("USER_ORGANIZATIONS_COUNT",count($org_array));
 $smarty->assign("CHGORGOK",$org_change_ok);
-
-
-if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
-
-
-
-$module_path="modules/".$currentModule."/";
-
-require_once('include/Menu.php');
-
-//Assign the entered global search string to a variable and display it again
-if($_REQUEST['query_string'] != '')
-	$smarty->assign("QUERY_STRING",$_REQUEST['query_string']);
-else
-	$smarty->assign("QUERY_STRING","$app_strings[LBL_SEARCH_STRING]");
-
-global $module_menu;
-
-
-require_once('data/Tracker.php');
-$tracFocus=new Tracker();
-$list = $tracFocus->get_recently_viewed($current_user->id);
-$smarty->assign("TRACINFO",$list);
-$smarty->display("Header.tpl");
-?>
+
+
+if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
+
+
+
+$module_path="modules/".$currentModule."/";
+
+require_once('include/Menu.php');
+
+//Assign the entered global search string to a variable and display it again
+if($_REQUEST['query_string'] != '')
+	$smarty->assign("QUERY_STRING",$_REQUEST['query_string']);
+else
+	$smarty->assign("QUERY_STRING","$app_strings[LBL_SEARCH_STRING]");
+
+global $module_menu;
+
+
+require_once('data/Tracker.php');
+$tracFocus=new Tracker();
+$list = $tracFocus->get_recently_viewed($current_user->id);
+$smarty->assign("TRACINFO",$list);
+$smarty->display("Header.tpl");
+?>
diff -ruN htdocs.orig/themes/woodspice/header.php htdocs/themes/woodspice/header.php
--- htdocs.orig/themes/woodspice/header.php	2007-05-09 00:56:25.000000000 +0200
+++ htdocs/themes/woodspice/header.php	2007-05-09 01:59:13.000000000 +0200
@@ -1,90 +1,90 @@
-<?php
-
-/*********************************************************************************
-
- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
-
- * ("License"); You may not use this file except in compliance with the
-
- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
-
- * Software distributed under the License is distributed on an  "AS IS"  basis,
-
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
-
- * the specific language governing rights and limitations under the License.
-
- * The Original Code is:  SugarCRM Open Source
-
- * The Initial Developer of the Original Code is SugarCRM, Inc.
-
- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
-
- * All Rights Reserved.
-
- * Contributor(s): ______________________________________.
-
- ********************************************************************************/
-
-/*********************************************************************************
-
- * $Header$
-
- * Description:  Contains a variety of utility functions used to display UI
-
- * components such as form headers and footers.  Intended to be modified on a per
-
- * theme basis.
-
- ********************************************************************************/
-
-require_once('Smarty_setup.php');
-
-require_once("data/Tracker.php");
-
-require_once("include/utils/utils.php");
-
-require_once("include/calculator/Calc.php");
-
-
-
-global $currentModule;
-global $app_strings;
-global $app_list_strings;
-global $moduleList;
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-require_once($theme_path.'layout_utils.php');
-
-$smarty = new vtigerCRM_Smarty;
-$header_array = getHeaderArray();
-$smarty->assign("HEADERS",$header_array);
-$smarty->assign("THEME",$theme);
-$smarty->assign("IMAGEPATH",$image_path);
-
-$qc_modules = getQuickCreateModules();
-$smarty->assign("QCMODULE", $qc_modules);
-$smarty->assign("APP", $app_strings);
-
-$cnt = count($qc_modules);
-$smarty->assign("CNT", $cnt);
-
-$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
-
-$smarty->assign("MODULE_NAME", $currentModule);
-
-$smarty->assign("DATE", getDisplayDate(date("Y-m-d H:i")));
-
-$smarty->assign("CURRENT_USER", $current_user->user_name);
-
-$smarty->assign("CURRENT_USER_ID", $current_user->id);
-$smarty->assign("MODULELISTS",$app_list_strings['moduleList']);
-$smarty->assign("CATEGORY",getParentTab());
-$smarty->assign("CALC",get_calc($image_path));
-$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
-$smarty->assign("ANNOUNCEMENT",get_announcements());
-
+<?php
+
+/*********************************************************************************
+
+ * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
+
+ * ("License"); You may not use this file except in compliance with the
+
+ * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+
+ * Software distributed under the License is distributed on an  "AS IS"  basis,
+
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+
+ * the specific language governing rights and limitations under the License.
+
+ * The Original Code is:  SugarCRM Open Source
+
+ * The Initial Developer of the Original Code is SugarCRM, Inc.
+
+ * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
+
+ * All Rights Reserved.
+
+ * Contributor(s): ______________________________________.
+
+ ********************************************************************************/
+
+/*********************************************************************************
+
+ * $Header$
+
+ * Description:  Contains a variety of utility functions used to display UI
+
+ * components such as form headers and footers.  Intended to be modified on a per
+
+ * theme basis.
+
+ ********************************************************************************/
+
+require_once('Smarty_setup.php');
+
+require_once("data/Tracker.php");
+
+require_once("include/utils/utils.php");
+
+require_once("include/calculator/Calc.php");
+
+
+
+global $currentModule;
+global $app_strings;
+global $app_list_strings;
+global $moduleList;
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+require_once($theme_path.'layout_utils.php');
+
+$smarty = new vtigerCRM_Smarty;
+$header_array = getHeaderArray();
+$smarty->assign("HEADERS",$header_array);
+$smarty->assign("THEME",$theme);
+$smarty->assign("IMAGEPATH",$image_path);
+
+$qc_modules = getQuickCreateModules();
+$smarty->assign("QCMODULE", $qc_modules);
+$smarty->assign("APP", $app_strings);
+
+$cnt = count($qc_modules);
+$smarty->assign("CNT", $cnt);
+
+$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
+
+$smarty->assign("MODULE_NAME", $currentModule);
+
+$smarty->assign("DATE", getDisplayDate(date("Y-m-d H:i")));
+
+$smarty->assign("CURRENT_USER", $current_user->user_name);
+
+$smarty->assign("CURRENT_USER_ID", $current_user->id);
+$smarty->assign("MODULELISTS",$app_list_strings['moduleList']);
+$smarty->assign("CATEGORY",getParentTab());
+$smarty->assign("CALC",get_calc($image_path));
+$smarty->assign("QUICKACCESS",getAllParenttabmoduleslist());
+$smarty->assign("ANNOUNCEMENT",get_announcements());
+
 $smarty->assign("CURRENT_ORGANIZATION",$current_organization);
 $org_array=array();
 $org=strtok( $user_organizations, "|");
@@ -95,28 +95,28 @@
 $smarty->assign("USER_ORGANIZATIONS",$org_array);
 $smarty->assign("USER_ORGANIZATIONS_COUNT",count($org_array));
 $smarty->assign("CHGORGOK",$org_change_ok);
-
-
-if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
-
-
-
-$module_path="modules/".$currentModule."/";
-
-require_once('include/Menu.php');
-
-//Assign the entered global search string to a variable and display it again
-if($_REQUEST['query_string'] != '')
-	$smarty->assign("QUERY_STRING",$_REQUEST['query_string']);
-else
-	$smarty->assign("QUERY_STRING","$app_strings[LBL_SEARCH_STRING]");
-
-global $module_menu;
-
-
-require_once('data/Tracker.php');
-$tracFocus=new Tracker();
-$list = $tracFocus->get_recently_viewed($current_user->id);
-$smarty->assign("TRACINFO",$list);
-$smarty->display("Header.tpl");
-?>
+
+
+if (is_admin($current_user)) $smarty->assign("ADMIN_LINK", "<a href='index.php?module=Settings&action=index'>".$app_strings['LBL_SETTINGS']."</a>");
+
+
+
+$module_path="modules/".$currentModule."/";
+
+require_once('include/Menu.php');
+
+//Assign the entered global search string to a variable and display it again
+if($_REQUEST['query_string'] != '')
+	$smarty->assign("QUERY_STRING",$_REQUEST['query_string']);
+else
+	$smarty->assign("QUERY_STRING","$app_strings[LBL_SEARCH_STRING]");
+
+global $module_menu;
+
+
+require_once('data/Tracker.php');
+$tracFocus=new Tracker();
+$list = $tracFocus->get_recently_viewed($current_user->id);
+$smarty->assign("TRACINFO",$list);
+$smarty->display("Header.tpl");
+?>


More information about the vtigercrm-developers mailing list