[Vtigercrm-commits] [vtiger-commits] r7314 - in /vtigercrm/branches/4.2: data/ include/ modules/Accounts/ modules/Orders/ modules/Settings/language/ modules/Users/

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Jun 21 00:24:09 EDT 2006


Author: jrydbeck
Date: Tue Jun 20 22:23:57 2006
New Revision: 7314

Log:
Finished php notices bug #748.  This changeset will close-out the bug. Some noticies still appear, but should be bugged individually

Modified:
    vtigercrm/branches/4.2/data/SugarBean.php
    vtigercrm/branches/4.2/include/RelatedListView.php
    vtigercrm/branches/4.2/include/uifromdbutil.php
    vtigercrm/branches/4.2/include/utils.php
    vtigercrm/branches/4.2/modules/Accounts/RenderRelatedListUI.php
    vtigercrm/branches/4.2/modules/Orders/RenderRelatedListUI.php
    vtigercrm/branches/4.2/modules/Orders/SalesOrderDetailView.php
    vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php
    vtigercrm/branches/4.2/modules/Settings/language/en_us.lang.php
    vtigercrm/branches/4.2/modules/Users/DetailView.php
    vtigercrm/branches/4.2/modules/Users/EditView.php
    vtigercrm/branches/4.2/modules/Users/User.php

Modified: vtigercrm/branches/4.2/data/SugarBean.php
==============================================================================
--- vtigercrm/branches/4.2/data/SugarBean.php (original)
+++ vtigercrm/branches/4.2/data/SugarBean.php Tue Jun 20 22:23:57 2006
@@ -289,25 +289,25 @@
 		$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)){
+			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])) {
+					if (isset($row[$field]))
+					{
 						$this->$field = $row[$field];
-						
-						
-						$this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field);
+						// this used to display {$row['id']}, but that was broken and I'm
+						// 		not certain what that was supposed to display
+						$this->log->debug("$this->object_name(): ".$field." = ".$this->$field);
 					}
-					else 
+					else
 					{
 						$this->$field = "";
 					}

