diff --git a/inc/print_tickets.inc.php b/inc/print_tickets.inc.php index b6204a27..1605a249 100644 --- a/inc/print_tickets.inc.php +++ b/inc/print_tickets.inc.php @@ -1,7 +1,7 @@ $v) +{ + if ($v['use']) + { + $sql_final .= ", `".$k."`"; + } +} + +$sql_final.= " FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE "; // This code will be used to count number of results $sql_count = "SELECT COUNT(*) FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE "; @@ -87,11 +122,15 @@ while ($row = $results->fetch_assoc()) } $status = $possible_status; -foreach ($status as $k => $v) +// Process statuses unless overridden with "s_all" variable +if ( ! hesk_GET('s_all') ) { - if (empty($_GET['s'.$k])) + foreach ($status as $k => $v) { - unset($status[$k]); + if (empty($_GET['s' . $k])) + { + unset($status[$k]); + } } }