Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
Jonathan Druart 4db91211aa Bug 6739: (follow-up) template changes for the bootstrap theme
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes QA script, t, xt and t/db_dependent/Members*.

Testing notes:
    - Database update
      * Changes to kohastructure match changes done by the updatedatabase
        statement. Feature is activated by default!
      * Ran database update succesfully.
      * Note: Expired patrons are now blocked by default in new
        AND in updated installations.
    - System preference
      * Verified system preference shows up correctly.
    - Category configuration
      * Add new patron category
      * Edit existing patron category
      * Delete patron category
      * Check patron category summary table.
      => Verified all actions work as expected.
      => Verified chosen value for BlockExpiredPatronOpacActions
         is always displayed and saved correctly.
      * Note: The new value is missing from the summary table.
      * Note: The new value is also not shown when deleting a patron
        category.
    - Check functionality
      * Renew and place a hold for an NOT EXPIRED patron with
        a) category: use syspref (default)
           syspref: block  (default)
        b) category: use syspref (default)
           syspref: don't block
        c) category: block
           syspref: don't block
        d) category: block
           syspref: block
        e) category: don't block
           sypref: block
        f) category: don't block
           syspref: don't block
        Holds and renewals were always possible.
      * Also verified that the warning from NotifyBorrowerDeparture
        still shows up correctly.
      * Verified holds and renewals are still blocked, when the
        user has a restriction with a date in the future.
      * Renew and place a hold for an EXPIRED patron with
        a) category: use syspref (default)
           syspref: block  (default)
           Holds and renewals blocked.
        b) category: use syspref (default)
           syspref: don't block
           Holds an renewals possible.
        c) category: block
           syspref: don't block
           Holds and renewals blocked.
        d) category: block
           syspref: block
           Holds and renewals blocked.
        e) category: don't block
           sypref: block
           Holds and renewals possible.
        f) category: don't block
           syspref: don't block
           Holds and renewals possible.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-05-05 01:55:28 +00:00

