Lines 2-7
Link Here
|
2 |
[% USE KohaDates %] |
2 |
[% USE KohaDates %] |
3 |
[% USE Price %] |
3 |
[% USE Price %] |
4 |
[% USE ItemTypes %] |
4 |
[% USE ItemTypes %] |
|
|
5 |
[% USE Branches %] |
6 |
|
5 |
[% INCLUDE 'doc-head-open.inc' %] |
7 |
[% INCLUDE 'doc-head-open.inc' %] |
6 |
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold</title> |
8 |
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold</title> |
7 |
[% INCLUDE 'doc-head-close.inc' %] |
9 |
[% INCLUDE 'doc-head-close.inc' %] |
Lines 135-140
Link Here
|
135 |
<!-- These values are set dynamically by js --> |
137 |
<!-- These values are set dynamically by js --> |
136 |
<input type="hidden" name="biblionumbers" id="biblionumbers"/> |
138 |
<input type="hidden" name="biblionumbers" id="biblionumbers"/> |
137 |
<input type="hidden" name="selecteditems" id="selections"/> |
139 |
<input type="hidden" name="selecteditems" id="selections"/> |
|
|
140 |
<label> |
141 |
<input type="checkbox" id="requestany" name="requestany" value="1"> |
142 |
Place a hold on the first available item among the selected titles |
143 |
</label> |
144 |
<div id="hold-options" class="hold-options"> |
145 |
<fieldset class="rows"> |
146 |
<ul> |
147 |
<li> |
148 |
<label for="branch">Pickup location:</label> |
149 |
<select id="branch" name="branch"> |
150 |
[% FOREACH branch IN Branches.all({selected = Branches.GetLoggedInBranchcode }) %] |
151 |
[% IF branch.selected %] |
152 |
<option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option> |
153 |
[% ELSE %] |
154 |
<option value="[% branch.branchcode %]">[% branch.branchname %]</option> |
155 |
[% END %] |
156 |
[% END %] |
157 |
</select> |
158 |
</li> |
159 |
[% IF ( reserve_in_future ) %] |
160 |
<li> |
161 |
<label for="from">Hold starts on date:</label> |
162 |
<input name="reserve_date" id="from" size="10" class="holddatefrom"/> |
163 |
<span class="date-format from" data-biblionumber="all">[% INCLUDE 'date-format.inc' %]</span> |
164 |
</li> |
165 |
[% END %] |
166 |
<li> |
167 |
<label for="to">Hold not needed after:</label> |
168 |
<input name="expiration_date" id="to" size="10" class="holddateto" /> |
169 |
<span class="date-format to" data-biblionumber="all">[% INCLUDE 'date-format.inc' %]</span> |
170 |
</li> |
171 |
[% IF ( OpacHoldNotes ) %] |
172 |
<li> |
173 |
<div class="notesrow" id="notesrow"> |
174 |
<label for="holdnotes">Hold notes:</label> |
175 |
<span id="forcenotesreason" class="forcenotesreason"></span> |
176 |
<textarea id="holdnotes" rows="2" cols="30" name="notes"></textarea> |
177 |
</div> |
178 |
</li> |
179 |
[% END # / IF OpacHoldNotes %] |
180 |
</ul> |
181 |
</fieldset> |
182 |
</div> |
138 |
<div id="bigloop"> |
183 |
<div id="bigloop"> |
139 |
|
184 |
|
140 |
[% FOREACH bibitemloo IN bibitemloop %] |
185 |
[% FOREACH bibitemloo IN bibitemloop %] |
Lines 504-520
Link Here
|
504 |
}); |
549 |
}); |
505 |
|
550 |
|
506 |
$(".date-format").each(function(){ |
551 |
$(".date-format").each(function(){ |
507 |
if($(this).hasClass("to")){ var op = "to"; } |
552 |
var input = $(this).siblings('input').first(); |
508 |
if($(this).hasClass("from")){ var op = "from"; } |
553 |
var clearDateLink = $('<a></a>') |
509 |
var bibNum = $(this).data("biblionumber"); |
554 |
.attr('href', '#') |
510 |
$(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>"); |
555 |
.addClass('clear-date') |
511 |
}); |
556 |
.html(_("Clear date")) |
512 |
|
557 |
.on('click', function(e) { |
513 |
$(".clear-date").on("click",function(e){ |
558 |
e.preventDefault(); |
514 |
e.preventDefault(); |
559 |
input.val(''); |
515 |
var fieldID = this.id.replace("clear",""); |
560 |
}); |
516 |
var op = $(this).data("op"); |
561 |
$(this).empty().append(clearDateLink); |
517 |
$("#" + op + fieldID).val(""); |
|
|
518 |
}); |
562 |
}); |
519 |
|
563 |
|
520 |
// Replace non-JS single-selection with multi-selection capability. |
564 |
// Replace non-JS single-selection with multi-selection capability. |
Lines 645-671
Link Here
|
645 |
return true; |
689 |
return true; |
646 |
}); |
690 |
}); |
647 |
|
691 |
|
648 |
[% FOREACH bibitemloo IN bibitemloop %] |
692 |
$('.hold-options').each(function() { |
649 |
[% IF ( bibitemloo.holdable ) %] |
693 |
var dates = $(this).find('.holddatefrom, .holddateto').datepicker({ |
650 |
// http://jqueryui.com/demos/datepicker/#date-range |
694 |
minDate: 0, |
651 |
var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({ |
695 |
changeMonth: true, |
652 |
minDate: 0, |
696 |
numberOfMonths: 1, |
653 |
changeMonth: true, |
697 |
onSelect: function( selectedDate ) { |
654 |
numberOfMonths: 1, |
698 |
var option = $(this).hasClass('holddatefrom') ? "minDate" : "maxDate", |
655 |
onSelect: function( selectedDate ) { |
699 |
instance = $(this).data('datepicker'), |
656 |
var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate", |
700 |
dateFormat = instance.settings.dateFormat |
657 |
instance = $( this ).data( "datepicker" ); |
701 |
|| $.datepicker._defaults.dateFormat, |
658 |
date = $.datepicker.parseDate( |
702 |
date = $.datepicker.parseDate(dateFormat, |
659 |
instance.settings.dateFormat || |
703 |
selectedDate, instance.settings); |
660 |
$.datepicker._defaults.dateFormat, |
704 |
|
661 |
selectedDate, instance.settings ); |
705 |
dates.not(this).datepicker('option', option, date); |
662 |
dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date ); |
706 |
} |
663 |
} |
707 |
}); |
664 |
}); |
708 |
}); |
665 |
[% END %] |
|
|
666 |
[% END %] |
667 |
|
668 |
}); |
709 |
}); |
669 |
// ]]> |
710 |
// ]]> |
670 |
</script> |
711 |
</script> |
|
|
712 |
|
713 |
<script> |
714 |
$(document).ready(function() { |
715 |
$('#requestany').on('change', function() { |
716 |
if ($(this).is(':checked')) { |
717 |
$('.holdrow > fieldset').hide(); |
718 |
$('#hold-options').show(); |
719 |
} else { |
720 |
$('.holdrow > fieldset').show(); |
721 |
$('#hold-options').hide(); |
722 |
} |
723 |
}).trigger('change'); |
724 |
}); |
725 |
</script> |
671 |
[% END %] |
726 |
[% END %] |