Ticket Statuses - the steps a ticket goes through. The five ITFlow * has (New, Open, On Hold, Resolved, Closed) and your own - Waiting on * Vendor, Scheduled, Parts Ordered. Each row shows the status as it looks, * what it is for, how many tickets are in it, whether the SLA's resolution * clock runs in it and what a client's reply does to a ticket in it. In use * are in the order the pickers and the board show them, and can be dragged * into another; switched off ones are kept, but can't be picked. The work is * in functions/ticket_status.php; the handlers are admin/post/ticket_status.php. */ // Default Column Sortby Filter - the order the pickers and the board show them in $sort = "ticket_status_order"; $order = "ASC"; require_once "includes/inc_all_admin.php"; $builtins = ticketStatusBuiltIns(); $views = [ '' => ['label' => 'In use', 'icon' => 'fa-check-circle', 'where' => 'ticket_status_active = 1', 'title' => 'In the pickers and on the board'], 'off' => ['label' => 'Switched off', 'icon' => 'fa-power-off', 'where' => 'ticket_status_active = 0', 'title' => 'Kept, but can\'t be picked'], ]; $show = (string) ($_GET['show'] ?? ''); $show = isset($views[$show]) ? $show : ''; // Only these sort - an unknown column would take the page down $sortable_columns = [ 'ticket_status_order' => "ticket_status_order $order, ticket_status_id ASC", 'ticket_status_name' => "ticket_status_name $order", 'tickets' => "n_tickets $order, ticket_status_order ASC", 'ticket_status_pauses_sla' => "ticket_status_pauses_sla $order, ticket_status_order ASC", ]; if (!isset($sortable_columns[$sort])) { $sort = 'ticket_status_order'; } $filters = "(ticket_status_name LIKE '%$q%'" . (ticketStatusColumnsReady() ? " OR ticket_status_description LIKE '%$q%'" : '') . ")"; $sql = mysqli_query($mysqli, "SELECT SQL_CALC_FOUND_ROWS " . ticketStatusColumnsSql() . ", (SELECT COUNT(*) FROM tickets WHERE ticket_status = ticket_status_id AND ticket_archived_at IS NULL) AS n_tickets FROM ticket_statuses WHERE $filters AND {$views[$show]['where']} ORDER BY {$sortable_columns[$sort]} LIMIT $record_from, $record_to"); $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $counts = mysqli_fetch_row(mysqli_query($mysqli, "SELECT " . implode(', ', array_map(function ($view) { return "COALESCE(SUM({$view['where']}), 0)"; }, $views)) . " FROM ticket_statuses WHERE $filters")); $view_counts = array_combine(array_keys($views), $counts); // Dragging into order: the ones in use, in their order, with nothing searched $can_reorder = $show === '' && $sort === 'ticket_status_order' && $order === 'ASC' && $q === '' && $num_rows[0] > 1; $sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) { return '' . $label . ($sort === $column ? " $order_icon" : '') . ''; }; $pill_url = function ($view) { return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view])); }; $csrf = $_SESSION['csrf_token']; ?>

Ticket Statuses

"> > ' : ''; $clock_html = $ticket_status_id === TICKET_STATUS_CLOSED ? 'Stopped' : ($paused ? 'Paused' : 'Runs'); $reply_html = $ticket_status_id === TICKET_STATUS_CLOSED ? 'Can\'t reply' : '' . ([TICKET_STATUS_NEW => 'Opens it', TICKET_STATUS_OPEN => 'Stays Open', TICKET_STATUS_RESOLVED => 'Reopens it'][$ticket_status_id] ?? $reply['short']) . ''; ?>
Order When the client replies
Built in
0
Drag them into the order the status pickers and the ticket board show them in.
Clear the search to drag them into order.
'ticket statuses', 'icon' => 'fa-info-circle', 'filtered' => $q !== '', 'views' => ['show'], 'view' => $show === 'off' ? [ 'title' => 'None switched off', 'icon' => 'fa-power-off', 'text' => 'A status you switch off is kept here - it can\'t be picked, and comes off the board.', ] : [], 'text' => 'The steps a ticket goes through - add your own, like Waiting on Vendor or Scheduled.', 'actions' => [['label' => 'New Status', 'modal' => 'modals/ticket_status/ticket_status_add.php']], ]; require_once "../includes/filter_footer.php"; ?>