[Vtigercrm-commits] [vtiger-commits] r5000 - /vtigercrm/trunk/modules/Settings/CustomFieldList.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri Apr 7 08:49:25 EDT 2006


Author: saraj
Date: Fri Apr  7 06:49:21 2006
New Revision: 5000

Log:
changed to old UI

Modified:
    vtigercrm/trunk/modules/Settings/CustomFieldList.php

Modified: vtigercrm/trunk/modules/Settings/CustomFieldList.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/CustomFieldList.php (original)
+++ vtigercrm/trunk/modules/Settings/CustomFieldList.php Fri Apr  7 06:49:21 2006
@@ -6,42 +6,123 @@
  * The Initial Developer of the Original Code is vtiger.
  * Portions created by vtiger are Copyright (C) vtiger.
  * All Rights Reserved.
-*
+* 
  ********************************************************************************/
-require_once('Smarty_setup.php');
-require_once('modules/Settings/SettingsSubMenu.php');
+
 require_once('include/database/PearDatabase.php');
 require_once('include/CustomFieldUtil.php');
+require_once ($theme_path."layout_utils.php");
 global $mod_strings;
-$smarty=new vtigerCRM_Smarty;
+
+echo get_module_title("Settings", $mod_strings['LBL_MODULE_NAME'].": ".$mod_strings[$_REQUEST['fld_module']].$mod_strings['CustomFields'] , true);
+
+echo '<table width="25%" cellpadding="2" cellspacing="0" border="0">';
+echo '<form action="index.php" method="post" name="new" id="form">';
+echo '<input type="hidden" name="fld_module" value="'.$_REQUEST['fld_module'].'">';
+echo '<input type="hidden" name="module" value="Settings">';
+echo '<input type="hidden" name="parenttab" value="Settings">';
+echo '<input type="hidden" name="mode">';
+echo '<input type="hidden" name="action" value="CreateCustomField">';
+echo '<tr><br>';
+echo '<td><input title="'.$mod_strings['`'].'" accessKey="C" class="button" type="submit" name="NewCustomField" value="'.$mod_strings['NewCustomField'].'"></td>';
+
+if($_REQUEST['fld_module']=="Leads")
+{
+	echo '<td><input title="'.$mod_strings['CUSTOMFIELDMAPPING'].'"  class="button" onclick="this.form.action.value=\'LeadCustomFieldMapping\'" type="submit" name="ListLeadCustomFieldMapping" value="'.$mod_strings['CUSTOMFIELDMAPPING'].'"></td>'; //button for custom field mapping
+}
+
+echo '</tr></form></table>';
+echo '<br>';
+
+$tabid = getTabid($_REQUEST['fld_module']);
 $fld_module = $_REQUEST['fld_module'];
-$smarty->assign("MODULE",$fld_module);
-$smarty->assign("CFENTRIES",getCFListEntries($fld_module));
-$smarty->assign("MOD",$mod_strings);
-global $theme;
-$theme_path="themes/".$theme."/";
-$image_path=$theme_path."images/";
-require_once($theme_path.'layout_utils.php');
-$smarty->assign("IMAGE_PATH", $image_path);
-if($_REQUEST['ajax'] != 'true')
+
+echo getCustomFieldList($tabid,$mod_strings,$fld_module);
+
+
+function getCustomFieldList($tabid, $mod_strings, $fld_module)
 {
-	$module_array=Array('Leads'=>'Leads',
-                        'Accounts'=>'Accounts',
-                        'Contacts'=>'Contacts',
-                        'Potentials'=>'Potentials',
-                        'HelpDesk'=>'HelpDesk',
-                        'Products'=>'Products',
-                        'Vendor'=>'Vendor',
-                        'PriceBook'=>'PriceBook',
-                        'PurchaseOrder'=>'PurchaseOrder',
-                        'SalesOrder'=>'SalesOrder',
-                        'Quotes'=>'Quotes',
-                        'Invoice'=>'Invoice'
-                        );
-	$smarty->assign("MODULES",$module_array);
-	$smarty->display('CustomFieldList.tpl');	
+  global $adb;
+  $dbQuery = "select fieldid,columnname,fieldlabel,uitype,displaytype from field where tabid=".$tabid." and generatedtype=2 order by sequence";
+  $result = $adb->query($dbQuery) or die("Couldn't get file list");
+
+
+$list = '<table border="0" cellpadding="5" cellspacing="1" class="FormBorder" width="60%">';
+
+$list .='<form action="index.php" method="post" name="CustomFieldUpdate" id="form">';
+
+$list .= '<tr height=20>';
+
+$list .= '<td class="ModuleListTitle" width="20%" style="padding:0px 3px 0px 3px;"><div><b>Operation</b></div>';
+
+$list .= '</td>';
+
+$list .= '';
+
+$list .= '<td class="ModuleListTitle" height="21" width="20%" style="padding:0px 3px 0px 3px;"><b>';
+
+$list .= $mod_strings['FieldName'].'</b></td>';
+
+$list .= '<td class="ModuleListTitle" width="20%" style="padding:0px 3px 0px 3px;"><b>';
+
+$list .= $mod_strings['FieldType'].'</b></td>';
+
+$list .= '</tr>';
+
+$i=1;
+while($row = $adb->fetch_array($result))
+{
+
+
+if ($i%2==0)
+$trowclass = 'evenListRow';
+else
+$trowclass = 'oddListRow';
+	$list .= '<tr class="'. $trowclass.'">';
+	
+	$list .= '<td height="21" style="padding:0px 3px 0px 3px;"><div>';
+
+	 $list .= '<a href="javascript:deleteCustomField('.$row["fieldid"].',\''.$fld_module.'\', \''.$row["columnname"].'\', \''.$row["uitype"].'\')">'.$mod_strings['Delete'].'</a>'; 
+	$list .=' | <a href="index.php?module=Settings&action=CreateCustomField&fieldid='.$row["fieldid"].'&tabid='.$tabid.'&uitype='.$row["uitype"].'&fld_module='.$fld_module.'&parenttab=Settings">'.$mod_strings['Edit'].'</a>';
+	
+
+	$list .= '</div></td>';
+
+	
+	$list .= '<td height="21" style="padding:0px 3px 0px 3px;">';
+
+	 $list .= $row["fieldlabel"]; 
+
+	$list .= '</td>';
+        
+
+	$list .= '<td height="21" style="padding:0px 3px 0px 3px;">';
+
+	$fld_type_name = getCustomFieldTypeName($row["uitype"]);
+
+	 $list .= $fld_type_name; 
+
+	$list .= '</td>';
+
+	$list .= '</tr>';
+$i++;
 }
-else
-	$smarty->display('CustomFieldEntries.tpl');
+	$list .= '</form>';
 
+	$list .= '</table>';
+
+	$list .= '<script type="text/javascript">';
+	$list .= 'function deleteCustomField(id, fld_module, colName, uitype)
+	  	  {
+			if(confirm("Are you sure?"))
+			{
+				document.CustomFieldUpdate.action="index.php?module=Settings&action=DeleteCustomField&fld_module="+fld_module+"&fld_id="+id+"&colName="+colName+"&uitype="+uitype
+				document.CustomFieldUpdate.submit()
+		   	}	
+	  	   }';
+	$list .= '</script>';
+	
+
+return $list;
+}
 ?>





More information about the vtigercrm-commits mailing list