[Vtigercrm-commits] [vtiger-commits] r4731 - /vtigercrm/trunk/modules/Invoice/EditView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Mar 30 01:16:58 EST 2006


Author: saraj
Date: Wed Mar 29 23:16:52 2006
New Revision: 4731

Log:
changes made for duplicate code removal

Modified:
    vtigercrm/trunk/modules/Invoice/EditView.php

Modified: vtigercrm/trunk/modules/Invoice/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Invoice/EditView.php (original)
+++ vtigercrm/trunk/modules/Invoice/EditView.php Wed Mar 29 23:16:52 2006
@@ -266,48 +266,13 @@
 $invoice_tables = Array('invoice','invoicebillads','invoiceshipads'); 
  $tabid = getTabid("Invoice");
  $validationData = getDBValidationData($invoice_tables,$tabid);
- $fieldName = '';
- $fieldLabel = '';
- $fldDataType = '';
-
- $rows = count($validationData);
- foreach($validationData as $fldName => $fldLabel_array)
- {
-   if($fieldName == '')
-   {
-     $fieldName="'".$fldName."'";
-   }
-   else
-   {
-     $fieldName .= ",'".$fldName ."'";
-   }
-   foreach($fldLabel_array as $fldLabel => $datatype)
-   {
-	if($fieldLabel == '')
-	{
-			
-     		$fieldLabel = "'".$fldLabel ."'";
-	}		
-      else
-       {
-      $fieldLabel .= ",'".$fldLabel ."'";
-        }
- 	if($fldDataType == '')
-         {
-      		$fldDataType = "'".$datatype ."'";
-    	}
-	 else
-        {
-       		$fldDataType .= ",'".$datatype ."'";
-     	}
-   }
- }
+ $data = split_validationdataArray($validationData);
 $category = getParentTab();
 $smarty->assign("CATEGORY",$category);
 
-$smarty->assign("VALIDATION_DATA_FIELDNAME",$fieldName);
-$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$fldDataType);
-$smarty->assign("VALIDATION_DATA_FIELDLABEL",$fieldLabel);
+$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
+$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
+$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
 
 if($focus->mode == 'edit')
 $smarty->display("salesEditView.tpl");





More information about the vtigercrm-commits mailing list