[Rt-commit] rt branch, 4.4/user-ticket-counts, created. rt-4.4.1-123-g59eb230
Shawn Moore
shawn at bestpractical.com
Mon Dec 5 12:06:45 EST 2016
The branch, 4.4/user-ticket-counts has been created
at 59eb2300a920a0b07bd15fa4008d9fe51b29a41a (commit)
- Log -----------------------------------------------------------------
commit 59eb2300a920a0b07bd15fa4008d9fe51b29a41a
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Mon Dec 5 17:05:29 2016 +0000
Respect ShowSearchResultCount for user summary searches
This mirrors the changes made for homepage searches with
b854b45012c5be2cebcceca9d6847f3b21ef61cc
Fixes: T#177158
diff --git a/share/html/User/Elements/TicketList b/share/html/User/Elements/TicketList
index dbcb5e3..a38a3b4 100644
--- a/share/html/User/Elements/TicketList
+++ b/share/html/User/Elements/TicketList
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
% if ( $TitleBox ) {
- <& /Widgets/TitleBoxStart, title => $Title, title_href => $url, class => $Class &>
+ <& /Widgets/TitleBoxStart, title => $Title, title_raw => $title_raw, title_href => $url, class => $Class &>
% } else {
<span class="label"><a href="<% $url %>"><% $Title %>:</a></span>
% }
@@ -100,6 +100,18 @@ my $url = RT->Config->Get('WebPath') . '/Search/Results.html?';
Order => $QueryProperties{'Order'},
);
+my $title_raw;
+if ($ShowCount) {
+ my $tickets = RT::Tickets->new( $session{'CurrentUser'} );
+ $tickets->FromSQL($QueryProperties{Query});
+ my $count = $tickets->CountAll();
+
+ $title_raw = '<span class="results-count">' . loc('(Found [quant,_1,ticket,tickets])', $count) . '</span>';
+
+ # don't repeat the search in CollectionList
+ $QueryProperties{Collection} = $tickets;
+ $QueryProperties{TotalFound} = $count;
+}
</%INIT>
<%ARGS>
$Title => ''
@@ -112,4 +124,5 @@ $Description => ''
$TitleBox => 0
$Format => ''
$ShowHeader => 0
+$ShowCount => RT->Config->Get('ShowSearchResultCount')
</%ARGS>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list