[Vtigercrm-commits] [vtiger-commits] r7243 - in /vtigercrm/branches/4.2: data/CRMEntity.php include/uifromdbutil.php include/utils.php modules/Accounts/DetailView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sun Jun 18 14:18:36 EDT 2006


Author: jrydbeck
Date: Sun Jun 18 12:18:31 2006
New Revision: 7243

Log:
Bug #748 - Account list, edit, & save do not produce notices during common-path execution

Modified:
    vtigercrm/branches/4.2/data/CRMEntity.php
    vtigercrm/branches/4.2/include/uifromdbutil.php
    vtigercrm/branches/4.2/include/utils.php
    vtigercrm/branches/4.2/modules/Accounts/DetailView.php

Modified: vtigercrm/branches/4.2/data/CRMEntity.php
==============================================================================
--- vtigercrm/branches/4.2/data/CRMEntity.php (original)
+++ vtigercrm/branches/4.2/data/CRMEntity.php Sun Jun 18 12:18:31 2006
@@ -260,9 +260,12 @@
     global $adb;
     global $current_user;
     global $vtlog;	
+    global $insertion_mode;
+    
+    $assigntype = isset($_REQUEST['assigntype'])? $_REQUEST['assigntype'] : '';
                 
     $date_var = $adb->database->DBTimeStamp(date('YmdHis'));
-    if($_REQUEST['assigntype'] == 'T')
+    if($assigntype == 'T')
     {
       $ownerid= 0;
     }
@@ -413,6 +416,10 @@
 	  $vtlog->logthis("function insertIntoCrmEntity ".$module.' table name ' .$table_name,'info');  
 	  global $adb;
 	  $insertion_mode = $this->mode;
+	  
+	  $assigntype = isset($_REQUEST['assigntype'])? $_REQUEST['assigntype'] : '';
+	  $groupname = isset($_REQUEST['assigned_group_name'])? $_REQUEST['assigned_group_name'] : '';
+
 
 	  //Checkin whether an entry is already is present in the table to update
 	  if($insertion_mode == 'edit')
@@ -546,7 +553,7 @@
 			  {
 				  global $current_user;
 				  $fldvalue = date("l dS F Y h:i:s A").' by '.$current_user->user_name;
-				  if($_REQUEST['assigned_group_name'] != '' && $_REQUEST['assigntype'] == 'T')
+				  if($_REQUEST['assigned_group_name'] != '' && $assigntype == 'T')
                                   {
                                         $group_name = $_REQUEST['assigned_group_name'];
                                   }
@@ -626,10 +633,8 @@
 
 		  	$adb->query($sql1); 
 		  }
-
-		  if($_REQUEST['assigntype'] == 'T')
+		  if($assigntype == 'T')
 		  {
-			  $groupname = $_REQUEST['assigned_group_name'];
 			  //echo 'about to update lead group relation';
 			  if($module == 'Leads' && $table_name == 'leaddetails')
 			  {
@@ -676,26 +681,23 @@
 	  {	
 		  $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")";
 		  $adb->query($sql1); 
-		  $groupname = $_REQUEST['assigned_group_name'];
-		//Fix ref to undefined variable during lead import -mikefedyk
-		if (isset($_REQUEST['assigntype']))
-		{
-		  if($_REQUEST['assigntype'] == 'T' && $table_name == 'leaddetails')
+
+		  if($assigntype == 'T' && $table_name == 'leaddetails')
 		  {
 			  if($table_name == 'leaddetails')
 			  {
 				  insert2LeadGroupRelation($this->id,$groupname);
 			  }
 		  }
-		  elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'activity') 
+		  elseif($assigntype == 'T' && $table_name == 'activity') 
 		  {
 			  insert2ActivityGroupRelation($this->id,$groupname);
 		  }
-		  elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'troubletickets') 
+		  elseif($assigntype == 'T' && $table_name == 'troubletickets') 
 		  {
 			  insert2TicketGroupRelation($this->id,$groupname);
 		  }
-		}
+		
 	  }
 
   }
