From bec50e08475533fdbd48b247a466636402dbc3d8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 23 Jul 2025 14:06:03 +0000 Subject: [PATCH] Bug 37219: In OPAC item holds, separate copy number from radio button and add table configuration This patch changes the way items are displayed during the process of placing a single or multiple item-level holds in the OPAC. The item-selection radio button is now in a separate column from copy number, and the columns can be configured. Note: This patch includes indentation changes by the tidy script, so ignore whitespace when viewing the diff. The patch also includes some code changes to hide the copy number column if it contains no data. To test, apply the patch and restart services. - If necessary, go to Administration -> Circulation and fine rules and enable item-level holds in one of the rules. - Log in to the OPAC and start the process of placing a hold on a title which falls under your configured circulation rule. - On the place hold page, click "Show more options" and "A specific item" to show the table of items. - The radio buttons and copy numbers should appear in separate columns. - Go to Administration -> Table settings -> OPAC -> opac_holds and change the table's configuration to hide one or more columns. - Return to the OPAC holds process and confirm that the table reflects your configuration changes. - Perform the same test with multiple holds (selecting multiple items in catalog search results). Sponsored-by: Athens County Public Libraries --- admin/columns_settings.yml | 28 + .../opac-tmpl/bootstrap/css/src/opac.scss | 5 - .../bootstrap/en/modules/opac-reserve.tt | 908 +++++++++--------- opac/opac-reserve.pl | 20 +- 4 files changed, 506 insertions(+), 455 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 21e8e8a6186..129a6cdec65 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -2346,6 +2346,34 @@ modules: - columnname: link + opac_holds: + opac_holds_items: + columns: + - + cannot_be_toggled: 1 + cannot_be_modified: 1 + columnname: selection + - + columnname: copy_number + - + columnname: itemtype + - + columnname: barcode + - + columnname: current_library + - + columnname: home_library + - + columnname: collection + - + columnname: call_number + - + columnname: enumchron + - + columnname: notes + - + columnname: information + serials: subscription-detail: orders: diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 05063f81603..6c8ab039ea0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2315,11 +2315,6 @@ nav { } } -#holds { - margin: 0 auto; - max-width: 800px; -} - .holdrow { border-bottom: 1px solid #CCC; clear: both; 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 6a7fb94e4f8..d89295141e1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -5,6 +5,7 @@ [% USE Price %] [% USE ItemTypes %] [% USE AuthorisedValues %] +[% USE TablesSettings %] [% SET reserve_input_type = 'radio' %] [% IF ( Koha.Preference('DisplayMultiItemHolds') ) %] [% SET reserve_input_type = 'checkbox' %] @@ -27,481 +28,492 @@ [% END #/ WRAPPER breadcrumbs %]
-
-

Placing a hold

- [% IF ( message ) %] -
-

Sorry, you cannot place holds.

