Bug 18403: output_and_exit_if_error for circulation.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 5 Apr 2017 21:55:13 +0000 (18:55 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 18:41:39 +0000 (15:41 -0300)
This is a follow-up for a previous patch, changes have been tested
already

Signed-off-by: Signed-off-by: Jon McGowan <jon.mcgowan@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt

index d074c8f..ceccef1 100755 (executable)
@@ -128,6 +128,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
         flagsrequired   => { circulate => 'circulate_remaining_permissions' },
     }
 );
+my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
 
 my $force_allow_issue = $query->param('forceallow') || 0;
 if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) {
@@ -262,6 +263,10 @@ if ($findborrower) {
 # get the borrower information.....
 $patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
 if ($patron) {
+
+    $template->param( borrowernumber => $patron->borrowernumber );
+    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
+
     my $overdues = $patron->get_overdues;
     my $issues = $patron->checkouts;
     my $balance = $patron->account->balance;
index 8bad09d..cdfb908 100644 (file)
@@ -152,7 +152,7 @@ $(document).ready(function() {
        <div class="yui-b">
 [% END %]
 
-[% IF borrowernumber and borrower %]
+[% IF borrowernumber %]
 [% INCLUDE 'members-toolbar.inc' %]
 [% END %]