X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FElements%2FSelectGroupBy;h=95b5ee1fb8c93422f22c1a7dbd5d93b83652a3b4;hp=8b436c85429b962d9363a8c39379b0c7f11feab8;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125 diff --git a/rt/share/html/Search/Elements/SelectGroupBy b/rt/share/html/Search/Elements/SelectGroupBy index 8b436c854..95b5ee1fb 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-2013 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 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>