1 <& /Admin/Elements/Header, Title => 'Edit scrips' &>
2 <& /Admin/Elements/SystemTabs &>
4 <& /Elements/ListActions, actions => \@actions &>
6 <& /Elements/TitleBoxStart, title => "Modify global scrips" &>
8 <FORM METHOD=POST ACTION="Scrips.html">
10 % if ($Scrips->Count > 0 ) {
18 % while (my $scrip = $Scrips->Next ) {
21 <INPUT TYPE="CHECKBOX" NAME="DeleteScrip-<%$scrip->Id%>">
24 <% $scrip->ConditionObj->Name %>
25 <% $scrip->ActionObj->Name %>
26 with template <% $scrip->TemplateObj->Name %>
34 Add a scrip which will apply to all queues:
36 <li>Condition: <& /Admin/Elements/SelectScripCondition, Name => 'NewScripCondition' &>
37 Action: <& /Admin/Elements/SelectScripAction, Name => 'NewScripAction' &>
38 Template: <& /Admin/Elements/SelectTemplate, Name => 'NewScripTemplate' &>
42 <& /Elements/TitleBoxEnd &>
43 <& /Elements/Submit &>
46 my (@actions, $description);
48 my $Scrips = new RT::Scrips ($session{'CurrentUser'});
49 $Scrips->LimitToGlobal();
54 if ($NewScripAction and $NewScripCondition) {
55 my $NewScrip = new RT::Scrip($session{'CurrentUser'});
57 my ($retval, $msg) = $NewScrip->Create ( ScripAction => $NewScripAction,
58 ScripCondition => $NewScripCondition,
59 Stage => 'TransactionCreate',
61 Template => $NewScripTemplate);
62 if (defined $retval) {
70 # {{{ deal with modifying and deleting existing scrips
72 foreach $key (keys %ARGS) {
73 # {{{ if we're trying to delete the scrip
74 if ($key =~ /^DeleteScrip-(\d+)/) {
76 my $scrip = new RT::Scrip($session{'CurrentUser'});
78 my ($retval, $msg) = $scrip->Delete;
80 push @actions, "Scrip deleted";
92 $NewScripCondition => undef
93 $NewScripAction => undef
94 $NewScripTemplate => undef