diff options
Diffstat (limited to 'rt/webrt/Ticket/Elements/EditKeywordSelects')
-rw-r--r-- | rt/webrt/Ticket/Elements/EditKeywordSelects | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/rt/webrt/Ticket/Elements/EditKeywordSelects b/rt/webrt/Ticket/Elements/EditKeywordSelects new file mode 100644 index 000000000..34ade9f25 --- /dev/null +++ b/rt/webrt/Ticket/Elements/EditKeywordSelects @@ -0,0 +1,45 @@ + +<TABLE> + <TR> +% while ( my $KeywordSelect = $KeywordSelects->Next ) { +% my $CurrentKeywords = $TicketObj->KeywordsObj($KeywordSelect->id); +% my $Descendents = $KeywordSelect->KeywordObj->Descendents; + <TD VALIGN=TOP> + <% $KeywordSelect->Name %> + <BR> + <INPUT TYPE="hidden" NAME="KeywordSelectMagic<% $KeywordSelect->id %>" VALUE="1"> + <SELECT NAME="KeywordSelect<% $KeywordSelect->id %>" + <% $KeywordSelect->Single ? "" : " MULTIPLE " %> SIZE=5> +%# +%# +%# All of this cruft is so we have a 'no keyword' selector for single +%# keywords that's only selected when there's no value. +% +% my $selected_keywords = 0; +% foreach my $kid ( keys %{$Descendents} ) { +% my $selected = 0; +% if ($CurrentKeywords->HasEntry($kid)) { $selected_keywords++; $selected=1;} + <OPTION VALUE="<% $kid %>" + <% $selected && 'SELECTED'%>> + <% $Descendents->{$kid} %> + </OPTION> +% } +% if ( $KeywordSelect->Single) { +<OPTION VALUE="" <% ($selected_keywords == 0) && 'SELECTED' %> >(empty)</OPTION> +% } + </SELECT> + </TD> +% } + </TR> + +</TABLE> + + +<%INIT> +my $KeywordSelects = $TicketObj->QueueObj->KeywordSelects; +</%INIT> + +<%ARGS> +$TicketObj => undef +</%ARGS> + |