From 4b184bf5b1ba276c46717d76ebd94015783c8129 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Fri, 22 Feb 2013 11:15:12 -0500
Subject: [PATCH] Add Answered queue to advanced search

---
 include/ajax.tickets.php      | 3 +++
 include/staff/tickets.inc.php | 5 +++++
 scp/js/scp.js                 | 1 +
 3 files changed, 9 insertions(+)

diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index d1df0f6ca..56093119b 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -112,6 +112,9 @@ class TicketsAjaxAPI extends AjaxController {
             case 'open':
                 $where.=' AND ticket.status="open" ';
                 break;
+            case 'answered':
+                $where.=' AND ticket.status="open" AND ticket.isanswered=1 ';
+                break;
             case 'overdue':
                 $where.=' AND ticket.status="open" AND ticket.isoverdue=1 ';
                 break;
diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php
index f13c22a0c..64cd52cc7 100644
--- a/include/staff/tickets.inc.php
+++ b/include/staff/tickets.inc.php
@@ -555,6 +555,11 @@ $negorder=$order=='DESC'?'ASC':'DESC'; //Negate the sorting..
             <select id="status" name="status">
                 <option value="">&mdash; Any Status &mdash;</option>
                 <option value="open">Open</option>
+                <?php
+                if(!$cfg->showAnsweredTickets()) {?>
+                <option value="answered">Answered</option>
+                <?php
+                } ?>
                 <option value="overdue">Overdue</option>
                 <option value="closed">Closed</option>
             </select>
diff --git a/scp/js/scp.js b/scp/js/scp.js
index cf32e42d8..8ce35149e 100644
--- a/scp/js/scp.js
+++ b/scp/js/scp.js
@@ -369,6 +369,7 @@ $(document).ready(function(){
                 break;
             case 'open':
             case 'overdue':
+            case 'answered':
                 $('select#staffId').find('option:first').attr('selected', 'selected').parent('select');
                 $('select#staffId').attr('disabled','disabled');
                 $('select#assignee').removeAttr('disabled');
-- 
GitLab