1 <FORM NAME="ModifyKeywordSelect" METHOD=POST ACTION="<%$RT::WebPath%>/Admin/KeywordSelects/Modify.html">
6 <INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>">
10 %while ( $parent = $parents->Next ) {
12 <OPTION VALUE="<% $parent->id %>" <% defined($KeywordSelect->Parent) && $parent->id == $KeywordSelect->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION>
19 <SELECT NAME="ObjectType">
20 <OPTION SELECTED>Ticket</OPTION>
25 function addOption(text, value, defaultselected, selected) {
26 var option = new Option(text, value, defaultselected, selected )
27 var length = document.ModifyKeywordSelect.ObjectValue.length;
28 document.ModifyKeywordSelect.ObjectValue.options[length] = option
30 function ChangeObjectValue(what) {
31 Value = what.options[what.selectedIndex].value
32 if ( Value == "(none)" ) {
33 document.ModifyKeywordSelect.ObjectValue.options.length = 0
34 addOption("(n/a)", "", false, false)
36 if ( Value == "Queue" ) {
37 document.ModifyKeywordSelect.ObjectValue.options.length = 0
38 %foreach $queue ( keys %queues ) {
39 addOption("<% $queues{$queue} %>", "<% $queue %>", false, <% $queue == $KeywordSelect->ObjectValue ? 'true' : 'false' %> )
45 Limit to <SELECT NAME="ObjectField" onChange="ChangeObjectValue(this)">
46 <OPTION VALUE="" <% $KeywordSelect->ObjectField ? '' : ' SELECTED' %>>(none)</OPTION>
47 <OPTION VALUE="Queue" <% $KeywordSelect->ObjectField eq 'Queue' ? ' SELECTED' : '' %>>Queue</OPTION>
49 <SELECT NAME="ObjectValue">
50 <OPTION VALUE="<% $KeywordSelect->ObjectValue %>">
51 <% $KeywordSelect->ObjectField ? $queues{$KeywordSelect->ObjectValue} : "(n/a)" %></OPTION>
53 <INPUT TYPE="hidden" NAME="SingleMagic" VALUE="1">
54 <INPUT TYPE="checkbox" NAME="Single" VALUE="1" <% $KeywordSelect->Single ? ' CHECKED' : '' %>>Allow single selection only<BR>
55 Limit to <INPUT TYPE="text" NAME="Generations" SIZE="2" VALUE="<% $KeywordSelect->Generations %>"> generations (0 = no limit)<BR>
56 <& /Elements/Submit, Label => $submit &>
63 my $KeywordSelect = new RT::KeywordSelect($session{CurrentUser});
68 $title = "Create a new KeywordSelect";
73 $id = $KeywordSelect->Create (
75 ObjectType => $ObjectType,
76 ObjectField => $ObjectField,
77 ObjectValue => $ObjectValue,
79 Generations => $Generations,
80 ) or Abort "can't create KeywordSelect";
82 $KeywordSelect->Load($id) || Abort("Can't load keyword id $id");
84 $KeywordSelect->SetParent($Parent) if defined($Parent);
85 $KeywordSelect->SetObjectType($ObjectType) if defined($ObjectType);
86 $KeywordSelect->SetObjectField($ObjectField) if defined($ObjectField);
87 $KeywordSelect->SetObjectValue($ObjectValue) if defined($ObjectValue);
88 $KeywordSelect->SetSingle($Single) if defined($SingleMagic);
89 $KeywordSelect->SetGenerations($Generations) if defined($Generations);
91 $title = "Modify the KeywordSelect <B>". $KeywordSelect->KeywordObj->Name. "</B>";
96 my $parents = new RT::Keywords($session{CurrentUser});
100 my $queues = new RT::Queues($session{CurrentUser});
105 $queues{$queue->id} = $queue->Name while $queue = $queues->Next;
114 $ObjectField => undef
115 $ObjectValue => undef
117 $SingleMagic => undef
118 $Generations => undef