[Rt-commit] rt branch, 4.2/notify-owner-or-adminccs, created. rt-4.2.4-70-g2a6ac1c

Kevin Falcone falcone at bestpractical.com
Fri May 30 18:09:24 EDT 2014


The branch, 4.2/notify-owner-or-adminccs has been created
        at  2a6ac1ce06c278fd31755b7eb9ff0b5753a1379e (commit)

- Log -----------------------------------------------------------------
commit 2a6ac1ce06c278fd31755b7eb9ff0b5753a1379e
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri May 30 15:05:45 2014 -0400

    New "Notify Owner or AdminCcs" Scrip Action
    
    Useful if you want to keep AdminCcs in the loop about a ticket until an
    Owner is assigned and then want them to stop getting email.  Nothing
    uses it by default.
    
    The smallest code override I came up with was to lie in Argument for
    Notify, so we just return Owner or AdminCc for "who to notify" depending
    on the Owner of the ticket.  Doesn't handle the case where you set an
    Owner during a reply because of update ordering on Display.html.

diff --git a/docs/UPGRADING-4.2 b/docs/UPGRADING-4.2
index cb8b2c3..a6ee547 100644
--- a/docs/UPGRADING-4.2
+++ b/docs/UPGRADING-4.2
@@ -329,4 +329,13 @@ which is not listed as an option.  RT 4.2.4 also includes enhancements
 to the Queue admin page for ___Approvals to prevent editing things which
 might cause problems.
 
+=head1 UPGRADING FROM 4.2.5 AND EARLIER
+
+RT 4.2.6 includes a new Scrip Action "Notify Owner or AdminCc". This
+action will send the given correspondence to the Owner, if not Nobody,
+otherwise it will notify the AdminCcs. If using this, you will likely
+want to modify or remove the Notify Owner and AdminCcs scrip to avoid
+duplicate notifications. This Scrip Action is not used in any default
+Scrips at this time.
+
 =cut
diff --git a/etc/initialdata b/etc/initialdata
index 3de65f4..dd1daf5 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -62,6 +62,10 @@
       Description => 'Sends mail to the Owner and administrative Ccs',    # loc
       ExecModule  => 'Notify',
       Argument    => 'Owner,AdminCc' },
+    { Name        => 'Notify Owner or AdminCcs',                         # loc
+      Description => 'Sends mail to the Owner if set, otherwise administrative Ccs',    # loc
+      ExecModule  => 'NotifyOwnerOrAdminCc',
+    },
     { Name        => 'Notify Requestors and Ccs as Comment',              # loc
       Description => 'Send mail to requestors and Ccs as a comment',      # loc
       ExecModule  => 'NotifyAsComment',
diff --git a/etc/upgrade/4.2.6/content b/etc/upgrade/4.2.6/content
new file mode 100644
index 0000000..e17c5ea
--- /dev/null
+++ b/etc/upgrade/4.2.6/content
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+
+our @ScripActions = (
+    { Name        => 'Notify Owner or AdminCcs',                         # loc
+      Description => 'Sends mail to the Owner if set, otherwise administrative Ccs',    # loc
+      ExecModule  => 'NotifyOwnerOrAdminCc',
+    },
+);
diff --git a/lib/RT/Action/NotifyOwnerOrAdminCc.pm b/lib/RT/Action/NotifyOwnerOrAdminCc.pm
new file mode 100644
index 0000000..b99c7d9
--- /dev/null
+++ b/lib/RT/Action/NotifyOwnerOrAdminCc.pm
@@ -0,0 +1,76 @@
+# BEGIN BPS TAGGED BLOCK {{{
+#
+# COPYRIGHT:
+#
+# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
+#                                          <sales at bestpractical.com>
+#
+# (Except where explicitly superseded by other copyright notices)
+#
+#
+# LICENSE:
+#
+# This work is made available to you under the terms of Version 2 of
+# the GNU General Public License. A copy of that license should have
+# been provided with this software, but in any event can be snarfed
+# from www.gnu.org.
+#
+# This work is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 or visit their web page on the internet at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+#
+#
+# CONTRIBUTION SUBMISSION POLICY:
+#
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+#
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+#
+# END BPS TAGGED BLOCK }}}
+
+package RT::Action::NotifyOwnerOrAdminCc;
+
+use strict;
+use warnings;
+
+use base qw(RT::Action::Notify);
+
+use Email::Address;
+
+=head1 Notify Owner or AdminCc
+
+If the owner of this ticket is Nobody, notify the AdminCcs.  Otherwise, only notify the Owner.
+
+=cut
+
+sub Argument {
+    my $self = shift;
+    my $ticket = $self->TicketObj;
+    if ($ticket->Owner == RT->Nobody->id) {
+        return 'AdminCc';
+    } else {
+        return 'Owner';
+    }
+}
+
+RT::Base->_ImportOverlays();
+
+1;

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


More information about the rt-commit mailing list