3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <& /Elements/ListActions, actions => \@actions &>
27 <FORM METHOD=POST ACTION="Scrip.html">
28 <input type="hidden" name="id" value="<%$id%>">
29 <input type="hidden" name="Queue" value="<%$Queue%>">
33 <&|/l&>Description</&>:
36 <input Name="Scrip-<%$id%>-Description" value="<%$scrip->Description%>">
43 <& /Admin/Elements/SelectScripCondition, Name => "Scrip-$id-ScripCondition", Default => $scrip->ConditionObj->Id &><BR>
48 <&|/l&>Custom condition</&>:
51 <TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomIsApplicableCode"><%$scrip->CustomIsApplicableCode%></TEXTAREA>
59 <& /Admin/Elements/SelectScripAction, Name => "Scrip-$id-ScripAction", Default => $scrip->ActionObj->Id &>
64 <&|/l&>Custom action preparation code</&>:
67 <TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomPrepareCode"><%$scrip->CustomPrepareCode%></TEXTAREA>
72 <&|/l&>Custom action cleanup code</&>:
75 <TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomCommitCode"><%$scrip->CustomCommitCode%></TEXTAREA>
83 <& /Admin/Elements/SelectStage, Name => "Scrip-$id-Stage", Default => $scrip->Stage &>
91 <& /Admin/Elements/SelectTemplate, Name => "Scrip-$id-Template", Default => $scrip->TemplateObj->Id, Queue => $Queue &>
95 <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
101 my $scrip = new RT::Scrip($session{'CurrentUser'});
103 if ( $id eq 'new' ) {
105 my ( $retval, $msg ) = $scrip->Create(
107 ScripAction => $ARGS{"Scrip-new-ScripAction"},
108 ScripCondition => $ARGS{"Scrip-new-ScripCondition"},
109 Template => $ARGS{"Scrip-new-Template"},
110 Description => $ARGS{"Scrip-new-Description"},
111 CustomPrepareCode => $ARGS{"Scrip-new-CustomPrepareCode"},
112 CustomCommitCode => $ARGS{"Scrip-new-CustomCommitCode"},
113 CustomIsApplicableCode => $ARGS{"Scrip-new-CustomIsApplicableCode"},
115 if ( defined $retval ) {
123 my ($val,$msg) =$scrip->Load($id);
138 CustomIsApplicableCode
140 my @results = UpdateRecordObject( AttributesRef => \@attribs,
141 AttributePrefix => 'Scrip-'.$scrip->Id,
144 push (@actions, @results);
147 elsif ($ARGS{'create'}) {