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 <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit
7aedcf643e6f7793b4ebf55b1c7cdec7ec04a25d)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
}
}
-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 );
[% INCLUDE 'doc-head-open.inc' %]
[% SET destination = "circ" %]
<title>Koha › Circulation
-[% IF borrowernumber %]
+[% IF borrowernumber and borrower%]
› Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
[% END %]
</title>
columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %]
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
if($.cookie("holdfor") != [% borrowernumber %]){
$.removeCookie("holdfor", { path: '/' });
}
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> ›
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
<a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a> › [% INCLUDE 'patron-title.inc' %]
[% ELSE %]
<strong>Checkouts</strong>
<div class="yui-b">
[% END %]
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
[% INCLUDE 'members-toolbar.inc' %]
[% END %]
<!-- BARCODE ENTRY -->
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
<div class="yui-g">
[% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
[% END %]
</div> <!-- reservesloop -->
-[% END %] <!-- borrowernumber -->
+[% ELSE %]
+ <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
+[% END %] <!-- borrowernumber and borrower-->
</div></div>
[% END %]
</div>
</div>
-[% UNLESS ( borrowers ) %][% IF ( borrowernumber ) %]<div class="yui-b">
+[% UNLESS ( borrowers ) %][% IF borrowernumber and borrower %]<div class="yui-b">
[% INCLUDE 'circ-menu.inc' %]
</div>[% END %][% END %]
</div>
[% INCLUDE 'doc-head-open.inc' %]
[% SET destination = "circ" %]
<title>Koha › Circulation
-[% IF borrowernumber %]
+[% IF borrowernumber and borrower %]
› Batch check out › Issuing items to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
[% END %]
</title>
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> ›
- <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> › [% INCLUDE 'patron-title.inc' %]
+ [% IF borrower and borrowernumber %]
+ <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> › [% INCLUDE 'patron-title.inc' %]
+ [% ELSE %]
+ Batch check out
+ [% END %]
</div>
<div id="doc3" class="yui-t2">
<div class="yui-g">
-[% IF ( borrowernumber ) %]
+[% IF borrowernumber and borrower %]
[% INCLUDE 'members-toolbar.inc' %]
[% END %]
-[% IF NOT batch_allowed %]
+[% IF borrower and not batch_allowed %]
<div class="dialog alert">You are not allowed to use batch checkout for this patron</div>
-[% ELSIF noissues and not checkout_infos %]
+[% ELSIF borrower and noissues and not checkout_infos %]
<div class="dialog alert">
Cannot check out!
[% IF charges_is_blocker %]
Checkouts are <span class="circ-hlt">BLOCKED</span> because fine balance is <span class="circ-hlt">OVER THE LIMIT</span>.
[% END %]
</div>
-[% ELSIF NOT checkout_infos %]
+[% ELSIF borrower and not checkout_infos %]
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
<fieldset id="circ_circulation_issue">
<label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
</fieldset>
</form>
-[% ELSE %]
+[% ELSIF borrower %]
[% IF confirmation_needed && CAN_user_circulate_force_checkout %]
<h3>Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
</form>
[% END %]
+[% ELSE %]
+ <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
[% END %]
</div>
</div>
</div>
-<div class="yui-b">
-[% INCLUDE 'circ-menu.inc' %]
-</div>
+[% IF borrower %]
+ <div class="yui-b">
+ [% INCLUDE 'circ-menu.inc' %]
+ </div>
+[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]