# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
=head1 request.pl
my $multihold = $input->param('multi_hold');
$template->param(multi_hold => $multihold);
+my $showallitems = $input->param('showallitems');
# get Branches and Itemtypes
my $branches = GetBranches();
my $number_reserves =
GetReserveCount( $borrowerinfo->{'borrowernumber'} );
- if ( $number_reserves > C4::Context->preference('maxreserves') ) {
+ if ( C4::Context->preference('maxreserves') && $number_reserves >= C4::Context->preference('maxreserves') ) {
$warnings = 1;
$maxreserves = 1;
}
my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber};
my $num_available = 0;
my $num_override = 0;
+ my $hiddencount = 0;
$biblioitem->{description} =
$itemtypes->{ $biblioitem->{itemtype} }{description};
$item->{notforloanvalue} =
$notforloan_label_of->{ $item->{notforloan} };
}
-
+
# Management of lost or long overdue items
if ( $item->{itemlost} ) {
: $item->{itemlost} == 2 ? "(long overdue)"
: "";
$item->{backgroundcolor} = 'other';
+ if (GetHideLostItemsPreference($borrowernumber) && !$showallitems) {
+ $item->{hide} = 1;
+ $hiddencount++;
+ }
}
# Check the transit status
}
if (IsAvailableForItemLevelRequest($itemnumber) and not $item->{cantreserve} and CanItemBeReserved($borrowerinfo->{borrowernumber}, $itemnumber) ) {
- if ( not $policy_holdallowed and C4::Context->preference( 'AllowHoldPolicyOverride' ) ) {
- $item->{override} = 1;
- $num_override++;
- } elsif ( $policy_holdallowed ) {
+ if ( $policy_holdallowed ) {
$item->{available} = 1;
$num_available++;
}
+ } elsif (C4::Context->preference( 'AllowHoldPolicyOverride' ) ) {
+ $item->{override} = 1;
+ $num_override++;
}
+ # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
+ if (C4::Context->preference( 'AllowHoldPolicyOverride' ) && !$item->{available} ) {
+ $item->{override} = 1;
+ $num_override++;
+ }
+
# If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
# FIXME: move this to a pm
$biblioloopiter{warn} = 1;
$biblioloopiter{none_avail} = 1;
}
+ $template->param( hiddencount => $hiddencount);
push @bibitemloop, $biblioitem;
}
);
}
- if ( defined $res->{'found'} && $res->{'found'} eq 'W' ) {
+ if ( defined $res->{'found'} && $res->{'found'} eq 'W' || $res->{'found'} eq 'T' ) {
my $item = $res->{'itemnumber'};
$item = GetBiblioFromItemNumber($item,undef);
$reserve{'wait'}= 1;
}
# set found to 1 if reserve is waiting for patron pickup
$reserve{'found'} = 1 if $res->{'found'} eq 'W';
+ $reserve{'intransit'} = 1 if $res->{'found'} eq 'T';
} elsif ($res->{priority} > 0) {
if (defined($res->{itemnumber})) {
my $item = GetItem($res->{itemnumber});