[freeside-commits] branch FREESIDE_3_BRANCH updated. 7fe7e453b6eb0778235e0a64e3b654f673d1caa2

Mark Wells mark at 420.am
Wed Nov 23 15:14:33 PST 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  7fe7e453b6eb0778235e0a64e3b654f673d1caa2 (commit)
       via  ba7725a58fa6c211df8614f57973f49d71d64b80 (commit)
      from  8afd2939872ed96d7e205e85c183a5cf20c36ef6 (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 7fe7e453b6eb0778235e0a64e3b654f673d1caa2
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Nov 23 15:14:24 2016 -0800

    3.x fix

diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index 16a04f4..9e9020a 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -24,7 +24,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 ba7725a58fa6c211df8614f57973f49d71d64b80
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Nov 23 15:00:20 2016 -0800

    hide the notify-tickets widget if there are no tickets, or if the user turns it off, #73490

diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
index e661737..16a04f4 100644
--- a/httemplate/elements/notify-tickets.html
+++ b/httemplate/elements/notify-tickets.html
@@ -14,12 +14,20 @@
 use Class::Load 'load_class';
 
 my $enabled = $FS::TicketSystem::system eq 'RT_Internal';
+$enabled = 0 if $FS::CurrentUser::CurrentUser->option('hide_notify_tickets');
 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->LimitStatus( OPERATOR => '!=', VALUE => $status );
+  }
+  $enabled = 0 if $AnyTickets->Count == 0;
+
   $UnrepliedTickets = RT::Tickets->new($CurrentUser);
   my $search = $class->new(TicketsObj => $UnrepliedTickets);
   $search->Prepare;
diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html
index f5b5bb6..0134e6a 100644
--- a/httemplate/pref/pref-process.html
+++ b/httemplate/pref/pref-process.html
@@ -56,6 +56,7 @@ unless ( $error ) { # if ($access_user) {
                       enable_mask_clipboard_hack dashboard_customers
                       customer_view_emails
                       printtofit
+                      hide_notify_tickets
                       email_address
                       snom-ip snom-username snom-password
                       vonage-fromnumber vonage-username vonage-password
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index a6b5ba7..f6ad36a 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -150,7 +150,14 @@ Interface
   </TR>
 
   <TR>
-    <TH ALIGN="right">How many recently-modified customers displayed on dashboard</TH>
+    <TH ALIGN="right"><% emt('Hide notification of new ticket activity') %></TH>
+    <TD ALIGN="left">
+      <INPUT TYPE="checkbox" NAME="hide_notify_tickets" VALUE="1" <% $curuser->option('hide_notify_tickets') ? 'CHECKED' : '' %>>
+    </TD>
+  </TR>
+
+  <TR>
+    <TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
     <TD ALIGN="left" COLSPAN=2>
       <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
     </TD>

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

Summary of changes:
 httemplate/elements/notify-tickets.html |   13 +++++++++++++
 httemplate/pref/pref-process.html       |    1 +
 httemplate/pref/pref.html               |    9 ++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list