From d4855131e3b8e5852f221182ed9588f4ddc67368 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Dec 2021 15:34:28 +0100 Subject: [PATCH] Bug 29660: Remove biblioitem loop from request.pl It seems that hiddencount didn't work prior to this patch (to confirm) Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- .../prog/en/modules/reserve/request.tt | 406 +++++++++--------- reserve/request.pl | 399 +++++++---------- 2 files changed, 369 insertions(+), 436 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 8df40c0974..c97c7991e5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -284,7 +284,7 @@   Title - [% UNLESS ( item_level_itypes ) %] + [% UNLESS Koha.Preference('item-level_itypes') %] Item type [% END %] Priority @@ -317,9 +317,9 @@ [% END %] - [% UNLESS ( item_level_itypes ) %] + [% UNLESS Koha.Preference('item-level_itypes') %] - [% biblioloo.itypename | html %] + [% biblioloo.itemtype.translated_description | html %] [% END %] [% biblioloo.rank | html %] @@ -573,222 +573,222 @@ [% END %] - [% FOREACH bibitemloo IN bibitemloop %] -
    - [% UNLESS ( item_level_itypes ) %] -
  1. - Item type: - [% bibitemloo.description | html %] -
  2. - [% END %] + [% biblio = biblioloop.0 %] - [% IF ( bibitemloo.publicationyear ) %] -
  3. - Publication year: - [% bibitemloo.publicationyear | html %] -
  4. - [% END %] -
+
    + [% UNLESS Koha.Preference('item-level_itypes') %] +
  1. + Item typeX: + [% biblio.itemtype.translated_description | html %] +
  2. + [% END %] -

    - Place a hold on a specific item - [% IF bibitemloo.force_hold_level == 'item' %] - (Required) - [% END %] -

    + [% IF ( biblio.biblioitem.publicationyear ) %] +
  3. + Publication year: + [% biblio.biblioitem.publicationyear | $KohaDates %] +
  4. + [% END %] +
