From 05562a1a52ee7abc4a877f54c11f0742d6ff2fe1 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 25 Oct 2013 15:31:51 -0400 Subject: [PATCH] [SIGNED-OFF] Bug 11142 - Update Bootstrap theme's place hold form to match the new version in prog The update to the prog theme's place hold page (Bug 10836) happened after the Bootstrap theme's place hold form had already been converted, so it lags behind. This patch applies the changes made to prog to Bootstrap. To test, switch to the Bootstrap theme and follow the test plan from Bug 10836: Place single and multiple holds under various conditions: - Items which are not available to be place on hold - With OpacHoldNotes on and off - With OPACItemHolds on and off - With OPACAllowHoldDateInFuture on and off - With IndependentBranches on and off - With JavaScript disabled Test setting hold notes, holding specific copies, and setting hold start dates. When setting a hold start date and hold expiration date, the two datepickers should work together to prevent invalid date combinations (dates after today, expiration dates which precede the start date). Signed-off-by: Bernardo Gonzalez Kriegel No koha-qa errors. Works as described, very well. Tested all situations, all syspref, and without JavaScript. --- koha-tmpl/opac-tmpl/bootstrap/css/opac.css | 43 ++ .../bootstrap/en/includes/date-format.inc | 1 + .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 547 ++++++++++---------- koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 39 ++ 4 files changed, 360 insertions(+), 270 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/opac.css b/koha-tmpl/opac-tmpl/bootstrap/css/opac.css index a97158f..d9a22de 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/opac.css +++ b/koha-tmpl/opac-tmpl/bootstrap/css/opac.css @@ -755,6 +755,9 @@ fieldset.action { fieldset.action p { margin-bottom: 1em; } +fieldset table { + font-size: 100%; +} div.rows + div.rows { margin-top: .6em; } @@ -2194,6 +2197,46 @@ td img { #shelfbrowser #browser_next { background-position: -9px -1057px; } +#holds { + margin: 0 auto; + max-width: 800px; +} +.holdrow { + clear: both; + padding: 0 1em 1em 1em; + border-bottom: 1px solid #CCC; + margin-bottom: .5em; +} +.holdrow fieldset { + border: 0; + margin: 0; + float: none; +} +.holdrow fieldset .label { + font-size: 14px; +} +.holdrow label { + display: inline; +} +.hold-options { + clear: both; +} +.toggle-hold-options { + background-color: #eee; + clear: both; + display: block; + font-weight: bold; + margin: 1em 0; + padding: .5em; +} +.copiesrow { + clear: both; +} +.shadowed { + -webkit-box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2); + box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.2); +} @media only screen and (min-width: 0px) and (max-width: 304px) { /* Screens bewteen 0 and 304 pixels wide */ #oh:after { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc new file mode 100644 index 0000000..53dae71 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/date-format.inc @@ -0,0 +1 @@ +[% IF ( dateformat == "us" ) %](MM/DD/YYYY)[% ELSIF ( dateformat == "metric" ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 1038595..ecccb6e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -13,9 +13,8 @@
  • Placing a hold
  • -
    -
    -
    +
    +
    [% IF ( message ) %] [% IF ( GNA ) %] @@ -93,6 +92,7 @@ [% END %] [% END # / UNLESS none_available %] + [% IF (RESERVE_CHARGE) %]
    There is a charge of [% RESERVE_CHARGE %] for placing this hold @@ -104,295 +104,265 @@ -
    - - [% UNLESS ( none_available ) %] - - - - [% UNLESS ( item_level_itypes ) %] - - [% END %] - - [% IF showholds && showpriority %] - - [% ELSIF showholds %] - - [% ELSIF showpriority %] - - [% END %] - - [% IF ( reserve_in_future ) %] - - [% END %] - - [% IF ( OpacHoldNotes ) %] - - [% END %] - - - [% IF ( OPACItemHolds ) %] - - [% END %] - - [% UNLESS ( singleBranchMode ) %] - [% IF ( choose_branch ) %] - - [% END %] - [% END %] - - [% ELSE %] - - [% END # / UNLESS none_available%] - - [% FOREACH bibitemloo IN bibitemloop %] - + + [% FOREACH bibitemloo IN bibitemloop %] +
    +

    [% IF ( bibitemloo.holdable ) %] -

    - [% ELSE %] - [% UNLESS ( none_available ) %] - + + + + + + + + [% END # / bibitemloo.holdable %] + + + [% bibitemloo.title |html %] + [% IF ( bibitemloo.subtitle ) %] + [% FOREACH subtitl IN bibitemloo.subtitle %] + [% subtitl.subfield %] + [% END %] [% END %] - [% END # / IF biblioloo.holdable %] + + [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %] +

    - [% IF ( bibitemloo.holdable ) %] - - [% IF ( bibitemloo.holdable ) %] +
    This title cannot be requested.
    + [% END %] + [% END # / UNLESS bibitemloo.bib_available %] + [% END # / IF bibitemloo.already_reserved %] + [% END # / UNLESS bibitemloo.holdable %] + + [% IF ( bibitemloo.holdable ) %] +
    +
      [% UNLESS ( item_level_itypes ) %] -
    + [% END %] + [% IF showholds || showpriority %] - - [% END %] - [% IF ( reserve_in_future ) %] - - [% END # / IF reserve_in_future %] - - [% IF ( OpacHoldNotes && bibitemloo.holdable ) %] - + [% END %] - - [% IF ( OPACItemHolds ) %] - - - [% END # / IF OPACItemHolds %] - [% END # / IF bibitemloo.holdable %] - - [% UNLESS ( singleBranchMode ) %] - [% IF ( bibitemloo.holdable && choose_branch ) %] - - [% END %] - [% END # / UNLESS singleBranchMode %] - - - [% IF ( OpacHoldNotes && bibitemloo.holdable ) %] - - - - - [% END %] - - [% IF ( OPACItemHolds && bibitemloo.holdable ) %] - - - - - [% END # / IF OPACItemHolds && bibitemloo.holdable %] - [% END # / FOREACH bibitemloo %] -
    HoldTitleItem typeHolds and priorityHoldsPriorityHold starts on dateNotesHold not needed afterPickup location
    Title
    - - - - - - - -   + [% UNLESS ( bibitemloo.holdable ) %] + [% IF ( bibitemloo.already_reserved ) %] +
    You have already requested this title.
    [% ELSE %] -
    - [% END %] - [% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %] - [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %] - [% UNLESS ( bibitemloo.holdable ) %] - [% IF ( bibitemloo.already_reserved ) %] -
    You have already requested this title.
    + [% UNLESS ( bibitemloo.bib_available ) %] +
    No available items.
    + [% ELSE %] + [% IF ( bibitemloo.already_patron_possession ) %] +
    This title cannot be requested because it's already in your possession.
    [% ELSE %] - [% UNLESS ( bibitemloo.bib_available ) %] -
    No available items.
    - [% ELSE %] - [% IF ( bibitemloo.already_patron_possession ) %] -
    This title cannot be requested because it's already in your possession.
    - [% ELSE %] -
    This title cannot be requested.
    - [% END %] - [% END # / UNLESS biblioitemloo.bib_available %] - [% END # / IF bibitemloo.already_reserved %] - [% END # / UNLESS bibitemloo.holdable %] -
    +
  • + Item type: [% IF ( bibitemloo.imageurl ) %][% END %] [% bibitemloo.description %] -
  • +
  • + Holds and priority: [% IF showpriority %] [% bibitemloo.rank %] [% END %] [% IF showholds && showpriority %] out of [% END %] [% IF showholds %] [% bibitemloo.reservecount %] [% END %] -
  • - -

    Clear date

    -
    - -

    Clear date

    -
    - [% UNLESS ( bibitemloo.holdable ) %] - + [% FOREACH branchloo IN bibitemloo.branchloop %] + [% IF ( branchloo.selected ) %] + + [% ELSE %] + + [% END %] + [% END %] + + [% ELSE %] + + [% END # / UNLESS bibitemloo.holdable %] + + [% END # / IF bibitemloo.holdable && choose_branch %] + [% END # / UNLESS singleBranchMode %] + + + + +
    + +
      + [% IF ( reserve_in_future ) %] +
    • + + + [% INCLUDE 'date-format.inc' %] +
    • + [% END %] + +
    • + + + [% INCLUDE 'date-format.inc' %] +
    • + + [% IF ( OpacHoldNotes ) %] +
    • +
      + + + + +
      +
    • + [% END # / IF OpacHoldNotes %] + + [% IF ( OPACItemHolds ) %] + +
    • + + [% UNLESS ( bibitemloo.holdable ) %] + + [% ELSE %] + [% END %] - - [% ELSE %] - + [% ELSE %] + [% END %] - - [% END # / UNLESS bibitemloo.holdable %] -
      -   - - - -
      - - - - - [% IF ( item_level_itypes ) %] - - [% END %] - - [% UNLESS ( singleBranchMode ) %] - - - [% END %] - - [% IF ( itemdata_enumchron ) %] - - [% END %] - - - - [% FOREACH itemLoo IN bibitemloo.itemLoop %] - - + + [% END # / IF OPACItemHolds %] + + + [% IF ( OPACItemHolds ) %] +
    Select a specific copy:
    CopyItem typeBarcodeHome libraryLast locationCall numberVol infoInformation
    - [% IF ( itemLoo.available ) %] - - [% ELSE %] - - Cannot be put on hold - [% END %] - [% IF ( itemLoo.copynumber ) %] - [% itemLoo.copynumber %] - [% END %] -
    + + + [% IF ( item_level_itypes ) %] - + [% END %] - + [% UNLESS ( singleBranchMode ) %] - - + + [% END %] - + [% IF ( itemdata_enumchron ) %] - + [% END %] - + + + [% FOREACH itemLoo IN bibitemloo.itemLoop %] + + + + [% IF ( item_level_itypes ) %] + [% END %] - [% IF ( itemLoo.message ) %] - Unavailable (lost or missing) + + + [% UNLESS ( singleBranchMode ) %] + + [% END %] - [% IF ( itemLoo.notforloan ) %] - Not for loan ([% itemLoo.notforloanvalue %]) + + [% IF ( itemdata_enumchron ) %] + [% END %] - [% IF ( itemLoo.reservedate ) %] - - [% 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 %] - [% ELSE %] - [% IF ( itemLoo.reservedate ) %] - [% itemLoo.reservedate %] + - - [% END # / FOREACH itemLoo %] -
    Select a specific copy:
    Copy - [% UNLESS ( noItemTypeImages ) %] - [% IF ( itemLoo.imageurl ) %] - - [% END %] - [% END %] - [% itemLoo.description %] - Item type[% itemLoo.barcode %]Barcode[% itemLoo.homeBranchName %][% itemLoo.holdingBranchName %]Home libraryLast location[% itemLoo.callNumber %]Call number[% itemLoo.enumchron %]Vol info - [% IF ( itemLoo.dateDue ) %] - Due [% itemLoo.dateDue %] - [% ELSIF ( itemLoo.transfertwhen ) %] - In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %] + Information
    + [% IF ( itemLoo.available ) %] + + [% ELSE %] + + Cannot be put on hold + [% END %] + + [% IF ( itemLoo.copynumber ) %] + [% itemLoo.copynumber %] + [% END %] + + [% UNLESS ( noItemTypeImages ) %] + [% IF ( itemLoo.imageurl ) %] + + [% END %] + [% END %] + [% itemLoo.description %] + [% itemLoo.barcode %][% itemLoo.homeBranchName %][% itemLoo.holdingBranchName %][% itemLoo.callNumber %][% itemLoo.enumchron %] + [% IF ( itemLoo.dateDue ) %] + Due [% itemLoo.dateDue %] + [% ELSIF ( itemLoo.transfertwhen ) %] + In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %] + [% END %] + + [% IF ( itemLoo.message ) %] + Unavailable (lost or missing) + [% END %] + + [% IF ( itemLoo.notforloan ) %] + Not for loan ([% itemLoo.notforloanvalue %]) + [% END %] + + [% IF ( itemLoo.reservedate ) %] + + [% IF ( itemLoo.waitingdate ) %] + Waiting + [% ELSE %] + On hold [% END %] - [% END %]. - - [% ELSE %] - Not on hold - [% END # / IF itemLoo.reservedate %]  -
    -
    -
    + for patron + [% IF ( itemLoo.waitingdate ) %] + at + [% ELSE %] + expected at + [% END %] + [% itemLoo.ExpectedAtLibrary %] since + [% IF ( itemLoo.waitingdate ) %] + [% itemLoo.waitingdate %] + [% ELSE %] + [% IF ( itemLoo.reservedate ) %] + [% itemLoo.reservedate %] + [% END %] + [% END %]. + + [% ELSE %] + Not on hold + [% END # / IF ( itemLoo.reservedate )%] + + + [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] + + [% END # / IF ( OPACItemHolds )%] +
    + + [% END # / IF ( bibitemloo.holdable ) %] +
    + [% END # / FOREACH bibitemloo IN bibitemloop %] +
    + [% UNLESS ( none_available ) %] [% END %] + [% END # / UNLESS message %]
    -
    -
    - + [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] @@ -424,7 +394,6 @@ }); // Hides all 'specific copy' table rows on load. $(".copiesrow").hide(); - $(".notesrow").hide(); // Insert reasons for forced hold notes $(".forcenotesreason").each(function(){ @@ -437,20 +406,37 @@ $("#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("" + _("Clear date") + ""); + }); + + $(".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 = ""; + var html = " "; $(this).html(html); }); $(".confirmjs_nohold").each(function(){ var bib = $(this).attr("title"); - var html = ""; + var html = ""; $(this).html(html); }); @@ -485,7 +471,6 @@ if (!changeSelection(newCopiesRowId, true)) { return false; } - $(".copiesrow:not(" + newCopiesRowId + ")").hide(); // Show the specific copy table for this radio button. $(newCopiesRowId).show(); @@ -502,16 +487,9 @@ } // Hide the copies table row - $(".copiesrow").hide(); - }); - - // Show or hide holds notes - $(".shownotes").click(function(){ - biblioNum = suffixOf($(this).attr("id"), "_"); - $("#notesrow_"+biblioNum).toggle(); + $(newCopiesRowId).hide(); }); - // When 'Place Hold' button is clicked $(".placehold").click(function(){ var biblionumbers = ""; @@ -562,6 +540,35 @@ 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 %] + }); // ]]> diff --git a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less index c95d82a..8fb8bf2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less +++ b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less @@ -745,6 +745,9 @@ fieldset { margin-bottom : 1em; } } + table { + font-size: 100%; + } } div.rows+div.rows { @@ -2226,4 +2229,40 @@ td img { } } +#holds { + margin : 0 auto; + max-width: 800px; +} +.holdrow { + clear : both; + padding: 0 1em 1em 1em; + border-bottom:1px solid #CCC; + margin-bottom:.5em; + fieldset { + border : 0; + margin : 0; + float: none; + .label { + font-size: 14px; + } + } + label { + display: inline; + } +} +.hold-options { + clear : both; +} +.toggle-hold-options { + background-color: #eee; + clear : both; + display : block; + font-weight : bold; + margin: 1em 0; + padding: .5em; +} +.copiesrow { + clear : both; +} + @import "responsive.less"; -- 1.7.9.5