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 &>
26 <form action="Scrips.html" method="post">
27 <input type="hidden" name="id" value="<%$id%>">
29 <P><&|/l&>Current Scrips</&>:</P>
30 % if ($Scrips->Count == 0 ) {
31 <P><i><&|/l&>(No scrips)</&></i></P>
34 <P><i><&|/l&>(Check box to delete)</&></i></P>
36 % while (my $scrip = $Scrips->Next ) {
39 <input type="checkbox" name="DeleteScrip-<%$scrip->Id%>">
42 <a href="Scrip.html?id=<%$scrip->Id%>&Queue=<%$id%>"><% $scrip->Description || "<i>(".loc('no value').")</i>" |n %></a><br>
43 <small><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></small>
51 <& /Elements/Submit &>
56 my $Scrips = RT::Scrips->new($session{'CurrentUser'});
59 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
65 $Scrips->LimitToQueue($id);
68 $Scrips->LimitToGlobal();
74 # {{{ deal with modifying and deleting existing scrips
75 foreach my $key (keys %ARGS) {
76 # {{{ if we're trying to delete the scrip
77 if ($key =~ /^DeleteScrip-(\d+)/) {
79 my $scrip = new RT::Scrip($session{'CurrentUser'});
81 my ($retval, $msg) = $scrip->Delete;
83 push @actions, loc("Scrip deleted");