@@ -, +, @@
of titles (OPAC)
click on 'Place hold' button at the top of the results
notes).
reserved biblios and confirm the hold
holds should have been deleted
---
.../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 117 +++++++++++++++------
opac/opac-reserve.pl | 13 +++
2 files changed, 99 insertions(+), 31 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
@@ -2,6 +2,8 @@
[% USE KohaDates %]
[% USE Price %]
[% USE ItemTypes %]
+[% USE Branches %]
+
[% INCLUDE 'doc-head-open.inc' %]
[% FOREACH bibitemloo IN bibitemloop %]
@@ -504,17 +549,16 @@
});
$(".date-format").each(function(){
- if($(this).hasClass("to")){ var op = "to"; }
- if($(this).hasClass("from")){ var op = "from"; }
- var bibNum = $(this).data("biblionumber");
- $(this).html("
" + _("Clear date") + "");
- });
-
- $(".clear-date").on("click",function(e){
- e.preventDefault();
- var fieldID = this.id.replace("clear","");
- var op = $(this).data("op");
- $("#" + op + fieldID).val("");
+ var input = $(this).siblings('input').first();
+ var clearDateLink = $('
')
+ .attr('href', '#')
+ .addClass('clear-date')
+ .html(_("Clear date"))
+ .on('click', function(e) {
+ e.preventDefault();
+ input.val('');
+ });
+ $(this).empty().append(clearDateLink);
});
// Replace non-JS single-selection with multi-selection capability.
@@ -645,27 +689,38 @@
return true;
});
- [% FOREACH bibitemloo IN bibitemloop %]
- [% IF ( bibitemloo.holdable ) %]
- // http://jqueryui.com/demos/datepicker/#date-range
- var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
- minDate: 0,
- changeMonth: true,
- numberOfMonths: 1,
- onSelect: function( selectedDate ) {
- var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
- instance = $( this ).data( "datepicker" );
- date = $.datepicker.parseDate(
- instance.settings.dateFormat ||
- $.datepicker._defaults.dateFormat,
- selectedDate, instance.settings );
- dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );
- }
- });
- [% END %]
- [% END %]
-
+ $('.hold-options').each(function() {
+ var dates = $(this).find('.holddatefrom, .holddateto').datepicker({
+ minDate: 0,
+ changeMonth: true,
+ numberOfMonths: 1,
+ onSelect: function( selectedDate ) {
+ var option = $(this).hasClass('holddatefrom') ? "minDate" : "maxDate",
+ instance = $(this).data('datepicker'),
+ dateFormat = instance.settings.dateFormat
+ || $.datepicker._defaults.dateFormat,
+ date = $.datepicker.parseDate(dateFormat,
+ selectedDate, instance.settings);
+
+ dates.not(this).datepicker('option', option, date);
+ }
+ });
+ });
});
// ]]>
+
+
[% END %]
--- a/opac/opac-reserve.pl
+++ a/opac/opac-reserve.pl
@@ -135,6 +135,8 @@ my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch"))
$template->param( choose_branch => $OPACChooseBranch);
+my $requestany = $query->param('requestany');
+
#
#
# Build hashes of the requested biblio(item)s and items.
@@ -221,6 +223,11 @@ if ( $query->param('place_reserve') ) {
&get_out($query, $cookie, $template->output);
}
+ my $reserve_group_id;
+ if ($requestany) {
+ $reserve_group_id = AddReserveGroup();
+ }
+
my $failed_holds = 0;
while (@selectedItems) {
my $biblioNum = shift(@selectedItems);
@@ -287,11 +294,17 @@ if ( $query->param('place_reserve') ) {
# Here we actually do the reserveration. Stage 3.
if ($canreserve) {
+ if ($requestany) {
+ $startdate = $query->param('reserve_date');
+ $expiration_date = $query->param('expiration_date');
+ $notes = $query->param('notes');
+ }
my $reserve_id = AddReserve(
$branch, $borrowernumber, $biblioNum,
[$biblioNum], $rank, $startdate,
$expiration_date, $notes, $biblioData->{title},
$itemNum, $found, $itemtype,
+ $reserve_group_id,
);
$failed_holds++ unless $reserve_id;
++$reserve_cnt;
--