Bug 15752: (QA follow-up) Inform user that patron was automatically switched
authorJosef Moravec <josef.moravec@gmail.com>
Fri, 18 Aug 2017 10:58:51 +0000 (10:58 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 20:38:58 +0000 (17:38 -0300)
Test plan:

1) Start checking out to some patron - there should be no message about
auto switching
2) read the another patrons card - note the patron is switched and there
is a message about it at top of the main page content

Followed test plan, patch worked as described. Passed QA test tool
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 3df7b1e..cd7b550 100755 (executable)
@@ -86,7 +86,7 @@ my $barcode =  $query->param('barcode');
 
 if (C4::Context->preference("AutoSwitchPatron") && $barcode) {
     if (Koha::Patrons->search( { cardnumber => $barcode} )->count() > 0) {
-        print $query->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=".$barcode);
+        print $query->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$barcode&amp;autoswitched=1");
     }
 }
 
@@ -669,6 +669,7 @@ $template->param(
     has_modifications         => $has_modifications,
     override_high_holds       => $override_high_holds,
     nopermission              => scalar $query->param('nopermission'),
+    autoswitched              => $query->param("autoswitched"),
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index cdfb908..d47d703 100644 (file)
@@ -159,6 +159,10 @@ $(document).ready(function() {
 <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
 [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>[% END %]
 
+[% IF autoswitched %]
+    <div id="autoswitched" class="dialog message">Patron was automatically switched by reading the patron card during checking out. Ensure you are working with the right patron.</div>
+[% END %]
+
 [% IF additional_materials %]
     <div id="materials" class="dialog message">Note about the accompanying materials: <br />
     [% additional_materials %]