From 24ba695b2bd72f18c8f82076dd7760eaeba09f41 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Tue, 13 Nov 2007 15:59:29 -0600 Subject: [PATCH] Fix so with independent branches a staff member cant see who has items out if the borrower is from another library/branch Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Biblio.pm | 9 +++++++-- .../prog/en/modules/catalogue/detail.tmpl | 20 +++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 91cb0cb72e..7a59204850 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -745,7 +745,7 @@ sub GetItemsInfo { my ( $date_due, $count_reserves ); my $isth = $dbh->prepare( - "SELECT issues.*,borrowers.cardnumber,borrowers.surname,borrowers.firstname + "SELECT issues.*,borrowers.cardnumber,borrowers.surname,borrowers.firstname,borrowers.branchcode as bcode FROM issues LEFT JOIN borrowers ON issues.borrowernumber=borrowers.borrowernumber WHERE itemnumber = ? AND returndate IS NULL" @@ -759,13 +759,18 @@ sub GetItemsInfo { $data->{surname} = $idata->{surname}; $data->{firstname} = $idata->{firstname}; $datedue = format_date( $idata->{'date_due'} ); + if (C4::Context->preference("IndependantBranches")){ + my $userenv = C4::Context->userenv; + if ( ($userenv) && ( $userenv->{flags} != 1 ) ) { + $data->{'NOTSAMEBRANCH'} = 1 if ($idata->{'bcode'} ne $userenv->{branch}); + } + } } if ( $datedue eq '' ) { #$datedue="Available"; my ( $restype, $reserves ) = C4::Reserves::CheckReserves( $data->{'itemnumber'} ); if ($restype) { - #$datedue=$restype; $count_reserves = $restype; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 303f35b45f..8032e7bf0d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -152,7 +152,11 @@ - On issue to "> + + On issue to a borrower from another branch + + On issue to "> + Not For loan (itemtype) @@ -164,13 +168,13 @@ Item lost Item Cancelled - - - - - Available - - + + + + + Available + + -- 2.39.5