#!/usr/bin/perl
-# $Id$
#writen 2/1/00 by chris@katipo.oc.nz
# Copyright 2000-2002 Katipo Communications
}
# we check the date expiricy of the borrower (only if there is an expiry date, otherwise, set to 1 (warn)
- warn "BOR : ".$borrowerinfo->{'dateexpiry'};
- if ($borrowerinfo->{'dateexpiry'}) {
+ if ($borrowerinfo->{'dateexpiry'} ne '0000-00-00') {
my $warning = (Date_to_Days(split /-/,$date) > Date_to_Days( split /-/,$borrowerinfo->{'dateexpiry'}));
if ( $warning > 0 ) {
$expiry = 1;
borrowerstreetaddress => $borrowerinfo->{'address'},
borrowercity => $borrowerinfo->{'city'},
borrowerphone => $borrowerinfo->{'phone'},
+ borrowermobile => $borrowerinfo->{'mobile'},
+ borrowerfax => $borrowerinfo->{'fax'},
+ borrowerphonepro => $borrowerinfo->{'phonepro'},
borroweremail => $borrowerinfo->{'email'},
borroweremailpro => $borrowerinfo->{'emailpro'},
borrowercategory => $borrowerinfo->{'category'},
push( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} }, $itemnumber );
}
-@branchcodes = uniq @branchcodes;
+# @branchcodes = uniq @branchcodes;
my @biblioitemnumbers = keys %itemnumbers_of_biblioitem;
# If there is no loan, return and transfer, we show a checkbox.
$item->{notforloan} = $item->{notforloan} || 0;
-
+
+ # if independent branches is on we need to check if the person can reserve
+ # for branches they arent logged in to
+ if ( C4::Context->preference("IndependantBranches") ) {
+ if (! C4::Context->preference("canreservefromotherbranches")){
+ # cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve
+ my $userenv = C4::Context->userenv;
+ if ( ($userenv) && ( $userenv->{flags} != 1 ) ) {
+ $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
+ }
+ }
+ }
# An item is available only if:
if (
not defined $reservedate # not reserved yet
and $issues->{'date_due'} eq '' # not currently on loan
and not $item->{itemlost} # not lost
and not $item->{notforloan} # not forbidden to loan
+ and not $item->{cantreserve}
and $transfertwhen eq '' # not currently on transfert
)
{