X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fhtml%2FElements%2FQuicksearch;h=4acbc204d33ce7eac85b476e4042e8810c6fcc1d;hp=d54f72e88808c34cf0451da0630195f3a4fdc733;hb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4;hpb=a513c0bef534d05f03c1242831b6f3be19b97dae diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch index d54f72e88..4acbc204d 100644 --- a/rt/html/Elements/Quicksearch +++ b/rt/html/Elements/Quicksearch @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -43,46 +45,17 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> - - - - - - - - -<%PERL> -my $i; -while (my $queue = $Queues->Next) { - next unless ($queue->CurrentUserHasRight('ShowTicket')); - - my $name = $queue->Name; - $name =~ s|(['\\])|\\$1|g; - - my $new_q = "Queue = '$name' AND Status = 'new'"; - my $open_q = "Queue = '$name' AND Status = 'open'"; - my $all_q = "Queue = '$name' 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 &> - +
+<&|/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') }] &> + +
<%INIT> -my $Queues = RT::Queues->new($session{'CurrentUser'}); -$Queues->UnLimit(); -my $Tickets = RT::Tickets->new($session{'CurrentUser'}); +my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});