From 847c7101d66e09bf26c8d6a50978f4bd915b3161 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 16 Mar 2016 10:01:18 +0000 Subject: [PATCH] Bug 16082: Display a friendly "patron does not exist" message if that's the case - circulation.pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The major part of pages you can access from a patron detail page (menu) does not take into consideration the 'patron does not exist' case. If the borrowernumber is linked to a deleted patron, a friendly message should be displayed instead of an empty patron detail page. Test plan: Go on circ/circulation.pl?borrowernumber=424242 and circ/circulation.pl?borrowernumber=424242&batch=1 Notice the difference before and after this patch Signed-off-by: Marc VĂ©ron --- circ/circulation.pl | 2 +- .../prog/en/modules/circ/circulation.tt | 16 ++++++----- .../en/modules/circ/circulation_batch_checkouts.tt | 28 +++++++++++++------- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 5cfd93f..75799bd 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -537,7 +537,7 @@ foreach my $flag ( sort keys %$flags ) { } } -my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0; +my $amountold = $borrower->{flags} ? $borrower->{flags}->{'CHARGES'}->{'message'} || 0 : 0; $amountold =~ s/^.*\$//; # remove upto the $, if any my ( $total, $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index c4b41f3..eaae5d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -10,7 +10,7 @@ [% INCLUDE 'doc-head-open.inc' %] [% SET destination = "circ" %] Koha › Circulation -[% IF borrowernumber %] +[% IF borrowernumber and borrower%] › Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %] @@ -50,7 +50,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %] -[% IF ( borrowernumber ) %] +[% IF borrowernumber and borrower %] if($.cookie("holdfor") != [% borrowernumber %]){ $.removeCookie("holdfor", { path: '/' }); } @@ -129,7 +129,7 @@ $(document).ready(function() { [% INCLUDE 'circ-search.inc' %] [% END %] -[% UNLESS ( borrowers ) %][% IF ( borrowernumber ) %]
+[% UNLESS ( borrowers ) %][% IF borrowernumber and borrower %]
[% INCLUDE 'circ-menu.inc' %]
[% END %][% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt index 8118251..eadeb1d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt @@ -7,7 +7,7 @@ [% INCLUDE 'doc-head-open.inc' %] [% SET destination = "circ" %] Koha › Circulation -[% IF borrowernumber %] +[% IF borrowernumber and borrower %] › Batch check out › Issuing items to [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %] @@ -42,7 +42,11 @@ $(document).ready(function() { [% INCLUDE 'circ-search.inc' %]
@@ -52,20 +56,20 @@ $(document).ready(function() {
-[% IF ( borrowernumber ) %] +[% IF borrowernumber and borrower %] [% INCLUDE 'members-toolbar.inc' %] [% END %] -[% IF NOT batch_allowed %] +[% IF borrower and not batch_allowed %]
You are not allowed to use batch checkout for this patron
-[% ELSIF noissues and not checkout_infos %] +[% ELSIF borrower and noissues and not checkout_infos %]
Cannot check out! [% IF charges_is_blocker %] Checkouts are BLOCKED because fine balance is OVER THE LIMIT. [% END %]
-[% ELSIF NOT checkout_infos %] +[% ELSIF borrower and not checkout_infos %]
@@ -94,7 +98,7 @@ $(document).ready(function() {
-[% ELSE %] +[% ELSIF borrower %] [% IF confirmation_needed && CAN_user_circulate_force_checkout %]

Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]

@@ -276,13 +280,17 @@ $(document).ready(function() {
[% END %] +[% ELSE %] +
This patron does not exist. Find another patron?
[% END %]
-
-[% INCLUDE 'circ-menu.inc' %] -
+[% IF borrower %] +
+ [% INCLUDE 'circ-menu.inc' %] +
+[% END %] [% INCLUDE 'intranet-bottom.inc' %] -- 1.7.10.4