&CanBookBeReserved
&CanItemBeReserved
&CancelReserve
+ &CancelExpiredReserves
&IsAvailableForItemLevelRequest
sub CancelExpiredReserves {
- my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare( "SELECT * FROM reserves WHERE DATE(expirationdate) < DATE( CURDATE() ) AND expirationdate != '0000-00-00'" );
- $sth->execute();
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare( "
+ SELECT * FROM reserves WHERE DATE(expirationdate) < DATE( CURDATE() )
+ AND expirationdate IS NOT NULL
+ " );
+ $sth->execute();
- while ( my $res = $sth->fetchrow_hashref() ) {
- CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} );
- }
+ while ( my $res = $sth->fetchrow_hashref() ) {
+ CancelReserve( $res->{'biblionumber'}, '', $res->{'borrowernumber'} );
+ }
}
+++ /dev/null
-#!/usr/bin/perl
-
-# This script loops through each overdue item, determines the fine,
-# and updates the total amount of fines due by each user. It relies on
-# the existence of /tmp/fines, which is created by ???
-# Doesnt really rely on it, it relys on being able to write to /tmp/
-# It creates the fines file
-#
-# This script is meant to be run nightly out of cron.
-
-# Copyright 2000-2002 Katipo Communications
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# 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
-
-# $Id: sendoverdues.pl,v 1.1.2.1 2007/03/26 22:38:09 tgarip1957 Exp $
-
-BEGIN {
- # find Koha's Perl modules
- # test carefully before changing this
- use FindBin;
- eval { require "$FindBin::Bin/../kohalib.pl" };
-}
-
-use C4::Reserves;
-
-CancelExpiredReserves();
\ No newline at end of file
# Hourly holds queue updated
52 * * * * $KOHA_CRON_PATH/holds/build_holds_queue.pl >/dev/null 2>&1
+# Cancel expired holds
+0 1 * * * $KOHA_CRON_PATH/holds/cancel_expired_holds.pl >/dev/null 2>&1
+
# ZEBRA INDEX UPDATES with -z option, incremental index updates throughout the day
# for both authorities and bibs
*/10 * * * * $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2009-2010 Kyle Hall
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# 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
+
+BEGIN {
+ # find Koha's Perl modules
+ # test carefully before changing this
+ use FindBin;
+ eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+# cancel all expired hold requests
+
+use C4::Reserves;
+
+CancelExpiredReserves();
foreach my $biblioNum (@biblionumbers) {
my $record = GetMarcBiblio($biblioNum);
- my $subtitle = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $record, '');
# Init the bib item with the choices for branch pickup
my %biblioLoopIter = ( branchChoicesLoop => $CGIbranchloop );
$biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
$biblioLoopIter{title} = $biblioData->{title};
- $biblioLoopIter{subtitle} = $subtitle;
+ $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($biblioData->{biblionumber}));
$biblioLoopIter{author} = $biblioData->{author};
$biblioLoopIter{rank} = $biblioData->{rank};
$biblioLoopIter{reservecount} = $biblioData->{reservecount};
) {
$template->param(
reserve_in_future => 1,
- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
);
}
+$template->param( DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar() );
+
output_html_with_http_headers $query, $cookie, $template->output;
$reserve{'hidename'} = 1;
$reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'};
}
- $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) unless ( $res->{'expirationdate'} eq '0000-00-00' );
+ $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} )
+ unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' );
$reserve{'date'} = format_date( $res->{'reservedate'} );
$reserve{'borrowernumber'} = $res->{'borrowernumber'};
$reserve{'biblionumber'} = $res->{'biblionumber'};
}
if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) {
- template->param( reserve_in_future => 1 );
+ $template->param( reserve_in_future => 1 );
}
# printout the page