From 9c68254528b6f2c7d8c1921b452fa56064783782 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 2 Mar 2008 04:06:06 +0000 Subject: import rt 3.4.6 --- rt/html/Elements/Quicksearch | 57 +++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 16 deletions(-) (limited to 'rt/html/Elements/Quicksearch') diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch index 4acbc204d..5f1af0f2d 100644 --- a/rt/html/Elements/Quicksearch +++ b/rt/html/Elements/Quicksearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software -%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,17 +43,44 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -
-<&|/Widgets/TitleBox, title => loc("Quick search"), bodyclass => "", - titleright => loc("Edit"), titleright_href => $RT::WebPath.'/Prefs/Quicksearch.html' &> -<& /Elements/QueueSummary, - cache => 'quick_search_queues', - queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} }, - conditions => [ {cond => "Status = 'new'", name => loc ('new') }, - {cond => "Status = 'open'", name => loc ('open') }, - {cond => "Status = 'stalled'", name => loc ('stalled') }] &> - -
+<& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> + + + + + + + + +<%PERL> +my $i; +while (my $queue = $Queues->Next) { + next unless ($queue->CurrentUserHasRight('ShowTicket')); + + my $qid = $queue->Id; + my $new_q = "Queue = '$qid' AND Status = 'new'"; + my $open_q = "Queue = '$qid' AND Status = 'open'"; + my $all_q = "Queue = '$qid' AND (Status = 'open' OR Status = 'new')"; + + $Tickets->FromSQL($open_q); + my $open = $Tickets->Count(); + + $Tickets->FromSQL($new_q); + my $new = $Tickets->Count(); + + $i++; + + + + + + +% } +
<&|/l&>Queue<&|/l&>New<&|/l&>Open
<%$queue->Name%><%$new%><%$open%>
+<& /Elements/TitleBoxEnd &> + <%INIT> -my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {}); +my $Queues = RT::Queues->new($session{'CurrentUser'}); +$Queues->UnLimit(); +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); -- cgit v1.2.1