[Vtigercrm-commits] [vtiger-commits] r4732 - /vtigercrm/trunk/modules/Leads/EditView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Mar 30 01:19:50 EST 2006
Author: saraj
Date: Wed Mar 29 23:19:46 2006
New Revision: 4732
Log:
changes made for duplicate code removal
Modified:
vtigercrm/trunk/modules/Leads/EditView.php
Modified: vtigercrm/trunk/modules/Leads/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Leads/EditView.php (original)
+++ vtigercrm/trunk/modules/Leads/EditView.php Wed Mar 29 23:19:46 2006
@@ -22,10 +22,7 @@
require_once('include/utils/utils.php');
require_once('include/FormValidationUtil.php');
-global $mod_strings;
-global $app_list_strings;
-global $app_strings;
-global $current_user;
+global $mod_strings,$app_strings,$theme;
$focus = new Lead();
$smarty = new vtigerCRM_Smarty;
@@ -53,7 +50,6 @@
$smarty->assign("OP_MODE",$disp_view);
-global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
//retreiving the combo values array
@@ -107,46 +103,11 @@
$lead_tables = Array('leaddetails','crmentity','leadsubdetails','leadaddress','leadscf');
$tabid = getTabid("Leads");
$validationData = getDBValidationData($lead_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");
More information about the vtigercrm-commits
mailing list