[Bps-public-commit] rt-extension-jsgantt branch, master, updated. 1.05-3-gdc6dcf4

? sunnavy sunnavy at bestpractical.com
Fri Jul 17 15:14:02 EDT 2020


The branch, master has been updated
       via  dc6dcf4e795ed6db8e92e43ecdfc83182f027ce4 (commit)
       via  b70f6849294a934a9c487fbb452a866eb1c52063 (commit)
      from  b987793f6274dfe9a54df120e82b9ee4b9b62c9a (commit)

Summary of changes:
 html/Callbacks/JSGantt/Elements/Tabs/Privileged | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit b70f6849294a934a9c487fbb452a866eb1c52063
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jul 18 02:56:33 2020 +0800

    Show "Gantt Chart" menu for ticket searches only
    
    In RT 5, transaction/asset searches are also in /Search/

diff --git a/html/Callbacks/JSGantt/Elements/Tabs/Privileged b/html/Callbacks/JSGantt/Elements/Tabs/Privileged
index 27bb1fb..0a7f6a6 100644
--- a/html/Callbacks/JSGantt/Elements/Tabs/Privileged
+++ b/html/Callbacks/JSGantt/Elements/Tabs/Privileged
@@ -48,7 +48,7 @@
 <%INIT>
 my $request_path = $HTML::Mason::Commands::r->path_info;
 
-if ( $request_path =~ qr{^/Search/} ) {
+if ( $request_path =~ qr{^/Search/} && (!$DECODED_ARGS->{Class} || $DECODED_ARGS->{Class} eq 'RT::Tickets') ) {
     if ( $request_path =~ qr{^/Search/JSGantt.html} && $DECODED_ARGS->{Ticket} ) {
         PageMenu->child( 'gantt' => title => loc('Gantt Chart'), path => '/Search/JSGantt.html?Ticket=' . $DECODED_ARGS->{Ticket} );
     }

commit dc6dcf4e795ed6db8e92e43ecdfc83182f027ce4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jul 18 03:13:07 2020 +0800

    Current ticket search has a different session name in RT 5.0

diff --git a/html/Callbacks/JSGantt/Elements/Tabs/Privileged b/html/Callbacks/JSGantt/Elements/Tabs/Privileged
index 0a7f6a6..c448491 100644
--- a/html/Callbacks/JSGantt/Elements/Tabs/Privileged
+++ b/html/Callbacks/JSGantt/Elements/Tabs/Privileged
@@ -53,7 +53,7 @@ if ( $request_path =~ qr{^/Search/} && (!$DECODED_ARGS->{Class} || $DECODED_ARGS
         PageMenu->child( 'gantt' => title => loc('Gantt Chart'), path => '/Search/JSGantt.html?Ticket=' . $DECODED_ARGS->{Ticket} );
     }
     elsif ( $request_path !~ qr{^/Search/Simple.html$} || $DECODED_ARGS->{q} ) {
-        my $current_search = $session{"CurrentSearchHash"} || {};
+        my $current_search = $session{"CurrentSearchHash-RT::Tickets"} || $session{"CurrentSearchHash"} || {};
         my $query = $DECODED_ARGS->{'Query'} || $current_search->{'Query'};
         if ( $query ) {
             PageMenu->child( 'gantt' => title => loc('Gantt Chart'), path => '/Search/JSGantt.html?Query=' . $query );

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


More information about the Bps-public-commit mailing list