@@ -944,7 +946,7 @@
 
   function save($module_name) 
   {
-	global $vtlog;
+	global $vtlog, $migration;
 	$vtlog->logthis("module name is ".$module_name,'debug');  
     //GS Save entity being called with the modulename as parameter
       $this->saveentity($module_name,$migration);

Modified: vtigercrm/branches/4.2/include/uifromdbutil.php
==============================================================================
--- vtigercrm/branches/4.2/include/uifromdbutil.php (original)
+++ vtigercrm/branches/4.2/include/uifromdbutil.php Sun Jun 18 12:18:31 2006
@@ -24,6 +24,8 @@
         $result = $adb->query($sql);
 	$noofrows = $adb->num_rows($result);
 	$output='';
+	$mvAdd_flag = false;
+
 	if (($module == 'Accounts' || $module == 'Contacts' || $module == 'Quotes' || $module == 'Orders' || $module == 'SalesOrder'|| $module == 'Invoice') && $block == 2)
 	{
 		global $vtlog;
@@ -48,8 +50,12 @@
 		$output .= '<tr>';
 		$custfld = getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype);
 		$output .= $custfld;	
+		
 		if ($mvAdd_flag == true)
-		$output .= $moveAddress;
+		{
+			$output .= $moveAddress;
+		}
+		
 		$mvAdd_flag = false;
 		$i++;
 		if($i<$noofrows)

Modified: vtigercrm/branches/4.2/include/utils.php
==============================================================================
--- vtigercrm/branches/4.2/include/utils.php (original)
+++ vtigercrm/branches/4.2/include/utils.php Sun Jun 18 12:18:31 2006
@@ -1162,12 +1162,15 @@
         }
 	elseif($uitype == 51 || $uitype == 50 || $uitype == 73)
 	{
-		if($_REQUEST['convertmode'] != 'update_quote_val' && $_REQUEST['convertmode'] != 'update_so_val')
+		$convertmode = isset($_REQUEST['convertmode']) ? $_REQUEST['convertmode'] : '';
+		
+		if($convertmode != 'update_quote_val' && $convertmode != 'update_so_val')
 		{
                 	if(isset($_REQUEST['account_id']) && $_REQUEST['account_id'] != '')
                         	$value = $_REQUEST['account_id'];	
 		}
-
+		
+		$account_name = '';
 		if($value != '')
 		{		
 			$account_name = getAccountName($value);	
@@ -1787,6 +1790,7 @@
 	elseif($uitype == 51 || $uitype == 50 || $uitype == 73)
 	{
 		$account_id = $col_fields[$fieldname];
+		$account_name = '';
 		if($account_id != '')
 		{
 			$account_name = getAccountName($account_id);

Modified: vtigercrm/branches/4.2/modules/Accounts/DetailView.php
==============================================================================
--- vtigercrm/branches/4.2/modules/Accounts/DetailView.php (original)
+++ vtigercrm/branches/4.2/modules/Accounts/DetailView.php Sun Jun 18 12:18:31 2006
@@ -83,6 +83,7 @@
 $xtpl->assign("BLOCK3", $block_3);
 
 $block_5 = getDetailBlockInformation("Accounts",5,$focus->column_fields);
+$cust_fld = '';
 if(trim($block_5) != '')
 {
         $cust_fld = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="formOuterBorder">';
@@ -140,9 +141,10 @@
 	//$tempVal = mysql_fetch_array($wordTemplateResult);
 	$tempCount = $adb->num_rows($wordTemplateResult);
 	$tempVal = $adb->fetch_array($wordTemplateResult);
+	$optionString = '';
 	for($templateCount=0;$templateCount<$tempCount;$templateCount++)
 	{
-		$optionString .="<option value=\"".$tempVal["templateid"]."\">" .$tempVal["filename"] ."</option>";
+		$optionString ="<option value=\"".$tempVal["templateid"]."\">" .$tempVal["filename"] ."</option>";
 		$tempVal = $adb->fetch_array($wordTemplateResult);
 		//$tempVal = mysql_fetch_array($wordTemplateResult);
 	}





More information about the vtigercrm-commits mailing list