X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FElements%2FSelectGroupBy;h=99f0f47eb35629e680130564da3cd08ad61f3ddd;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hp=8daab6daa0bb8a4563a1dcc775de974715202b4e;hpb=73a6a80a9ca5edbd43d139b7cb25bfee4abfd35e;p=freeside.git diff --git a/rt/share/html/Search/Elements/SelectGroupBy b/rt/share/html/Search/Elements/SelectGroupBy index 8daab6daa..99f0f47eb 100644 --- a/rt/share/html/Search/Elements/SelectGroupBy +++ b/rt/share/html/Search/Elements/SelectGroupBy @@ -49,11 +49,29 @@ $Name => 'GroupBy' $Default => 'Status' $Query => '' +$ShowEmpty => 0 - +% if ( $ShowEmpty ) { + +% } +<%perl> +my $in_optgroup = ""; +while ( my ($label, $value) = splice @options, 0, 2 ) { + my ($optgroup, $text) = @$label; + if ($in_optgroup ne $optgroup) { + $m->out("\n") if $in_optgroup; + + my $name = $m->interp->apply_escapes(loc($optgroup), 'h'); + $m->out(qq[\n]); + + $in_optgroup = $optgroup; + } + + +% } +% if ($in_optgroup) { + % } <%init>