[Vtigercrm-commits] [vtiger-commits] r6464 - /vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri May 26 09:59:31 EDT 2006
Author: saraj
Date: Fri May 26 07:59:23 2006
New Revision: 6464
Log:
changes made to fix customfield issue
Modified:
vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php
Modified: vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php (original)
+++ vtigercrm/trunk/modules/Settings/AddCustomFieldToDB.php Fri May 26 07:59:23 2006
@@ -236,6 +236,10 @@
{
$custfld_fieldid=$adb->getUniqueID("field");
}
+ else
+ {
+ $custfld_fieldid= $_REQUEST['fieldid'];
+ }
$custfld_sequece=$adb->getUniqueId("customfield_sequence");
$blockid ='';
@@ -256,19 +260,22 @@
$adb->query($query);
}
//Inserting values into profile2field tables
- $sql1 = "select * from profile";
- $sql1_result = $adb->query($sql1);
- $sql1_num = $adb->num_rows($sql1_result);
- for($i=0; $i<$sql1_num; $i++)
- {
- $profileid = $adb->query_result($sql1_result,$i,"profileid");
- $sql2 = "insert into profile2field values(".$profileid.", ".$tabid.", ".$custfld_fieldid.", 0, 1)";
- $adb->query($sql2);
- }
-
- //Inserting values into def_org tables
- $sql_def = "insert into def_org_field values(".$tabid.", ".$custfld_fieldid.", 0, 1)";
- $adb->query($sql_def);
+ if($_REQUEST['fieldid'] == '')
+ {
+ $sql1 = "select * from profile";
+ $sql1_result = $adb->query($sql1);
+ $sql1_num = $adb->num_rows($sql1_result);
+ for($i=0; $i<$sql1_num; $i++)
+ {
+ $profileid = $adb->query_result($sql1_result,$i,"profileid");
+ $sql2 = "insert into profile2field values(".$profileid.", ".$tabid.", ".$custfld_fieldid.", 0, 1)";
+ $adb->query($sql2);
+ }
+
+ //Inserting values into def_org tables
+ $sql_def = "insert into def_org_field values(".$tabid.", ".$custfld_fieldid.", 0, 1)";
+ $adb->query($sql_def);
+ }
if($fldType == 'Picklist' || $fldType == 'MultiSelectCombo')
More information about the vtigercrm-commits
mailing list