[Vtigercrm-commits] [vtiger-commits] r4909 - /vtigercrm/trunk/include/utils/CommonUtils.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Apr 5 07:15:00 EDT 2006


Author: saraj
Date: Wed Apr  5 05:14:56 2006
New Revision: 4909

Log:
Added Quick Create Function - ahmed

Modified:
    vtigercrm/trunk/include/utils/CommonUtils.php

Modified: vtigercrm/trunk/include/utils/CommonUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/CommonUtils.php (original)
+++ vtigercrm/trunk/include/utils/CommonUtils.php Wed Apr  5 05:14:56 2006
@@ -1520,4 +1520,48 @@
 
 	return $filepath;
 }
+
+
+
+function QuickCreate($module)
+{
+    global $adb;
+    global $mod_strings;
+
+$tabid = getTabid($module);
+$category = getParentTab();
+$quickcreate_query = "select * from field where quickcreate=0 and tabid = ".$tabid." order by quickcreatesequence";
+$result = $adb->query($quickcreate_query);
+$noofrows = $adb->num_rows($result);
+
+for($i=0; $i<$noofrows; $i++)
+{
+      $fieldtablename = $adb->query_result($result,$i,'tablename');
+      $fieldcolname = $adb->query_result($result,$i,"columnname");
+      $uitype = $adb->query_result($result,$i,"uitype");
+      $fieldname = $adb->query_result($result,$i,"fieldname");
+      $fieldlabel = $adb->query_result($result,$i,"fieldlabel");
+      $maxlength = $adb->query_result($result,$i,"maximumlength");
+      $generatedtype = $adb->query_result($result,$i,"generatedtype");
+      $custfld = getOutputHtml($uitype, $fieldname, $fieldlabel, $maxlength, $col_fields,$generatedtype,$module);
+      //echo '<pre>';print_r($custfld);echo '</pre>';
+      $qcreate_arr[]=$custfld;
+}
+for ($i=0,$j=0;$i<count($qcreate_arr);$i=$i+2,$j++)
+{
+       $key1=$qcreate_arr[$i];
+       if(is_array($qcreate_arr[$i+1]))
+       {
+               $key2=$qcreate_arr[$i+1];
+       }
+       else
+       {
+                $key2 =array();
+       }
+                $return_data[$j]=array(0 => $key1,1 => $key2);
+}
+																        return $return_data;
+}
+
+
 ?>





More information about the vtigercrm-commits mailing list