Bug 11366: make "no group" option in acq basket group drop-down translatable
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 5 Mar 2014 13:26:14 +0000 (14:26 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jun 2014 12:35:26 +0000 (08:35 -0400)
in Acq baskets, there's a pull-down for basket groups. One of the
entries in that pull-down is "No group", which is untranslatable.
This string is hard-coded in Perl.

This patch removes the string from Perl to set it has first option
in select. To allow it to be default value, the option "Add new group"
is moved to last position.

Test plan :
- Go to a closed aquisition basket in no basket group :
  cgi-bin/koha/acqui/basket.pl?basketno=x
=> You see "No group" selected in combobox "Basket group"
- Cick on this combobox
=> You see "No group", then existing basket groups and then "Add new
   group"
- Select a basket group and click on "change basket group"
=> You see the basket group name in combobox
Use translation, for example fr-FR
- go to src/misc/translator
- run : perl translate update fr-FR
=> You find in PO file :
  #: intranet-tmpl/prog/en/modules/acqui/basket.tt:365
  #, fuzzy, c-format
  msgid "No group"
  msgstr "Nom de groupe"
- remove ", fuzzy" and correct translation : "Pas de groupe"
- run : perl translate install fr-FR
- Go to translated aquisition basket page
=> You see translated option in combobox

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 21e6518d32477fa1fe59da64d735f3f07ae49bcd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1b760f8e4df32f73861b96ffc5ea4e2d0bd196a5)

acqui/basket.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

index 9dad355..c916138 100755 (executable)
@@ -216,13 +216,6 @@ if ( $op eq 'delete_confirm' ) {
                 $basketgroup = $bg;
             }
         }
-        my %emptygroup = ( id   =>   undef,
-                           name =>   "No group");
-        if ( ! $basket->{basketgroupid} ) {
-            $emptygroup{default} = 1;
-            $emptygroup{nogroup} = 1;
-        }
-        unshift( @$basketgroups, \%emptygroup );
     }
 
     # if the basket is closed, calculate estimated delivery date
index 6bfce77..5200080 100644 (file)
                             [%- END -%]
                           [% ELSE %]
                             <select id="basketgroupid" name="basketgroupid">
-                              <option value="new">Add new group</option>
+                              <option value="">No group</option>
                               [% FOREACH bg IN basketgroups %]
                                 [% IF ( bg.default ) %]
                                     <option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
                                   [% END %]
                                 [% END %]
                               [% END %]
+                              <option value="new">Add new group</option>
                             </select>
                             <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
                             <input type="hidden" value="mod_basket" name="op" />