Bug 15301: branchtransfers.tt: Remove ambiguous "To" and fix splitted sentence
authorMarc Véron <veron@veron.ch>
Wed, 2 Dec 2015 14:34:44 +0000 (15:34 +0100)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Tue, 29 Dec 2015 21:24:50 +0000 (21:24 +0000)
The file intranet-tmpl/prog/en/modules/circ/branchtransfers.tt contains two
ambiguous words 'to' and a sentence splitted up by html tags, leading to weird
translations. Example in German: "Sie können keine Exemplare aus itemtype
transferieren BK für: Airfield"

To test:
- Apply patch

- Set up transfer policies for item types and collection codes in
  Home > Administration > Set library checkin and transfer policy
  Make sure that you have rules that deny and others that allow transfers

- Verify that syspref 'UseBranchTransferLimits' is set to 'Enforce'

- Set 'BranchTransferLimitTypes' to 'item type'

- Go to Home > Circulation > Transfers
- Transfer an item that is allowed for item type
  - Verify that the table of transferred items displays information
    about Item type, Collection code and Destination

- Transfer an item that is not allowed for the item type
  - Verify that the information about not allowing the transfer displays
    properly and is meaningfull

- Set 'BranchTransferLimitTypes' to 'collection code'

- Repeat the transfer steps above for allowed / not allowed collection code

(Amended to add ids to table and 8 columns, see comment #2)
(Amended for comment #5)
Followup for comment #8

Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
circ/branchtransfers.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchtransfers.tt

index 4caca05..22c9a07 100755 (executable)
@@ -188,15 +188,6 @@ if ($found) {
     }
 }
 
-#####################
-
-# Used for branch transfer limits error messages.
-my $codeTypeDescription = 'Collection Code';
-my $codeType = C4::Context->preference("BranchTransferLimitsType");
-if ( $codeType eq 'itemtype' ) {   
-    $codeTypeDescription = 'Item Type';
-}
-
 my @errmsgloop;
 foreach my $code ( keys %$messages ) {
     if ( $code ne 'WasTransfered' ) {
@@ -212,7 +203,6 @@ foreach my $code ( keys %$messages ) {
             my ( $tbr, $typecode ) = split( /::/,  $messages->{'NotAllowed'} );
             $err{tbr}      = $branches->{ $tbr }->{'branchname'};
             $err{code}     = $typecode;
-            $err{codeType} = $codeTypeDescription;
         }
         elsif ( $code eq 'IsPermanent' ) {
             $err{errispermanent} = 1;
index 1d47060..e2916d9 100644 (file)
@@ -1,3 +1,6 @@
+[% USE Koha %]
+[% USE ItemTypes %]
+[% USE AuthorisedValues %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Transfers</title>
 [% INCLUDE 'doc-head-close.inc' %]
                                   <li>Please return item to home library: [% errmsgloo.msg %]</li>
                               [% END %]
                               [% IF ( errmsgloo.errnotallowed ) %]
-                                  <li>You cannot transfer items of [% errmsgloo.codeType %] <b>[% errmsgloo.code %]</b> to <b>[% errmsgloo.tbr %]</b></li>
+                                  <li>Transfer is not allowed for:
+                                      <ol>
+                                          [% IF ( Koha.Preference('BranchTransferLimitsType') == 'itemtype' ) %]
+                                              <li>Item type: <b>[% ItemTypes.GetDescription( errmsgloo.code ) %]</b></li>
+                                          [% ELSE %]
+                                              <li>Collection code: <b>[% AuthorisedValues.GetByCode( 'CCODE', errmsgloo.code ) %]</b></li>
+                                          [% END %]
+                                          <li>Destination library: <b>[% errmsgloo.tbr %]</b></li>
+                                      </ol>
+                                  </li>
                               [% END %]
                               [% IF ( errmsgloo.errdesteqholding ) %]
                                   <li>Item is already at destination library.</li>
                <table>
             <caption>Transferred items</caption>
             <tr>
-                <th>Title</th>
-                <th>Author</th>
-                <th>Barcode</th>
-                <th>Shelving location</th>
-                <th>Call number</th>
-                <th>Type</th>
-                <th>To</th>
+                <th class="tf-title">Title</th>
+                <th class="tf-author">Author</th>
+                <th class="tf-barcode">Barcode</th>
+                <th class="tf-location">Shelving location</th>
+                <th class="tf-itemcallnumber">Call number</th>
+                <th class="tf-itemtype">Item type</th>
+                <th class="tf-ccode">Collection code</th>
+                <th class="tf-destination">Destination</th>
             </tr>
             [% FOREACH trsfitemloo IN trsfitemloop %]
                 <tr>
-                    <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% trsfitemloo.biblionumber %]">[% trsfitemloo.title |html %]</a></td>
-                    <td>[% trsfitemloo.author %]</td>
-                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% trsfitemloo.biblionumber %]&amp;itemnumber=[% trsfitemloo.itemnumber %]#item[% trsfitemloo.itemnumber %]">[% trsfitemloo.barcode %]</a></td>
-                    <td>[% trsfitemloo.location %]</td>
-                    <td>[% trsfitemloo.itemcallnumber %]</td>
-                    <td>[% trsfitemloo.ccode %]</td>
-                    <td>[% trsfitemloo.tobrname %]</td>
+                    <td class="tf-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% trsfitemloo.biblionumber %]">[% trsfitemloo.title |html %]</a></td>
+                    <td class="tf-author">[% trsfitemloo.author %]</td>
+                    <td class="tf-barcode"><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% trsfitemloo.biblionumber %]&amp;itemnumber=[% trsfitemloo.itemnumber %]#item[% trsfitemloo.itemnumber %]">[% trsfitemloo.barcode %]</a></td>
+                    <td class="tf-location">[% trsfitemloo.location %]</td>
+                    <td class="tf-itemcallnumber">[% trsfitemloo.itemcallnumber %]</td>
+                    <td class="tf-itemtype">[% ItemTypes.GetDescription( trsfitemloo.itemtype ) %]</td>
+                    <td class="tf-ccode">[% AuthorisedValues.GetByCode( 'CCODE', trsfitemloo.ccode ) %]</td>
+                    <td class="tf-destination">[% trsfitemloo.tobrname %]</td>
                 </tr>
             [% END %]
         </table>