Modified: vtigercrm/branches/4.2/include/RelatedListView.php
==============================================================================
--- vtigercrm/branches/4.2/include/RelatedListView.php (original)
+++ vtigercrm/branches/4.2/include/RelatedListView.php Tue Jun 20 22:23:57 2006
@@ -1,670 +1,673 @@
-<?php
-require_once('modules/Users/UserInfoUtil.php');
-require_once("include/utils.php");
-
-function GetRelatedList($module,$relatedmodule,$focus,$query,$button,$returnset,$edit_val='',$del_val='')
-{
-
-require_once('XTemplate/xtpl.php');
-require_once("data/Tracker.php");
-require_once('include/database/PearDatabase.php');
-
-global $adb;
-global $app_strings;
-global $current_language;
-
-$mod_dir=getModuleDirName($module);
-$current_module_strings = return_module_language($current_language, $mod_dir);
-
-global $list_max_entries_per_page;
-global $urlPrefix;
-
-$log = LoggerManager::getLogger('account_list');
-
-global $currentModule;
-global $theme;
-global $theme_path;
-global $theme_path;
-
-// focus_list is the means of passing data to a ListView.
-global $focus_list;
-
-if (!isset($where)) $where = "";
-
-if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
-
-//if($module == 'Potentials')
-//	$focus = new Potential();
-
-echo '<br><br>';
-
-$button = '<table cellspacing=0 cellpadding=2><tr><td>'.$button.'</td></tr></table>';
-
-// Added to have Purchase Order as form Title
-if($relatedmodule == 'Orders') 
-{
-	echo get_form_header($app_strings['PurchaseOrder'],$button, false);
-}
-else
-{
-	echo get_form_header($app_strings[$relatedmodule],$button, false);
-}
-
-$xtpl=new XTemplate ('include/RelatedListView.html');
-require_once('themes/'.$theme.'/layout_utils.php');
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-$xtpl->assign("MOD", $mod_strings);
-$xtpl->assign("APP", $app_strings);
-$xtpl->assign("IMAGE_PATH",$image_path);
-
-//Retreive the list from Database
-//$query = getListQuery("Accounts");
-
-//Appending the security parameter
-global $others_permission_id;
-global $current_user;
-$rel_tab_id = getTabid($relatedmodule);
-$defSharingPermissionData = $_SESSION['defaultaction_sharing_permission_set'];
-$others_rel_permission_id = $defSharingPermissionData[$rel_tab_id];
-if($others_rel_permission_id == 3 && $relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook') //Security fix by Don
-{
-	 $query .= " and crmentity.smownerid in(".$current_user->id .",0)";
-}
-
-if(isset($where) && $where != '')
-{
-        $query .= ' and '.$where;
-}
-
-//Appending the group by for Jaguar/Don
-// group by won't work this way in postgres
-if($relatedmodule == 'Activities' && !$adb->isPostgres())
-{
-	$query .= ' group by crmentity.crmid';
-}
-
-
-//$url_qry = getURLstring($focus);
-
-if(isset($order_by) && $order_by != '')
-{
-        $query .= ' ORDER BY '.$order_by;
-        $url_qry .="&order_by=".$order_by;
-}
-
-$list_result = $adb->query($query);
-//Retreiving the no of rows
-$noofrows = $adb->num_rows($list_result);
-        
-//Retreiving the start value from request
-$start_idx = $relatedmodule.'start';
-if(isset($_REQUEST[$start_idx]) && $_REQUEST[$start_idx] != '') {
-        $start = $_REQUEST[$start_idx];
-} else {
-        $start = 1;
-}
-//Retreive the Navigation array
-$navigation_array = getRelatedNavigationValues($start, $noofrows, $list_max_entries_per_page, $relatedmodule);
-
-//Retreive the List View Table Header
-if($noofrows == 0)
-{
-	echo $app_strings['LBL_NONE_SCHEDULED'];
-}
-else
-{
-	$listview_header = getListViewHeader($focus,$relatedmodule,'','','','relatedlist');//"Accounts");
-	if ($navigation_array[$relatedmodule.'end_val'] - $navigation_array[$relatedmodule.'start'] > 15)
-	{
-		$xtpl->assign('SCROLLSTART','<div style="overflow:auto;height:315px;width:100%;">');
-		$xtpl->assign('SCROLLSTOP','</div>');
-	}
-	$xtpl->assign("LISTHEADER", $listview_header);
-
-	if($module == 'PriceBook' && $relatedmodule == 'Products')
-	{
-		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val);
-	}
-	if($module == 'Products' && $relatedmodule == 'PriceBook')
-	{
-		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'EditListPrice','DeletePriceBookProductRel');
-	}
-	elseif($relatedmodule == 'SalesOrder')
-	{
-		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder');
-	}else
-	{
-		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset);
-	}
-
-	//$listview_entries = getListViewEntries1($focus,"Accounts",$list_result,$navigation_array);
-	$xtpl->assign("LISTENTITY", $listview_entries);
-	$xtpl->assign("SELECT_SCRIPT", $view_script);
-	$navigationOutput = getTableHeaderNavigation($navigation_array, $url_qry,$relatedmodule, 'DetailView', '');
-	//echo $navigationOutput;
-
-	$navigationOutput = '
-<table  cellpadding="0" cellspacing="0" width="100%" border="0" class="FormBorder">
-        <tr height="20">
-                <td class="listFormHeaderLinks">
-                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
-                        <tr>'.$navigationOutput.'</tr>
-                        </table>
-                </td>
-        </tr>
-</table>';
-
-
-	if($navigation_array[$relatedmodule.'allflag'] != 'All' || $navigation_array[$relatedmodule.'verylast'] > 1) {
-		// only show if navigation is possible
-		$xtpl->assign("NAVIGATION", $navigationOutput);
-	}
-
-	$xtpl->parse("main");
-	$xtpl->out("main");
-}
-
-}
-
-function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='')
-{
-	global $theme;
-
-	$list = '<script>
-                        function confirmdelete(url)
-                        {
-                                if(confirm("Are you sure?"))
-                                {
-                                        document.location.href=url;
-                                }
-                        }
-                </script>';
-
-	$theme_path="themes/".$theme."/";
-	$image_path=$theme_path."images/";
-	require_once ($theme_path."layout_utils.php");
-
-	global $adb;
-	global $mod_strings;
-	global $app_strings;
-
-	$result=$adb->query($query);
-	$noofrows = $adb->num_rows($result);
-	if($sid=='salesorderid')
-	{
-		$return_action = "SalesOrderDetailView";
-	}
-	else
-	{
-		$return_action = "DetailView";
-	}
-	$button .= '<table cellspacing=0 cellpadding=2><tr><td>';
-	$button .= '<input type="hidden" name="fileid">';
-	$button .= '<input title="New Attachment" accessyKey="F" class="button" onclick="this.form.action.value=\'upload\';this.form.module.value=\'uploads\'" type="submit" name="button" value="'.$app_strings['LBL_NEW_ATTACHMENT'].'">&nbsp;';
-
-        if(isPermitted("Notes",1,"") == 'yes')
-        {
-	
-		$button .= '<input title="New Notes" accessyKey="F" class="button" onclick="this.form.action.value=\'EditView\';this.form.return_action.value=\''.$return_action.'\';this.form.module.value=\'Notes\'" type="submit" name="button" value="'.$app_strings['LBL_NEW_NOTE'].'">&nbsp;';
-	}
-	$button .= '</td></tr></table>';
-	
-
-echo '<br><br>';
-echo get_form_header($app_strings['LBL_ATTACHMENT_AND_NOTES'],$button, false);
-
-if($noofrows == 0)
-{
-	echo $app_strings['LBL_NONE_SCHEDULED'];
-}
-else
-{
+<?php
+require_once('modules/Users/UserInfoUtil.php');
+require_once("include/utils.php");
+
+function GetRelatedList($module,$relatedmodule,$focus,$query,$button,$returnset,$edit_val='',$del_val='')
+{
+
+require_once('XTemplate/xtpl.php');
+require_once("data/Tracker.php");
+require_once('include/database/PearDatabase.php');
+
+global $adb;
+global $app_strings;
+global $mod_strings;
+global $current_language;
+
+$mod_dir=getModuleDirName($module);
+$current_module_strings = return_module_language($current_language, $mod_dir);
+
+global $list_max_entries_per_page;
+global $urlPrefix;
+
+$log = LoggerManager::getLogger('account_list');
+
+global $currentModule;
+global $theme;
+global $theme_path;
+global $theme_path;
+
+// focus_list is the means of passing data to a ListView.
+global $focus_list;
+
+if (!isset($where)) $where = "";
+
+if (isset($_REQUEST['order_by'])) $order_by = $_REQUEST['order_by'];
+
+//if($module == 'Potentials')
+//	$focus = new Potential();
+
+echo '<br><br>';
+
+$button = '<table cellspacing=0 cellpadding=2><tr><td>'.$button.'</td></tr></table>';
+
+// Added to have Purchase Order as form Title
+if($relatedmodule == 'Orders') 
+{
+	echo get_form_header($app_strings['PurchaseOrder'],$button, false);
+}
+else
+{
+	echo get_form_header($app_strings[$relatedmodule],$button, false);
+}
+
+$xtpl=new XTemplate ('include/RelatedListView.html');
+require_once('themes/'.$theme.'/layout_utils.php');
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+$xtpl->assign("MOD", $mod_strings);
+$xtpl->assign("APP", $app_strings);
+$xtpl->assign("IMAGE_PATH",$image_path);
+
+//Retreive the list from Database
+//$query = getListQuery("Accounts");
+
+//Appending the security parameter
+global $others_permission_id;
+global $current_user;
+$rel_tab_id = getTabid($relatedmodule);
+$defSharingPermissionData = $_SESSION['defaultaction_sharing_permission_set'];
+$others_rel_permission_id = $defSharingPermissionData[$rel_tab_id];
+if($others_rel_permission_id == 3 && $relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook') //Security fix by Don
+{
+	 $query .= " and crmentity.smownerid in(".$current_user->id .",0)";
+}
+
+if(isset($where) && $where != '')
+{
+        $query .= ' and '.$where;
+}
+
+//Appending the group by for Jaguar/Don
+// group by won't work this way in postgres
+if($relatedmodule == 'Activities' && !$adb->isPostgres())
+{
+	$query .= ' group by crmentity.crmid';
+}
+
+
+//$url_qry = getURLstring($focus);
+
+if(isset($order_by) && $order_by != '')
+{
+        $query .= ' ORDER BY '.$order_by;
+        $url_qry .="&order_by=".$order_by;
+}
+
+$list_result = $adb->query($query);
+//Retreiving the no of rows
+$noofrows = $adb->num_rows($list_result);
+        
+//Retreiving the start value from request
+$start_idx = $relatedmodule.'start';
+if(isset($_REQUEST[$start_idx]) && $_REQUEST[$start_idx] != '') {
+        $start = $_REQUEST[$start_idx];
+} else {
+        $start = 1;
+}
+//Retreive the Navigation array
+$navigation_array = getRelatedNavigationValues($start, $noofrows, $list_max_entries_per_page, $relatedmodule);
+
+//Retreive the List View Table Header
+if($noofrows == 0)
+{
+	echo $app_strings['LBL_NONE_SCHEDULED'];
+}
+else
+{
+	$listview_header = getListViewHeader($focus,$relatedmodule,'','','','relatedlist');//"Accounts");
+	if ($navigation_array[$relatedmodule.'end_val'] - $navigation_array[$relatedmodule.'start'] > 15)
+	{
+		$xtpl->assign('SCROLLSTART','<div style="overflow:auto;height:315px;width:100%;">');
+		$xtpl->assign('SCROLLSTOP','</div>');
+	}
+	$xtpl->assign("LISTHEADER", $listview_header);
+
+	if($module == 'PriceBook' && $relatedmodule == 'Products')
+	{
+		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val);
+	}
+	if($module == 'Products' && $relatedmodule == 'PriceBook')
+	{
+		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'EditListPrice','DeletePriceBookProductRel');
+	}
+	elseif($relatedmodule == 'SalesOrder')
+	{
+		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder');
+	}else
+	{
+		$listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset);
+	}
+
+	//$listview_entries = getListViewEntries1($focus,"Accounts",$list_result,$navigation_array);
+	$xtpl->assign("LISTENTITY", $listview_entries);
+	$xtpl->assign("SELECT_SCRIPT", $view_script);
+	$navigationOutput = getTableHeaderNavigation($navigation_array, $url_qry,$relatedmodule, 'DetailView', '');
+	//echo $navigationOutput;
+
+	$navigationOutput = '
+<table  cellpadding="0" cellspacing="0" width="100%" border="0" class="FormBorder">
+        <tr height="20">
+                <td class="listFormHeaderLinks">
+                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
+                        <tr>'.$navigationOutput.'</tr>
+                        </table>
+                </td>
+        </tr>
+</table>';
+
+
+	if($navigation_array[$relatedmodule.'allflag'] != 'All' || $navigation_array[$relatedmodule.'verylast'] > 1) {
+		// only show if navigation is possible
+		$xtpl->assign("NAVIGATION", $navigationOutput);
+	}
+
+	$xtpl->parse("main");
+	$xtpl->out("main");
+}
+
+}
+
+function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='')
+{
+	global $theme;
+
+	$list = '<script>
+                        function confirmdelete(url)
+                        {
+                                if(confirm("Are you sure?"))
+                                {
+                                        document.location.href=url;
+                                }
+                        }
+                </script>';
+
+	$theme_path="themes/".$theme."/";
+	$image_path=$theme_path."images/";
+	require_once ($theme_path."layout_utils.php");
+
+	global $adb;
+	global $mod_strings;
+	global $app_strings;
+
+	$result=$adb->query($query);
+	$noofrows = $adb->num_rows($result);
+	
+	if($sid=='salesorderid')
+	{
+		$return_action = "SalesOrderDetailView";
+	}
+	else
+	{
+		$return_action = "DetailView";
+	}
+	
+	$button = '<table cellspacing=0 cellpadding=2><tr><td>';
+	$button .= '<input type="hidden" name="fileid">';
+	$button .= '<input title="New Attachment" accessyKey="F" class="button" onclick="this.form.action.value=\'upload\';this.form.module.value=\'uploads\'" type="submit" name="button" value="'.$app_strings['LBL_NEW_ATTACHMENT'].'">&nbsp;';
+
+        if(isPermitted("Notes",1,"") == 'yes')
+        {
+	
+		$button .= '<input title="New Notes" accessyKey="F" class="button" onclick="this.form.action.value=\'EditView\';this.form.return_action.value=\''.$return_action.'\';this.form.module.value=\'Notes\'" type="submit" name="button" value="'.$app_strings['LBL_NEW_NOTE'].'">&nbsp;';
+	}
+	$button .= '</td></tr></table>';
+	
+
+echo '<br><br>';
+echo get_form_header($app_strings['LBL_ATTACHMENT_AND_NOTES'],$button, false);
+
+if($noofrows == 0)
+{
+	echo $app_strings['LBL_NONE_SCHEDULED'];
+}
+else
+{
 // begin: Armando Lüscher 15.07.2005 -> §scrollableTables
 // Desc: class="blackLine" deleted because of vertical line in title <tr>
-	$list .= '<table border="0" cellpadding="0" cellspacing="0" class="FormBorder" width="100%">';
-	$list .= '<tr class="ModuleListTitle" height=20>';
-
-	$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td width="30%" class="moduleListTitle">';
-
-	$class_black="";
-	if($noofrows<15)
-	{
-		$class_black='class="blackLine"';
-	}
-	$list .= $app_strings['LBL_TITLE_OR_DESCRIPTION'].'</td>';
-	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td width="10%" class="moduleListTitle">';
-
-	$list .= $app_strings['LBL_ENTITY_TYPE'].'</td>';
-	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td width="15%" class="moduleListTitle">';
-
-	$list .= $app_strings['LBL_FILENAME'].'</td>';
-	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td width="15%" class="moduleListTitle">';
-
-	$list .= $app_strings['LBL_TYPE'].'</td>';
-	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td width="20%" class="moduleListTitle">';
-
-	$list .= $app_strings['LBL_LAST_MODIFIED'].'</td>';
-	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td width="10%" class="moduleListTitle" height="21">';
-
-	$list .= $app_strings['LBL_ACTION'].'</td>';
-	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-	$list .= '<td class="moduleListTitle">';
-
-	$list .= '</td>';
-	if($noofrows>15)
-	{
-		$list .= '<td style="width:20px">&nbsp;&nbsp&nbsp;&nbsp;</td>';
-	}
-
-	$list .= '</tr>';
-	$list .= '<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
-//	$list .= '</table>';
-// end: Armando Lüscher 15.07.2005 -> scrollableTables
-
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: 'Y'
-//			 Insert new table with 1 cell where all entries are in a new table.
-//			 This cell will be scrollable when too many entries exist
-	$list .= ($noofrows>15) ? '<tr><td colspan="20"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTables
-
-	$i=1;
-	while($row = $adb->fetch_array($result))
-	{
-        	if($row[1] == 'Notes')
-	        {
-        	        $module = 'Notes';
-                	$editaction = 'EditView';
-	                $deleteaction = 'Delete';
-        	}
-	        elseif($row[1] == 'Attachments')
-	        {
-	                $module = 'uploads';
-	                $editaction = 'upload';
-	                $deleteaction = 'deleteattachments';
-	        }
-
-		if ($i%2==0)
-			$trowclass = 'evenListRow';
-		else
-			$trowclass = 'oddListRow';
-
-		$list .= '<tr class="'. $trowclass.'">';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-
-		if($module == 'Notes')
-			$list .= '<td width="30%"><a href="index.php?module='.$module.'&action=DetailView&return_module='.$returnmodule.'&return_action='.$returnaction.'&record='.$row["crmid"] .'&return_id='.$_REQUEST['record'].'">'.$row[0].'</td>';
-		elseif($module == 'uploads')
-			$list .= '<td width="30%">'.$row[0].'</td>';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
-		$list .= $row[1];
-		$list .= '</td>';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">';
-		$list .= '<a href = "index.php?module=uploads&action=downloadfile&return_module=Accounts&activity_type=' . $row[1] . '&fileid=' . $row[5] . '&filename=' . urlencode($row[2]) . '">' . $row[2] . '</a>';
-		$list .= '</td>';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">';
-		$list .= $row[3];
-		$list .= '</td>';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="20%" height="21" style="padding:0px 3px 0px 3px;">';
-
-		if($row[4] != '0000-00-00 00:00:00')
-			$list .= $row[4];
-		else
-                        $list .= '';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
-
-		if($row[1] == 'Notes')
-			$list .= '<a href="index.php?module='.$module.'&action='.$editaction.'&return_module='.$parentmodule.'&return_action='.$return_action.'&record='.$row["crmid"].'&filename='.$row[2].'&fileid='.$row['attachmentsid'].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_EDIT'].'</a>  |  ';
-//		$list .= '<a href="index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["crmid"].'&filename='.$row[2].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_DELETE'].'</a>';
-		$del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$return_action.'&record='.$row["crmid"].'&filename='.$row[2].'&return_id='.$_REQUEST["record"];
-                $list .= '<a href="javascript:confirmdelete(\''.$del_param.'\')">'.$app_strings['LNK_DELETE'].'</a>';
-
-		$list .= '</td>';
-
-		$list .= '</tr>';
-		$i++;
-	}
-	
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: Close table from 'Y'
-		$list .= ($noofrows>15) ? '</table></div></td></tr>':'';
-// end: Armando Lüscher 14.07.2005 -> scrollableTables
-
-	$list .= '<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
-	$list .= '</table>';
-	echo $list;
-
-}
-}
-
-function getHistory($parentmodule,$query,$id)
-{
-	$parentaction = $_REQUEST['action'];
-	global $theme;
-	$theme_path="themes/".$theme."/";
-	$image_path=$theme_path."images/";
-	require_once ($theme_path."layout_utils.php");
-
-	global $adb;
-	global $mod_strings;
-	global $app_strings;
-
-	//Appending the security parameter
-	global $others_permission_id;
-	global $current_user;
-	$rel_tab_id = getTabid("Activities");
-	$defSharingPermissionData = $_SESSION['defaultaction_sharing_permission_set'];
-	$others_rel_permission_id = $defSharingPermissionData[$rel_tab_id];
-	if($others_rel_permission_id == 3) //Security fix by Don
-	{
-         	$query .= " and crmentity.smownerid in(".$current_user->id .",0)";
-	}
-
-	$result=$adb->query($query);
-	$noofrows = $adb->num_rows($result);
-	
-	$button .= '<table cellspacing=0 cellpadding=2><tr><td>';
-	$button .= '</td></tr></table>';
-
-	echo '<br><br>';
-	echo get_form_header($app_strings['LBL_HISTORY'],'', false);
-
-	if($noofrows == 0)
-	{
-		echo $app_strings['LBL_NONE_SCHEDULED'];
-	}
-	else
-	{
-		$list .= '<table border="0" cellpadding="0" cellspacing="0" class="FormBorder" width="100%" >';
-		$list .= '<tr class="ModuleListTitle" height=20>';
-
-		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="4%" class="moduleListTitle"></td>';
-
-// Armando Lüscher 15.07.2005 -> §scrollableTables
-// Desc: class="blackLine" deleted because of vertical line in title <tr>
-
-//		$list .= $app_strings['LBL_ICON'].'Icon</td>';
-		$class_black="";
-		if($noofrows<15)
-		{
-			$class_black='class="blackLine"';	
-		}
-
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="25%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
-	
-		$list .= $app_strings['LBL_SUBJECT'].'</td>';
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="10%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
-	
-		$list .= $app_strings['LBL_STATUS'].'</td>';
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="18%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
-	
-		$list .= $app_strings['LBL_LIST_CONTACT_NAME'].'</td>';
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="18%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
-
-		$list .= $app_strings['LBL_RELATED_TO'].'</td>';
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="15%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
-	
-		$list .= $app_strings['LBL_LAST_MODIFIED'].'</td>';
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td width="10%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">';
-
-		$list .= $app_strings['LBL_ACTION'].'</td>';
-		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-		$list .= '<td class="moduleListTitle">';
-
-		$list .= '</td>';
-		if($noofrows>15)
-		{
-			$list .= '<td style="width:20px">&nbsp;&nbsp&nbsp;&nbsp;</td>';
-		}
-		$list .= '</tr>';
-	
-		$list .= '<tr><td COLSPAN="14" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
-
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: 'X'
-//			 Insert new table with 1 cell where all entries are in a new table.
-//			 This cell will be scrollable when too many entries exist
-		$list .= ($noofrows>15) ? '<tr><td colspan="21"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTablEs
-
-		$i=1;
-		while($row = $adb->fetch_array($result))
-		{
-			if($row['activitytype'] == 'Task')
-			{
-				$activitymode = 'Task';
-				$icon = 'Tasks.gif';
-				$status = $row['status'];
-			}
-			elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting')
-			{
-				$activitymode = 'Events';
-				$icon = 'Activities.gif';
-				$status = $row['eventstatus'];
-			}
-			if ($i%2==0)
-				$trowclass = 'evenListRow';
-			else
-				$trowclass = 'oddListRow';
-	
-			$list .= '<tr class="'. $trowclass.'">';
-	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="4%"><IMG SRC="'.$image_path.'/'.$icon.'"></td>';
-
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="25%" height="21" style="padding:0px 3px 0px 3px;">';
-			$list .= '<a href="index.php?module=Activities&action=DetailView&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["activityid"] .'&activity_mode='.$activitymode.'&return_id='.$_REQUEST['record'].'" title="'.$row['description'].'">'.$row['subject'].'</a></td>';
-			$list .= '</td>';
-	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
-			$list .= $status;
-			$list .= '</td>';
-
-			if($row['firstname'] != 'NULL')	
-				$contactname = $row['firstname'].' ';
-			if($ros['lastname'] != 'NULL')
-				$contactname .= $row['lastname'];
-
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="18%" height="21" style="padding:0px 3px 0px 3px;">';
-			$list .= '<a href="index.php?module=Contacts&action=DetailView&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["contactid"].'&return_id='.$_REQUEST['record'].'">'.$contactname;
-			$list .= '</td>';
-
-			$parentname = getRelatedTo('Activities',$result,$i-1);
-
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="18%" height="21" style="padding:0px 3px 0px 3px;">';
-			$list .= $parentname;
-			$list .= '</td>';
-	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">';
-			$modifiedtime = getDisplayDate($row['modifiedtime']);
-			$list .= $modifiedtime;
-	
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-			$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
-
-			if(isPermitted("Activities",1,$row["activityid"]) == 'yes')
-                	{
-	
-				$list .= '<a href="index.php?module=Activities&action=EditView&return_module='.$parentmodule.'&return_action='.$parentaction.'&activity_mode='.$activitymode.'&record='.$row["activityid"].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_EDIT'].'</a>  |  ';
-			}
-	
-			if(isPermitted("Activities",2,$row["activityid"]) == 'yes')
-                	{
-				$list .= '<a href="index.php?module=Activities&action=Delete&return_module='.$parentmodule.'&return_action='.$parentaction.'&record='.$row["activityid"].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_DELETE'].'</a>';
-			}
-	
-			$list .= '</td>';
-			
-			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
-
-			$list .= '</tr>';
-			$i++;
-		}
-
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: Close table from 
-		$list .= ($noofrows>15) ? '</table></div></td></tr>':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTables
-
-		$list .= '<tr><td colspan="14" class="blackLine"></td></tr>';
-
-		$list .= '</table>';
-		echo $list;
-	}
-}
-
-function getPriceBookRelatedProducts($query,$focus,$returnset='')
-{
-	global $adb;
-	global $app_strings;
-	global $mod_strings;
-	global $current_language;
-	$current_module_strings = return_module_language($current_language, 'Products');
-
-	global $list_max_entries_per_page;
-	global $urlPrefix;
-
-
-	global $theme;
-	$pricebook_id = $_REQUEST['record'];
-	$theme_path="themes/".$theme."/";
-	$image_path=$theme_path."images/";
-	require_once($theme_path.'layout_utils.php');
-	$list_result = 	$adb->query($query);
-	$num_rows = $adb->num_rows($list_result);
-	$xtpl=new XTemplate('include/RelatedListView.html');
-	$xtpl->assign("MOD", $mod_strings);
-	$xtpl->assign("APP", $app_strings);
-	$xtpl->assign("IMAGE_PATH",$image_path);
-	echo '<BR>';
-	$other_text = '<table width="100%" border="0" cellpadding="1" cellspacing="0">
-	<form name="selectproduct" method="POST">
-	<tr>
-	<input name="action" type="hidden" value="AddProductsToPriceBook">
-	<input name="module" type="hidden" value="Products">
-	<input name="return_module" type="hidden" value="Products">
-	<input name="return_action" type="hidden" value="PriceBookDetailView">
-	<input name="pricebook_id" type="hidden" value="'.$_REQUEST["record"].'">';
-
-        $other_text .='<td><input title="Select Products" accessyKey="F" class="button" onclick="this.form.action.value=\'AddProductsToPriceBook\';this.form.module.value=\'Products\';this.form.return_module.value=\'Products\';this.form.return_action.value=\'PriceBookDetailView\'" type="submit" name="button" value="'.$app_strings["LBL_SELECT_PRODUCT_BUTTON_LABEL"].'"></td>';
-		$other_text .='</tr></table>';
-
-//Retreive the list from Database
-echo get_form_header($current_module_strings['LBL_LIST_FORM_TITLE'], $other_text, false );
-
-
-//echo $list_query;
-$list_result = $adb->query($query);
-$num_rows = $adb->num_rows($list_result);
-
-//Retreive the List View Table Header
-
-// Armando Lüscher 15.07.2005 -> §scrollableTables
-// Desc: class="blackLine" deleted because of vertical line in title <tr>
-
-//		$list .= $app_strings['LBL_ICON'].'Icon</td>';
-		$class_black="";
-		if($num_rows<15)
-		{
-			$class_black='class="blackLine"';	
-		}
-
-$list_header = '';
-$list_header .= '<tr class="moduleListTitle" height=20>';
-$list_header .= '<td WIDTH="1" class="blackLine"><IMG SRC="'.$image_path.'blank.gif"></td>';
-$list_header .= '<td width="40%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_LIST_PRODUCT_NAME'].'</td>';
-$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
-$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_PRODUCT_CODE'].'</td>';
-$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
-$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_PRODUCT_UNIT_PRICE'].'</td>';
-$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
-$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_PB_LIST_PRICE'].'</td>';
-$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
-$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">Edit|Del</td>';
-$list_header .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
-
-$list_header .= '</tr>';
-
-$xtpl->assign("LISTHEADER", $list_header);
-
-$list_body ='';
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: 'X'
-//			 Insert new table with 1 cell where all entries are in a new table.
-//			 This cell will be scrollable when too many entries exist
-		$list_body .= ($num_rows>15) ? '<tr><td colspan="12"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTablEs
-
-for($i=0; $i<$num_rows; $i++)
-{
-	$entity_id = $adb->query_result($list_result,$i,"crmid");
-		if (($i%2)==0)
-			$list_body .= '<tr height=20 class=evenListRow>';
-		else
-			$list_body .= '<tr height=20 class=oddListRow>';
-
-		$unit_price = 	$adb->query_result($list_result,$i,"unit_price");
-		$listprice = $adb->query_result($list_result,$i,"listprice");
-		$field_name=$entity_id."_listprice";
-
-		$list_body .= '<td WIDTH="1" class="blackLine"><IMG SRC="'.$image_path.'blank.gif"></td>';
-		$list_body .= '<td width="40%" height="21" style="padding:0px 3px 0px 3px;">'.$adb->query_result($list_result,$i,"productname").'</td>';
-		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
-		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">'.$adb->query_result($list_result,$i,"productcode").'</td>';
-		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
-		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">'.$unit_price.'</td>';
-		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
-		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">'.$listprice.'</td>';
-		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
-		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;"><a href="index.php?module=Products&action=EditListPrice&record='.$entity_id.'&pricebook_id='.$pricebook_id.'&listprice='.$listprice.'">edit</a>&nbsp;|&nbsp;<a href="index.php?module=Products&action=DeletePriceBookProductRel'.$returnset.'&record='.$entity_id.'&pricebook_id='.$pricebook_id.'">del</a></td>';
-	$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td></tr>';
-	
-}
-// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
-// Desc: Close table from 
-		$list_body .= ($num_rows>15) ? '</table></div></td></tr>':'';
-// end: Armando Lüscher 14.07.2005 -> §scrollableTables
-
-	$list_body .= '<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
-
-//$listview_entries = getListViewEntries($focus,"Products",$list_result,$navigation_array);
-
-$xtpl->assign("LISTENTITY", $list_body);
-
-$xtpl->parse("main");
-$xtpl->out("main");	
-
-}
-
-//echo '</form>';
-?>
+	$list .= '<table border="0" cellpadding="0" cellspacing="0" class="FormBorder" width="100%">';
+	$list .= '<tr class="ModuleListTitle" height=20>';
+
+	$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td width="30%" class="moduleListTitle">';
+
+	$class_black="";
+	if($noofrows<15)
+	{
+		$class_black='class="blackLine"';
+	}
+	$list .= $app_strings['LBL_TITLE_OR_DESCRIPTION'].'</td>';
+	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td width="10%" class="moduleListTitle">';
+
+	$list .= $app_strings['LBL_ENTITY_TYPE'].'</td>';
+	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td width="15%" class="moduleListTitle">';
+
+	$list .= $app_strings['LBL_FILENAME'].'</td>';
+	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td width="15%" class="moduleListTitle">';
+
+	$list .= $app_strings['LBL_TYPE'].'</td>';
+	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td width="20%" class="moduleListTitle">';
+
+	$list .= $app_strings['LBL_LAST_MODIFIED'].'</td>';
+	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td width="10%" class="moduleListTitle" height="21">';
+
+	$list .= $app_strings['LBL_ACTION'].'</td>';
+	$list .= '<td WIDTH="1" '.$class_black .'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+	$list .= '<td class="moduleListTitle">';
+
+	$list .= '</td>';
+	if($noofrows>15)
+	{
+		$list .= '<td style="width:20px">&nbsp;&nbsp&nbsp;&nbsp;</td>';
+	}
+
+	$list .= '</tr>';
+	$list .= '<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
+//	$list .= '</table>';
+// end: Armando Lüscher 15.07.2005 -> scrollableTables
+
+// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
+// Desc: 'Y'
+//			 Insert new table with 1 cell where all entries are in a new table.
+//			 This cell will be scrollable when too many entries exist
+	$list .= ($noofrows>15) ? '<tr><td colspan="20"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
+// end: Armando Lüscher 14.07.2005 -> §scrollableTables
+
+	$i=1;
+	while($row = $adb->fetch_array($result))
+	{
+        	if($row[1] == 'Notes')
+	        {
+        	        $module = 'Notes';
+                	$editaction = 'EditView';
+	                $deleteaction = 'Delete';
+        	}
+	        elseif($row[1] == 'Attachments')
+	        {
+	                $module = 'uploads';
+	                $editaction = 'upload';
+	                $deleteaction = 'deleteattachments';
+	        }
+
+		if ($i%2==0)
+			$trowclass = 'evenListRow';
+		else
+			$trowclass = 'oddListRow';
+
+		$list .= '<tr class="'. $trowclass.'">';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+
+		if($module == 'Notes')
+			$list .= '<td width="30%"><a href="index.php?module='.$module.'&action=DetailView&return_module='.$returnmodule.'&return_action='.$returnaction.'&record='.$row["crmid"] .'&return_id='.$_REQUEST['record'].'">'.$row[0].'</td>';
+		elseif($module == 'uploads')
+			$list .= '<td width="30%">'.$row[0].'</td>';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
+		$list .= $row[1];
+		$list .= '</td>';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">';
+		$list .= '<a href = "index.php?module=uploads&action=downloadfile&return_module=Accounts&activity_type=' . $row[1] . '&fileid=' . $row[5] . '&filename=' . urlencode($row[2]) . '">' . $row[2] . '</a>';
+		$list .= '</td>';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">';
+		$list .= $row[3];
+		$list .= '</td>';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="20%" height="21" style="padding:0px 3px 0px 3px;">';
+
+		if($row[4] != '0000-00-00 00:00:00')
+			$list .= $row[4];
+		else
+                        $list .= '';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
+
+		if($row[1] == 'Notes')
+			$list .= '<a href="index.php?module='.$module.'&action='.$editaction.'&return_module='.$parentmodule.'&return_action='.$return_action.'&record='.$row["crmid"].'&filename='.$row[2].'&fileid='.$row['attachmentsid'].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_EDIT'].'</a>  |  ';
+//		$list .= '<a href="index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["crmid"].'&filename='.$row[2].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_DELETE'].'</a>';
+		$del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$return_action.'&record='.$row["crmid"].'&filename='.$row[2].'&return_id='.$_REQUEST["record"];
+                $list .= '<a href="javascript:confirmdelete(\''.$del_param.'\')">'.$app_strings['LNK_DELETE'].'</a>';
+
+		$list .= '</td>';
+
+		$list .= '</tr>';
+		$i++;
+	}
+	
+// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
+// Desc: Close table from 'Y'
+		$list .= ($noofrows>15) ? '</table></div></td></tr>':'';
+// end: Armando Lüscher 14.07.2005 -> scrollableTables
+
+	$list .= '<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
+	$list .= '</table>';
+	echo $list;
+
+}
+}
+
+function getHistory($parentmodule,$query,$id)
+{
+	$parentaction = $_REQUEST['action'];
+	global $theme;
+	$theme_path="themes/".$theme."/";
+	$image_path=$theme_path."images/";
+	require_once ($theme_path."layout_utils.php");
+
+	global $adb;
+	global $mod_strings;
+	global $app_strings;
+
+	//Appending the security parameter
+	global $others_permission_id;
+	global $current_user;
+	$rel_tab_id = getTabid("Activities");
+	$defSharingPermissionData = $_SESSION['defaultaction_sharing_permission_set'];
+	$others_rel_permission_id = $defSharingPermissionData[$rel_tab_id];
+	if($others_rel_permission_id == 3) //Security fix by Don
+	{
+         	$query .= " and crmentity.smownerid in(".$current_user->id .",0)";
+	}
+
+	$result=$adb->query($query);
+	$noofrows = $adb->num_rows($result);
+	
+	$button = '<table cellspacing=0 cellpadding=2><tr><td>';
+	$button .= '</td></tr></table>';
+
+	echo '<br><br>';
+	echo get_form_header($app_strings['LBL_HISTORY'],'', false);
+
+	if($noofrows == 0)
+	{
+		echo $app_strings['LBL_NONE_SCHEDULED'];
+	}
+	else
+	{
+		$list .= '<table border="0" cellpadding="0" cellspacing="0" class="FormBorder" width="100%" >';
+		$list .= '<tr class="ModuleListTitle" height=20>';
+
+		$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="4%" class="moduleListTitle"></td>';
+
+// Armando Lüscher 15.07.2005 -> §scrollableTables
+// Desc: class="blackLine" deleted because of vertical line in title <tr>
+
+//		$list .= $app_strings['LBL_ICON'].'Icon</td>';
+		$class_black="";
+		if($noofrows<15)
+		{
+			$class_black='class="blackLine"';	
+		}
+
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="25%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
+	
+		$list .= $app_strings['LBL_SUBJECT'].'</td>';
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="10%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
+	
+		$list .= $app_strings['LBL_STATUS'].'</td>';
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="18%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
+	
+		$list .= $app_strings['LBL_LIST_CONTACT_NAME'].'</td>';
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="18%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
+
+		$list .= $app_strings['LBL_RELATED_TO'].'</td>';
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="15%" class="moduleListTitle" style="padding:0px 3px 0px 3px;">';
+	
+		$list .= $app_strings['LBL_LAST_MODIFIED'].'</td>';
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td width="10%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">';
+
+		$list .= $app_strings['LBL_ACTION'].'</td>';
+		$list .= '<td WIDTH="1" '.$class_black.'><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+		$list .= '<td class="moduleListTitle">';
+
+		$list .= '</td>';
+		if($noofrows>15)
+		{
+			$list .= '<td style="width:20px">&nbsp;&nbsp&nbsp;&nbsp;</td>';
+		}
+		$list .= '</tr>';
+	
+		$list .= '<tr><td COLSPAN="14" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
+
+// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
+// Desc: 'X'
+//			 Insert new table with 1 cell where all entries are in a new table.
+//			 This cell will be scrollable when too many entries exist
+		$list .= ($noofrows>15) ? '<tr><td colspan="21"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
+// end: Armando Lüscher 14.07.2005 -> §scrollableTablEs
+
+		$i=1;
+		while($row = $adb->fetch_array($result))
+		{
+			if($row['activitytype'] == 'Task')
+			{
+				$activitymode = 'Task';
+				$icon = 'Tasks.gif';
+				$status = $row['status'];
+			}
+			elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting')
+			{
+				$activitymode = 'Events';
+				$icon = 'Activities.gif';
+				$status = $row['eventstatus'];
+			}
+			if ($i%2==0)
+				$trowclass = 'evenListRow';
+			else
+				$trowclass = 'oddListRow';
+	
+			$list .= '<tr class="'. $trowclass.'">';
+	
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="4%"><IMG SRC="'.$image_path.'/'.$icon.'"></td>';
+
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="25%" height="21" style="padding:0px 3px 0px 3px;">';
+			$list .= '<a href="index.php?module=Activities&action=DetailView&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["activityid"] .'&activity_mode='.$activitymode.'&return_id='.$_REQUEST['record'].'" title="'.$row['description'].'">'.$row['subject'].'</a></td>';
+			$list .= '</td>';
+	
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
+			$list .= $status;
+			$list .= '</td>';
+
+			if($row['firstname'] != 'NULL')	
+				$contactname = $row['firstname'].' ';
+			if($ros['lastname'] != 'NULL')
+				$contactname .= $row['lastname'];
+
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="18%" height="21" style="padding:0px 3px 0px 3px;">';
+			$list .= '<a href="index.php?module=Contacts&action=DetailView&return_module='.$parentmodule.'&return_action=DetailView&record='.$row["contactid"].'&return_id='.$_REQUEST['record'].'">'.$contactname;
+			$list .= '</td>';
+
+			$parentname = getRelatedTo('Activities',$result,$i-1);
+
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="18%" height="21" style="padding:0px 3px 0px 3px;">';
+			$list .= $parentname;
+			$list .= '</td>';
+	
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">';
+			$modifiedtime = getDisplayDate($row['modifiedtime']);
+			$list .= $modifiedtime;
+	
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+			$list .= '<td width="10%" height="21" style="padding:0px 3px 0px 3px;">';
+
+			if(isPermitted("Activities",1,$row["activityid"]) == 'yes')
+                	{
+	
+				$list .= '<a href="index.php?module=Activities&action=EditView&return_module='.$parentmodule.'&return_action='.$parentaction.'&activity_mode='.$activitymode.'&record='.$row["activityid"].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_EDIT'].'</a>  |  ';
+			}
+	
+			if(isPermitted("Activities",2,$row["activityid"]) == 'yes')
+                	{
+				$list .= '<a href="index.php?module=Activities&action=Delete&return_module='.$parentmodule.'&return_action='.$parentaction.'&record='.$row["activityid"].'&return_id='.$_REQUEST["record"].'">'.$app_strings['LNK_DELETE'].'</a>';
+			}
+	
+			$list .= '</td>';
+			
+			$list .= '<td WIDTH="1" class="blackLine"><IMG SRC="themes/'.$theme.'/images/blank.gif">';
+
+			$list .= '</tr>';
+			$i++;
+		}
+
+// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
+// Desc: Close table from 
+		$list .= ($noofrows>15) ? '</table></div></td></tr>':'';
+// end: Armando Lüscher 14.07.2005 -> §scrollableTables
+
+		$list .= '<tr><td colspan="14" class="blackLine"></td></tr>';
+
+		$list .= '</table>';
+		echo $list;
+	}
+}
+
+function getPriceBookRelatedProducts($query,$focus,$returnset='')
+{
+	global $adb;
+	global $app_strings;
+	global $mod_strings;
+	global $current_language;
+	$current_module_strings = return_module_language($current_language, 'Products');
+
+	global $list_max_entries_per_page;
+	global $urlPrefix;
+
+
+	global $theme;
+	$pricebook_id = $_REQUEST['record'];
+	$theme_path="themes/".$theme."/";
+	$image_path=$theme_path."images/";
+	require_once($theme_path.'layout_utils.php');
+	$list_result = 	$adb->query($query);
+	$num_rows = $adb->num_rows($list_result);
+	$xtpl=new XTemplate('include/RelatedListView.html');
+	$xtpl->assign("MOD", $mod_strings);
+	$xtpl->assign("APP", $app_strings);
+	$xtpl->assign("IMAGE_PATH",$image_path);
+	echo '<BR>';
+	$other_text = '<table width="100%" border="0" cellpadding="1" cellspacing="0">
+	<form name="selectproduct" method="POST">
+	<tr>
+	<input name="action" type="hidden" value="AddProductsToPriceBook">
+	<input name="module" type="hidden" value="Products">
+	<input name="return_module" type="hidden" value="Products">
+	<input name="return_action" type="hidden" value="PriceBookDetailView">
+	<input name="pricebook_id" type="hidden" value="'.$_REQUEST["record"].'">';
+
+        $other_text .='<td><input title="Select Products" accessyKey="F" class="button" onclick="this.form.action.value=\'AddProductsToPriceBook\';this.form.module.value=\'Products\';this.form.return_module.value=\'Products\';this.form.return_action.value=\'PriceBookDetailView\'" type="submit" name="button" value="'.$app_strings["LBL_SELECT_PRODUCT_BUTTON_LABEL"].'"></td>';
+		$other_text .='</tr></table>';
+
+//Retreive the list from Database
+echo get_form_header($current_module_strings['LBL_LIST_FORM_TITLE'], $other_text, false );
+
+
+//echo $list_query;
+$list_result = $adb->query($query);
+$num_rows = $adb->num_rows($list_result);
+
+//Retreive the List View Table Header
+
+// Armando Lüscher 15.07.2005 -> §scrollableTables
+// Desc: class="blackLine" deleted because of vertical line in title <tr>
+
+//		$list .= $app_strings['LBL_ICON'].'Icon</td>';
+		$class_black="";
+		if($num_rows<15)
+		{
+			$class_black='class="blackLine"';	
+		}
+
+$list_header = '';
+$list_header .= '<tr class="moduleListTitle" height=20>';
+$list_header .= '<td WIDTH="1" class="blackLine"><IMG SRC="'.$image_path.'blank.gif"></td>';
+$list_header .= '<td width="40%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_LIST_PRODUCT_NAME'].'</td>';
+$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
+$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_PRODUCT_CODE'].'</td>';
+$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
+$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_PRODUCT_UNIT_PRICE'].'</td>';
+$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
+$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">'.$mod_strings['LBL_PB_LIST_PRICE'].'</td>';
+$list_header .='<td WIDTH="1" '.$class_black.' NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
+$list_header .= '<td width="15%" class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;">Edit|Del</td>';
+$list_header .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="{IMAGE_PATH}blank.gif"></td>';
+
+$list_header .= '</tr>';
+
+$xtpl->assign("LISTHEADER", $list_header);
+
+$list_body ='';
+// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
+// Desc: 'X'
+//			 Insert new table with 1 cell where all entries are in a new table.
+//			 This cell will be scrollable when too many entries exist
+		$list_body .= ($num_rows>15) ? '<tr><td colspan="12"><div style="overflow:auto;height:315px;width:100%;"><table cellspacing="0" cellpadding="0" border="0" width="100%">':'';
+// end: Armando Lüscher 14.07.2005 -> §scrollableTablEs
+
+for($i=0; $i<$num_rows; $i++)
+{
+	$entity_id = $adb->query_result($list_result,$i,"crmid");
+		if (($i%2)==0)
+			$list_body .= '<tr height=20 class=evenListRow>';
+		else
+			$list_body .= '<tr height=20 class=oddListRow>';
+
+		$unit_price = 	$adb->query_result($list_result,$i,"unit_price");
+		$listprice = $adb->query_result($list_result,$i,"listprice");
+		$field_name=$entity_id."_listprice";
+
+		$list_body .= '<td WIDTH="1" class="blackLine"><IMG SRC="'.$image_path.'blank.gif"></td>';
+		$list_body .= '<td width="40%" height="21" style="padding:0px 3px 0px 3px;">'.$adb->query_result($list_result,$i,"productname").'</td>';
+		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
+		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">'.$adb->query_result($list_result,$i,"productcode").'</td>';
+		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
+		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">'.$unit_price.'</td>';
+		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
+		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;">'.$listprice.'</td>';
+		$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td>';
+		$list_body .= '<td width="15%" height="21" style="padding:0px 3px 0px 3px;"><a href="index.php?module=Products&action=EditListPrice&record='.$entity_id.'&pricebook_id='.$pricebook_id.'&listprice='.$listprice.'">edit</a>&nbsp;|&nbsp;<a href="index.php?module=Products&action=DeletePriceBookProductRel'.$returnset.'&record='.$entity_id.'&pricebook_id='.$pricebook_id.'">del</a></td>';
+	$list_body .='<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="'.$image_path.'blank.gif"></td></tr>';
+	
+}
+// begin: Armando Lüscher 14.07.2005 -> §scrollableTables
+// Desc: Close table from 
+		$list_body .= ($num_rows>15) ? '</table></div></td></tr>':'';
+// end: Armando Lüscher 14.07.2005 -> §scrollableTables
+
+	$list_body .= '<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/'.$theme.'/images//blank.gif"></td></tr>';
+
+//$listview_entries = getListViewEntries($focus,"Products",$list_result,$navigation_array);
+
+$xtpl->assign("LISTENTITY", $list_body);
+
+$xtpl->parse("main");
+$xtpl->out("main");	
+
+}
+
+//echo '</form>';
+?>

