X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FElements%2FSelectGroupBy;h=99f0f47eb35629e680130564da3cd08ad61f3ddd;hb=0ed195595b5c7ea404c8848d9d1881ada4214489;hp=9a6951a82e0e9eaa48060a32a5fa8691550d5105;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/rt/share/html/Search/Elements/SelectGroupBy b/rt/share/html/Search/Elements/SelectGroupBy index 9a6951a82..99f0f47eb 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-2015 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>