- - - - - [% IF ( item_level_itypes ) %] - - [% END %] - - - - [% IF itemdata_ccode %] - - [% END %] - - - [% IF itemdata_enumchron %] - - [% END %] - - - - - - [% SET selected = 0 %] - [% FOREACH itemloo IN bibitemloo.itemloop %] - [% UNLESS ( itemloo.hide ) %] - - + + + [% END # / UNLESS itemloo.hide %] + [% END # /FOREACH itemloo %] + +
HoldItem typeBarcodeHome libraryLast locationCollectionCall numberCopy numberVol no.InformationAllowed pickup locations
- [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] - - - Hold must be record level - - [% ELSIF ( itemloo.available ) %] - - [% ELSIF ( itemloo.override ) %] - - - [% ELSE %] - - - [% IF itemloo.not_holdable %] - [% IF itemloo.not_holdable == 'damaged' %] - Item damaged - [% ELSIF itemloo.not_holdable == 'ageRestricted' %] - Age restricted - [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %] - Exceeded max holds per record - [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %] - Daily hold limit reached for patron - [% ELSIF itemloo.not_holdable == 'tooManyReserves' %] - Too many holds - [% ELSIF itemloo.not_holdable == 'notReservable' %] - Not holdable - [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %] - Patron is from different library - [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %] - Cannot place hold from patron's library - [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %] - Patron already has hold for this item - [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %] - Cannot be transferred to pickup library - [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %] - Only pickup locations within the same hold group are allowed - [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %] - No reserves are allowed on this item - [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %] - Library is not a pickup location - [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %] - No valid pickup location - [% ELSE %] - [% itemloo.not_holdable | html %] - [% END %] +

+ Place a hold on a specific item + [% IF force_hold_level == 'item' %] + (Required) + [% END %] +

+ + + + + + [% IF Koha.Preference('item-level_itypes') %] + + [% END %] + + + + [% IF itemdata_ccode %] + + [% END %] + + + [% IF itemdata_enumchron %] + + [% END %] + + + + + + [% SET selected = 0 %] + [% FOREACH itemloo IN biblio.itemloop %] + [% UNLESS ( itemloo.hide ) %] + + - [% IF ( item_level_itypes ) %] - - [% END %] - + + [% END # /IF force_hold_level %] + + [% IF Koha.Preference('item-level_itypes') %] + [% END %] + + + + [% IF itemdata_ccode %] - [% IF itemdata_ccode %] - - [% END %] + [% END %] + + + [% IF itemdata_enumchron %] + [% END %] + [% IF ( itemloo.onloan ) %] + - [% IF itemdata_enumchron %] - - [% END %] - [% IF ( itemloo.onloan ) %] - - - - [% END # / UNLESS itemloo.hide %] - [% END # /FOREACH itemloo %] - -
HoldItem typeBarcodeHome libraryLast locationCollectionCall numberCopy numberVol no.InformationAllowed pickup locations
+ [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %] + + + Hold must be record level + + [% ELSIF ( itemloo.available ) %] + + [% ELSIF ( itemloo.override ) %] + + + [% ELSE %] + + + [% IF itemloo.not_holdable %] + [% IF itemloo.not_holdable == 'damaged' %] + Item damaged + [% ELSIF itemloo.not_holdable == 'ageRestricted' %] + Age restricted + [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %] + Exceeded max holds per record + [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %] + Daily hold limit reached for patron + [% ELSIF itemloo.not_holdable == 'tooManyReserves' %] + Too many holds + [% ELSIF itemloo.not_holdable == 'notReservable' %] + Not holdable + [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %] + Patron is from different library + [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %] + Cannot place hold from patron's library + [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %] + Patron already has hold for this item + [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %] + Cannot be transferred to pickup library + [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %] + Only pickup locations within the same hold group are allowed + [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %] + No reserves are allowed on this item + [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %] + Library is not a pickup location + [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %] + No valid pickup location + [% ELSE %] + [% itemloo.not_holdable | html %] [% END %] - - [% END # /IF itemloo.force_hold_level %] - - [% UNLESS ( noItemTypeImages ) %] - [% IF ( itemloo.imageurl ) %]
[% END %] [% END %] - [% itemloo.itypename | html %] -
- [% itemloo.barcode | html %] - - [% Branches.GetName( itemloo.homebranch ) | html %] + [% UNLESS ( noItemTypeImages ) %] + [% IF ( itemloo.itemtype.image_location) %]
[% END %] + [% END %] + [% itemloo.itemtype.translated_description | html %]
+ [% itemloo.barcode | html %] + + [% Branches.GetName( itemloo.homebranch ) | html %] + + [% Branches.GetName( itemloo.holdingbranch ) | html %] + - [% Branches.GetName( itemloo.holdingbranch ) | html %] + [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %] - [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %] - + [% itemloo.itemcallnumber | html %] + + [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %] + - [% itemloo.itemcallnumber | html %] + [% itemloo.enumchron | html %] + Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] + [% ELSE %] - [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %] [% END %] - - [% itemloo.enumchron | html %] - - Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] - [% ELSE %] - - [% IF ( itemloo.transfertwhen ) %] - In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], - to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %] - [% END %] - [% END %] + [% IF ( itemloo.transfertwhen ) %] + In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %], + to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %] + [% END %] + [% END %] - [% IF ( itemloo.reservedate ) %] - [% IF ( itemloo.nocancel ) %] - Can't be cancelled when item is in transit + [% IF ( itemloo.reservedate ) %] + [% IF ( itemloo.nocancel ) %] + Can't be cancelled when item is in transit + [% ELSE %] + [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] + [% IF ( itemloo.canreservefromotherbranches ) %] + for [% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %] + [% END %] + [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] + [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since + [% IF ( itemloo.waitingdate ) %] + [% itemloo.waitingdate | $KohaDates %] [% ELSE %] - [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] - [% IF ( itemloo.canreservefromotherbranches ) %] - for [% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %] + [% IF ( itemloo.reservedate ) %] + [% itemloo.reservedate | html %] [% END %] - [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] - [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since - [% IF ( itemloo.waitingdate ) %] - [% itemloo.waitingdate | $KohaDates %] - [% ELSE %] - [% IF ( itemloo.reservedate ) %] - [% itemloo.reservedate | html %] - [% END %] - [% END %]. - Cancel hold - [% END # /IF itemloo.nocancel %] - [% ELSE %] - Not on hold - [% END # /IF itemloo.reservedate %] + [% END %]. + Cancel hold + [% END # /IF itemloo.nocancel %] + [% ELSE %] + Not on hold + [% END # /IF itemloo.reservedate %] - [% IF itemloo.item_level_holds == "N" %] -
Item level hold not allowed from OPAC - [% ELSIF itemloo.item_level_holds == "F" %] -
Item level hold forced from OPAC - [% END %] + [% IF itemloo.item_level_holds == "N" %] +
Item level hold not allowed from OPAC + [% ELSIF itemloo.item_level_holds == "F" %] +
Item level hold forced from OPAC + [% END %] - [% IF ( itemloo.itemlost ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %] - [% END %] + [% IF ( itemloo.itemlost ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %] + [% END %] - [% IF ( itemloo.damaged ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %] - [% END %] + [% IF ( itemloo.damaged ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %] + [% END %] - [% IF ( itemloo.withdrawn ) %] - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %] - [% END %] + [% IF ( itemloo.withdrawn ) %] + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %] + [% END %] - [% IF ( itemloo.notforloan ) %] - Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %]) - [% END %] -
- [% IF (itemloo.pickup_locations_count > 0) %] - + [% IF ( itemloo.notforloan ) %] + Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %]) [% END %] -
- - [% IF ( bibitemloo.hiddencount ) %] -
-

- Show all items ([% bibitemloo.hiddencount | html %] hidden) -

-
- [% END # /IF bibitemloo.hiddencount %] - [% END # /FOREACH bibitemloo %] +
+ [% IF (itemloo.pickup_locations_count > 0) %] + + [% END %] +
+ + [% IF hiddencount %] +
+

+ Show all items ([% biblio.hiddencount | html %] hidden) +

+
+ [% END # /IF hiddencount %] [% ELSE # /UNLESS multi_hold %] @@ -796,7 +796,7 @@   Title - [% UNLESS ( item_level_itypes ) %] + [% UNLESS Koha.Preference('item-level_itypes') %] Item type [% END %] Priority @@ -830,9 +830,9 @@ [% END %] - [% UNLESS ( item_level_itypes ) %] + [% UNLESS Koha.Preference('item-level_itypes') %] - [% biblioloo.itypename | html %] + [% biblioloo.itemtype.translated_description | html %] [% END %] [% biblioloo.rank | html %] @@ -1146,18 +1146,18 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'calendar.inc' %] [% INCLUDE 'columns_settings.inc' %] [% Asset.js("lib/hc-sticky.js") | $raw %] [% Asset.js("js/circ-patron-search-results.js") | $raw %] [% INCLUDE 'select2.inc' %] [% Asset.js("js/holds.js") | $raw%] - [% INCLUDE 'calendar.inc' %]