function getByModule_ColumnsHTML($module, $columnslist, $selected = "") { $columnsList = getByModule_ColumnsList($module, $columnslist, $selected); return generateSelectColumnsHTML($columnsList, $module); }
function getByModule_ColumnsHTML($module, $columnslist, $selected = "") { global $vtiger_current_version; if (version_compare($vtiger_current_version, '5.3.0') >= 0) { $columnsList = getByModule_ColumnsList($module, $columnslist, $selected); return generateSelectColumnsHTML($columnsList, $module); } else { global $oCustomView, $current_language, $theme; global $app_list_strings; $advfilter = array(); $mod_strings = return_specified_module_language($current_language, $module); $check_dup = array(); foreach ($oCustomView->module_list[$module] as $key => $value) { $advfilter = array(); $label = $key; if (isset($columnslist[$module][$key])) { foreach ($columnslist[$module][$key] as $field => $fieldlabel) { if (!in_array($fieldlabel, $check_dup)) { if (isset($mod_strings[$fieldlabel])) { if ($selected == $field) { $advfilter_option['value'] = $field; $advfilter_option['text'] = $mod_strings[$fieldlabel]; $advfilter_option['selected'] = "selected"; } else { $advfilter_option['value'] = $field; $advfilter_option['text'] = $mod_strings[$fieldlabel]; $advfilter_option['selected'] = ""; } } else { if ($selected == $field) { $advfilter_option['value'] = $field; $advfilter_option['text'] = $fieldlabel; $advfilter_option['selected'] = "selected"; } else { $advfilter_option['value'] = $field; $advfilter_option['text'] = $fieldlabel; $advfilter_option['selected'] = ""; } } $advfilter[] = $advfilter_option; $check_dup[] = $fieldlabel; } } $advfilter_out[$label] = $advfilter; } } // Special case handling only for Calendar moudle - Not required for other modules. if ($module == 'Calendar') { $finalfield = array(); $finalfield1 = array(); $finalfield2 = array(); $newLabel = $mod_strings['LBL_CALENDAR_INFORMATION']; if (isset($advfilter_out[$mod_strings['LBL_TASK_INFORMATION']])) { $finalfield1 = $advfilter_out[$mod_strings['LBL_TASK_INFORMATION']]; } if (isset($advfilter_out[$mod_strings['LBL_EVENT_INFORMATION']])) { $finalfield2 = $advfilter_out[$mod_strings['LBL_EVENT_INFORMATION']]; } $finalfield[$newLabel] = array_merge($finalfield1, $finalfield2); if (isset($advfilter_out[$mod_strings['LBL_CUSTOM_INFORMATION']])) { $finalfield[$mod_strings['LBL_CUSTOM_INFORMATION']] = $advfilter_out[$mod_strings['LBL_CUSTOM_INFORMATION']]; } $advfilter_out = $finalfield; } return $advfilter_out; } }