1 <& /Admin/Elements/Header, Title => 'Admin KeywordSelects' &>
2 <& /Admin/Elements/Tabs, current_tab => 'Admin/KeywordSelects/' &>
4 A <B>KeywordSelect</B> is a link between a <B>Keyword</B> and a object
5 (currently just <B>Tickets</B>), titled by the <I>Name</I> field of the Keyword such that:
7 <li>Object display will contain a field, titled with the <I>Name</I> field of
8 the <B>Keyword</B> and showing any descendent keywords.
9 <li>Object creation for this field will contain a field, titled with the
10 <I>Name</I> field of the <B>Keyword</B> and containing the descendents of
11 the <B>Keyword</B> as choices.
12 <li>Searches for this object type will contain a selection field titled with
13 the <I>Name</I> field of the <B>Keyword</B> and containing the descendents
14 of the <B>Keyword</B> as choices.
20 <h2>Create KeywordSelect</h2>
21 <FORM NAME="ModifyKeywordSelect" METHOD="POST" ACTION="<%$RT::WebPath%>/Admin/KeywordSelects/Modify.html">
25 <INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>">
27 <SELECT NAME="Parent">
29 %while ( $parent = $parents->Next ) {
31 <OPTION VALUE="<% $parent->id %>" <% defined($KeywordSelect->Parent) && $parent->id == $KeywordSelect->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION>
38 <SELECT NAME="ObjectType">
39 <OPTION SELECTED>Ticket</OPTION>
43 %foreach $queue ( keys %queues ) {
44 addOption("<% $queues{$queue} %>", "<% $queue %>", false, <% $queue == $KeywordSelect->ObjectValue ? 'true' : 'false' %> )
50 Limit to <SELECT NAME="ObjectField" onChange="ChangeObjectValue(this)">
51 <OPTION VALUE="" <% $KeywordSelect->ObjectField ? '' : ' SELECTED' %>>(none)</OPTION>
52 <OPTION VALUE="Queue" <% $KeywordSelect->ObjectField eq 'Queue' ? ' SELECTED' : '' %>>Queue</OPTION>
54 <SELECT NAME="ObjectValue">
55 <OPTION VALUE="<% $KeywordSelect->ObjectValue %>">
56 <% $KeywordSelect->ObjectField ? $queues{$KeywordSelect->ObjectValue} : "(n/a)" %></OPTION>
58 <INPUT TYPE="hidden" NAME="SingleMagic" VALUE="1">
59 <INPUT TYPE="checkbox" NAME="Single" VALUE="1" <% $KeywordSelect->Single ? ' CHECKED' : '' %>>Allow single selection only<BR>
60 Limit to <INPUT TYPE="text" NAME="Generations" SIZE="2" VALUE="<% $KeywordSelect->Generations %>"> generations (0 = no limit)<BR>
61 <& /Elements/Submit, Label => $submit &>
68 my $KeywordSelect = new RT::KeywordSelect($session{CurrentUser});
73 $title = "Create a new KeywordSelect";
78 $id = $KeywordSelect->Create (
80 ObjectType => $ObjectType,
81 ObjectField => $ObjectField,
82 ObjectValue => $ObjectValue,
84 Generations => $Generations,
85 ) or Abort "can't create KeywordSelect";
87 $KeywordSelect->Load($id) || Abort("Can't load keyword id $id");
89 $KeywordSelect->SetParent($Parent) if defined($Parent);
90 $KeywordSelect->SetObjectType($ObjectType) if defined($ObjectType);
91 $KeywordSelect->SetObjectField($ObjectField) if defined($ObjectField);
92 $KeywordSelect->SetObjectValue($ObjectValue) if defined($ObjectValue);
93 $KeywordSelect->SetSingle($Single) if defined($SingleMagic);
94 $KeywordSelect->SetGenerations($Generations) if defined($Generations);
96 $title = "Modify the KeywordSelect <B>". $KeywordSelect->KeywordObj->Name. "</B>";
101 my $parents = new RT::Keywords($session{CurrentUser});
105 my $queues = new RT::Queues($session{CurrentUser});
110 $queues{$queue->id} = $queue->Name while $queue = $queues->Next;
119 $ObjectField => undef
120 $ObjectValue => undef
122 $SingleMagic => undef
123 $Generations => undef
127 <& /Admin/Elements/ModifyKeywordSelect, 'Create'=>'1' &>
131 <H2>Modify KeywordSelect</H2>
133 <& /Admin/Elements/SelectModifyKeywordSelect &>