Bug 12137: followup sort <select> index by value

adds alphabetical sorting to <select> lists displayed by
preferences.tt. although added for sorting the days of the
week, this may have larger ramifications. haven't been
tested thoroughly, but no apparent breakage seems to be
happening in preferences.

NOTE: Nice tweak. Makes days of week in sensible order.
      Properly adds sorting based on documentation that
      is really hard to find.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
This commit is contained in:
Indranil Das Gupta 2015-06-20 18:22:32 +05:30 committed by Tomas Cohen Arazi
parent db5fe99b33
commit 984f051adc

View file

@ -118,7 +118,7 @@
<input type="[%IF CHUNK.input_type %][% CHUNK.input_type %][% ELSE %]text[% END %]" name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" value="[% CHUNK.value %]" autocomplete="off" /> [% IF ( CHUNK.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
[% ELSIF ( CHUNK.type_select ) %]
<select name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "choice" %]">
[% FOREACH CHOICE IN CHUNK.CHOICES %]
[% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
[% IF ( CHOICE.selected ) %]
<option value="[% CHOICE.value %]" selected="selected">
[% ELSE %]