diff --git a/inc/print_tickets.inc.php b/inc/print_tickets.inc.php index a28dcc24..1c4c0375 100644 --- a/inc/print_tickets.inc.php +++ b/inc/print_tickets.inc.php @@ -95,7 +95,7 @@ foreach ($status as $k => $v) } } -// How many statuses are we pulling out of the database? +// How many statuses are we pulling out of the database?\ $tmp = count($status); // Do we need to search by status? @@ -105,11 +105,16 @@ if ( $tmp < $totalStatuses ) if ($tmp == 0) { $status = $possible_status; - unset($status[3]); - } + $resolvedSql = "SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `IsClosed` = 1"; + $resolvedRS = hesk_dbQuery($resolvedSql); + while ($row = $resolvedRS->fetch_assoc()) + { + unset($status[$row['ID']]); + } + } - // Add to the SQL - $sql .= " AND `status` IN ('" . implode("','", array_keys($status) ) . "') "; + // Add to the SQL + $sql .= " AND `status` IN ('" . implode("','", array_keys($status) ) . "') "; } // --> TICKET PRIORITY diff --git a/inc/show_search_form.inc.php b/inc/show_search_form.inc.php index e143b8fc..6745925c 100644 --- a/inc/show_search_form.inc.php +++ b/inc/show_search_form.inc.php @@ -33,18 +33,16 @@ *******************************************************************************/ /* Check if this is a valid include */ -if (!defined('IN_SCRIPT')) {die('Invalid attempt');} - +if (!defined('IN_SCRIPT')) {die('Invalid attempt');} if ( ! isset($status) ) { - $status = array( - 0 => 'NEW', - 1 => 'WAITING REPLY', - 2 => 'REPLIED', - #3 => 'RESOLVED (CLOSED)', - 4 => 'IN PROGRESS', - 5 => 'ON HOLD', - ); + $status = array(); + //-- We don't want to check statuses that are considered "closed" + $statusRS = hesk_dbQuery('SELECT `ID`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0'); + while ($row = $statusRS->fetch_assoc()) + { + $status[$row['ID']] = $row['ShortNameContentKey']; + } } if ( ! isset($priority) ) @@ -114,14 +112,31 @@ $more2 = empty($_GET['more2']) ? 0 : 1;
- | - | - |
- | - | + fetch_assoc()) + { + if ($rowCounter > 3) + { + echo ' |
'.$hesklang[$row['ShortNameContentKey']].' | '; + + $rowCounter++; + } + ?>