/** * Static function to display form for the field type * @param string $name * @param string $value * @param string $css * @return html for the form containing the field */ public static function display_field($name, $idfield, $value = '', $css = 'form-control input-sm') { $combo_values = new ComboValues(); $combo_values->get_combo_values($idfield); echo '<select class="' . $css . '" name = "' . $name . '" id="' . $name . '">' . "\n"; if ($combo_values->getNumRows() > 0) { while ($combo_values->next()) { $select = ''; if ($value == $combo_values->combo_value) { $select = 'Selected'; } echo '<option value = "' . $combo_values->combo_option . '" ' . $select . '>' . $combo_values->combo_value . '</option>' . "\n"; } } echo '</select>'; }
/** * Static function to display form for the field type * @param string $name * @param string $value * @param string $css * @return html for the form containing the field */ public static function display_field($name, $idfield, $value = '', $css = '') { $combo_values = new ComboValues(); $combo_values->get_combo_values($idfield); if ($value != '') { $val_to_array = explode(",", $value); } echo '<select class="' . $css . '" name = "' . $name . '[]" id="' . $name . '" size= 5 multiple>' . "\n"; if ($combo_values->getNumRows() > 0) { while ($combo_values->next()) { $select = ''; if ($value != '' && in_array($combo_values->combo_value, $val_to_array)) { $select = 'Selected'; } echo '<option value = "' . $combo_values->combo_option . '" ' . $select . '>' . $combo_values->combo_value . '</option>' . "\n"; } } echo '</select>'; }
$ignore_modules = array(1, 8, 9); if (isset($_GET["cmid"]) && $_GET["cmid"] != '') { $cf_module = (int) $_GET["cmid"]; } else { $cf_module = 3; } $modules_info = $_SESSION["do_module"]->get_modules_with_full_info(); $do_crm_fields->get_pick_multiselect_fields($cf_module); $data_array = array(); if ($do_crm_fields->getNumRows() > 0) { while ($do_crm_fields->next()) { $combo_data = array(); if (in_array($do_crm_fields->idfields, $non_editable_combo_fields)) { continue; } $do_combo_values->get_combo_values($do_crm_fields->idfields); if ($do_combo_values->getNumRows() > 0) { $combo_data = array(); while ($do_combo_values->next()) { $combo_data[] = $do_combo_values->combo_value; } } $data_array[$do_crm_fields->idfields]["field_label"] = $do_crm_fields->field_label; $data_array[$do_crm_fields->idfields]["combo_data"] = $combo_data; } } if (isset($_GET['ajaxreq']) && $_GET['ajaxreq'] == true) { require_once 'view/picklist_entry_view.php'; } else { require_once 'view/picklist_view.php'; }