[% END %]
@@ -653,7 +654,7 @@ function checkMultiHold() {
[% IF ( reserveloo.wait ) %]
[% IF ( reserveloo.atdestination ) %]
- [% IF ( reserveloo.found ) %]
+ [% IF ( reserveloo.found ) %]
Item waiting at [% reserveloo.wbrname %]
[% ELSE %]
Waiting to be pulled
@@ -728,6 +729,44 @@ function checkMultiHold() {
+
+ [% UNLESS ( reserveloo.wait ) %]
+
+
+ [% IF AutoResumeSuspendedHolds %]
+
+
+
+
+ Clear Date
+ [% END %]
+ [% ELSE %]
+
+ [% END %]
+
[% END %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
index 8fc13d9..85982ea 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
@@ -1,6 +1,7 @@
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Your library home
[% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.inc' %]
+ Clear Date
+ [% END %]
+
+
+
+
+
[% END %]
@@ -429,3 +483,4 @@ $.tablesorter.addParser({
[% INCLUDE 'opac-bottom.inc' %]
+
diff --git a/members/moremember.pl b/members/moremember.pl
index c477100..2f1d287 100755
--- a/members/moremember.pl
+++ b/members/moremember.pl
@@ -390,6 +390,8 @@ if ($borrowernumber) {
$getreserv{biblionumber} = $num_res->{'biblionumber'};
}
$getreserv{waitingposition} = $num_res->{'priority'};
+ $getreserv{suspend} = $num_res->{'suspend'};
+ $getreserv{suspend_until} = C4::Dates->new( $num_res->{'suspend_until'}, "iso")->output("syspref");;
push( @reservloop, \%getreserv );
}
@@ -493,4 +495,6 @@ $template->param(
koha_news_count => $koha_news_count
);
+$template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') );
+
output_html_with_http_headers $input, $cookie, $template->output;
diff --git a/misc/cronjobs/holds/auto_unsuspend_holds.pl b/misc/cronjobs/holds/auto_unsuspend_holds.pl
new file mode 100755
index 0000000..268910b
--- /dev/null
+++ b/misc/cronjobs/holds/auto_unsuspend_holds.pl
@@ -0,0 +1,34 @@
+#!/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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+#use strict;
+#use warnings; FIXME - Bug 2505
+
+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;
+
+AutoUnsuspendReserves();
diff --git a/opac/opac-modrequest-suspend.pl b/opac/opac-modrequest-suspend.pl
new file mode 100755
index 0000000..1a3f364
--- /dev/null
+++ b/opac/opac-modrequest-suspend.pl
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+# 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+use CGI;
+use C4::Output;
+use C4::Reserves;
+use C4::Auth;
+my $query = new CGI;
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ {
+ template_name => "opac-account.tmpl",
+ query => $query,
+ type => "opac",
+ authnotrequired => 0,
+ flagsrequired => { borrow => 1 },
+ debug => 1,
+ }
+);
+
+my $suspend = $query->param('suspend');
+my $suspend_until = $query->param('suspend_until') || undef;
+
+SuspendAll(
+ borrowernumber => $borrowernumber,
+ suspend => $suspend,
+ suspend_until => $suspend_until,
+);
+
+print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds");
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index a88bffb..a423eaa 100755
--- a/opac/opac-user.pl
+++ b/opac/opac-user.pl
@@ -271,6 +271,7 @@ foreach my $res (@reserves) {
if ($OPACDisplayRequestPriority) {
$res->{'priority'} = '' if $res->{'priority'} eq '0';
}
+ $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
}
# use Data::Dumper;
@@ -369,5 +370,8 @@ $template->param(
dateformat => C4::Context->preference("dateformat"),
);
+$template->param( DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar() );
+$template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') );
+
output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl
index eecd86b..03ef064 100755
--- a/reserve/modrequest.pl
+++ b/reserve/modrequest.pl
@@ -46,6 +46,7 @@ my @biblionumber=$query->param('biblionumber');
my @borrower=$query->param('borrowernumber');
my @branch=$query->param('pickup');
my @itemnumber=$query->param('itemnumber');
+my @suspend_until=$query->param('suspend_until');
my $multi_hold = $query->param('multi_hold');
my $biblionumbers = $query->param('biblionumbers');
my $count=@rank;
@@ -66,7 +67,7 @@ if ($CancelBorrowerNumber) {
else {
for (my $i=0;$i<$count;$i++){
undef $itemnumber[$i] unless $itemnumber[$i] ne '';
- ModReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$itemnumber[$i]); #from C4::Reserves
+ ModReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$itemnumber[$i],$suspend_until[$i]); #from C4::Reserves
}
}
my $from=$query->param('from');
diff --git a/reserve/modrequest_suspendall.pl b/reserve/modrequest_suspendall.pl
new file mode 100755
index 0000000..7e3a836
--- /dev/null
+++ b/reserve/modrequest_suspendall.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+#script to modify reserves/requests
+#written 2/1/00 by chris@katipo.oc.nz
+#last update 27/1/2000 by chris@katipo.co.nz
+
+
+# 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.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+use CGI;
+use C4::Output;
+use C4::Reserves;
+use C4::Auth;
+
+my $query = new CGI;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "about.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { catalogue => 1 },
+ debug => 1,
+ }
+);
+
+my $borrowernumber = $query->param('borrowernumber');
+my $suspend = $query->param('suspend');
+my $suspend_until = $query->param('suspend_until');
+
+SuspendAll( borrowernumber => $borrowernumber, suspend_until => $suspend_until, suspend => $suspend );
+
+my $from = $query->param('from');
+$from ||= q{};
+if ( $from eq 'borrower'){
+ print $query->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
+} elsif ( $from eq 'circ'){
+ print $query->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
+} else {
+ print $query->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
+}
diff --git a/reserve/request.pl b/reserve/request.pl
index 24557f4..150b81f 100755
--- a/reserve/request.pl
+++ b/reserve/request.pl
@@ -109,6 +109,10 @@ if ( $action eq 'move' ) {
my $borrowernumber = $input->param('borrowernumber');
my $biblionumber = $input->param('biblionumber');
ToggleLowestPriority( $borrowernumber, $biblionumber );
+} elsif ( $action eq 'toggleSuspend' ) {
+ my $borrowernumber = $input->param('borrowernumber');
+ my $biblionumber = $input->param('biblionumber');
+ ToggleSuspend( $borrowernumber, $biblionumber );
}
if ($findborrower) {
@@ -567,7 +571,8 @@ foreach my $biblionumber (@biblionumbers) {
$reserve{'lowestPriority'} = $res->{'lowestPriority'};
$reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'});
$reserve{'optionloop'} = \@optionloop;
-
+ $reserve{'suspend'} = $res->{'suspend'};
+ $reserve{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref");
push( @reserveloop, \%reserve );
}
@@ -626,5 +631,7 @@ if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) {
$template->param( reserve_in_future => 1 );
}
+$template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') );
+
# printout the page
output_html_with_http_headers $input, $cookie, $template->output;
--
1.7.2.5