X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FElements%2FSelectGroupBy;h=bdd60c90f7f480d260b26c1435de21a2f24885fa;hb=187086c479a09629b7d180eec513fb7657f4e291;hp=9a6951a82e0e9eaa48060a32a5fa8691550d5105;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6;p=freeside.git diff --git a/rt/share/html/Search/Elements/SelectGroupBy b/rt/share/html/Search/Elements/SelectGroupBy index 9a6951a82..bdd60c90f 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-2018 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>