From: Bill Erickson Date: Thu, 27 Oct 2011 17:03:26 +0000 (-0400) Subject: TPac; sort coded value maps by label alphabetically X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=83d70f918cb7f143e55778dd25dc8ac56d970674;p=contrib%2FConifer.git TPac; sort coded value maps by label alphabetically Affects languages, formats, and audience. Signed-off-by: Bill Erickson Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2 b/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2 index 33469fe558..0016b7a1a9 100644 --- a/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2 +++ b/Open-ILS/src/templates/opac/parts/coded_value_selector.tt2 @@ -20,8 +20,14 @@ size ? (' size="' _ size _ '"') : ''; %]> [% IF none_ok %] -[% END %] -[% FOR o IN all_values %] +[% END; +# turn the list of objects into a list of hashes to +# leverage TT's array.sort('') behavior +sorter = []; +FOR o IN all_values; + sorter.push({code => o.code, value => o.value}); +END; +FOR o IN sorter.sort('value') %] [% END -%]