diff options
Diffstat (limited to 'rt/webrt/Admin/Queues/Keywords.html')
-rw-r--r-- | rt/webrt/Admin/Queues/Keywords.html | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/rt/webrt/Admin/Queues/Keywords.html b/rt/webrt/Admin/Queues/Keywords.html deleted file mode 100644 index 7809805c5..000000000 --- a/rt/webrt/Admin/Queues/Keywords.html +++ /dev/null @@ -1,114 +0,0 @@ -<& /Admin/Elements/Header, Title => 'Edit keywords' &> -<& /Admin/Elements/QueueTabs, id => $QueueObj->Id &> - -<& /Elements/ListActions, actions => \@actions &> - -<& /Elements/TitleBoxStart, title => $description &> - -<h2>Global Keyword Selections</h2> -<& /Admin/Elements/ListGlobalKeywordSelects &> -<BR> - - <FORM METHOD=POST ACTION="Keywords.html"> - <INPUT TYPE=HIDDEN NAME=id VALUE="<%$id%>"> - -% if ($KeywordSelects->Count > 0 ) { - - -<h2>Queue Keyword Selections</h2> -<TABLE> -<TR><TD>Delete</TD></TR> -% while (my $keywordselect = $KeywordSelects->Next ) { -<TR> - <TD><INPUT TYPE="CHECKBOX" NAME="KeywordSelect-<%$keywordselect->Id%>-Delete"></TD> - <TD><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $keywordselect &></TD> -</TR> -% } -</TABLE> -% } - -Add a keyword selection to this queue: -%my $ks = new RT::KeywordSelect($session{'CurrentUser'}); -<ul> -<li><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $ks, NamePrefix => 'new' &></li> -</ul> - -<& /Elements/TitleBoxEnd &> -<& /Elements/Submit &> - -</FORM> -<%init> -my (@actions); - - - -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); - -my $description = "Modify Keyword selections for queue '". $QueueObj->Name ."'"; - - - -# {{{ if we're trying to create a new keyword select - -if ($ARGS{'KeywordSelect-new-Name'}) { - my $NewKeywordSelect = new RT::KeywordSelect($session{'CurrentUser'}); - - my ($retval, $msg) = $NewKeywordSelect->Create ( Keyword => $ARGS{'KeywordSelect-new-Keyword'}, - ObjectField => 'Queue', - ObjectType => 'Ticket', - ObjectValue => $QueueObj->Id, - Name => $ARGS{'KeywordSelect-new-Name'}, - Single => $ARGS{'KeywordSelect-new-Single'}, - Depth => $ARGS{'KeywordSelect-new-Depth'} - ); - push (@actions, $msg); -} -# }}} -# {{{ if we're trying to delete the keywordselect -foreach my $key (keys %ARGS) { - if ($key =~ /^KeywordSelect-(\d+)-Delete$/) { - my $id = $1; - my $keywordselect = new RT::KeywordSelect($session{'CurrentUser'}); - $keywordselect->Load($id) || push @actions, "Couldn't load keywordSelect"; - my ($val, $msg) = $keywordselect->SetDisabled(1); - if ($val) { - push @actions, 'KeywordSelect disabled.'; - } - else { - push @actions, $msg; - } - } -} -# }}} -# {{{ if we're modifying keyword selects -my @fields = qw(Name Keyword Single Depth); - -while (my $ks = $KeywordSelects->Next) { - foreach my $field (@fields) { - if (defined ($ARGS{"KeywordSelect-".$ks->Id."-".$field}) && - ($ARGS{"KeywordSelect-".$ks->Id."-".$field} ne $ks->$field())) { - - my $method = "Set$field"; - my ($val, $msg) = $ks->$method($ARGS{"KeywordSelect-".$ks->Id."-".$field}); - push @actions, "Keyword Select ". $ks->Name."/$field:".$msg; - } - } -} -# }}} - -</%init> - -<%ARGS> -$id => undef #some identifier that a Queue could - -</%ARGS> |