[Vtigercrm-commits] [vtiger-commits] r4736 - /vtigercrm/trunk/modules/Products/EditView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Mar 30 02:20:26 EST 2006
Author: saraj
Date: Thu Mar 30 00:20:21 2006
New Revision: 4736
Log:
changes made for duplicate code removal
Modified:
vtigercrm/trunk/modules/Products/EditView.php
Modified: vtigercrm/trunk/modules/Products/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Products/EditView.php (original)
+++ vtigercrm/trunk/modules/Products/EditView.php Thu Mar 30 00:20:21 2006
@@ -127,43 +127,7 @@
$product_tables = Array('products','productcf','productcollaterals');
$validationData = getDBValidationData($product_tables);
- $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);
if($errormessage==2)
{
$msg =$mod_strings['LBL_MAXIMUM_LIMIT_ERROR'];
@@ -194,10 +158,9 @@
$smarty->assign("ERROR_MESSAGE",$errormessage);
}
-$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