X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FQueueSummaryByLifecycle;h=da31ebb5919b2688f016500958a9ebc5cd003121;hp=1410e82efa21a8e2f2aec4a91ef744525b814005;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500 diff --git a/rt/share/html/Elements/QueueSummaryByLifecycle b/rt/share/html/Elements/QueueSummaryByLifecycle index 1410e82ef..da31ebb59 100644 --- a/rt/share/html/Elements/QueueSummaryByLifecycle +++ b/rt/share/html/Elements/QueueSummaryByLifecycle @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -66,20 +66,16 @@ for my $queue (@queues) { next if lc($queue->{Lifecycle} || '') ne lc $lifecycle->Name; $i++; - my $name = $queue->{Name}; - $name =~ s/(['\\])/\\$1/g; - my $queue_cond = "Queue = '$name' AND "; - my $all_q = $queue_cond . '(' . join( " OR ", map "Status = '$_'", @cur_statuses ) . ')'; - <% $queue->{Name} %> + <% $queue->{Name} %> % for my $status (@cur_statuses) { - "><% $data->{$queue->{id}}->{$status } || '-' %> + <% $data->{$queue->{id}}->{lc $status} || '-' %> % } @@ -87,6 +83,31 @@ for my $queue (@queues) { % } <%INIT> +my $build_search_link = sub { + my ($queue_name, $extra_query) = @_; + $queue_name =~ s/(['\\])/\\$1/g; #' + + return RT->Config->Get('WebPath') + . "/Search/Results.html?Query=" + . $m->interp->apply_escapes("Queue = '$queue_name' AND $extra_query", 'u'); +}; + +my $link_all = sub { + my ($queue, $all_statuses) = @_; + return $build_search_link->($queue->{Name}, "(".join(" OR ", map "Status = '$_'", @$all_statuses).")"); +}; + +my $link_status = sub { + my ($queue, $status) = @_; + return $build_search_link->($queue->{Name}, "Status = '$status'"); +}; + +$m->callback( + CallbackName => 'LinkBuilders', + build_search_link => \$build_search_link, + link_all => \$link_all, + link_status => \$link_status, +); my $Queues = RT::Queues->new( $session{'CurrentUser'} ); $Queues->UnLimit();