[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-341-g9eb6181
Shawn Moore
shawn at bestpractical.com
Wed May 10 13:36:26 EDT 2017
The branch, 4.4-trunk has been updated
via 9eb6181f26d56ee8e7db3859f95d411bfbb98d34 (commit)
via ff484be8ea2de5c6f52df48e5d41f093c3adaaff (commit)
from 93b6ebaef455378ac7d30567d6bd24cf622265a4 (commit)
Summary of changes:
docs/customizing/scrip_conditions_and_action.pod | 271 +++++++++++++++++++++
docs/images/create-setowner-action.png | Bin 0 -> 134415 bytes
docs/images/status-change-condition.png | Bin 0 -> 145629 bytes
lib/RT.pm | 1 +
lib/RT/ScripAction.pm | 23 +-
lib/RT/ScripCondition.pm | 23 +-
.../ModifyDates.html => Admin/Actions/Create.html} | 66 +++--
.../Templates.html => Actions/Display.html} | 29 ++-
.../Actions/Elements/EditBasics} | 41 ++--
.../Elements/ShowBasics} | 47 ++--
.../Admin/{Assets/Catalogs => Actions}/Modify.html | 67 +++--
share/html/Admin/{ => Actions}/autohandler | 5 +-
.../Modify.html => Conditions/Create.html} | 69 ++++--
.../CustomField.html => Conditions/Display.html} | 42 ++--
.../Conditions/Elements/EditBasics} | 67 ++---
.../Conditions/Elements/ShowBasics} | 46 ++--
.../{Assets/Catalogs => Conditions}/Modify.html | 66 +++--
share/html/Admin/{ => Conditions}/autohandler | 5 +-
.../Admin/Elements/{EditTemplates => EditActions} | 111 ++++-----
.../Elements/{EditTemplates => EditConditions} | 111 ++++-----
.../Admin/Global/{Scrips.html => Actions.html} | 4 +-
.../Admin/Global/{Scrips.html => Conditions.html} | 4 +-
.../{RT__Template => RT__ScripAction}/ColumnMap | 21 +-
.../{RT__Template => RT__ScripCondition}/ColumnMap | 21 +-
share/html/Elements/Tabs | 28 +++
25 files changed, 786 insertions(+), 382 deletions(-)
create mode 100644 docs/customizing/scrip_conditions_and_action.pod
create mode 100644 docs/images/create-setowner-action.png
create mode 100644 docs/images/status-change-condition.png
copy share/html/{Ticket/ModifyDates.html => Admin/Actions/Create.html} (65%)
copy share/html/Admin/{Queues/Templates.html => Actions/Display.html} (76%)
copy share/html/{Elements/EditPassword => Admin/Actions/Elements/EditBasics} (73%)
copy share/html/Admin/{Tools/Shredder/Elements/PluginArguments => Actions/Elements/ShowBasics} (77%)
copy share/html/Admin/{Assets/Catalogs => Actions}/Modify.html (62%)
copy share/html/Admin/{ => Actions}/autohandler (94%)
copy share/html/Admin/{Assets/Catalogs/Modify.html => Conditions/Create.html} (62%)
copy share/html/Admin/{Queues/CustomField.html => Conditions/Display.html} (75%)
copy share/html/{Errors/WebRemoteUser/Wrapper => Admin/Conditions/Elements/EditBasics} (68%)
copy share/html/{Elements/EditPassword => Admin/Conditions/Elements/ShowBasics} (73%)
copy share/html/Admin/{Assets/Catalogs => Conditions}/Modify.html (61%)
copy share/html/Admin/{ => Conditions}/autohandler (94%)
copy share/html/Admin/Elements/{EditTemplates => EditActions} (51%)
copy share/html/Admin/Elements/{EditTemplates => EditConditions} (50%)
copy share/html/Admin/Global/{Scrips.html => Actions.html} (94%)
copy share/html/Admin/Global/{Scrips.html => Conditions.html} (94%)
copy share/html/Elements/{RT__Template => RT__ScripAction}/ColumnMap (88%)
copy share/html/Elements/{RT__Template => RT__ScripCondition}/ColumnMap (88%)
- Log -----------------------------------------------------------------
commit ff484be8ea2de5c6f52df48e5d41f093c3adaaff
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue May 9 14:52:35 2017 -0400
Core admin conditions and actions extension
diff --git a/docs/customizing/scrip_conditions_and_action.pod b/docs/customizing/scrip_conditions_and_action.pod
new file mode 100644
index 0000000..b4c6257
--- /dev/null
+++ b/docs/customizing/scrip_conditions_and_action.pod
@@ -0,0 +1,271 @@
+=head1 Scrip Conditions & Actions
+
+The core building blocks of scrips in RT are the conditions and actions
+you select when configuring the scrip. A condition defines the criteria
+for an action to run in the context of the current transaction. The
+result is true or false: if true, the condition is satisfied and the
+action runs, if false, the action is skipped. Actions define something
+to be done when a condition is true and they can be anything you
+can capture in code: sending a notification (email, SMS, etc.),
+changing things in RT like data on a ticket, or calling out to
+external systems, DBs, or APIs.
+
+You can view all of the scrips that come standard with RT
+by going to Admin > Global > Scrips. In the scrips list you'll see each has a
+condition and an action and these are provided with the initial RT
+installation. You might also see additional conditions and actions added
+by extensions or through a local customization.
+
+You can view the default conditions and actions provided in RT at
+Admin > Global > Conditions and Admin > Global > Actions. This document
+describes how to add new conditions and actions to RT so you can provide
+additional automation to your workflows.
+
+As you look at the default conditions and actions provided with RT, you'll
+notice that it's not possible to edit them. This is to prevent changes from
+accidentally impacting default RT functionality. However, it is easy to copy
+a default condition or action, modify it, and then change existing scrips or
+create new scrips that use your new conditions and actions.
+
+=head2 User Defined Conditions and Actions
+
+The simplest way to add a custom condition or action is to create a new
+scrip and select "User Defined" as the Condition or Action. You can then
+put your custom code right in the "User Defined" boxes on the bottom of
+the scrip modification page. You can put any code described in the later
+sections in the User Defined box in the RT web UI and it will run just
+as it would in a module file.
+
+However, you might prefer writing your condition or action in a module
+with the code in a file. This allows you to track it in version control
+and call it from other places like C<rt-crontool>. The following sections
+describe how to create these modules.
+
+=head2 Custom Conditions
+
+Let's assume you have a custom lifecycle with a status
+called 'review' and you want an 'On Review Needed' condition so you can
+trigger actions when a ticket is put in review status. You notice RT
+already has 'On Resolve' and other similar conditions, so you look at
+the configuration at Admin > Global > Conditions and click on 'On Resolve'.
+
+The condition has a Name, which is displayed in the Condition dropdown when
+you create a scrip, and a Description to identify it. The Condition Module is
+the RT module that executes the condition, in this case C<StatusChange>. You
+can find the code in C</opt/rt4/lib/RT/Condition/StatusChange.pm> and view
+the documentation at L<RT::Condition::StatusChange>.
+
+Parameters to Pass shows the actual parameter that is passed to the module
+when this condition is executed. When you look at the module documentation
+it makes sense when you see that C<StatusChange> accepts a valid status and
+returns true if the transaction is setting the status to the provided value.
+Finally, Applicable Transaction Types lists the transactions for which this
+condition will run, and in this case it's transactions of type 'Status'.
+
+=for html <img alt="Status Change Condition" src="../images/status-change-condition.png">
+
+=for :text [Status change condition F<docs/images/status-change-condition.png>]
+
+=for :man [Status change condition F<docs/images/status-change-condition.png>]
+
+This is really close to what we might need for our 'On Review Needed' so
+you can click the Copy Condition button to copy the current condition. On
+the new condition page, you can update the Name and Description and set
+the Parameters to Pass to 'review'. Then click save and you have your new
+condition. You can now create a new scrip and select it from the Condition
+dropdown.
+
+=head2 Custom Condition Module
+
+Now assume we have an additional requirement to check if a custom field value
+'Special' is selected when we check the review status. For this one
+we'll need to write some code. To start, create a new file for your new
+SpecialReviewNeeded module here:
+
+ /opt/rt4/local/lib/RT/Condition/SpecialReviewNeeded.pm
+
+Creating it in the C<local> directory will keep it safe when you apply
+RT upgrades in the future.
+
+The basics of a condition module are as follows:
+
+ package RT::Condition::SpecialReviewNeeded;
+
+ use strict;
+ use warnings;
+ use base 'RT::Condition';
+
+ sub IsApplicable {
+ my $self = shift;
+
+ # Your code here
+
+ return 1; # True if condition is true, false if not
+ }
+
+ 1; # Don't forget module needs this
+
+C<IsApplicable> is the method you will override from the C<RT::Condition>
+base class. The return value of this method, true or false, determines
+whether the condition passes or not.
+
+C<$self> gives you access to the ticket object and transaction object via:
+
+ $self->TransactionObj
+ $self->TicketObj
+
+These are your main hooks into the current ticket and transaction.
+
+To check review status and the custom field value, we might add something
+like this:
+
+ # Setting status to review?
+ return 0 unless $self->TransactionObj->Type eq 'Status'
+ and $self->TransactionObj->NewValue eq 'review';
+
+ # Is 'Special' set to Yes?
+ return 0 unless $self->TicketObj->FirstCustomFieldValue('Special') eq 'Yes';
+
+ return 1;
+
+We've hardcoded C<review> and C<Special> here, but as with C<StatusChange>,
+you could pass a value from the Parameters to Pass field. You can access this
+value by calling the C<Argument> method.
+
+ my $arg = $self->Argument;
+
+Using passed arguments can make your conditions and actions more general
+and potentially reusable.
+
+Once the file is created, return to the RT web UI and create a new condition,
+possibly by editing On Review Needed and clicking Copy Condition.
+You can name it Special Review Needed and set the Condition Module to
+SpecialReviewNeeded.
+
+=head2 Custom Actions
+
+Once you have the correct condition you can now think about the action. You
+want to send email to a group of people, so to start you look at some of the
+existing actions on the action display page at Admin > Global > Actions.
+You find Notify AdminCcs, which might be close. Taking
+a quick look you see it has a Name and Description, like conditions, and
+the module it calls is C<Notify>, which can be found at
+C</opt/rt4/lib/RT/Action/Notify.pm>.
+
+The Parameter to Pass is AdminCc, and if you look at other notification
+actions you'll see many use Notify and just pass a different ticket role.
+
+Your reviewers aren't always AdminCcs on tickets, so you'd rather
+send a notification to a group. You can create this new action using the
+existing action module C<NotifyGroup>. On the action list page, click Create
+and add something like the following:
+
+ Name Notify Review Group
+ Description Send notification to the review group
+ Action Module NotifyGroup
+ Parameters to Pass Review Group
+
+The 'Review Group' can be whatever your group name is. Then you can build a
+template with some custom ticket information for reviewers and set up a new
+scrip to send email to the review group whenever a ticket status is set to
+review.
+
+=head2 Custom Action Modules
+
+As part of the request to add a condition to check for the 'Special' custom
+field, we now want to route these special requests to the person who handles
+them. This extra bit of functionality will require a module, maybe called
+C<SetOwner>. Create the new file in:
+
+ /local/lib/RT/Action/SetOwner.pm
+
+The base action code looks like this:
+
+ package RT::Action::SetOwner;
+
+ use strict;
+ use warnings;
+ use base 'RT::Action';
+
+ sub Prepare {
+ my $self = shift;
+
+ # Your code here
+
+ return 1; # True if Commit should run, false if not
+ }
+
+ sub Commit {
+ my $self = shift;
+
+ # Your code here
+
+ return 1; # True if action was successful
+ }
+
+ 1; # Don't forget module needs this
+
+Actions have two methods you can override. The C<Prepare> method provides
+you with a chance to make sure the action should actually run.
+If C<Prepare> returns false, C<Commit> will not run. You'll typically
+handle this in your condition, in which case you can just omit C<Prepare>
+from your action. However, when you have a condition that covers a common
+general case, but you want to check one extra criteria for a particular
+action, the C<Prepare> method can be helpful. In our example, you might
+choose to keep just the On Review Needed condition and add the check
+for the 'Special' custom field to the C<Prepare> method.
+
+C<Commit> is where you do the actual work of the action. It should
+return true on success. On failure, you can use C<RT::Logger> to
+write errors or debugging information to RTs logs so you can track
+down the problem.
+
+In actions, C<$self> gives you access to the transaction and ticket
+objects, just like conditions, via:
+
+ $self->TransactionObj
+ $self->TicketObj
+
+For our C<SetOwner> action, we don't need C<Prepare> and can add the
+following to C<Commit>:
+
+ my $user = RT::User->new(RT->SystemUser);
+ my ($ret, $msg) = $user->Load($self->Argument);
+ RT::Logger->error('Unable to load user: '
+ . $self->Argument . " $msg") unless $ret;
+
+ $self->TicketObj->SetOwner($user->Id);
+ return 1;
+
+The C<Argument> method returns the value set for Parameters to
+Pass in the action configuration. This example expects the
+argument to be the username of an RT user.
+
+Now you can create the new action in RT. Go to the action page, click
+Create, and enter the following:
+
+ Name Set Owner
+ Description Set owner
+ Action Module SetOwner
+ Parameters to Pass reviewer_username
+
+Click Create and the new action will be available when creating scrips.
+
+=for html <img alt="Create Set Owner Action" src="../images/create-setowner-action.png">
+
+=for :text [Create Set Owner action F<docs/images/create-setowner-action.png>]
+
+=for :man [Create Set Owner action F<docs/images/create-setowner-action.png>]
+
+Note that actions you perform in scrips can themselves create new
+transactions, as is the case with C<SetOwner>. When this action runs,
+the set owner transaction will fire the default On Owner Change Notify
+Owner scrip, if it is enabled.
+
+=head1 ADDITIONAL INFORMATION
+
+When writing actions and conditions, it's helpful to look at the actions
+and conditions provided with RT. You can find more information about
+the methods available from ticket and transaction objects in your RT
+distribution and on the
+L<"Best Practical website"|http://docs.bestpractical.com>.
diff --git a/docs/images/create-setowner-action.png b/docs/images/create-setowner-action.png
new file mode 100644
index 0000000..150ce2b
Binary files /dev/null and b/docs/images/create-setowner-action.png differ
diff --git a/docs/images/status-change-condition.png b/docs/images/status-change-condition.png
new file mode 100644
index 0000000..fe8b3aa
Binary files /dev/null and b/docs/images/status-change-condition.png differ
diff --git a/lib/RT.pm b/lib/RT.pm
index e8a14c0..ea67b5a 100644
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -739,6 +739,7 @@ our %CORED_PLUGINS = (
'RT::Extension::SpawnLinkedTicketInQueue' => '4.4',
'RT::Extension::ParentTimeWorked' => '4.4',
'RT::Extension::FutureMailgate' => '4.4',
+ 'RT::Extension::AdminConditionsAndActions' => '4.4.2',
);
sub InitPlugins {
diff --git a/lib/RT/ScripAction.pm b/lib/RT/ScripAction.pm
index f3bb82c..2ce1693 100644
--- a/lib/RT/ScripAction.pm
+++ b/lib/RT/ScripAction.pm
@@ -101,9 +101,28 @@ sub Create {
return($self->SUPER::Create(@_));
}
-sub Delete {
+sub Delete {
my $self = shift;
- return (0, "ScripAction->Delete not implemented");
+
+ unless ( $self->CurrentUser->HasRight( Object => RT->System, Right => 'ModifyScrips' ) ) {
+ return ( 0, $self->loc('Permission Denied') );
+ }
+
+ my $scrips = RT::Scrips->new( RT->SystemUser );
+ $scrips->Limit( FIELD => 'ScripAction', VALUE => $self->id );
+ if ( $scrips->Count ) {
+ return ( 0, $self->loc('Action is in use') );
+ }
+
+ return $self->SUPER::Delete(@_);
+}
+
+sub UsedBy {
+ my $self = shift;
+
+ my $scrips = RT::Scrips->new( $self->CurrentUser );
+ $scrips->Limit( FIELD => 'ScripAction', VALUE => $self->Id );
+ return $scrips;
}
diff --git a/lib/RT/ScripCondition.pm b/lib/RT/ScripCondition.pm
index 81cbb40..7868264 100644
--- a/lib/RT/ScripCondition.pm
+++ b/lib/RT/ScripCondition.pm
@@ -112,9 +112,28 @@ No API available for deleting things just yet.
=cut
-sub Delete {
+sub Delete {
my $self = shift;
- return(0, $self->loc('Unimplemented'));
+
+ unless ( $self->CurrentUser->HasRight( Object => RT->System, Right => 'ModifyScrips' ) ) {
+ return ( 0, $self->loc('Permission Denied') );
+ }
+
+ my $scrips = RT::Scrips->new( RT->SystemUser );
+ $scrips->Limit( FIELD => 'ScripCondition', VALUE => $self->id );
+ if ( $scrips->Count ) {
+ return ( 0, $self->loc('Condition is in use') );
+ }
+
+ return $self->SUPER::Delete(@_);
+}
+
+sub UsedBy {
+ my $self = shift;
+
+ my $scrips = RT::Scrips->new( $self->CurrentUser );
+ $scrips->Limit( FIELD => 'ScripCondition', VALUE => $self->Id );
+ return $scrips;
}
diff --git a/share/html/Admin/Actions/Create.html b/share/html/Admin/Actions/Create.html
new file mode 100644
index 0000000..a89c942
--- /dev/null
+++ b/share/html/Admin/Actions/Create.html
@@ -0,0 +1,102 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => "Create a global action" &>
+<& /Elements/Tabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+<form method="post" action="Create.html" id="CreateAction" name="CreateAction">
+
+<&| /Widgets/TitleBox, title => loc('Basics') &>
+<table>
+<& Elements/EditBasics, %ARGS, Action => $action, &>
+</table>
+</&>
+
+<& /Elements/Submit,
+ Label => loc('Create'),
+ Name => 'Create',
+&>
+
+</form>
+<%ARGS>
+$Create => undef
+$id => undef
+</%ARGS>
+<%INIT>
+my @results;
+
+if ( $id ) {
+ my $action = RT::ScripAction->new( $session{'CurrentUser'} );
+ $action->Load( $id );
+ if ( $action ) {
+ for my $item ( qw/Name Description ExecModule Argument/ ) {
+ $ARGS{$item} ||= $action->$item;
+ }
+ }
+}
+
+my $action = RT::ScripAction->new( $session{'CurrentUser'} );
+if ( $Create ) {
+ my ($status, $msg) = $action->Create(
+ Name => $ARGS{"Name"},
+ Description => $ARGS{"Description"},
+ ExecModule => $ARGS{"ExecModule"},
+ Argument => $ARGS{"Argument"},
+ );
+
+ MaybeRedirectForResults(
+ Force => 1,
+ Actions => [ $msg ],
+ Path => 'Admin/Actions/Modify.html',
+ Arguments => { id => $action->id },
+ ) if $status;
+
+ push @results, $msg;
+}
+
+</%INIT>
diff --git a/share/html/Admin/Actions/Display.html b/share/html/Admin/Actions/Display.html
new file mode 100644
index 0000000..35c4548
--- /dev/null
+++ b/share/html/Admin/Actions/Display.html
@@ -0,0 +1,74 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => loc("Display action #[_1]", $id) &>
+<& /Elements/Tabs &>
+
+<&| /Widgets/TitleBox, title => loc('Basics') &>
+<table>
+<& Elements/ShowBasics, %ARGS, Action => $action, &>
+</table>
+</&>
+<form>
+<input type="hidden" class="hidden" name="id" value="<% $id %>" />
+<& /Elements/Submit, Label => loc('Copy Action'), Name => 'Copy' &>
+</form>
+
+<%ARGS>
+$id => undef
+$Copy => undef
+</%ARGS>
+<%INIT>
+
+if ( $Copy ) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."Admin/Actions/Create.html?id=$id" );
+}
+
+my $action = RT::ScripAction->new( $session{'CurrentUser'} );
+$action->Load( $id );
+Abort(loc("Couldn't load action #[_1]", $id)) unless $action->id;
+</%INIT>
diff --git a/share/html/Admin/Actions/Elements/EditBasics b/share/html/Admin/Actions/Elements/EditBasics
new file mode 100644
index 0000000..7356f6d
--- /dev/null
+++ b/share/html/Admin/Actions/Elements/EditBasics
@@ -0,0 +1,78 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<tr>
+ <td class="label"><&|/l&>Name</&>:</td>
+ <td class="value">
+ <input name="Name" size="60" value="<% $ARGS{"Name"} || $Action->Name || '' %>" />
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Description</&>:</td>
+ <td class="value">
+ <input name="Description" size="60" value="<% $ARGS{"Description"} || $Action->Description || '' %>" />
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Action Module</&>:</td>
+ <td class="value">
+ <input name="ExecModule" size="60" value="<% $ARGS{"ExecModule"} || $Action->ExecModule || ''%>" />
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Parameters to Pass</&>:</td>
+ <td class="value">
+ <input name="Argument" size="60" value="<% $ARGS{"Argument"} || $Action->Argument || '' %>"/>
+ </td>
+</tr>
+
+<%ARGS>
+$Action
+</%ARGS>
diff --git a/share/html/Admin/Actions/Elements/ShowBasics b/share/html/Admin/Actions/Elements/ShowBasics
new file mode 100644
index 0000000..342d772
--- /dev/null
+++ b/share/html/Admin/Actions/Elements/ShowBasics
@@ -0,0 +1,78 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<tr>
+ <td class="label"><&|/l&>Name</&>:</td>
+ <td class="value">
+ <% $ARGS{"Name"} || $Action->Name || '' %>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Description</&>:</td>
+ <td class="value">
+ <% $ARGS{"Description"} || $Action->Description || '' %>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Action Module</&>:</td>
+ <td class="value">
+ <% $ARGS{"ExecModule"} || $Action->ExecModule || ''%>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Parameters to Pass</&>:</td>
+ <td class="value">
+ <% $ARGS{"Argument"} || $Action->Argument || '' %>
+ </td>
+</tr>
+
+<%ARGS>
+$Action
+</%ARGS>
diff --git a/share/html/Admin/Actions/Modify.html b/share/html/Admin/Actions/Modify.html
new file mode 100644
index 0000000..2119ca1
--- /dev/null
+++ b/share/html/Admin/Actions/Modify.html
@@ -0,0 +1,101 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => loc("Modify action #[_1]", $id) &>
+<& /Elements/Tabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+<form method="post" action="Modify.html" id="ModifyAction" name="ModifyAction">
+<input type="hidden" class="hidden" name="id" value="<% $id %>" />
+
+<&| /Widgets/TitleBox, title => loc('Basics') &>
+<table>
+<& Elements/EditBasics, %ARGS, Action => $action, &>
+</table>
+</&>
+<& /Elements/Submit, Label => loc('Copy Action'), Name => 'Copy' &>
+
+<& /Elements/Submit, Label => loc('Save Changes'), Name => 'Update', Reset => 1 &>
+
+
+</form>
+<%ARGS>
+$id => undef
+$Update => undef
+$Copy => undef
+</%ARGS>
+<%INIT>
+
+my $action = RT::ScripAction->new( $session{'CurrentUser'} );
+$action->Load( $id );
+Abort(loc("Couldn't load action #[_1]", $id)) unless $action->id;
+
+if ( $action->Creator == RT->SystemUser->id ) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."Admin/Actions/Display.html?id=$id" );
+}
+
+my @results;
+if ( $Update ) {
+ my @attribs = qw(
+ Name Description
+ ExecModule Argument
+ );
+ @results = UpdateRecordObject(
+ AttributesRef => \@attribs,
+ Object => $action,
+ ARGSRef => \%ARGS
+ );
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Arguments => { id => $action->id },
+ );
+}
+elsif ( $Copy ) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."Admin/Actions/Create.html?id=$id" );
+}
+
+</%INIT>
diff --git a/share/html/Admin/Actions/autohandler b/share/html/Admin/Actions/autohandler
new file mode 100644
index 0000000..a6c261b
--- /dev/null
+++ b/share/html/Admin/Actions/autohandler
@@ -0,0 +1,58 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<%init>
+return $m->call_next(%ARGS) if $session{'CurrentUser'}->UserObj->HasRight(
+ Right => 'ShowScrips',
+ Object => $RT::System,
+) && $session{'CurrentUser'}->UserObj->HasRight(
+ Right => 'ModifyScrips',
+ Object => $RT::System,
+);
+
+$m->clear_and_abort(403);
+</%init>
diff --git a/share/html/Admin/Conditions/Create.html b/share/html/Admin/Conditions/Create.html
new file mode 100644
index 0000000..31b2aaf
--- /dev/null
+++ b/share/html/Admin/Conditions/Create.html
@@ -0,0 +1,103 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => "Create a global condition" &>
+<& /Elements/Tabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+<form method="post" action="Create.html" id="CreateCondition" name="CreateCondition">
+
+<&| /Widgets/TitleBox, title => loc('Basics') &>
+<table>
+<& Elements/EditBasics, %ARGS, Condition => $condition, &>
+</table>
+</&>
+
+<& /Elements/Submit,
+ Label => loc('Create'),
+ Name => 'Create',
+&>
+
+</form>
+<%ARGS>
+$Create => undef
+$id => undef
+</%ARGS>
+<%INIT>
+my @results;
+
+if ( $id ) {
+ my $condition = RT::ScripCondition->new( $session{'CurrentUser'} );
+ $condition->Load( $id );
+ if ( $condition ) {
+ for my $item ( qw/Name Description ExecModule Argument ApplicableTransTypes/ ) {
+ $ARGS{$item} ||= $condition->$item;
+ }
+ }
+}
+
+my $condition = RT::ScripCondition->new( $session{'CurrentUser'} );
+if ( $Create ) {
+ my ($status, $msg) = $condition->Create(
+ Name => $ARGS{"Name"},
+ Description => $ARGS{"Description"},
+ ExecModule => $ARGS{"ExecModule"},
+ Argument => $ARGS{"Argument"},
+ ApplicableTransTypes => $ARGS{"ApplicableTransTypes"},
+ );
+
+ MaybeRedirectForResults(
+ Force => 1,
+ Actions => [ $msg ],
+ Path => 'Admin/Conditions/Modify.html',
+ Arguments => { id => $condition->id },
+ ) if $status;
+
+ push @results, $msg;
+}
+
+</%INIT>
diff --git a/share/html/Admin/Conditions/Display.html b/share/html/Admin/Conditions/Display.html
new file mode 100644
index 0000000..307b266
--- /dev/null
+++ b/share/html/Admin/Conditions/Display.html
@@ -0,0 +1,72 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => loc("Display condition #[_1]", $id) &>
+<& /Elements/Tabs &>
+
+<&| /Widgets/TitleBox, title => loc('Basics') &>
+<table>
+<& Elements/ShowBasics, %ARGS, Condition => $condition, &>
+</table>
+</&>
+<form>
+<input type="hidden" class="hidden" name="id" value="<% $id %>" />
+<& /Elements/Submit, Label => loc('Copy Condition'), Name => 'Copy' &>
+</form>
+<%ARGS>
+$id => undef
+$Copy => undef
+</%ARGS>
+<%INIT>
+if ( $Copy ) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."Admin/Conditions/Create.html?id=$id" );
+}
+
+my $condition = RT::ScripCondition->new( $session{'CurrentUser'} );
+$condition->Load( $id );
+Abort(loc("Couldn't load condition #[_1]", $id)) unless $condition->id;
+</%INIT>
diff --git a/share/html/Admin/Conditions/Elements/EditBasics b/share/html/Admin/Conditions/Elements/EditBasics
new file mode 100644
index 0000000..4b79c53
--- /dev/null
+++ b/share/html/Admin/Conditions/Elements/EditBasics
@@ -0,0 +1,85 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<tr>
+ <td class="label"><&|/l&>Name</&>:</td>
+ <td class="value">
+ <input name="Name" size="60" value="<% $ARGS{"Name"} || $Condition->Name || '' %>" />
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Description</&>:</td>
+ <td class="value">
+ <input name="Description" size="60" value="<% $ARGS{"Description"} || $Condition->Description || '' %>" />
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Condition Module</&>:</td>
+ <td class="value">
+ <input name="ExecModule" size="60" value="<% $ARGS{"ExecModule"} || $Condition->ExecModule || ''%>" />
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Parameters to Pass</&>:</td>
+ <td class="value">
+ <input name="Argument" size="60" value="<% $ARGS{"Argument"} || $Condition->Argument || '' %>"/>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Applicable Transaction Types</&>:</td>
+ <td class="value">
+ <input name="ApplicableTransTypes" size="60" value="<% $ARGS{"ApplicableTransTypes"} || $Condition->ApplicableTransTypes || '' %>" />
+ </td>
+</tr>
+
+<%ARGS>
+$Condition
+</%ARGS>
diff --git a/share/html/Admin/Conditions/Elements/ShowBasics b/share/html/Admin/Conditions/Elements/ShowBasics
new file mode 100644
index 0000000..c6d6afc
--- /dev/null
+++ b/share/html/Admin/Conditions/Elements/ShowBasics
@@ -0,0 +1,85 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<tr>
+ <td class="label"><&|/l&>Name</&>:</td>
+ <td class="value">
+ <% $ARGS{"Name"} || $Condition->Name || '' %>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Description</&>:</td>
+ <td class="value">
+ <% $ARGS{"Description"} || $Condition->Description || '' %>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Condition Module</&>:</td>
+ <td class="value">
+ <% $ARGS{"ExecModule"} || $Condition->ExecModule || ''%>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Parameters to Pass</&>:</td>
+ <td class="value">
+ <% $ARGS{"Argument"} || $Condition->Argument || '' %>
+ </td>
+</tr>
+
+<tr>
+ <td class="label"><&|/l&>Applicable Transaction Types</&>:</td>
+ <td class="value">
+ <% $ARGS{"ApplicableTransTypes"} || $Condition->ApplicableTransTypes || '' %>
+ </td>
+</tr>
+
+<%ARGS>
+$Condition
+</%ARGS>
diff --git a/share/html/Admin/Conditions/Modify.html b/share/html/Admin/Conditions/Modify.html
new file mode 100644
index 0000000..e206f4c
--- /dev/null
+++ b/share/html/Admin/Conditions/Modify.html
@@ -0,0 +1,100 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => loc("Modify condition #[_1]", $id) &>
+<& /Elements/Tabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+<form method="post" action="Modify.html" id="ModifyCondition" name="ModifyCondition">
+<input type="hidden" class="hidden" name="id" value="<% $id %>" />
+
+<&| /Widgets/TitleBox, title => loc('Basics') &>
+<table>
+<& Elements/EditBasics, %ARGS, Condition => $condition, &>
+</table>
+</&>
+<& /Elements/Submit, Label => loc('Copy Condition'), Name => 'Copy' &>
+
+<& /Elements/Submit, Label => loc('Save Changes'), Name => 'Update', Reset => 1 &>
+
+</form>
+<%ARGS>
+$id => undef
+$Update => undef
+$Copy => undef
+</%ARGS>
+<%INIT>
+
+my $condition = RT::ScripCondition->new( $session{'CurrentUser'} );
+$condition->Load( $id );
+Abort(loc("Couldn't load condition #[_1]", $id)) unless $condition->id;
+
+if ( $condition->Creator == RT->SystemUser->id ) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."Admin/Conditions/Display.html?id=$id" );
+}
+
+my @results;
+if ( $Update ) {
+ my @attribs = qw(
+ Name Description
+ ExecModule Argument ApplicableTransTypes
+ );
+ @results = UpdateRecordObject(
+ AttributesRef => \@attribs,
+ Object => $condition,
+ ARGSRef => \%ARGS
+ );
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Arguments => { id => $condition->id },
+ );
+}
+elsif ( $Copy ) {
+ RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."Admin/Conditions/Create.html?id=$id" );
+}
+
+</%INIT>
diff --git a/share/html/Admin/Conditions/autohandler b/share/html/Admin/Conditions/autohandler
new file mode 100644
index 0000000..a6c261b
--- /dev/null
+++ b/share/html/Admin/Conditions/autohandler
@@ -0,0 +1,58 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<%init>
+return $m->call_next(%ARGS) if $session{'CurrentUser'}->UserObj->HasRight(
+ Right => 'ShowScrips',
+ Object => $RT::System,
+) && $session{'CurrentUser'}->UserObj->HasRight(
+ Right => 'ModifyScrips',
+ Object => $RT::System,
+);
+
+$m->clear_and_abort(403);
+</%init>
diff --git a/share/html/Admin/Elements/EditActions b/share/html/Admin/Elements/EditActions
new file mode 100644
index 0000000..f117e45
--- /dev/null
+++ b/share/html/Admin/Elements/EditActions
@@ -0,0 +1,123 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Elements/ListActions, actions => \@actions &>
+
+<form action="Actions.html" method="post">
+
+<h2><&|/l&>System Actions</&></h2>
+<div class="admin-hint"></div>
+% if ( $system_actions->Count ){
+<& /Elements/CollectionList, %common_applied_args, DisplayFormat => $Format, Collection => $system_actions &>
+% } else {
+<p><i><&|/l&>Click Create to add a new custom action.</&></i></p>
+% }
+
+<h2><&|/l&>Custom Actions</&></h2>
+<div class="admin-hint"></div>
+% if ( $actions->Count ){
+<& /Elements/CollectionList, %common_applied_args, Collection => $actions &>
+% } else {
+<p><i><&|/l&>Click Create to add a new custom action.</&></i></p>
+% }
+
+<& /Elements/Submit,
+ Name => 'RemoveActions',
+ Caption => loc("Delete selected actions"),
+ Label => loc("Delete"),
+&>
+
+</form>
+
+<%init>
+unless ( $session{CurrentUser}->HasRight( Object => RT->System, Right => 'ShowScrips' )
+ && $session{CurrentUser}->HasRight( Object => RT->System, Right => 'ModifyScrips' ) )
+{
+ Abort( loc('You must have ShowScrips/ModifyScrips rights to work with actions.') );
+}
+
+my (@actions);
+
+my $system_actions = RT::ScripActions->new($session{'CurrentUser'});
+$system_actions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id );
+
+my $actions = RT::ScripActions->new($session{'CurrentUser'});
+$actions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id, OPERATOR => '!=' );
+
+my $Format = RT->Config->Get('AdminSearchResultFormat')->{'Actions'}
+ || q{'<a href="__WebPath__/Admin/Actions/Modify.html?id=__id__">__id__</a>/TITLE:#'}
+ . q{,'<a href="__WebPath__/Admin/Actions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+ . q{,'__Description__','__UsedBy__};
+
+my $DisplayFormat = "__CheckBox.{RemoveAction}__, $Format";
+
+my %common_applied_args = (
+ %ARGS,
+ Format => $Format,
+ DisplayFormat => $DisplayFormat,
+ Rows => 0,
+ Page => 1,
+ AllowSorting => 1,
+);
+
+if ( $RemoveActions ) {
+ foreach my $id ( @RemoveAction ) {
+ my $action = RT::ScripAction->new( $session{'CurrentUser'} );
+ $action->Load( $id );
+ next unless $action->id;
+
+ my ($status, $msg) = $action->Delete();
+ push @actions, $msg;
+ }
+}
+
+</%init>
+
+<%ARGS>
+ at RemoveAction => ()
+$RemoveActions => undef
+</%ARGS>
diff --git a/share/html/Admin/Elements/EditConditions b/share/html/Admin/Elements/EditConditions
new file mode 100644
index 0000000..1ee35f2
--- /dev/null
+++ b/share/html/Admin/Elements/EditConditions
@@ -0,0 +1,123 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Elements/ListActions, actions => \@actions &>
+
+<form action="Conditions.html" method="post">
+
+<h2><&|/l&>System Conditions</&></h2>
+<div class="admin-hint"></div>
+% if ( $system_conditions->Count ){
+<& /Elements/CollectionList, %common_applied_args, DisplayFormat => $Format, Collection => $system_conditions &>
+% } else {
+<p><i><&|/l&>Click Create to add a new custom condition.</&></i></p>
+% }
+
+<h2><&|/l&>Custom Conditions</&></h2>
+<div class="admin-hint"></div>
+% if ( $conditions->Count ){
+<& /Elements/CollectionList, %common_applied_args, Collection => $conditions &>
+% } else {
+<p><i><&|/l&>Click Create to add a new custom condition.</&></i></p>
+% }
+
+<& /Elements/Submit,
+ Name => 'RemoveConditions',
+ Caption => loc("Delete selected conditions"),
+ Label => loc("Delete"),
+&>
+
+</form>
+
+<%init>
+unless ( $session{CurrentUser}->HasRight( Object => RT->System, Right => 'ShowScrips' )
+ && $session{CurrentUser}->HasRight( Object => RT->System, Right => 'ModifyScrips' ) )
+{
+ Abort( loc('You must have ShowScrips/ModifyScrips rights to work with conditions.') );
+}
+
+my (@actions);
+
+my $system_conditions = RT::ScripConditions->new($session{'CurrentUser'});
+$system_conditions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id );
+
+my $conditions = RT::ScripConditions->new($session{'CurrentUser'});
+$conditions->Limit( FIELD => 'Creator', VALUE => RT->SystemUser->id, OPERATOR => '!=' );
+
+my $Format = RT->Config->Get('AdminSearchResultFormat')->{'Conditions'}
+ || q{'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__id__</a>/TITLE:#'}
+ . q{,'<a href="__WebPath__/Admin/Conditions/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+ . q{,'__Description__','__UsedBy__};
+
+my $DisplayFormat = "__CheckBox.{RemoveCondition}__, $Format";
+
+my %common_applied_args = (
+ %ARGS,
+ Format => $Format,
+ DisplayFormat => $DisplayFormat,
+ Rows => 0,
+ Page => 1,
+ AllowSorting => 1,
+);
+
+if ( $RemoveConditions ) {
+ foreach my $id ( @RemoveCondition ) {
+ my $condition = RT::ScripCondition->new( $session{'CurrentUser'} );
+ $condition->Load( $id );
+ next unless $condition->id;
+
+ my ($status, $msg) = $condition->Delete();
+ push @actions, $msg;
+ }
+}
+
+</%init>
+
+<%ARGS>
+ at RemoveCondition => ()
+$RemoveConditions => undef
+</%ARGS>
diff --git a/share/html/Admin/Global/Actions.html b/share/html/Admin/Global/Actions.html
new file mode 100644
index 0000000..a5f815c
--- /dev/null
+++ b/share/html/Admin/Global/Actions.html
@@ -0,0 +1,58 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => $title &>
+<& /Elements/Tabs &>
+<& /Admin/Elements/EditActions, title => $title, id => $id, %ARGS &>
+</form>
+<%init>
+my $title = loc("Actions");
+my (@actions);
+</%init>
+<%ARGS>
+$id => 0
+</%ARGS>
diff --git a/share/html/Admin/Global/Conditions.html b/share/html/Admin/Global/Conditions.html
new file mode 100644
index 0000000..a4d2c60
--- /dev/null
+++ b/share/html/Admin/Global/Conditions.html
@@ -0,0 +1,58 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<& /Admin/Elements/Header, Title => $title &>
+<& /Elements/Tabs &>
+<& /Admin/Elements/EditConditions, title => $title, %ARGS &>
+</form>
+<%init>
+my $title = loc("Conditions");
+my (@actions);
+</%init>
+<%ARGS>
+$id => 0
+</%ARGS>
diff --git a/share/html/Elements/RT__ScripAction/ColumnMap b/share/html/Elements/RT__ScripAction/ColumnMap
new file mode 100644
index 0000000..69ad50e
--- /dev/null
+++ b/share/html/Elements/RT__ScripAction/ColumnMap
@@ -0,0 +1,91 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<%ARGS>
+$Name
+$Attr => undef
+$GenericMap => {}
+</%ARGS>
+<%ONCE>
+my $COLUMN_MAP = {
+ id => {
+ title => '#', # loc
+ attribute => 'id',
+ align => 'right',
+ value => sub { return $_[0]->id },
+ },
+ Name => {
+ title => 'Name', # loc
+ attribute => 'Name',
+ value => sub { return $_[0]->Name() },
+ },
+ Description => {
+ title => 'Description', # loc
+ attribute => 'Description',
+ value => sub { return $_[0]->Description() },
+ },
+ UsedBy => {
+ title => 'Used by scrips', # loc
+ value => sub {
+ my @res;
+ my $scrips = $_[0]->UsedBy;
+ while ( my $scrip = $scrips->Next ) {
+ push @res, ', ' if @res;
+ push @res, \'<a href="', RT->Config->Get('WebPath'), '/Admin/Scrips/Modify.html';
+ push @res, '?id='. $scrip->id;
+ push @res, \'" title="', $scrip->Description, \'">', $scrip->id, \'</a>';
+ }
+ return @res;
+ },
+ },
+};
+
+</%ONCE>
+<%INIT>
+$m->callback( GenericMap => $GenericMap, COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 );
+return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr );
+</%INIT>
diff --git a/share/html/Elements/RT__ScripCondition/ColumnMap b/share/html/Elements/RT__ScripCondition/ColumnMap
new file mode 100644
index 0000000..69ad50e
--- /dev/null
+++ b/share/html/Elements/RT__ScripCondition/ColumnMap
@@ -0,0 +1,91 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2017 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 }}}
+<%ARGS>
+$Name
+$Attr => undef
+$GenericMap => {}
+</%ARGS>
+<%ONCE>
+my $COLUMN_MAP = {
+ id => {
+ title => '#', # loc
+ attribute => 'id',
+ align => 'right',
+ value => sub { return $_[0]->id },
+ },
+ Name => {
+ title => 'Name', # loc
+ attribute => 'Name',
+ value => sub { return $_[0]->Name() },
+ },
+ Description => {
+ title => 'Description', # loc
+ attribute => 'Description',
+ value => sub { return $_[0]->Description() },
+ },
+ UsedBy => {
+ title => 'Used by scrips', # loc
+ value => sub {
+ my @res;
+ my $scrips = $_[0]->UsedBy;
+ while ( my $scrip = $scrips->Next ) {
+ push @res, ', ' if @res;
+ push @res, \'<a href="', RT->Config->Get('WebPath'), '/Admin/Scrips/Modify.html';
+ push @res, '?id='. $scrip->id;
+ push @res, \'" title="', $scrip->Description, \'">', $scrip->id, \'</a>';
+ }
+ return @res;
+ },
+ },
+};
+
+</%ONCE>
+<%INIT>
+$m->callback( GenericMap => $GenericMap, COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 );
+return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr );
+</%INIT>
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index d2951f4..b896e9e 100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -131,6 +131,22 @@ my $build_admin_menu = sub {
$scrips->child( select => title => loc('Select'), path => "/Admin/Global/Scrips.html" );
$scrips->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html?Global=1" );
+ my $conditions = $admin_global->child( conditions =>
+ title => loc('Conditions'),
+ description => loc('Edit system conditions'),
+ path => '/Admin/Global/Conditions.html',
+ );
+ $conditions->child( select => title => loc('Select'), path => "/Admin/Global/Conditions.html" );
+ $conditions->child( create => title => loc('Create'), path => "/Admin/Conditions/Create.html" );
+
+ my $actions = $admin_global->child( actions =>
+ title => loc('Actions'),
+ description => loc('Edit system actions'),
+ path => '/Admin/Global/Actions.html',
+ );
+ $actions->child( select => title => loc('Select'), path => "/Admin/Global/Actions.html" );
+ $actions->child( create => title => loc('Create'), path => "/Admin/Actions/Create.html" );
+
my $templates = $admin_global->child( templates =>
title => loc('Templates'),
description => loc('Edit system templates'),
@@ -480,6 +496,18 @@ my $build_admin_menu = sub {
$tabs->child( create => title => loc('Create'), path => "/Admin/Scrips/Create.html?Global=1" );
}
+ if ( $request_path =~ m{^/Admin(?:/Global)?/Conditions} ) {
+ my $tabs = PageMenu();
+ $tabs->child( select => title => loc('Select'), path => "/Admin/Global/Conditions.html" );
+ $tabs->child( create => title => loc('Create'), path => "/Admin/Conditions/Create.html" );
+ }
+
+ if ( $request_path =~ m{^/Admin(?:/Global)?/Actions} ) {
+ my $tabs = PageMenu();
+ $tabs->child( select => title => loc('Select'), path => "/Admin/Global/Actions.html" );
+ $tabs->child( create => title => loc('Create'), path => "/Admin/Actions/Create.html" );
+ }
+
if ( $request_path =~ m{^/Admin/Global/Templates?\.html} ) {
my $tabs = PageMenu();
$tabs->child( select => title => loc('Select'), path => "/Admin/Global/Templates.html" );
commit 9eb6181f26d56ee8e7db3859f95d411bfbb98d34
Merge: 93b6eba ff484be
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Wed May 10 17:36:21 2017 +0000
Merge branch '4.4/integrate-admin-conditions-and-actions' into 4.4-trunk
-----------------------------------------------------------------------
More information about the rt-commit
mailing list