[Vtigercrm-commits] [vtiger-commits] r4725 - /vtigercrm/trunk/modules/Campaigns/EditView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Mar 30 00:54:39 EST 2006


Author: saraj
Date: Wed Mar 29 22:54:35 2006
New Revision: 4725

Log:
changes made for duplicate code removal

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

Modified: vtigercrm/trunk/modules/Campaigns/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/EditView.php (original)
+++ vtigercrm/trunk/modules/Campaigns/EditView.php Wed Mar 29 22:54:35 2006
@@ -91,47 +91,11 @@
 $campaign_tables = Array('campaign','crmentity');
 $tabid = getTabid("Campaigns");
 $validationData = getDBValidationData($campaign_tables,$tabid);
-$fieldName = '';
-$fieldLabel = '';
-$fldDataType = '';
+$data = split_validationdataArray($validationData);
 
-$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 ."'";
-		}
-	}
-}
-
-$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");
 else





More information about the vtigercrm-commits mailing list