From c649f73d029b406a6bad80c31b8388ba19cdd15c Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 20 Apr 2023 15:47:01 +0000 Subject: [PATCH] Bug 33575: Add dataTable to hold table on /reserve/request.tt To test: 1. Have a record with several holds on it. 2. Go to the holds page for that record ( /cgi-bin/koha/reserve/request.pl?biblionumber=144 ) 3. Cannot sort by columns 4. Apply patch, restart_all 5. Now the table should be a dataTable that will allow you sort. 6. Try hiding columns by clicking on the 'Columns' icon above the table, make sure columns are correctly being hidden. 7. Try to hide columns by going to Adminstration > Table settings ( Circulation > Holds > patron_holds_table ), make sure columns are correctly being hidden. 8. Now login with a user who has the 'place_holds' permission but does NOT have the 'modify_holds_priority' permssion. 9. The table will not have the change priority columns. Make sure all columns can still be hidden/shown correctly for that use. Signed-off-by: Sally Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- admin/columns_settings.yml | 32 ++ .../prog/en/includes/holds_table.inc | 425 +++++++++--------- .../prog/en/modules/reserve/request.tt | 7 + 3 files changed, 239 insertions(+), 225 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 3692679f7a..c2bdc7867f 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1675,6 +1675,38 @@ modules: - columnname: action + holds: + patron_holds_table: + columns: + - + columnname: checkbox + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: priority + - + columnname: change_priority + - + columnname: patron + - + columnname: notes + - + columnname: date + - + columnname: expiration + - + columnname: pickup_library + - + columnname: details + - + columnname: set_lowest_priority + - + columnname: delete + - + columnname: suspend + - + columnname: print_slip + holdsratios: holds-ratios: default_display_length: 20 diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index 543c027957..f46a3ef26a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -1,28 +1,26 @@ [% USE Koha %] [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %] [% USE AuthorisedValues %] - +
- - + + [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] - + [% END %] - - - - - - + + + + + + [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] - + [% END %] - - - + + + [%- SET first_priority = 0 -%] @@ -40,237 +38,214 @@ [%- loop_priority = loop_priority + 1- %] [%- END -%] [% END %] - - [% FOREACH hold IN holds %] - [%- IF !hold.found && first_priority == 0 -%] - [%- first_priority = hold.priority -%] - [%- found_holds = loop.index() -%] - [%- END -%] - [%- IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' -%] - [%- this_priority = hold.priority -%] - [%- ELSE -%] - [%- this_priority = loop.count() - found_holds -%] - [%- END -%] - [% IF hold.suspend %] - - [% ELSE %] - - [% END %] - - + [% FOREACH hold IN holds %] + [%- IF !hold.found && first_priority == 0 -%] + [%- first_priority = hold.priority -%] + [%- found_holds = loop.index() -%] + [%- END -%] + [%- IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' -%] + [%- this_priority = hold.priority -%] + [%- ELSE -%] + [%- this_priority = loop.count() - found_holds -%] + [%- END -%] + [% IF hold.suspend %] + + [% ELSE %] + + [% END %] + + - [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] - [%- UNLESS hold.found -%] - [%- SET prev_priority = loop.prev.priority -%] - [%- SET next_priority = loop.next.priority -%] - + [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] + [%- UNLESS hold.found -%] + [%- SET prev_priority = loop.prev.priority -%] + [%- SET next_priority = loop.next.priority -%] + - [%- ELSE -%] - - [%- END -%] + + + + + [%- ELSE -%] + [%- END -%] - - - - + + + - + - + - [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] - [%- UNLESS hold.found -%] - - [%- ELSE -%] - - [%- END -%] + [%- IF hold.non_priority -%] +
Non priority hold + [%- END -%] + + [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%] + [%- UNLESS hold.found -%] + + [%- ELSE -%] + [%- END -%] - - + - [% IF ( hold.intransit || hold.atdestination ) %] - - [% ELSE %] - - [% END %] - - [% END %] + + [% IF ( hold.intransit || hold.atdestination ) %] + + [% ELSE %] + + [% END %] + + [% END %] +
PriorityPriority Change priorityPatronNotesDateExpirationPickup libraryDetailsPatronNotesDateExpirationPickup libraryDetails - -   Print hold/transfer slipDeleteSuspendPrint hold/transfer slip
- - - - [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] - [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] - - [% ELSE %] - -
+ + + + [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] + [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] + [% ELSE %] - + + [% END %] - + [% ELSE %] + + [% hold.priority | html %] [% END %] - [% ELSE %] - - [% hold.priority | html %] - [% END %] - - - - + + + + - - - + + + - - - + + + - - - - - [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %] - [% hold.notes | html | html_line_break %] - [% IF Koha.Preference('AllowHoldDateInFuture') %] - - [% ELSE %] - [% hold.date | $KohaDates %] - [% END %] - - [% UNLESS hold.expired %] + [%- END -%] + + [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %] + [% hold.notes | html | html_line_break %] + [% IF Koha.Preference('AllowHoldDateInFuture') %] + + [% ELSE %] + [% hold.date | $KohaDates %] + [% END %] + - [% ELSE %] - [% hold.expirationdate | $KohaDates %] - [% END %] - - [%- IF ( hold.found ) -%] - - [%- IF ( hold.atdestination ) -%] - Item waiting at [% hold.wbrname | html %][% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %] - [%- ELSIF (hold.intransit) -%] - Item being transferred to [% hold.wbrname | html %] - [%- ELSIF (hold.inprocessing) -%] - Item being processed at [% hold.wbrname | html %] - [%- ELSE -%] - Hold expected at [% hold.wbrname | html %], please checkin to verify status - [%- END -%] - [%- ELSE -%] - [%- IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 -%] - [% Branches.GetName(hold.branchcode) | html %] + + [%- IF ( hold.found ) -%] + + [%- IF ( hold.atdestination ) -%] + Item waiting at [% hold.wbrname | html %][% IF hold.desk_name %], [% hold.desk_name | html %],[% END %] since [% hold.waiting_date | $KohaDates %] + [%- ELSIF (hold.intransit) -%] + Item being transferred to [% hold.wbrname | html %] + [%- ELSIF (hold.inprocessing) -%] + Item being processed at [% hold.wbrname | html %] + [%- ELSE -%] + Hold expected at [% hold.wbrname | html %], please checkin to verify status + [%- END -%] [%- ELSE -%] - - - [%- END -%] - [%- END -%] - - [%- IF ( hold.found ) -%] - - [%- IF ( hold.barcodenumber ) -%] - [%- hold.barcodenumber | html -%] - + [%- IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 -%] + [% Branches.GetName(hold.branchcode) | html %] [%- ELSE -%] - No barcode + + [%- END -%] - - [%- ELSE -%] - [%- IF ( hold.item_level_hold ) -%] - - [%- IF ! hold.change_hold_type_allowed -%] - Only item - - [%- IF ( hold.barcodenumber ) -%] - [%- hold.barcodenumber | html -%] - - [%- ELSE -%] - No barcode - [%- END -%] - + [%- END -%] + + [%- IF ( hold.found ) -%] + + [%- IF ( hold.barcodenumber ) -%] + [%- hold.barcodenumber | html -%] + [%- ELSE -%] - [%- ELSE -%] - No barcode + No barcode [%- END -%] - - - - [%- IF ( hold.barcodenumber ) -%] - - [%- END -%] - [%- IF hold.itemtype -%] - Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item - [%- ELSE -%] - Next available - [%- END -%] - [%- END -%] - - [%- ELSE -%] - [%- IF hold.itemtype -%] - Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item - [%- ELSIF hold.object.item_group -%] - Next available item from group [% hold.object.item_group.description | html %] + + [%- ELSE -%] - Next available - [%- END -%] + [%- IF hold.itemtype -%] + Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item + [%- ELSIF hold.object.item_group -%] + Next available item from group [% hold.object.item_group.description | html %] + [%- ELSE -%] + Next available + [%- END -%] - + + [%- END -%] [%- END -%] - [%- END -%] - [%- IF hold.non_priority -%] -
Non priority hold - [%- END -%] -
- [% IF ( hold.lowestPriority ) %] - - - [% ELSE %] - - - [% END %] - - + [% IF ( hold.lowestPriority ) %] + + + [% ELSE %] + + + [% END %] + + - - - - - [% IF Koha.Preference('SuspendHoldsIntranet') %] - [% UNLESS ( hold.found ) %] - + [%- END -%] + + + + + + [% IF Koha.Preference('SuspendHoldsIntranet') %] + [% UNLESS ( hold.found ) %] + - [% IF Koha.Preference('AutoResumeSuspendedHolds') %] - - - [%- ELSE -%] - + [% IF Koha.Preference('AutoResumeSuspendedHolds') %] + + + [%- ELSE -%] + + [%- END -%] [%- END -%] + [%- END # IF SuspendHoldsIntranet -%] + [%- IF ( hold.found ) -%] + [%- END -%] - [%- END # IF SuspendHoldsIntranet -%] - [%- IF ( hold.found ) -%] - - [%- END -%] -
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 3f0a1973b4..a1e63a4fdb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1301,6 +1301,13 @@ [% END %]