581 lines
37 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Placing a hold
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
<body id="opac-holds">
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
<li><a href="#">Placing a hold</a></li>
</ul>
<div class="container">
<div id="holds">
[% IF ( message ) %]
[% IF ( GNA ) %]
<div id="gna" class="alert">
<p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a> on file.</p>
<p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-memberentry.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)</p>
</div>
[% END %]
[% IF ( lost ) %]
<div id="lost" class="alert">
<p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
<p>If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.</p>
</div>
[% END %]
[% IF ( debarred ) %]
<div id="debarred" class="alert">
<p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
<p>Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please consult a librarian.</p>
</div>
[% END %]
[% IF ( too_much_oweing ) %]
<div id="too_much_oweing" class="alert">
Sorry, you cannot place holds because you owe [% too_much_oweing %].
</div>
[% END %]
[% IF ( too_many_reserves ) %]
<div id="too_many_reserves" class="alert">
Sorry, you cannot place more than [% too_many_reserves %] holds.
</div>
[% END %]
[% IF ( bad_biblionumber ) %]
<div id="bad_biblionumber" class="alert">
ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
[% END %]
[% IF ( no_items_selected ) %]
<div id="no_items_selected" class="alert">
You must select at least one item.
</div>
[% END %]
[% IF ( no_branch_selected ) %]
<div id="no_branch_selected" class="alert">
You must select a library for pickup.
</div>
[% END %]
[% IF ( no_biblionumber ) %]
<div id="no_biblionumber" class="alert">ERROR: No biblionumber received.</div>
[% END %]
[% IF ( bad_data ) %]
<div id="bad_data" class="alert">ERROR: Internal error: incomplete hold request.</div>
[% END %]
[% IF ( expired_patron ) %]
<div id="expired_patron" class="alert"><strong>Sorry</strong>, you cannot place holds because your library card has expired.</p><p>Please contact your librarian if you wish to renew your card.</div>
[% END %]
[% ELSE %]
[% IF ( none_available ) %]
<div id="none_available" class="alert"><strong>Sorry</strong>, none of these items can be placed on hold.
</div>
[% END %]
[% END # / IF message %]
[% UNLESS ( message ) %]
[% UNLESS ( none_available ) %]
<h3>Confirm holds for:
[% FOREACH USER_INF IN USER_INFO %]
[% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
[% END %]
</h3>
[% END # / UNLESS none_available %]
[% IF (RESERVE_CHARGE) %]
<div class="alert" id="reserve_fee">
There is a charge of [% RESERVE_CHARGE %] for placing this hold
</div>
[% END %]
<form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
<input type="hidden" name="place_reserve" value="1"/>
<!-- These values are set dynamically by js -->
<input type="hidden" name="biblionumbers" id="biblionumbers"/>
<input type="hidden" name="selecteditems" id="selections"/>
<div id="bigloop">
[% FOREACH bibitemloo IN bibitemloop %]
<div class="holdrow">
<p>
[% IF ( bibitemloo.holdable ) %]
<input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
<input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
<span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
<span class="confirm_nonjs">
<input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
<label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
</span>
[% END # / bibitemloo.holdable %]
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
[% bibitemloo.title |html %]
[% IF ( bibitemloo.subtitle ) %]
[% FOREACH subtitl IN bibitemloo.subtitle %]
[% subtitl.subfield %]
[% END %]
[% END %]
</a>
[% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
</p>
[% UNLESS ( bibitemloo.holdable ) %]
[% IF ( bibitemloo.already_reserved ) %]
<div class="alert">You have already requested this title.</div>
[% ELSE %]
[% UNLESS ( bibitemloo.bib_available ) %]
<div class="alert">No available items.</div>
[% ELSE %]
[% IF ( bibitemloo.already_patron_possession ) %]
<div class="alert">This title cannot be requested because it's already in your possession.</div>
[% ELSE %]
<div class="alert">This title cannot be requested.</div>
[% END %]
[% END # / UNLESS bibitemloo.bib_available %]
[% END # / IF bibitemloo.already_reserved %]
[% END # / UNLESS bibitemloo.holdable %]
[% IF ( bibitemloo.holdable ) %]
<fieldset class="rows">
<ul>
<!-- HOLDABLE -->
[% UNLESS ( item_level_itypes ) %]
<li class="itype">
<span class="label">Item type: </span>
[% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
[% bibitemloo.description %]
</li>
[% END %]
[% IF showholds || showpriority %]
<li class="priority">
<span class="label">Holds and priority: </span>
[% IF showpriority %] [% bibitemloo.rank %] [% END %]
[% IF showholds && showpriority %] out of [% END %]
[% IF showholds %] [% bibitemloo.reservecount %] [% END %]
</li>
[% END %]
[% UNLESS ( singleBranchMode ) %]
[% IF ( bibitemloo.holdable && choose_branch ) %]
<li class="branch">
<label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
[% UNLESS ( bibitemloo.holdable ) %]
<select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
[% FOREACH branchloo IN bibitemloo.branchloop %]
[% IF ( branchloo.selected ) %]
<option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
[% ELSE %]
<option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
[% END %]
[% END %]
</select>
[% ELSE %]
<select name="branch" id="branch_[% bibitemloo.biblionumber %]">
[% FOREACH branchloo IN bibitemloo.branchloop %]
[% IF ( branchloo.selected ) %]
<option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
[% ELSE %]
<option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
[% END %]
[% END %]
</select>
[% END # / UNLESS bibitemloo.holdable %]
</li>
[% END # / IF bibitemloo.holdable && choose_branch %]
[% END # / UNLESS singleBranchMode %]
</ul>
<a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
<div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
<ul>
[% IF ( reserve_in_future ) %]
<li>
<label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
<input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
<span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
</li>
[% END %]
<li>
<label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
<input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
<span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
</li>
[% IF ( OpacHoldNotes ) %]
<li>
<div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
<label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
<span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
<textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
<input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
</div>
</li>
[% END # / IF OpacHoldNotes %]
[% IF ( OPACItemHolds ) %]
<!-- ITEM HOLDS -->
<li class="lradio">
<label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
[% UNLESS ( bibitemloo.holdable ) %]
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" disabled="disabled" />
[% ELSE %]
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" checked="checked" />
[% END %]
<label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
[% UNLESS ( bibitemloo.holdable ) %]
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" disabled="disabled" value="Specific" />
[% ELSE %]
<input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" value="Specific" />
[% END %]
</li>
[% END # / IF OPACItemHolds %]
</ul>
[% IF ( OPACItemHolds ) %]
<table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
<caption>Select a specific item:</caption>
<tr>
<th>Copy number</th>
[% IF ( item_level_itypes ) %]
<th>Item type</th>
[% END %]
<th>Barcode</th>
[% UNLESS ( singleBranchMode ) %]
<th>Home library</th>
<th>Last location</th>
[% END %]
<th>Call number</th>
[% IF ( itemdata_enumchron ) %]
<th>Vol info</th>
[% END %]
<th>Information</th>
</tr>
[% FOREACH itemLoo IN bibitemloo.itemLoop %]
<tr class="[% itemLoo.backgroundcolor %]">
<td class="copynumber">
[% IF ( itemLoo.available ) %]
<input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
[% ELSE %]
<input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
<img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
[% END %]
[% IF ( itemLoo.copynumber ) %]
[% itemLoo.copynumber %]
[% END %]
</td>
[% IF ( item_level_itypes ) %]
<td class="itype">
[% UNLESS ( noItemTypeImages ) %]
[% IF ( itemLoo.imageurl ) %]
<img src="[% itemLoo.imageurl %]" alt="" />
[% END %]
[% END %]
[% itemLoo.description %]
</td>
[% END %]
<td class="barcode">[% itemLoo.barcode %]</td>
[% UNLESS ( singleBranchMode ) %]
<td class="homebranch">[% itemLoo.homeBranchName %]</td>
<td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
[% END %]
<td class="call_no">[% itemLoo.callNumber %]</td>
[% IF ( itemdata_enumchron ) %]
<td class="vol_info">[% itemLoo.enumchron %]</td>
[% END %]
<td class="information">
[% IF ( itemLoo.dateDue ) %]
<span class="checkedout">Due [% itemLoo.dateDue %]</span>
[% ELSIF ( itemLoo.transfertwhen ) %]
<span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
[% END %]
[% IF ( itemLoo.message ) %]
<span class="lost">Unavailable (lost or missing)</span>
[% END %]
[% IF ( itemLoo.notforloan ) %]
<span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
[% END %]
[% IF ( itemLoo.reservedate ) %]
<span class="waiting">
[% IF ( itemLoo.waitingdate ) %]
Waiting
[% ELSE %]
On hold
[% END %]
for patron
[% IF ( itemLoo.waitingdate ) %]
at
[% ELSE %]
expected at
[% END %]
[% itemLoo.ExpectedAtLibrary %] since
[% IF ( itemLoo.waitingdate ) %]
[% itemLoo.waitingdate | $KohaDates %]
[% ELSE %]
[% IF ( itemLoo.reservedate ) %]
[% itemLoo.reservedate %]
[% END %]
[% END %].
</span>
[% ELSE %]
<span class="notonhold">Not on hold</span>
[% END # / IF ( itemLoo.reservedate )%]
</td>
</tr>
[% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
</table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
[% END # / IF ( OPACItemHolds )%]
</div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
</fieldset>
[% END # / IF ( bibitemloo.holdable ) %]
</div> <!-- / .holdrow -->
[% END # / FOREACH bibitemloo IN bibitemloop %]
</div><!-- #bigloop -->
[% UNLESS ( none_available ) %]
<input type="submit" value="Place hold" class="btn placehold" />
[% END %]
</form>
[% END # / UNLESS message %]
</div> <!-- / #holds -->
</div> <!-- / .container -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'calendar.inc' %]
<script type="text/javascript">
// <![CDATA[
var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
var ForceHoldNotesReasons=new Array(
_("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
"*** Add a new reason above this line ***" );
// NOTE: Do not renumber reasons; this will affect use of existing ones.
// Clear the contents of an input field
$(".clearfield").on("click",function(e){
$(this).closest("td").find("input").val("");
e.preventDefault();
});
$(document).ready(function() {
$("#hold-request-form").preventDoubleFormSubmit();
var copiesRowId = null;
var wasSpecific = false;
var lastCopiesRowId = null;
$(".checkitem").parent().click(function(e){
if(e.target.tagName.toLowerCase() == 'td'){
$(this).find("input.checkitem").each( function() {
$(this).attr('checked', !$(this).attr('checked'));
});
}
});
// Hides all 'specific copy' table rows on load.
$(".copiesrow").hide();
// Insert reasons for forced hold notes
$(".forcenotesreason").each(function(){
biblioNum = suffixOf($(this).attr("id"), "_");
var j=$("#notesmandatory_"+biblioNum).val();
if(j>0) {
$(this).html(ForceHoldNotesReasons[j-1]);
}
});
$("#place_on_hdr").show();
$(".place_on_type").show();
$("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
$(".hold-options").hide();
$(".holddatefrom,.holddateto").prop("readOnly", true);
$(".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("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
});
$(".clear-date").on("click",function(e){
e.preventDefault();
var fieldID = this.id.replace("clear","");
var op = $(this).data("op");
$("#" + op + fieldID).val("");
});
// Replace non-JS single-selection with multi-selection capability.
$(".reserve_mode").val("multi");
$(".confirm_nonjs").remove();
$(".confirmjs_hold").each(function(){
var bib = $(this).attr("title");
var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
$(this).html(html);
});
$(".confirmjs_nohold").each(function(){
var bib = $(this).attr("title");
var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
$(this).html(html);
});
// Make sure a specific item was selected where specified
// before moving on to a new item.
function changeSelection (newCopiesRowId, isSpecific) {
if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
var biblioNum = suffixOf(copiesRowId, "_");
// If the 'specific copy' radio button was checked
if (wasSpecific && (copiesRowId != newCopiesRowId)) {
// Find the selected copy
var item = $(".checkitem_" + biblioNum + ":checked");
if ($(item).size() == 0) {
alert(MSG_NO_ITEM_SELECTED);
return false;
}
}
}
copiesRowId = newCopiesRowId;
wasSpecific = isSpecific;
return true;
}
// When 'specific copy' radio button is clicked
$(".selectspecific").click(function() {
// Make sure all other specific copy table rows are hidden
biblioNum = suffixOf($(this).attr("id"), "_");
newCopiesRowId = "#copiesrow_" + biblioNum;
if (!changeSelection(newCopiesRowId, true)) {
return false;
}
// Show the specific copy table for this radio button.
$(newCopiesRowId).show();
});
// When 'first available' radion button is clicked
$(".selectany").click(function() {
// Make sure all other specific copy table rows are hidden
biblioNum = suffixOf($(this).attr("id"), "_");
newCopiesRowId = "#copiesrow_" + biblioNum;
if (!changeSelection(newCopiesRowId, false)) {
return false;
}
// Hide the copies table row
$(newCopiesRowId).hide();
});
// When 'Place Hold' button is clicked
$(".placehold").click(function(){
var biblionumbers = "";
var selections = "";
if ($(".confirmjs:checked").size() == 0) {
alert(MSG_NO_RECORD_SELECTED);
return false;
}
// Find the items with the 'Hold' box checked
var badBib = null;
$(".confirmjs:checked").each(function() {
var biblioNum = $(this).val();
biblionumbers += biblioNum + "/";
selections += biblioNum + "/";
// If the 'specific copy' radio button is checked
if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
// Find the selected copy
var item = $(".checkitem_" + biblioNum + ":checked");
if ($(item).size() == 0) {
badBib = biblioNum;
return false;
} else {
selections += $(item).val();
}
}
selections += "/";
// Add the pickup location
var branchSel = $("#branch_" + biblioNum);
if (branchSel.size() > 0) {
selections += $(branchSel).val();
}
selections += "/";
return true;
});
if (badBib) {
alert(MSG_NO_ITEM_SELECTED);
return false;
}
$("#selections").val(selections);
$("#biblionumbers").val(biblionumbers);
return true;
});
$(".toggle-hold-options").on("click",function(e){
e.preventDefault();
toggleLink = $(this);
var optionsID = this.id.replace("toggle-hold-options-","");
$("#hold-options-"+optionsID).toggle(0, function() {
toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
});
});
[% 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: 1,
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 %]
});
// ]]>
</script>
[% END %]