[Rt-commit] rt branch 5.0/search-callbacks-count created. rt-5.0.3-77-g7b4f8e3e85

BPS Git Server git at git.bestpractical.com
Thu Aug 11 18:57:29 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/search-callbacks-count has been created
        at  7b4f8e3e85cd729d1c81f2f70d3d2f4cf933c12e (commit)

- Log -----------------------------------------------------------------
commit 7b4f8e3e85cd729d1c81f2f70d3d2f4cf933c12e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Aug 11 14:54:30 2022 -0400

    Provided calculated count as a callback parameter
    
    Generating count requires running the query and this has
    already been done when the callbacks run. Provide the
    count in case it can be useful since the work has already
    been done. This is mostly likely to be useful for callbacks
    that have a different behavior if no tickets are found.

diff --git a/share/html/Search/Results.html b/share/html/Search/Results.html
index e0de84d99f..768b2d5ef6 100644
--- a/share/html/Search/Results.html
+++ b/share/html/Search/Results.html
@@ -51,7 +51,7 @@
 <& /Elements/Tabs &>
 
 % my $DisplayFormat;
-% $m->callback( ARGSRef => \%ARGS, Format => \$Format, DisplayFormat => \$DisplayFormat, CallbackName => 'BeforeResults' );
+% $m->callback( ARGSRef => \%ARGS, Format => \$Format, DisplayFormat => \$DisplayFormat, Count => $count, CallbackName => 'BeforeResults' );
 
 % unless ($ok) {
 %    $msg =~ s{ at .*? line .*}{}s;
@@ -79,7 +79,7 @@
     PassArguments => [qw(Query Format Rows Page Order OrderBy SavedSearchId SavedChartSearchId Class ObjectType ExtraQueryParams), @ExtraQueryParams],
 &>
 % }
-% $m->callback( ARGSRef => \%ARGS, CallbackName => 'AfterResults' );
+% $m->callback( ARGSRef => \%ARGS, Count => $count, CallbackName => 'AfterResults' );
 
 % my %hiddens = (Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order, HideResults => $HideResults, Page => $Page, SavedChartSearchId => $SavedChartSearchId );
 <div align="right" class="refresh">

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list