[Koha-patches] [PATCH] on checkout ask for confirmation if borrower from different branch

Michael Hafen mdhafen at tech.washk12.org
Tue Mar 30 22:58:50 CEST 2010


With IndependantBranches on check that the borrower is from the same branch as
the librarian.  If not then ask for confirmation.  This check is skipped for
SuperLibrarians.
---
 C4/Circulation.pm                                  |    4 +++-
 .../prog/en/modules/circ/circulation.tmpl          |    6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index d780189..0a09118 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -798,8 +798,10 @@ sub CanBookBeIssued {
     if ( C4::Context->preference("IndependantBranches") ) {
         my $userenv = C4::Context->userenv;
         if ( ($userenv) && ( $userenv->{flags} % 2 != 1 ) ) {
-            $issuingimpossible{NOTSAMEBRANCH} = 1
+            $issuingimpossible{ITEMNOTSAMEBRANCH} = 1
               if ( $item->{C4::Context->preference("HomeOrHoldingBranch")} ne $userenv->{branch} );
+            $needsconfirmation{BORRNOTSAMEBRANCH} = GetBranchName( $borrower->{'branchcode'} )
+              if ( $borrower->{'branchcode'} ne $userenv->{branch} );
         }
     }
 
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
index d7a70fe..507fc3f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -235,6 +235,10 @@ function refocus(calendar) {
     <li>Too many checked out (already checked out / max : <!-- TMPL_VAR name="TOO_MANY" -->)</li>
 <!-- /TMPL_IF -->
 
+<!-- TMPL_IF NAME="BORRNOTSAMEBRANCH" -->
+    <li>This patrons is from a different library (<!-- TMPL_VAR NAME="BORRNOTSAMEBRANCH" -->)</li>
+<!-- /TMPL_IF -->
+
 <!-- TMPL_IF NAME="PATRON_CANT" -->
     <li>This patron can't check out this item per library circulation policy</i>
 <!-- /TMPL_IF -->
@@ -334,7 +338,7 @@ function refocus(calendar) {
             <li>Patron's card is expired</li>
         <!-- /TMPL_IF -->
 
-        <!-- TMPL_IF NAME="NOTSAMEBRANCH" -->
+        <!-- TMPL_IF NAME="ITEMNOTSAMEBRANCH" -->
             <li>This item belongs to <!-- TMPL_VAR NAME="itemhomebranch" --> and cannot be issued from this location.</li>
         <!-- /TMPL_IF -->
         </ul>
-- 
1.6.3.3




More information about the Koha-patches mailing list