From 73ba73de3ba614784c9621f3f6747fb4af2031d5 Mon Sep 17 00:00:00 2001
From: Kyle M Hall <kyle@bywatersolutions.com>
Date: Tue, 18 Dec 2012 14:18:16 -0500
Subject: [PATCH] Bug 9393 - Add note to circulation.pl if borrower has pending
 modifications

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
New link "patron modifications" (if there are) on the checkout page.
---
 circ/circulation.pl                                         | 2 ++
 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/circ/circulation.pl b/circ/circulation.pl
index 3a57685..8c94a98 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -49,6 +49,7 @@ use Koha::DateUtils;
 use Koha::Database;
 use Koha::Patron::Messages;
 use Koha::Patron::Images;
+use Koha::Borrower::Modifications;
 
 use Date::Calc qw(
   Today
@@ -660,6 +661,7 @@ $template->param(
     canned_bor_notes_loop     => $canned_notes,
     debarments                => GetDebarments({ borrowernumber => $borrowernumber }),
     todaysdate                => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
+    borrower_modifications    => Koha::Borrower::Modifications->GetModifications({ borrowernumber => $borrowernumber }),
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
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 4727192..716db30 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -730,6 +730,14 @@ No patron matched <span class="ex">[% message %]</span>
 
 		<ul>
 
+                   [% IF ( borrower_modifications ) %]
+                    <li><span class="circ-hlt">Pending modifications:</span> Patron has pending modifications.
+                            [% IF ( CAN_user_borrowers ) %]
+                                    <a href="/cgi-bin/koha/members/members-update.pl">View all pending patron modifications</a>
+                            [% END %]
+                   </li>
+                  [% END %]
+
 			[% IF ( warndeparture ) %]
 			<li><span class="circ-hlt">Expiration:</span> Patron's card will expire soon.
             Patron's card expires on [% expiry | $KohaDates %] <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&amp;destination=circ&amp;reregistration=y">Renew</a> or <a href="/cgi-bin/koha/members/memberentry.pl?op=modify&amp;destination=circ&amp;borrowernumber=[% borrowernumber %]&amp;categorycode=[% categorycode %]">Edit Details</a>
-- 
2.1.4