[Vtigercrm-commits] [vtiger-commits] r4435 - /vtigercrm/trunk/include/CustomFieldUtil.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri Mar 24 09:21:57 EST 2006
Author: saraj
Date: Fri Mar 24 07:21:52 2006
New Revision: 4435
Log:
changes made for customfield edit
Modified:
vtigercrm/trunk/include/CustomFieldUtil.php
Modified: vtigercrm/trunk/include/CustomFieldUtil.php
==============================================================================
--- vtigercrm/trunk/include/CustomFieldUtil.php (original)
+++ vtigercrm/trunk/include/CustomFieldUtil.php Fri Mar 24 07:21:52 2006
@@ -65,6 +65,10 @@
elseif($uitype == 21)
{
$fldname = 'Text Area';
+ }
+ elseif($uitype == 33)
+ {
+ $fldname = 'Multi-Select Combo Box';
}
return $fldname;
}
@@ -394,4 +398,71 @@
}
}
+function getCustomFieldData($tab,$id,$datatype)
+{
+ global $adb;
+ $query = "select * from field where tabid=".$tab." and fieldid=".$id;
+ $result = $adb->query($query);
+ $return_data=$adb->fetch_array($result);
+ return $return_data[$datatype];
+}
+
+function getFldTypeandLengthValue($label,$typeofdata)
+{
+ if($label == 'Text')
+ {
+ $types = explode("~",$typeofdata);
+ $data_array=array('0',$types[3]);
+ $fieldtype = implode(";",$data_array);
+ }
+ elseif($label == 'Number')
+ {
+ $types = explode("~",$typeofdata);
+ $data_decimal = explode(",",$types[2]);
+ $data_array=array('1',$data_decimal[0],$data_decimal[1]);
+ $fieldtype = implode(";",$data_array);
+ }
+ elseif($label == 'Percent')
+ {
+ $types = explode("~",$typeofdata);
+ $data_array=array('2','5',$types[3]);
+ $fieldtype = implode(";",$data_array);
+ }
+ elseif($label == 'Currency')
+ {
+ $types = explode("~",$typeofdata);
+ $data_decimal = explode(",",$types[2]);
+ $data_array=array('3',$data_decimal);
+ $fieldtype = implode(";",$data_array);
+ }
+ elseif($label == 'Date')
+ {
+ $fieldtype = '4';
+ }
+ elseif($label == 'Email')
+ {
+ $fieldtype = '5';
+ }
+ elseif($label == 'Phone')
+ {
+ $fieldtype = '6';
+ }
+ elseif($label == 'PickList')
+ {
+ $fieldtype = '7';
+ }
+ elseif($label == 'Url')
+ {
+ $fieldtype = '8';
+ }
+ elseif($label == 'Checkbox')
+ {
+ $fieldtype = '9';
+ }
+ elseif($label == 'Text Area')
+ {
+ $fieldtype = '10';
+ }
+ return $fieldtype;
+}
?>
More information about the vtigercrm-commits
mailing list