$fieldset_data['elements'][] = array('title' => _l('Account'), 'fields' => array(array('type' => module_ticket::can_edit_tickets() ? 'select' : 'html', 'name' => 'ticket_account_id', 'value' => module_ticket::can_edit_tickets() ? $ticket['ticket_account_id'] : friendly_key(module_ticket::get_accounts_rel(), $ticket['ticket_account_id']), 'options' => module_ticket::get_accounts_rel()))); } $fieldset_data['elements'][] = array('title' => _l('Status'), 'fields' => array(array('type' => module_ticket::can_edit_tickets() ? 'select' : 'html', 'name' => 'status_id', 'value' => module_ticket::can_edit_tickets() ? $ticket['status_id'] : friendly_key(module_ticket::get_statuses(), $ticket['status_id']), 'options' => module_ticket::get_statuses()))); if (module_ticket::can_edit_tickets() || module_config::c('ticket_allow_priority_selection', 0)) { $priorities = module_ticket::get_ticket_priorities(); if (!module_ticket::can_edit_tickets() && isset($priorities[_TICKET_PRIORITY_STATUS_ID]) && $ticket['priority'] != _TICKET_PRIORITY_STATUS_ID) { unset($priorities[_TICKET_PRIORITY_STATUS_ID]); } $fieldset_data['elements'][] = array('title' => _l('Priority'), 'fields' => array(array('type' => 'select', 'name' => 'priority', 'value' => $ticket['priority'], 'blank' => false, 'options' => $priorities))); } $fieldset_data['extra_settings'] = array('owner_table' => 'ticket', 'owner_key' => 'ticket_id', 'owner_id' => $ticket['ticket_id'], 'layout' => 'table_row', 'allow_new' => module_extra::can_i('create', 'Tickets'), 'allow_edit' => module_extra::can_i('edit', 'Tickets')); echo module_form::generate_fieldset($fieldset_data); unset($fieldset_data); $done_messages = false; if (class_exists('module_mobile', false)) { if (module_mobile::is_mobile_browser()) { // we're on mobile, display the ticket messages here: $tickets_in_reverse = false; include module_theme::include_ucm('includes/plugin_ticket/pages/ticket_admin_edit_messages.php'); $done_messages = true; } } if ($ticket['user_id']) { if (module_config::c('ticket_other_list_by', 'user') == 'user') { $other_tickets = module_ticket::get_tickets(array('user_id' => $ticket['user_id'])); } else { if (module_config::c('ticket_other_list_by', 'user') == 'customer' && $ticket['customer_id']) { $other_tickets = module_ticket::get_tickets(array('customer_id' => $ticket['customer_id'])); } else { $other_tickets = false; }
function get_display_mode() { if (isset($_REQUEST['display_mode']) && $_REQUEST['display_mode'] != 'iframe' && $_REQUEST['display_mode'] != 'ajax') { $_SESSION['display_mode'] = $_REQUEST['display_mode']; } if (isset($_REQUEST['display_mode'])) { return $_REQUEST['display_mode']; } if (isset($_SESSION['display_mode']) && $_SESSION['display_mode']) { return $_SESSION['display_mode']; } if (class_exists('module_mobile', false)) { if (module_mobile::is_mobile_browser()) { return 'mobile'; } } return 'normal'; }