<& /Admin/Elements/Header, Title => loc('Edit scrips') &> <& /Admin/Elements/SystemTabs &> <& /Elements/ListActions, actions => \@actions &> <& /Elements/TitleBoxStart, title => loc("Modify global scrips") &>

<&|/l&>Create a new global scrip

<&|/l&>Global Scrips:

% if ($Scrips->Count == 0 ) {

<&|/l&>(No scrips)

% } else {

<&|/l&>(Check box to delete scrip)

% while (my $scrip = $Scrips->Next ) { % }
  • <% $scrip->ConditionObj->Name %> <% $scrip->ActionObj->Name %> <&|/l, $scrip->TemplateObj->Name &>with template [_1]
  • % } <& /Elements/TitleBoxEnd &> <& /Elements/Submit &>
    <%init> my (@actions); my $Scrips = new RT::Scrips ($session{'CurrentUser'}); $Scrips->LimitToGlobal(); # {{{ 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); my ($retval, $msg) = $scrip->Delete; if ($retval) { push @actions, "Scrip deleted"; } else { push @actions, $msg; } } # }}} } # }}} <%ARGS>