-
    - [% IF ( GNA ) %] -
  • - According to our records, we don't have up-to-date contact information. Please contact the library. - [% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %] - [% IF ( Koha.Preference('OPACPatronDetails') ) %](Please note: there may be a delay in restoring your account if you submit online.)[% END %] -
  • - [% END %] +
    +
    +
    +

    Placing a hold

    + [% IF ( message ) %] +
    +

    Sorry, you cannot place holds.

    +
      + [% IF ( GNA ) %] +
    • + According to our records, we don't have up-to-date contact information. Please contact the library. + [% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %] + [% IF ( Koha.Preference('OPACPatronDetails') ) %](Please note: there may be a delay in restoring your account if you submit online.)[% END %] +
    • + [% END %] - [% IF ( lost ) %] -
    • - Your library card has been marked as lost or stolen.
      - If this is an error, please take your library card to the circulation desk at your local library and the error will be corrected. -
    • - [% END %] + [% IF ( lost ) %] +
    • + Your library card has been marked as lost or stolen.
      + If this is an error, please take your library card to the circulation desk at your local library and the error will be corrected. +
    • + [% END %] - [% IF ( debarred ) %] - [% INCLUDE "patron-restrictions.inc" %] - [% END %] + [% IF ( debarred ) %] + [% INCLUDE "patron-restrictions.inc" %] + [% END %] - [% IF ( too_much_oweing ) %] -
    • You have unpaid fines. Amount: [% too_much_oweing | $Price %].
    • - [% END %] + [% IF ( too_much_oweing ) %] +
    • You have unpaid fines. Amount: [% too_much_oweing | $Price %].
    • + [% END %] - [% IF ( too_many_reserves ) %] -
    • Sorry, you cannot place more than [% too_many_reserves | html %] holds.
    • - [% END %] + [% IF ( too_many_reserves ) %] +
    • Sorry, you cannot place more than [% too_many_reserves | html %] holds.
    • + [% END %] - [% IF ( bad_biblionumber ) %] -
    • ERROR: No record found for record ID [% bad_biblionumber | html %].
    • - [% END %] + [% IF ( bad_biblionumber ) %] +
    • ERROR: No record found for record ID [% bad_biblionumber | html %].
    • + [% END %] - [% IF ( no_items_selected ) %] -
    • You must select at least one item.
    • - [% END %] + [% IF ( no_items_selected ) %] +
    • You must select at least one item.
    • + [% END %] - [% IF ( no_branch_selected ) %] -
    • You must select a library for pickup.
    • - [% END %] + [% IF ( no_branch_selected ) %] +
    • You must select a library for pickup.
    • + [% END %] - [% IF ( no_biblionumber ) %] -
    • ERROR: No record ID specified.
    • - [% END %] + [% IF ( no_biblionumber ) %] +
    • ERROR: No record ID specified.
    • + [% END %] - [% IF ( bad_data ) %] -
    • ERROR: Internal error: incomplete hold request.
    • - [% END %] + [% IF ( bad_data ) %] +
    • ERROR: Internal error: incomplete hold request.
    • + [% END %] - [% IF ( expired_patron ) %] -
    • Your library card has expired. Please contact your librarian if you wish to renew your card.
    • - [% END %] + [% IF ( expired_patron ) %] +
    • Your library card has expired. Please contact your librarian if you wish to renew your card.
    • + [% END %] - [% IF ( no_pickup_locations ) %] -
    • None of the libraries are available for pickup location.
    • - [% END %] -
    -
    - - [% ELSE # /IF message %] + [% IF ( no_pickup_locations ) %] +
  • None of the libraries are available for pickup location.
  • + [% END %] +
+
+ + [% ELSE # /IF message %] - [% IF ( none_available && multi_hold ) %] -
Sorry, none of these titles can be placed on hold.
- [% END %] - [% END # / IF message %] + [% IF ( none_available && multi_hold ) %] +
Sorry, none of these titles can be placed on hold.
+ [% END %] + [% END # / IF message %] - [% UNLESS ( message ) %] - [% UNLESS ( none_available ) %] -

Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])

- [% END # / UNLESS none_available %] + [% UNLESS ( message ) %] + [% UNLESS ( none_available ) %] +

Confirm holds for:[% INCLUDE 'patron-title.inc' patron = logged_in_user %] ([% logged_in_user.cardnumber | html %])

+ [% END # / UNLESS none_available %] - [% IF ( new_reserves_allowed ) %] -
Sorry, you can only place [% new_reserves_allowed | html %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on.
- [% END %] + [% IF ( new_reserves_allowed ) %] +
+ Sorry, you can only place [% new_reserves_allowed | html %] more holds. Please uncheck the checkboxes for the items you wish to not place holds on. +
+ [% END %] -
- [% INCLUDE 'csrf-token.inc' %] - Hold requests - - - - -
- [% FOREACH bibitemloo IN bibitemloop %] -
- [% IF bibitemloo.forced_hold_level %] -
- [% IF bibitemloo.forced_hold_level == 'item' %] - You already have at least one item level hold on this title. All further holds must be item level. - [% ELSE %] - You already have at least one record level hold on this title. All further holds must be record level. + + [% INCLUDE 'csrf-token.inc' %] + Hold requests + + + + +
+ [% FOREACH bibitemloo IN bibitemloop %] +
+ [% IF bibitemloo.forced_hold_level %] +
+ [% IF bibitemloo.forced_hold_level == 'item' %] + You already have at least one item level hold on this title. All further holds must be item level. + [% ELSE %] + You already have at least one record level hold on this title. All further holds must be record level. + [% END %] +
[% END %] -
- [% END %] - [% IF ( bibitemloo.reserve_charge ) %] -
- [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %] - You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] when you collect this item - [% ELSE %] - You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] for placing this hold + [% IF ( bibitemloo.reserve_charge ) %] +
+ [% IF Koha.Preference('HoldFeeMode') == 'any_time_is_collected' %] + You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] when you collect this item + [% ELSE %] + You will be charged a hold fee of [% bibitemloo.reserve_charge | $Price %] for placing this hold + [% END %] +
[% END %] -
- [% END %] -

- [% IF ( bibitemloo.holdable ) %] - - - - - - - - [% END # / bibitemloo.holdable %] - - [% INCLUDE 'biblio-title.inc' biblio=bibitemloo link=> 1 %] - - [% IF ( bibitemloo.author ) %], by [% bibitemloo.author | html %][% END %] -

- - [% UNLESS ( bibitemloo.holdable ) %] - [% IF ( bibitemloo.ageRestricted ) %] -
Sorry, you are too young to place a hold for this item.
- [% END %] - [% IF ( bibitemloo.already_reserved ) %] -
You have already requested this title.
- [% ELSIF ( bibitemloo.recall ) %] -
You have already placed a recall on this title.
- [% ELSE %] - [% IF bibitemloo.alreadypossession %] -
This title cannot be requested because it's already in your possession.
- [% ELSIF bibitemloo.tooManyReserves %] -
This title cannot be requested because you reached the maximum number of holds.
- [% ELSIF bibitemloo.tooManyHoldsForThisRecord %] -
This title cannot be requested because you exceeded max holds per record.
- [% ELSIF bibitemloo.tooManyReservesToday %] -
This title cannot be requested because you reached the daily hold limit.
- [% ELSIF bibitemloo.itemAlreadyOnHold %] -
This title cannot be requested because you already have hold for this item.
- [% ELSE %] - [% UNLESS ( bibitemloo.bib_available ) %] -
There are no items that can be placed on hold.
- [% ELSE %] -
This title cannot be requested.
- [% END %] - [% END # / UNLESS bibitemloo.already_patron_possession %] - [% END # / IF bibitemloo.already_reserved %] - [% END # / UNLESS bibitemloo.holdable %] - - [% IF ( bibitemloo.holdable ) %] -
-
    - - [% UNLESS ( item_level_itypes ) %] -
  • - Item type: - [% IF ( bibitemloo.imageurl ) %][% END %] - [% bibitemloo.translated_description | html %] -
  • - [% END %] +

    + [% IF ( bibitemloo.holdable ) %] + + + + + + + + [% END # / bibitemloo.holdable %] - [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %] - [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %] -

  • - Your priority: - [% bibitemloo.rank | html %] -
  • - [% END %] + [% INCLUDE 'biblio-title.inc' biblio=bibitemloo link=> 1 %] - [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %] -
  • - Number of holds: - [% bibitemloo.reservecount | html %] -
  • - [% END %] + [% IF ( bibitemloo.author ) %], by [% bibitemloo.author | html %][% END %] +

    - [% UNLESS ( singleBranchMode ) %] - [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %] -
  • - - [% UNLESS ( bibitemloo.holdable ) %] - - [% ELSE %] - [% SET at_least_one_library_not_available_for_pickup = 0 %] - - [% IF at_least_one_library_not_available_for_pickup %] -
    - Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items -
    - [% END %] - [% END # / UNLESS bibitemloo.holdable %] -
  • - [% END # / IF bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch') %] - [% END # / UNLESS singleBranchMode %] -
- - - -
-
    - [% IF ( reserve_in_future ) %] -
  • - - - [% INCLUDE 'date-format.inc' %] - -
  • - [% END %] + [% UNLESS ( bibitemloo.holdable ) %] + [% IF ( bibitemloo.ageRestricted ) %] +
    Sorry, you are too young to place a hold for this item.
    + [% END %] + [% IF ( bibitemloo.already_reserved ) %] +
    You have already requested this title.
    + [% ELSIF ( bibitemloo.recall ) %] +
    You have already placed a recall on this title.
    + [% ELSE %] + [% IF bibitemloo.alreadypossession %] +
    This title cannot be requested because it's already in your possession.
    + [% ELSIF bibitemloo.tooManyReserves %] +
    This title cannot be requested because you reached the maximum number of holds.
    + [% ELSIF bibitemloo.tooManyHoldsForThisRecord %] +
    This title cannot be requested because you exceeded max holds per record.
    + [% ELSIF bibitemloo.tooManyReservesToday %] +
    This title cannot be requested because you reached the daily hold limit.
    + [% ELSIF bibitemloo.itemAlreadyOnHold %] +
    This title cannot be requested because you already have hold for this item.
    + [% ELSE %] + [% UNLESS ( bibitemloo.bib_available ) %] +
    There are no items that can be placed on hold.
    + [% ELSE %] +
    This title cannot be requested.
    + [% END %] + [% END # / UNLESS bibitemloo.already_patron_possession %] + [% END # / IF bibitemloo.already_reserved %] + [% END # / UNLESS bibitemloo.holdable %] + + [% IF ( bibitemloo.holdable ) %] +
    +
      + + [% UNLESS ( item_level_itypes ) %] +
    • + Item type: + [% IF ( bibitemloo.imageurl ) %][% END %] + [% bibitemloo.translated_description | html %] +
    • + [% END %] -
    • - - - [% INCLUDE 'date-format.inc' %] - -
    • - - [% IF Koha.Preference('AllowHoldItemTypeSelection') %] -
    • - - -
    • - [% END %] + [% SET OPACShowHoldQueueDetails = Koha.Preference('OPACShowHoldQueueDetails') %] + [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'priority' %] +
    • + Your priority: + [% bibitemloo.rank | html %] +
    • + [% END %] - [% UNLESS bibitemloo.forced_hold_level && ( bibitemloo.forced_hold_level == 'item' || bibitemloo.forced_hold_level == 'record' ) %] - [% IF Koha.Preference('EnableItemGroupHolds') && bibitemloo.object.item_groups.count %] -
    • - - + [% IF OPACShowHoldQueueDetails == 'holds_priority' || OPACShowHoldQueueDetails == 'holds' %] +
    • + Number of holds: + [% bibitemloo.reservecount | html %]
    • [% END %] - [% END %] - [% IF ( OpacHoldNotes ) %] -
    • -
      - - -
      -
    • - [% END # / IF OpacHoldNotes %] - - [% IF bibitemloo.itemholdable %] - - - [% END # / IF bibitemloo.itemholdable %] -
    - - [% IF bibitemloo.itemholdable %] -
    - - - - - - [% IF ( item_level_itypes ) %] - - [% END %] - - [% UNLESS ( singleBranchMode ) %] - - - [% END %] - [% IF ( itemdata_ccode ) %] - - [% END %] - - [% IF ( itemdata_enumchron ) %] - - [% END %] - - - - - - [% SET unholdable_items = 0 %] - [% FOREACH itemLoo IN bibitemloo.itemLoop %] - [% SET row_class = "holdable" %] - [% SET row_style = "" %] - [% IF ( itemLoo.available ) %] - [% IF ( itemLoo.checkout ) %] - [% row_class = "holdable onloan" %] - [% ELSE %] - [% row_class = "holdable" %] - [% END %] + [% UNLESS ( singleBranchMode ) %] + [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %] +
  • + + [% UNLESS ( bibitemloo.holdable ) %] + [% ELSE %] - [% SET unholdable_items = 1 %] - [% row_style = "display:none" %] - [% IF ( itemLoo.checkout ) %] - [% row_class = "unholdable onloan" %] - [% ELSE %] - [% row_class = "unholdable" %] + [% SET at_least_one_library_not_available_for_pickup = 0 %] + + [% IF at_least_one_library_not_available_for_pickup %] +
    + Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items +
    [% END %] + [% END # / UNLESS bibitemloo.holdable %] +
  • + [% END # / IF bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch') %] + [% END # / UNLESS singleBranchMode %] + + + + +
    +
      + [% IF ( reserve_in_future ) %] +
    • + + + [% INCLUDE 'date-format.inc' %] + +
    • + [% END %] + +
    • + + + [% INCLUDE 'date-format.inc' %] + +
    • + + [% IF Koha.Preference('AllowHoldItemTypeSelection') %] +
    • + + +
    • + [% END %] + + [% UNLESS bibitemloo.forced_hold_level && ( bibitemloo.forced_hold_level == 'item' || bibitemloo.forced_hold_level == 'record' ) %] + [% IF Koha.Preference('EnableItemGroupHolds') && bibitemloo.object.item_groups.count %] +
    • + + +
    • + [% END %] + [% END %] + + [% IF ( OpacHoldNotes ) %] +
    • +
      + + +
      +
    • + [% END # / IF OpacHoldNotes %] + + [% IF bibitemloo.itemholdable %] + +
    - [% IF ( itemLoo.available ) %] - + + + [% END # / FOREACH itemLoo IN bibitemloo.itemLoop %] + +
    Select a specific item:
    Copy numberItem typeBarcodeHome libraryLast locationCollectionCall numberVol infoNotesInformation
    - - [% IF ( itemLoo.copynumber ) %] - [% itemLoo.copynumber | html %] + + + + [% END # / IF bibitemloo.itemholdable %] + + + [% IF bibitemloo.itemholdable %] +
    + + + + + + [% IF ( itemdata_copynumber ) %] + + [% END %] + [% IF ( item_level_itypes ) %] + + [% END %] + + [% UNLESS ( singleBranchMode ) %] + + + [% END %] + [% IF ( itemdata_ccode ) %] + + [% END %] + + [% IF ( itemdata_enumchron ) %] + + [% END %] + + + + + + + [% SET unholdable_items = 0 %] + [% FOREACH itemLoo IN bibitemloo.itemLoop %] + [% SET row_class = "holdable" %] + [% SET row_style = "" %] + [% IF ( itemLoo.available ) %] + [% IF ( itemLoo.checkout ) %] + [% row_class = "holdable onloan" %] + [% ELSE %] + [% row_class = "holdable" %] + [% END %] + [% ELSE %] + [% SET unholdable_items = 1 %] + [% row_style = "display:none" %] + [% IF ( itemLoo.checkout ) %] + [% row_class = "unholdable onloan" %] + [% ELSE %] + [% row_class = "unholdable" %] [% END %] - - [%# copynumber %] - [% ELSE %] - + [% IF ( itemLoo.available ) %] + + [% ELSE %] + [% END %] - - [%# copynumber %] - [% END %] - [% IF ( item_level_itypes ) %] - [% END %] - [% itemLoo.translated_description | html %] - - [% END %] - - [% UNLESS ( singleBranchMode ) %] - - - [% END %] - [% IF ( itemdata_ccode ) %] - - [% END %] - - [% IF ( itemdata_enumchron ) %] - - [% END %] - - + [% END %] - [% IF ( itemLoo.itemlost == 1 || itemLoo.itemlost == 2 ) %] - [%# FIXME Why only for 1 or 2? Shouldn't we test for withdrawn as well? %] - Unavailable (lost or missing) - [% END %] + + [% UNLESS ( singleBranchMode ) %] + + + [% END %] + [% IF ( itemdata_ccode ) %] + + [% END %] + + [% IF ( itemdata_enumchron ) %] + + [% END %] + + - - [% END # / FOREACH itemLoo IN bibitemloo.itemLoop %] - -
    Select a specific item:
    ChooseCopy numberItem typeBarcodeCurrent libraryHome libraryCollectionCall numberVol infoNotesInformation
    - - - [% IF ( itemLoo.copynumber ) %] - [% itemLoo.copynumber | html %] + [% END %] +
    + + + + + Cannot be put on hold + - [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] - [% IF ( itemLoo.imageurl ) %] - - [% END %] + [% IF ( itemdata_copynumber ) %] + + [% IF ( itemLoo.copynumber ) %] + [% itemLoo.copynumber | html %] + [% END %] + [% itemLoo.barcode | html %][% Branches.GetName( itemLoo.homebranch) | html %][% Branches.GetName( itemLoo.holdingbranch ) | html %] - [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %][% itemLoo.itemcallnumber | html %][% itemLoo.enumchron | html %] [% itemLoo.itemnotes | html %] - [% IF ( itemLoo.checkout.date_due) %] - Due [% itemLoo.checkout.date_due| $KohaDates as_due_date => 1 %] - [% ELSIF ( itemLoo.transfertwhen ) %] - In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since - [% itemLoo.transfertwhen | $KohaDates %] - [% END %] + [% IF ( item_level_itypes ) %] + + [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] + [% IF ( itemLoo.imageurl ) %] + + [% END %] + [% END %] + [% itemLoo.translated_description | html %] + [% itemLoo.barcode | html %][% Branches.GetName( itemLoo.homebranch) | html %][% Branches.GetName( itemLoo.holdingbranch ) | html %] + [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %][% itemLoo.itemcallnumber | html %][% itemLoo.enumchron | html %] [% itemLoo.itemnotes | html %] + [% IF ( itemLoo.checkout.date_due) %] + Due [% itemLoo.checkout.date_due| $KohaDates as_due_date => 1 %] + [% ELSIF ( itemLoo.transfertwhen ) %] + In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since + [% itemLoo.transfertwhen | $KohaDates %] + [% END %] - [% IF ( itemLoo.notforloan ) %] - Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemLoo.notforloan ) %]) - [% END %] + [% IF ( itemLoo.itemlost == 1 || itemLoo.itemlost == 2 ) %] + [%# FIXME Why only for 1 or 2? Shouldn't we test for withdrawn as well? %] + Unavailable (lost or missing) + [% END %] - [% IF ( itemLoo.first_hold ) %] - - [% IF ( itemLoo.waitingdate ) %] - Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %] - [% ELSIF ( itemLoo.reservedate ) %] - On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %] - [% ELSE %] - On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] + [% IF ( itemLoo.notforloan ) %] + Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemLoo.notforloan ) %]) [% END %] - - [% ELSE %] - Not on hold - [% END # / IF ( itemLoo.first_hold ) %] -
    - - [% IF unholdable_items %] - - - [% END %] + + [% IF ( itemLoo.first_hold ) %] + + [% IF ( itemLoo.waitingdate ) %] + Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %] + [% ELSIF ( itemLoo.reservedate ) %] + On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %] + [% ELSE %] + On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] + [% END %] + + [% ELSE %] + Not on hold + [% END # / IF ( itemLoo.first_hold ) %] +
    + + [% IF unholdable_items %] + + + [% END %] +
    + + [% END # / IF ( bibitemloo.itemholdable ) %]
- [% END # / IF ( bibitemloo.itemholdable ) %] -
- - - [% END # / IF ( bibitemloo.holdable ) %] -
- - [% END # / FOREACH bibitemloo IN bibitemloop %]
- - [% UNLESS ( none_available ) %] - - [% END %] - - [% END # / UNLESS message %] + + + [% END # / IF ( bibitemloo.holdable ) %] +
+ + [% END # / FOREACH bibitemloo IN bibitemloop %]
+ + [% UNLESS ( none_available ) %] + + [% END %] + + [% END # / UNLESS message %] +
+ + - @@ -731,15 +743,25 @@ return true; }); - $(".itemstable").each(function(){ - $(this).DataTable({ - dom: "t", - initComplete: function() { - this.find("input:radio").first().prop("checked", true ); - }, - paging: false - }); - }); + + var table_settings = [% TablesSettings.GetTableSettings( 'opac', 'opac_holds', 'opac_holds_items', 'json' ) | $raw %]; + + $(".itemstable").kohaTable({ + bKohaColumnsUseNames: true, + order: [[ 1, "asc" ]], + responsive: { + details: { "type": 'column',"target": -1 } + }, + columnDefs: [ + { "className": 'dtr-control', "orderable": false, "targets": -1 } + ], + initComplete: function(settings, json) { + /* Select the first radio button in the table as a default */ + $( "#" + settings.sInstance ).find("input:radio").first().prop("checked", true ); + }, + paging: false + }, table_settings + ); }); [% END %] diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 6db213f2985..39b1124a8bf 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -366,13 +366,14 @@ $template->param( select_item_types => 1 ); # # -my $biblioLoop = []; -my $numBibsAvailable = 0; -my $itemdata_enumchron = 0; -my $itemdata_ccode = 0; -my $anyholdable = 0; -my $itemLevelTypes = C4::Context->preference('item-level_itypes'); -my $pickup_locations = Koha::Libraries->search( { pickup_location => 1 } ); +my $biblioLoop = []; +my $numBibsAvailable = 0; +my $itemdata_copynumber = 0; +my $itemdata_enumchron = 0; +my $itemdata_ccode = 0; +my $anyholdable = 0; +my $itemLevelTypes = C4::Context->preference('item-level_itypes'); +my $pickup_locations = Koha::Libraries->search( { pickup_location => 1 } ); $template->param( 'item_level_itypes' => $itemLevelTypes ); my $patron_unblessed = $patron->unblessed; @@ -486,6 +487,11 @@ foreach my $biblioNum (@biblionumbers) { } } + # Show copy number when needed + if ( $item_info->{copynumber} ) { + $itemdata_copynumber = 1; + } + # Show serial enumeration when needed if ( $item_info->{enumchron} ) { $itemdata_enumchron = 1; -- 2.39.5