[freeside-commits] branch FREESIDE_3_BRANCH updated. f545571ead3feee00e99e0947a2346c5369c9836

Ivan ivan at 420.am
Wed Feb 8 16:22:33 PST 2017


The branch, FREESIDE_3_BRANCH has been updated
       via  f545571ead3feee00e99e0947a2346c5369c9836 (commit)
       via  60cad42d5098f9d55d9215e3d87a234eaaa7dc2e (commit)
       via  6063323400b7721c71d89d3cc39355153fc3bf2b (commit)
      from  9f3d40d71b076c664b38c1cfa4b60c12d42c473a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f545571ead3feee00e99e0947a2346c5369c9836
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Feb 8 16:22:07 2017 -0800

    fix slight mistake in "fix ticketing system error on bootstrap of new install" -- revert to RT 4.0 style query

diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index 35917c3..37a4e84 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -25,7 +25,12 @@ if ($enabled) {
     # if there are no tickets the current user could see, always hide it
     my $AnyTickets = RT::Tickets->new($CurrentUser);
     foreach my $status (qw(resolved rejected deleted)) {
-      $AnyTickets->LimitStatus( OPERATOR => '!=', VALUE => $status );
+      $AnyTickets->RT::SearchBuilder::Limit(
+        FIELD => 'Status',
+        OPERATOR => '!=',
+        ENTRYAGGREGATOR => 'AND',
+        VALUE => $status,
+      );
     }
     $enabled = 0 if $AnyTickets->Count == 0;
 

commit 60cad42d5098f9d55d9215e3d87a234eaaa7dc2e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Feb 8 16:02:18 2017 -0800

    fix ticketing system error on bootstrap of new install

diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index 9e9020a..35917c3 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -19,22 +19,21 @@ my $UnrepliedTickets;
 if ($enabled) {
   my $class = 'RT::Search::UnrepliedTickets';
   load_class($class);
-  my $session = FS::TicketSystem->session;
-  my $CurrentUser = $session->{CurrentUser};
-  # if there are no tickets the current user could see, always hide it
-  my $AnyTickets = RT::Tickets->new($CurrentUser);
-  foreach my $status (qw(resolved rejected deleted)) {
-    $AnyTickets->RT::SearchBuilder::Limit(
-      FIELD => 'Status',
-      OPERATOR => '!=',
-      ENTRYAGGREGATOR => 'AND',
-      VALUE => $status,
-    );
-  }
-  $enabled = 0 if $AnyTickets->Count == 0;
+  my $session = eval { FS::TicketSystem->session; };
+  if ( $session ) {
+    my $CurrentUser = $session->{CurrentUser};
+    # if there are no tickets the current user could see, always hide it
+    my $AnyTickets = RT::Tickets->new($CurrentUser);
+    foreach my $status (qw(resolved rejected deleted)) {
+      $AnyTickets->LimitStatus( OPERATOR => '!=', VALUE => $status );
+    }
+    $enabled = 0 if $AnyTickets->Count == 0;
 
-  $UnrepliedTickets = RT::Tickets->new($CurrentUser);
-  my $search = $class->new(TicketsObj => $UnrepliedTickets);
-  $search->Prepare;
+    $UnrepliedTickets = RT::Tickets->new($CurrentUser);
+    my $search = $class->new(TicketsObj => $UnrepliedTickets);
+    $search->Prepare;
+  } else {
+    $enabled = 0;
+  }
 }
 </%init>

commit 6063323400b7721c71d89d3cc39355153fc3bf2b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Feb 8 12:20:28 2017 -0800

    fix ticketing system error on bootstrap of new install

diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index bd2464a..829a787 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -818,7 +818,7 @@ $config_menu{'Billing'} = [ \%config_billing, '' ]
   if keys %config_billing;
 $config_menu{'Ticketing'} = [ \%config_ticketing, '' ]
   if $conf->config('ticket_system')
-  && FS::TicketSystem->access_right(\%session, 'ShowConfigTab');
+  && eval { FS::TicketSystem->access_right(\%session, 'ShowConfigTab') };
 $config_menu{'Network Monitoring'} = [ \%config_nms, '' ]
   if $curuser->access_right('Configure network monitoring')
   && $conf->config('network_monitoring_system') eq 'Torrus_Internal';

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

Summary of changes:
 httemplate/elements/menu.html           |    2 +-
 httemplate/elements/notify-tickets.html |   36 +++++++++++++++++--------------
 2 files changed, 21 insertions(+), 17 deletions(-)




More information about the freeside-commits mailing list