4 % while ( my $KeywordSelect = $KeywordSelects->Next ) {
5 % my $CurrentKeywords = $TicketObj->KeywordsObj($KeywordSelect->id);
6 % my $Descendents = $KeywordSelect->KeywordObj->Descendents;
8 <% $KeywordSelect->Name %>
10 <INPUT TYPE="hidden" NAME="KeywordSelectMagic<% $KeywordSelect->id %>" VALUE="1">
11 <SELECT NAME="KeywordSelect<% $KeywordSelect->id %>"
12 <% $KeywordSelect->Single ? "" : " MULTIPLE " %> SIZE=5>
15 %# All of this cruft is so we have a 'no keyword' selector for single
16 %# keywords that's only selected when there's no value.
18 % my $selected_keywords = 0;
19 % foreach my $kid ( keys %{$Descendents} ) {
21 % if ($CurrentKeywords->HasEntry($kid)) { $selected_keywords++; $selected=1;}
22 <OPTION VALUE="<% $kid %>"
23 <% $selected && 'SELECTED'%>>
24 <% $Descendents->{$kid} %>
27 % if ( $KeywordSelect->Single) {
28 <OPTION VALUE="" <% ($selected_keywords == 0) && 'SELECTED' %> >(empty)</OPTION>
39 my $KeywordSelects = $TicketObj->QueueObj->KeywordSelects;