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>
52 Caption => loc("Delete selected scrips"),
53 Label => loc("Delete") &>
58 my $Scrips = RT::Scrips->new($session{'CurrentUser'});
61 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
67 $Scrips->LimitToQueue($id);
70 $Scrips->LimitToGlobal();
76 # {{{ deal with modifying and deleting existing scrips
77 foreach my $key (keys %ARGS) {
78 # {{{ if we're trying to delete the scrip
79 if ($key =~ /^DeleteScrip-(\d+)/) {
81 my $scrip = new RT::Scrip($session{'CurrentUser'});
83 my ($retval, $msg) = $scrip->Delete;
85 push @actions, loc("Scrip deleted");