<& /Admin/Elements/Header, Title => 'Edit scrips' &> <& /Admin/Elements/SystemTabs &> <& /Elements/ListActions, actions => \@actions &> <& /Elements/TitleBoxStart, title => "Modify global scrips" &>
> % if ($Scrips->Count > 0 ) { % while (my $scrip = $Scrips->Next ) { % }
Delete
<% $scrip->ConditionObj->Name %> <% $scrip->ActionObj->Name %> <% $scrip->TemplateObj->Alias %>
% } Add a scrip which will apply to all queues: <& /Elements/TitleBoxEnd &> <& /Elements/Submit &>
<%init> my (@actions, $description); my $Scrips = new RT::Scrips ($session{'CurrentUser'}); $Scrips->LimitToGlobal(); if ($NewScripAction and $NewScripCondition) { my $NewScrip = new RT::Scrip($session{'CurrentUser'}); my $retval = $NewScrip->Create ( ScripAction => $NewScripAction, ScripCondition => $NewScripCondition, Stage => 'TransactionCreate', Queue => $Queue, Template => $NewScripTemplate); if (defined $retval) { push @actions, "Scrip added."; } else { push @actions, "Scrip could not be added"; } } # {{{ deal with modifying and deleting existing scrips my ($key ); foreach $key (keys %ARGS) { # {{{ if we're trying to delete the scrip if ($key =~ /^DeleteScrip-(\d+)/) { my $id = $1; my $scrip = new RT::Scrip($session{'CurrentUser'}); $scrip->Load($id); $scrip->Delete; } # }}} } # }}} <%ARGS> $NewScripCondition => undef $NewScripAction => undef $NewScripTemplate => undef $Queue => undef #some identifier that a Queue could