Bug 18335 - Check in: Make patron info in hold messages obey syspref AddressFormat
authorMarc Véron <veron@veron.ch>
Sun, 26 Mar 2017 15:26:22 +0000 (17:26 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 21 Apr 2017 14:34:49 +0000 (10:34 -0400)
When checking in, information about patrons with a hold always display
in an US style. Address information should opey the system preference
AddressFormat

To reproduce:
- Set syspref AddressFormat to German style
- Check out an item to a patron A
- Put a hold on this item for patron B
- Check in item using the Check in field in page header
- Result: In message 'Hold found', address does not display in German
  style

To test:
- Apply patch
- Repeat steps above
- Verify that address displays as expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
circ/returns.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

index 6e27645..3ef887f 100755 (executable)
@@ -92,7 +92,7 @@ my $printer = $userenv->{'branchprinter'} // '';
 my $forgivemanualholdsexpire = $query->param('forgivemanualholdsexpire');
 
 my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
-#
+ #
 # Some code to handle the error if there is no branch or printer setting.....
 #
 
@@ -413,11 +413,14 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
             wbortitle       => $borr->{'title'},
             wborphone       => $borr->{'phone'},
             wboremail       => $borr->{'email'},
-            wborstnum       => $borr->{streetnumber},
-            wboraddress     => $borr->{'address'},
-            wboraddress2    => $borr->{'address2'},
-            wborcity        => $borr->{'city'},
-            wborzip         => $borr->{'zipcode'},
+            streetnumber    => $borr->{streetnumber},
+            streettype      => $borr->{streettype},
+            address         => $borr->{'address'},
+            address2        => $borr->{'address2'},
+            city            => $borr->{'city'},
+            zipcode         => $borr->{'zipcode'},
+            state           => $borr->{'state'},
+            country         => $borr->{'country'},
             wborrowernumber => $reserve->{'borrowernumber'},
             wborcnum        => $borr->{'cardnumber'},
             wtransfertFrom  => $userenv_branch,
@@ -455,11 +458,14 @@ if ( $messages->{'ResFound'}) {
             bortitle       => $borr->{'title'},
             borphone       => $borr->{'phone'},
             boremail       => $borr->{'email'},
-            boraddress     => $borr->{'address'},
-            boraddress2    => $borr->{'address2'},
-            borstnum       => $borr->{streetnumber},
-            borcity        => $borr->{'city'},
-            borzip         => $borr->{'zipcode'},
+            streetnumber   => $borr->{streetnumber},
+            streettype     => $borr->{streettype},
+            address        => $borr->{'address'},
+            address2       => $borr->{'address2'},
+            city           => $borr->{'city'},
+            zipcode        => $borr->{'zipcode'},
+            state          => $borr->{'state'},
+            country        => $borr->{'country'},
             borcnum        => $borr->{'cardnumber'},
             debarred       => $borr->{'debarred'},
             gonenoaddress  => $borr->{'gonenoaddress'},
index bcac3fc..ba284bc 100644 (file)
     [% END %]
 [% END %]
 
+[% BLOCK display_holdpatron_address %]
+    [% IF Koha.Preference( 'AddressFormat' ) %]
+        [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
+    [% ELSE %]
+        [% INCLUDE 'member-display-address-style-us.inc' %]
+    [% END %]
+[% END %]
+
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
@@ -226,13 +234,12 @@ $(document).ready(function () {
         <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% TransferWaitingAt %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
         <button class="deny" type="submit" onclick="window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1'"><i class="fa fa-times"></i> Cancel transfer</button>
 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
-        <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
+        <ul>
+            <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
             [% borsurname %], [% borfirstname %]</a> ([% borcnum %]) <span class="patron-category"> - [% wborcategory %]</span> </li>
-                <li>[% wborstnum %] [% wboraddress %][% IF ( wboraddress2 ) %]<br />
-               [% wboraddress2 %]<br />[% END %]
-        [% wborcity %]  [% wborzip %]</li>
-        [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
-               [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
+            [% INCLUDE display_holdpatron_address %]
+            [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
+            [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
         </ul>
 
     <form method="post" action="returns.pl" class="confirm">
@@ -272,20 +279,12 @@ $(document).ready(function () {
                     [% END %]
 
                     <h4>Hold for:</h4>
-
+                    <ul>
                     <li>
                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])
                         <span class="patron-category"> - [% borcategory %]</span>
                     </li>
-
-                    <li>
-                        [% borstnum %] [% boraddress %]<br />
-                        [% IF ( boraddress2 ) %]
-                            [% boraddress2 %]<br />
-                        [% END %]
-                        [% borcity %] [% borzip %]
-                    </li>
-
+                    [% INCLUDE display_holdpatron_address %]
                     [% IF ( borphone ) %]
                         <li> [% borphone %]</li>
                     [% END %]
@@ -301,6 +300,7 @@ $(document).ready(function () {
                     [% IF ( gonenoaddress ) %]
                         <li class="error">Patron's address is in doubt</li>
                     [% END %]
+                    </ul>
 
                     [% IF ( transfertodo ) %]
                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
@@ -357,9 +357,7 @@ $(document).ready(function () {
                 <h4>Hold for: </h4>
                     <ul>
                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %]) <span class="patron-category"> - [% wborcategory %]</span> </li>
-                        <li>[% borstnum %] [% boraddress %]<br />
-                                               [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
-                                               [% borcity %]  [% borzip %]</li>
+                        [% INCLUDE display_holdpatron_address %]
                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
@@ -477,7 +475,6 @@ $(document).ready(function () {
                         <h4>Notes: [% reservenotes %]</h4>
                     [% END %]
                     <h5>Hold for:</h5>
-
                         <li>
                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
                                 [% borsurname %], [% borfirstname %]
@@ -486,13 +483,7 @@ $(document).ready(function () {
                             <span class="patron-category"> - [% borcategory %]</span>
                         </li>
 
-                        <li>
-                            [% borstnum %] [% boraddress %]<br />
-                            [% IF ( boraddress2 ) %]
-                                [% boraddress2 %]<br />
-                            [% END %]
-                            [% borcity %] [% borzip %]
-                        </li>
+                        [% INCLUDE display_holdpatron_address %]
 
                         [% IF ( borphone ) %]
                             <li>[% borphone %]</li>