& /Admin/Elements/Header, Title => 'Edit keywords' &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id &> <& /Elements/ListActions, actions => \@actions &> <& /Elements/TitleBoxStart, title => $description &>
<%init> my (@actions, $description); my $KeywordSelects = new RT::KeywordSelects ($session{'CurrentUser'}); unless ($id =~ /^\d+$/) { Abort("$id isn't a valid Queue id."); } unless ($KeywordSelects->LimitToQueue($id)) { Abort("Couldn't load KeywordSelects."); } my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($id); $description = "Modify Keyword selections for queue '". $QueueObj->Name ."'"; if (($Keyword) && ($Keyword ne '' )){ my $NewKeywordSelect = new RT::KeywordSelect($session{'CurrentUser'}); my $retval = $NewKeywordSelect->Create ( Keyword => $Keyword, ObjectField => 'Queue', ObjectType => 'Ticket', ObjectValue => $QueueObj->Id, Name => $Name, Single => $Single, Depth => $Depth, ); if (defined $retval) { push @actions, "KeywordSelect added to queue"; } else { push @actions, "KeywordSelect could not be added to queue"; } } # {{{ deal with modifying and deleting existing scrips my ($key); foreach $key (keys %ARGS) { # {{{ if we're trying to delete the scrip if ($key =~ /^DeleteKeywordSelect-(\d+)/) { my $id = $1; $RT::Logger->debug("Now trying to delete keyword select $id\n"); my $keywordselect = new RT::KeywordSelect($session{'CurrentUser'}); $keywordselect->Load($id) || Abort("Couldn't load KeywordSelect $id for deletion"); $keywordselect->Delete || Abort("Couldn't delete KeywordSelect $id"); } # }}} } # }}} %init> <%ARGS> $id => undef #some identifier that a Queue could $Keyword => undef $Single => undef $Depth => undef $Name => undef %ARGS>