コード例 #1
0
$module_array = getCustomFieldSupportedModules();
$cfimagecombo = array($image_path . "text.gif", $image_path . "number.gif", $image_path . "percent.gif", $image_path . "currency.gif", $image_path . "date.gif", $image_path . "email.gif", $image_path . "phone.gif", $image_path . "picklist.gif", $image_path . "url.gif", $image_path . "checkbox.gif", $image_path . "text.gif", $image_path . "picklist.gif");
$cftextcombo = array($mod_strings['Text'], $mod_strings['Number'], $mod_strings['Percent'], $mod_strings['Currency'], $mod_strings['Date'], $mod_strings['Email'], $mod_strings['Phone'], $mod_strings['PickList'], $mod_strings['LBL_URL'], $mod_strings['LBL_CHECK_BOX'], $mod_strings['LBL_TEXT_AREA'], $mod_strings['LBL_MULTISELECT_COMBO']);
$smarty->assign("MODULES", $module_array);
$smarty->assign("CFTEXTCOMBO", $cftextcombo);
$smarty->assign("CFIMAGECOMBO", $cfimagecombo);
if ($_REQUEST['fld_module'] != '') {
    $fld_module = vtlib_purify($_REQUEST['fld_module']);
} elseif ($_REQUEST['formodule'] != '') {
    $fld_module = vtlib_purify($_REQUEST['formodule']);
} else {
    $fld_module = 'Leads';
}
$smarty->assign("MODULE", $fld_module);
if ($fld_module == 'Calendar') {
    $smarty->assign("CFENTRIES", getCFListEntries($fld_module));
} else {
    $smarty->assign("CFENTRIES", getCFLeadMapping($fld_module));
}
if (isset($_REQUEST["duplicate"]) && $_REQUEST["duplicate"] == "yes") {
    $error = getTranslatedString('ERR_CUSTOM_FIELD_WITH_NAME', 'Settings') . vtlib_purify($_REQUEST["fldlabel"]) . ' ' . getTranslatedString('ERR_ALREADY_EXISTS', 'Settings') . ' ' . getTranslatedString('ERR_SPECIFY_DIFFERENT_LABEL', 'Settings');
    $smarty->assign("DUPLICATE_ERROR", $error);
}
if ($_REQUEST['mode'] != '') {
    $mode = vtlib_purify($_REQUEST['mode']);
}
$smarty->assign("MODE", $mode);
if ($_REQUEST['ajax'] != 'true') {
    $smarty->display(vtlib_getModuleTemplate('Vtiger', 'CustomFieldList.tpl'));
} else {
    $smarty->display(vtlib_getModuleTemplate('Vtiger', 'CustomFieldEntries.tpl'));
コード例 #2
0
global $app_strings;
$smarty = new CRMSmarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_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);
$multifieldid = $_REQUEST["multifieldid"];
$fieldinfo = getMultiFieldInfo($multifieldid, false);
$smarty->assign("FieldInfo", $fieldinfo);
$tab_mod_strings = return_module_language($current_language, $fieldinfo['modulename']);
$smarty->assign("CMOD", $tab_mod_strings);
$smarty->assign("FieldInfo", $fieldinfo);
$smarty->assign("CFENTRIES", getCFListEntries($fieldinfo["fields"], $multifieldid, $tab_mod_strings));
$smarty->display('Settings/EditMultiCustomField.tpl');
/**
 * Function to get customfield entries
 * @param string $module - Module name
 * return array  $cflist - customfield entries
 */
function getCFListEntries($fields, $multifieldid, $tab_mod_strings)
{
    global $adb;
    global $theme;
    global $mod_strings;
    global $app_strings;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    //$dbQuery = "select fieldid,columnname,fieldlabel,uitype,displaytype from ec_field where tabid=".$tabid." and generatedtype=2 order by sequence";