X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FElements%2FSelectGroupBy;h=864c68f6b27d04a2dec14105c94630783d143c3c;hp=9a6951a82e0e9eaa48060a32a5fa8691550d5105;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916 diff --git a/rt/share/html/Search/Elements/SelectGroupBy b/rt/share/html/Search/Elements/SelectGroupBy index 9a6951a82..864c68f6b 100644 --- a/rt/share/html/Search/Elements/SelectGroupBy +++ b/rt/share/html/Search/Elements/SelectGroupBy @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -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>