Modified: vtigercrm/branches/4.2/include/uifromdbutil.php
==============================================================================
--- vtigercrm/branches/4.2/include/uifromdbutil.php (original)
+++ vtigercrm/branches/4.2/include/uifromdbutil.php Tue Jun 20 22:23:57 2006
@@ -145,8 +145,10 @@
 	$image_path=$theme_path."images/";
 
 	$record = isset($_REQUEST['record']) ? $_REQUEST['record'] : '';
-	$relmodule = $_REQUEST['module'] == $module ? '' : $module;
-	$start = $relmodule.'start';
+	
+//	$relmodule = $_REQUEST['module'] == $module ? '' : $module;
+	$relmodule = '';
+$start = $relmodule.'start';
 	$end_val = $relmodule.'end_val';
 	$first = $relmodule.'first';
 	$end = $relmodule.'end';
@@ -157,6 +159,9 @@
 	$prev = $relmodule.'prev';
 	$dir_name = $_REQUEST['module'];
 
+	
+	
+	
 	$output = '<td align="right">';
 	$output .= '<a href="index.php?module='.$dir_name.'&record='.$record.'&action='.$action_val.$url_qry.'&'.$start.'=1&viewname='.$viewid.'&'.$allflag.'='.$navigation_array[$allflag].'" >'.$navigation_array[$allflag].'</a>&nbsp;';
 	if(($navigation_array[$prev]) != 0) {

Modified: vtigercrm/branches/4.2/include/utils.php
==============================================================================
--- vtigercrm/branches/4.2/include/utils.php (original)
+++ vtigercrm/branches/4.2/include/utils.php Tue Jun 20 22:23:57 2006
@@ -879,19 +879,34 @@
 {
 	global $adb, $vtlog;
 	static $res = null;
-	$vtlog->logthis("module  is ".$module,'info');  
-        
-	if(!is_null($res)) return $res[$module];
-
+	$vtlog->logthis("module is ".$module,'info');
+
+	// if we've already built static variable $res, let's not do it again...
+	if(sizeof($res) > 0)
+	{
+		if(isset($res[$module]))
+		{
+			return $res[$module];
+		}
+		else
+		{
+			return 0;
+		}
+	}
+
+	// ok, we must not have built $res; so let's grab the db data for a
 	$sql = "select tabid, name from tab";
 	$result = $adb->query($sql);
 	$tab_count = $adb->num_rows($result);
-	for($i=0; $i<$tab_count; $i++) {
+
+	for($i=0; $i<$tab_count; $i++)
+	{
 		$tabid = $adb->query_result($result,$i,"tabid");
 		$tabname = $adb->query_result($result, $i, "name");
 		$res[$tabname] = $tabid;
 	}
-	return $res[$module];
+	
+	return isset($res[$module])? $res[$module] : 0;
 }
 
 function getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype)
@@ -1316,33 +1331,29 @@
 	}
 	elseif($uitype == 57)
 	{
-		//if(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id'] != '')
-		//	$value = $_REQUEST['contact_id'];
-
-	       if($value != '')
-               {
-                       $contact_name = getContactName($value);
-               }
-	       elseif(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id'] != '')
-	       {
+		$contact_name = '';
+		
+		if($value != '')
+		{
+			$contact_name = getContactName($value);
+		}
+		elseif(isset($_REQUEST['contact_id']) && $_REQUEST['contact_id'] != '')
+		{
 			if($_REQUEST['module'] == 'Contacts' && $fieldname = 'contact_id')
 			{
-				$contact_name = '';	
+				$contact_name = '';
 			}
 			else
 			{
 				$value = $_REQUEST['contact_id'];
-				$contact_name = getContactName($value);		
+				$contact_name = getContactName($value);
 			}
-			
-	       }
-	
-		//Checking for contacts duplicate
-					 	
+		}
+
 		$custfld .= '<td width="20%" valign="center" class="dataLabel">'.$mod_strings[$fieldlabel].'</td>';
 		$custfld .= '<td width="30%"><input name="contact_name" readonly type="text" value="'.$contact_name.'"><input name="contact_id" type="hidden" value="'.$value.'">&nbsp;<img src="'.$image_path.'select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick=\'return window.open("index.php?module=Contacts&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");\' align="absmiddle" style=\'cursor:hand;cursor:pointer\'>&nbsp;<input type="image" src="'.$image_path.'clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.contact_id.value=\'\';this.form.contact_name.value=\'\';return false;" align="absmiddle" style=\'cursor:hand;cursor:pointer\'></td>';
 	}
-        elseif($uitype == 61 || $uitype == 69)
+	elseif($uitype == 61 || $uitype == 69)
         {
                 global $current_user;
                 if($value != '')
@@ -1653,31 +1664,31 @@
 	}
 	elseif($uitype == 76)
 	{
-
+		$potential_name = '';
 		if($value != '')
-               {
-                       $potential_name = getPotentialName($value);
-               }
-	       elseif(isset($_REQUEST['potential_id']) && $_REQUEST['potential_id'] != '')
-	       {
+		{
+			$potential_name = getPotentialName($value);
+		}
+		elseif(isset($_REQUEST['potential_id']) && $_REQUEST['potential_id'] != '')
+		{
 			$value = $_REQUEST['potental_id'];
 			$potential_name = getPotentialName($value);
-	       }		 	
+		}
 		$custfld .= '<td width="20%" valign="center" class="dataLabel">'.$mod_strings[$fieldlabel].'</td>';
 		$custfld .= '<td width="30%"><input name="potential_name" readonly type="text" value="'.$potential_name.'"><input name="potential_id" type="hidden" value="'.$value.'">&nbsp;<img src="'.$image_path.'select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick=\'return window.open("index.php?module=Potentials&action=Popup&html=Popup_picker&popuptype=specific_potential_account_address&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");\' align="absmiddle" style=\'cursor:hand;cursor:pointer\'>&nbsp;<input type="image" src="'.$image_path.'clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.potential_id.value=\'\';this.form.potential_name.value=\'\';return false;" align="absmiddle" style=\'cursor:hand;cursor:pointer\'></td>';
 	}
 	elseif($uitype == 78)
 	{
-
+		$quote_name = '';
 		if($value != '')
-               {
-                       $quote_name = getQuoteName($value);
-               }
-	       elseif(isset($_REQUEST['quote_id']) && $_REQUEST['quote_id'] != '')
-	       {
+		{
+			$quote_name = getQuoteName($value);
+		}
+		elseif(isset($_REQUEST['quote_id']) && $_REQUEST['quote_id'] != '')
+		{
 			$value = $_REQUEST['quote_id'];
 			$potential_name = getQuoteName($value);
-	       }		 	
+		}
 		$custfld .= '<td width="20%" valign="center" class="dataLabel">'.$mod_strings[$fieldlabel].'</td>';
 		$custfld .= '<td width="30%"><input name="quote_name" readonly type="text" value="'.$quote_name.'"><input name="quote_id" type="hidden" value="'.$value.'">&nbsp;<img src="'.$image_path.'select.gif" alt="Select" title="Select" LANGUAGE=javascript onclick=\'return window.open("index.php?module=Quotes&action=Popup&html=Popup_picker&popuptype=specific&form=EditView","test","width=600,height=400,resizable=1,scrollbars=1");\' align="absmiddle" style=\'cursor:hand;cursor:pointer\'>&nbsp;<input type="image" src="'.$image_path.'clear_field.gif" alt="Clear" title="Clear" LANGUAGE=javascript onClick="this.form.quote_id.value=\'\';this.form.quote_name.value=\'\';return false;" align="absmiddle" style=\'cursor:hand;cursor:pointer\'></td>';
 	}
@@ -1778,7 +1789,13 @@
 	elseif($uitype == 19)
 	{
 		$col_fields[$fieldname]=html_entity_decode(nl2br($col_fields[$fieldname]));
-		$custfld .= '<td width="20%" class="dataLabel" valign="top">'.$mod_strings[$fieldlabel].':</td>';
+		$custfld .= '<td width="20%" class="dataLabel" valign="top">';
+		// not all fields (e.g. Terms & Conditions) have a field label
+		if(isset($mod_strings[$fieldlabel]))
+		{
+			$custfld .= $mod_strings[$fieldlabel].':';
+		}
+		$custfld .= '&nbsp;</td>';
 		$custfld .= '<td colspan="3" valign="top">'.$col_fields[$fieldname].'</td>'; // Armando LC<scher 10.08.2005 -> B'descriptionSpan -> Desc: inserted colspan="3"
 	}
 	elseif($uitype == 20 || $uitype == 21 || $uitype == 22 || $uitype == 24) // Armando LC<scher 11.08.2005 -> B'descriptionSpan -> Desc: removed $uitype == 19 and made an aditional elseif above
@@ -1877,6 +1894,7 @@
         {
                 $custfld .= '<td width="20%" class="dataLabel">'.$mod_strings[$fieldlabel].':</td>';
                 $contact_id = $col_fields[$fieldname];
+                $contact_name = '';
                 if($contact_id != '')
                 {
                         $contact_name = getContactName($contact_id);
@@ -2217,6 +2235,7 @@
         {
                 $custfld .= '<td width="20%" class="dataLabel">'.$mod_strings[$fieldlabel].':</td>';
                 $potential_id = $col_fields[$fieldname];
+				$potential_name = '';
                 if($potential_id != '')
                 {
                         $potential_name = getPotentialName($potential_id);
@@ -2228,6 +2247,7 @@
         {
                 $custfld .= '<td width="20%" class="dataLabel">'.$mod_strings[$fieldlabel].':</td>';
                 $quote_id = $col_fields[$fieldname];
+                $quote_name = '';
                 if($quote_id != '')
                 {
                         $quote_name = getQuoteName($quote_id);
@@ -3049,6 +3069,7 @@
 {
 	global $adb, $theme, $app_strings;
 	$filename = '';
+	$potential_name = '';
 	
 	$noofrows = $adb->num_rows($list_result);
 	$list_header = '<script>
@@ -4597,6 +4618,7 @@
 {
 	global $adb;
 	global $theme;
+	global $app_strings;
 	global $vtlog;
         $theme_path="themes/".$theme."/";
         $image_path=$theme_path."images/";

Modified: vtigercrm/branches/4.2/modules/Accounts/RenderRelatedListUI.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Accounts/RenderRelatedListUI.php (original)
+++ vtigercrm/branches/4.2/modules/Accounts/RenderRelatedListUI.php Tue Jun 20 22:23:57 2006
@@ -19,7 +19,7 @@
 //	$image_path=$theme_path."images/";
 //	require_once ($theme_path."layout_utils.php");
 
-	$hidden .= '<form border="0" action="index.php" method="post" name="form" id="form">';
+	$hidden = '<form border="0" action="index.php" method="post" name="form" id="form">';
 	$hidden .= '<input type="hidden" name="module">';
 	$hidden .= '<input type="hidden" name="mode">';
 	$hidden .= '<input type="hidden" name="account_id" value="'.$id.'">';

Modified: vtigercrm/branches/4.2/modules/Orders/RenderRelatedListUI.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/RenderRelatedListUI.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/RenderRelatedListUI.php Tue Jun 20 22:23:57 2006
@@ -16,7 +16,7 @@
 
 function getHiddenValues($id,$sid='purchaseorderid')
 {
-        $hidden .= '<form border="0" action="index.php" method="post" name="form" id="form">';
+        $hidden = '<form border="0" action="index.php" method="post" name="form" id="form">';
         $hidden .= '<input type="hidden" name="module">';
         $hidden .= '<input type="hidden" name="mode">';
         $hidden .= '<input type="hidden" name="'.$sid.'" value="'.$id.'">';

Modified: vtigercrm/branches/4.2/modules/Orders/SalesOrderDetailView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/SalesOrderDetailView.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/SalesOrderDetailView.php Tue Jun 20 22:23:57 2006
@@ -90,6 +90,7 @@
 $xtpl->assign("BLOCK4", $block_4);
 
 $block_5 = getDetailBlockInformation("SalesOrder",5,$focus->column_fields);
+$cust_fld = '';
 if(trim($block_5) != '')
 {
         $cust_fld = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="formOuterBorder">';

Modified: vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php (original)
+++ vtigercrm/branches/4.2/modules/Orders/SalesOrderListView.php Tue Jun 20 22:23:57 2006
@@ -46,16 +46,17 @@
 $focus = new SalesOrder();
 
 $url_string = '&smodule=SO'; // assigning http url string
-
-if(isset($_REQUEST['query']) && $_REQUEST['query'] != '' && $_REQUEST['query'] == 'true')
+	
+$query = isset($_REQUEST['query'])? $_REQUEST['query'] : '';
+$subject = isset($_REQUEST['subject'])? $_REQUEST['subject'] : '';
+$accountname = isset($_REQUEST['accountname'])? $_REQUEST['accountname'] : '';
+$quotename = isset($_REQUEST['quotename'])? $_REQUEST['quotename'] : '';
+	
+if($query == 'true')
 {
 	$url_string .="&query=true";
-	if (isset($_REQUEST['subject'])) $subject = $_REQUEST['subject'];
-        if (isset($_REQUEST['accountname'])) $accountname = $_REQUEST['accountname'];
-        if (isset($_REQUEST['quotename'])) $quotename = $_REQUEST['quotename'];
 
 	$where_clauses = Array();
-	//$search_query='';
 
 	//Added for Custom Field Search
 	$sql="select * from field where tablename='salesordercf' order by fieldlabel";
@@ -211,7 +212,7 @@
 	<td>';
 if(isPermitted('SalesOrder',2,'') == 'yes')
 {
-	$other_text .=	'<input class="button" type="submit" value="'.$app_strings[LBL_MASS_DELETE].'" onclick="return massDelete()"/>&nbsp;';
+	$other_text .=	'<input class="button" type="submit" value="'.$app_strings['LBL_MASS_DELETE'].'" onclick="return massDelete()"/>&nbsp;';
 }
 
 if($viewid == 0)
@@ -228,9 +229,9 @@
 <span class="sep">|</span>
 <a href="index.php?module=Orders&action=CustomView&smodule=SO" class="link">'.$app_strings['LNK_CV_CREATEVIEW'].'</a>';
 }
-	$other_text .='<td align="right">'.$app_strings[LBL_VIEW].'
+	$other_text .='<td align="right">'.$app_strings['LBL_VIEW'].'
                         <SELECT NAME="view" onchange="showDefaultCustomView(this)">
-                                <OPTION VALUE="0">'.$mod_strings[LBL_ALL].'</option>
+                                <OPTION VALUE="0">'.$mod_strings['LBL_ALL'].'</option>
 				'.$customviewcombo_html.'
                         </SELECT>
 			'.$cvHTML.'
@@ -293,7 +294,7 @@
 $start_rec = $navigation_array['start'];
 $end_rec = $navigation_array['end_val'];
 
-$record_string= $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows;
+$record_string= $app_strings['LBL_SHOWING']." " .$start_rec." - ".$end_rec." " .$app_strings['LBL_LIST_OF'] ." ".$noofrows;
 
 //Retreive the List View Table Header
 if($viewid !='')

Modified: vtigercrm/branches/4.2/modules/Settings/language/en_us.lang.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Settings/language/en_us.lang.php (original)
+++ vtigercrm/branches/4.2/modules/Settings/language/en_us.lang.php Tue Jun 20 22:23:57 2006
@@ -257,6 +257,8 @@
 //Added fields after RC1 - Release
 
 'LBL_MAIL_SERVER_INFO'=>'Mail Server Information',
+
+'LBL_MAIL_UNAME'=>'',
 
 'LBL_OUTGOING_MAIL_SERVER'=>'OutGoing Mail Server',
 

Modified: vtigercrm/branches/4.2/modules/Users/DetailView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/DetailView.php (original)
+++ vtigercrm/branches/4.2/modules/Users/DetailView.php Tue Jun 20 22:23:57 2006
@@ -59,9 +59,11 @@
 $role = fetchUserRole($focus->id);
 $rolename =  getRoleName($role);
 //the user might belong to multiple groups
+$group = '';
+
 if($focus->id != 1)
 {
- $group = fetchUserGroups($focus->id);
+	$group = fetchUserGroups($focus->id);
 }
 $log->info("User detail view");
 
@@ -103,25 +105,22 @@
 	$buttons .= "<td><input title='".$app_strings['LBL_FORUM_SHOW_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_FORUM_SHOW_BUTTON_KEY']."' class='button' onclick=\"this.form.module.value='Users'; this.form.forumDisplay.value='true'; this.form.action.value='DetailView'\" type='submit' name='Display' value=' ".$app_strings['LBL_FORUM_SHOW_BUTTON_LABEL']." '></td>\n";
 }
 */
-if (is_admin($current_user)) 
+if (is_admin($current_user))
 {
 	$buttons .= "<td><input title='".$app_strings['LBL_DUPLICATE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_DUPLICATE_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.isDuplicate.value=true; this.form.return_id.value='".$_REQUEST['record']."';this.form.action.value='EditView'\" type='submit' name='Duplicate' value=' ".$app_strings['LBL_DUPLICATE_BUTTON_LABEL']."'   >&nbsp; </td>\n";
+
 	//done so that only the admin user can see the customize tab button
 	if($_REQUEST['record'] == $current_user->id)
 	{
 		$buttons .= "<td><input title='".$app_strings['LBL_TABCUSTOMISE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_TABCUSTOMISE_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='TabCustomise'; this.form.action.value='TabCustomise'\" type='submit' name='Customise' value=' ".$app_strings['LBL_TABCUSTOMISE_BUTTON_LABEL']." '></td>\n";
 	}
+
 	if($_REQUEST['record'] != $current_user->id)
 	{
-	$buttons .= "<td><input title='".$app_strings['LBL_DELETE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_DELETE_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.return_id.value='$focus->id'; this.form.action.value='UserDeleteStep1'\" type='submit' name='Delete' value='  ".$app_strings['LBL_DELETE_BUTTON_LABEL']."  '></td>\n";
+		$buttons .= "<td><input title='".$app_strings['LBL_DELETE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_DELETE_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='DetailView'; this.form.return_id.value='$focus->id'; this.form.action.value='UserDeleteStep1'\" type='submit' name='Delete' value='  ".$app_strings['LBL_DELETE_BUTTON_LABEL']."  '></td>\n";
 	}
 
-        //$buttons .= "<td><input title='".$app_strings['LBL_ROLES_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_ROLES_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='TabCustomise'; this.form.action.value='ListPermissions'\" type='submit' name='ListPermissions' value=' ".$app_strings['LBL_ROLES_BUTTON_LABEL']." '></td>\n";
-	if($_SESSION['authenticated_user_roleid'] == 'administrator')
-	{
-	 $buttons .= "<td><input title='".$app_strings['LBL_LISTROLES_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_LISTROLES_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='TabCustomise'; this.form.action.value='listroles'; this.form.record.value= '". $current_user->id ."'\" type='submit' name='ListRoles' value=' ".$app_strings['LBL_LISTROLES_BUTTON_LABEL']." '></td>\n";
-	}
-
+	//$buttons .= "<td><input title='".$app_strings['LBL_LISTROLES_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_LISTROLES_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Users'; this.form.return_action.value='TabCustomise'; this.form.action.value='listroles'; this.form.record.value= '". $current_user->id ."'\" type='submit' name='ListRoles' value=' ".$app_strings['LBL_LISTROLES_BUTTON_LABEL']." '></td>\n";
 }
 
  // $buttons .="<td width='100%'></td><TD  align='right' nowrap='nowrap'><a href='".$_SERVER['PHP_SELF'] .'?'.$_SERVER['QUERY_STRING']."&reset_preferences=true' >". $mod_strings['LBL_RESET_PREFERENCES']. " </a></td>";
@@ -167,7 +166,8 @@
 $xtpl->assign("ADDRESS_STATE", $focus->address_state);
 $xtpl->assign("ADDRESS_POSTALCODE", $focus->address_postalcode);
 $xtpl->assign("ADDRESS_COUNTRY", $focus->address_country);
-$xtpl->assign("SIGNATURE", nl2br($focus->signature));
+// signature doesn't exist in the Users class definition
+//$xtpl->assign("SIGNATURE", nl2br($focus->signature));
 $xtpl->assign("MAP_START", nl2br($focus->map_source));
 $xtpl->parse("user_info");
 $xtpl->out("user_info");

Modified: vtigercrm/branches/4.2/modules/Users/EditView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/EditView.php (original)
+++ vtigercrm/branches/4.2/modules/Users/EditView.php Tue Jun 20 22:23:57 2006
@@ -96,7 +96,7 @@
 $xtpl->assign("ADDRESS_STATE", $focus->address_state);
 $xtpl->assign("ADDRESS_POSTALCODE", $focus->address_postalcode);
 $xtpl->assign("ADDRESS_COUNTRY", $focus->address_country);
-$xtpl->assign("SIGNATURE", $focus->signature);
+//$xtpl->assign("SIGNATURE", $focus->signature);
 $xtpl->assign("DESCRIPTION", $focus->description);
 
 $map_options = array('--None--', 'Home', 'Work');
@@ -109,27 +109,13 @@
 $xtpl->assign("MAP_START_OPTIONS", $map_start_options);
 
 $DATE_FORMAT_SELECT_OPTION = '<select name="date_format">';
-		
-               
-if($focus->date_format == 'dd-mm-yyyy')
-{
-	$selected1 = 'selected';
-}
-elseif($focus->date_format == 'mm-dd-yyyy')
-{
-	$selected2 = 'selected';
-}
-elseif($focus->date_format == 'yyyy-mm-dd')
-{
-	$selected3 = 'selected';
-}
-$DATE_FORMAT_SELECT_OPTION .= '<option value="dd-mm-yyyy" '.$selected1.'>';
+$DATE_FORMAT_SELECT_OPTION .= '<option value="dd-mm-yyyy" '.($focus->date_format == 'dd-mm-yyyy'? 'selected' : '') .'>';
 $DATE_FORMAT_SELECT_OPTION .= 'dd-mm-yyyy';
 $DATE_FORMAT_SELECT_OPTION .= '</option>';
-$DATE_FORMAT_SELECT_OPTION .= '<option value="mm-dd-yyyy" '.$selected2.'>';
+$DATE_FORMAT_SELECT_OPTION .= '<option value="mm-dd-yyyy" '.($focus->date_format == 'mm-dd-yyyy'? 'selected' : '').'>';
 $DATE_FORMAT_SELECT_OPTION .= 'mm-dd-yyyy';
 $DATE_FORMAT_SELECT_OPTION .= '</option>';
-$DATE_FORMAT_SELECT_OPTION .= '<option value="yyyy-mm-dd" '.$selected3.'>';
+$DATE_FORMAT_SELECT_OPTION .= '<option value="yyyy-mm-dd" '.($focus->date_format == 'yyyy-mm-dd'? 'selected' : '').'>';
 $DATE_FORMAT_SELECT_OPTION .= 'yyyy-mm-dd';
 $DATE_FORMAT_SELECT_OPTION .= '</option>';	
 $DATE_FORMAT_SELECT_OPTION .= ' </select>';

Modified: vtigercrm/branches/4.2/modules/Users/User.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Users/User.php (original)
+++ vtigercrm/branches/4.2/modules/Users/User.php Tue Jun 20 22:23:57 2006
@@ -53,6 +53,7 @@
 	var $address_country;
 	var $tz;
 	var $holidays;
+	var $map_source;
 	var $namedays;
 	var $workdays;
 	var $weekstart;





More information about the vtigercrm-commits mailing list