/** * 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'; }
* @author Abhik Chakraborty */ include_once "config.php"; $idmodule = (int) $_GET["idmodule"]; $referrar = $_GET["referrar"]; $idfields = (int) $_GET["sqrecord"]; $do_custom_fields = new CustomFields(); $do_custom_fields->getId($idfields); $field_validation = $do_custom_fields->field_validation; $field_validation_data = array(); if ($field_validation != '') { $field_validation_data = json_decode($field_validation, true); } if ($do_custom_fields->field_type == 5 || $do_custom_fields->field_type == 6) { $do_combo_values = new ComboValues(); $do_combo_values->get_combo_values($idfields); $pick_data = ''; while ($do_combo_values->next()) { $pick_data .= $do_combo_values->combo_value . "\n"; //adding new lines for the text area in pick options } } $allow = true; $e_add = new Event("CustomFields->eventEditCustomField"); echo '<form class="form-horizontal" id="CustomFields__eventEditCustomField" name="CustomFields__eventEditCustomField" action="/eventcontroler.php" method="post">'; echo $e_add->getFormEvent(); ?> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>