Bugzilla – Attachment 168465 Details for
Bug 37219
In OPAC item holds, separate copy number from radio button and add table configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37219: In OPAC item holds, separate copy number from radio button and add table configuration
Bug-37219-In-OPAC-item-holds-separate-copy-number-.patch (text/plain), 28.11 KB, created by
Owen Leonard
on 2024-07-03 16:20:59 UTC
(
hide
)
Description:
Bug 37219: In OPAC item holds, separate copy number from radio button and add table configuration
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-07-03 16:20:59 UTC
Size:
28.11 KB
patch
obsolete
>From c5e9eebe87d8a44074e083823774599b628321ba Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 3 Jul 2024 15:43:30 +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, so ignore whitespace when >viewing the diff. > >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 | 26 ++ > .../bootstrap/en/modules/opac-reserve.tt | 251 ++++++++++-------- > 2 files changed, 160 insertions(+), 117 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index af24061dcf..7b85919d33 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -2085,6 +2085,32 @@ 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: home_library >+ - >+ columnname: current_library >+ - >+ columnname: collection >+ - >+ columnname: call_number >+ - >+ columnname: notes >+ - >+ columnname: information >+ > serials: > subscription-detail: > orders: >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 4451b46802..82b58a05b6 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' %] >@@ -378,123 +379,130 @@ > > [% IF bibitemloo.itemholdable %] > <div id="copiesrow_[% bibitemloo.biblionumber | html %]" class="copiesrow"> >- <table class="table table-bordered table-striped itemstable"> >- <caption>Select a specific item:</caption> >- <thead> >- <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 %] >- [% IF ( itemdata_ccode ) %] >- <th>Collection</th> >- [% END %] >- <th>Call number</th> >- [% IF ( itemdata_enumchron ) %] >- <th>Vol info</th> >- [% END %] >- <th>Notes</th> >- <th>Information</th> >- </tr> >- </thead> >- <tbody> >- >- [% SET unholdable_items = 0 %] >- [% FOREACH itemLoo IN bibitemloo.itemLoop %] >- [% IF ( itemLoo.available ) %] >- [% IF ( itemLoo.checkout ) %] >- <tr class="holdable onloan"> >- [% ELSE %] >- <tr class="holdable"> >- [% END %] >- <td class="copynumber" data-order="[% itemLoo.copynumber | html %]"> >- <input type="[% reserve_input_type | html %]" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" /> >- [% ELSE %] >- [% SET unholdable_items = 1 %] >- [% IF ( itemLoo.checkout ) %] >- <tr class="unholdable onloan" style="display:none;"> >- [% ELSE %] >- <tr class="unholdable" style="display:none;"> >- [% END %] >- <td class="copynumber"> >- <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]" >- style="display:none;" /> >- <i class="fa fa-times danger" aria-hidden="true" title="Cannot be put on hold"></i> >- [% END %] >- [% IF ( itemLoo.copynumber ) %] >- [% itemLoo.copynumber | html %] >+ <table class="table table-bordered table-striped itemstable"> >+ <caption>Select a specific item:</caption> >+ <thead> >+ <tr> >+ <th class="NoSort">Choose</th> >+ <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 %] >+ [% IF ( itemdata_ccode ) %] >+ <th>Collection</th> >+ [% END %] >+ <th>Call number</th> >+ [% IF ( itemdata_enumchron ) %] >+ <th>Vol info</th> >+ [% END %] >+ <th>Notes</th> >+ <th>Information</th> >+ <th></th> >+ </tr> >+ </thead> >+ <tbody> >+ >+ [% SET unholdable_items = 0 %] >+ [% FOREACH itemLoo IN bibitemloo.itemLoop %] >+ [% IF ( itemLoo.available ) %] >+ [% IF ( itemLoo.checkout ) %] >+ <tr class="holdable onloan"> >+ [% ELSE %] >+ <tr class="holdable"> >+ [% END %] >+ <td class="copynumber"> >+ <input type="[% reserve_input_type | html %]" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" /> >+ </td> >+ [% ELSE %] >+ [% SET unholdable_items = 1 %] >+ [% IF ( itemLoo.checkout ) %] >+ <tr class="unholdable onloan" style="display:none;"> >+ [% ELSE %] >+ <tr class="unholdable" style="display:none;"> >+ [% END %] >+ <td class="copynumber"> >+ <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]" style="display:none;" /> >+ <i class="fa fa-times danger" aria-hidden="true"></i> >+ <span class="fa-sr-only">Cannot be put on hold</span> >+ </td> > [% END %] >- </td> [%# copynumber %] > >- [% IF ( item_level_itypes ) %] >- <td class="itype"> >- [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] >- [% IF ( itemLoo.imageurl ) %] >- <img src="[% itemLoo.imageurl | html %]" alt="" /> >+ <td class="copynumber" data-order="[% itemLoo.copynumber | html %]"> >+ [% IF ( itemLoo.copynumber ) %] >+ [% itemLoo.copynumber | html %] > [% END %] >+ </td> [%# copynumber %] >+ >+ [% IF ( item_level_itypes ) %] >+ <td class="itype"> >+ [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] >+ [% IF ( itemLoo.imageurl ) %] >+ <img src="[% itemLoo.imageurl | html %]" alt="" /> >+ [% END %] >+ [% END %] >+ <span class="itypetext">[% itemLoo.translated_description | html %]</span> >+ </td> > [% END %] >- <span class="itypetext">[% itemLoo.translated_description | html %]</span> >- </td> >- [% END %] > >- <td class="barcode">[% itemLoo.barcode | html %]</td> >- [% UNLESS ( singleBranchMode ) %] >- <td class="homebranch">[% Branches.GetName( itemLoo.homebranch) | html %]</td> >- <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingbranch ) | html %]</td> >- [% END %] >- [% IF ( itemdata_ccode ) %] >- <td class="ccode"> [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %]</td> >- [% END %] >- <td class="call_no">[% itemLoo.itemcallnumber | html %]</td> >- [% IF ( itemdata_enumchron ) %] >- <td class="vol_info">[% itemLoo.enumchron | html %]</td> >- [% END %] >- <td class="itemnotes"> >- [% itemLoo.itemnotes | html %] >- </td> >- <td class="information"> >- [% IF ( itemLoo.checkout.date_due) %] >- <span class="checkedout">Due [% itemLoo.checkout.date_due| $KohaDates as_due_date => 1 %]</span> >- [% ELSIF ( itemLoo.transfertwhen ) %] >- <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | $KohaDates %]</span> >- [% END %] >+ <td class="barcode">[% itemLoo.barcode | html %]</td> >+ [% UNLESS ( singleBranchMode ) %] >+ <td class="homebranch">[% Branches.GetName( itemLoo.homebranch) | html %]</td> >+ <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingbranch ) | html %]</td> >+ [% END %] >+ [% IF ( itemdata_ccode ) %] >+ <td class="ccode"> [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %]</td> >+ [% END %] >+ <td class="call_no">[% itemLoo.itemcallnumber | html %]</td> >+ [% IF ( itemdata_enumchron ) %] >+ <td class="vol_info">[% itemLoo.enumchron | html %]</td> >+ [% END %] >+ <td class="itemnotes"> >+ [% itemLoo.itemnotes | html %] >+ </td> >+ <td class="information"> >+ [% IF ( itemLoo.checkout.date_due) %] >+ <span class="checkedout">Due [% itemLoo.checkout.date_due| $KohaDates as_due_date => 1 %]</span> >+ [% ELSIF ( itemLoo.transfertwhen ) %] >+ <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | $KohaDates %]</span> >+ [% END %] > >- [% IF ( itemLoo.itemlost == 1 || itemLoo.itemlost == 2 ) %] [%# FIXME Why only for 1 or 2? Shouldn't we test for withdrawn as well? %] >- <span class="lost">Unavailable (lost or missing)</span> >- [% END %] >+ [% IF ( itemLoo.itemlost == 1 || itemLoo.itemlost == 2 ) %] [%# FIXME Why only for 1 or 2? Shouldn't we test for withdrawn as well? %] >+ <span class="lost">Unavailable (lost or missing)</span> >+ [% END %] > >- [% IF ( itemLoo.notforloan ) %] >- <span class="notforloan">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemLoo.notforloan ) %])</span> >- [% END %] >+ [% IF ( itemLoo.notforloan ) %] >+ <span class="notforloan">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemLoo.notforloan ) %])</span> >+ [% END %] > >- [% IF ( itemLoo.first_hold ) %] >- <span class="waiting"> >- [% IF ( itemLoo.waitingdate ) %] >- <span>Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %]</span> >- [% ELSIF ( itemLoo.reservedate ) %] >- <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %]</span> >+ [% IF ( itemLoo.first_hold ) %] >+ <span class="waiting"> >+ [% IF ( itemLoo.waitingdate ) %] >+ <span>Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %]</span> >+ [% ELSIF ( itemLoo.reservedate ) %] >+ <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %]</span> >+ [% ELSE %] >+ <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %]</span> >+ [% END %] >+ </span> > [% ELSE %] >- <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %]</span> >- [% END %] >- </span> >- [% ELSE %] >- <span class="notonhold">Not on hold</span> >- [% END # / IF ( itemLoo.first_hold )%] >- </td> >- </tr> >- [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] >- </tbody> >- </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] --> >- [% IF unholdable_items %] >- <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button> >- <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button> >- [% END %] >- </div> >+ <span class="notonhold">Not on hold</span> >+ [% END # / IF ( itemLoo.first_hold )%] >+ </td> >+ <td></td> >+ </tr> >+ [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] >+ </tbody> >+ </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] --> >+ [% IF unholdable_items %] >+ <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button> >+ <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button> >+ [% END %] >+ </div> <!-- /.copiesrow --> > [% END # / IF ( bibitemloo.itemholdable )%] > </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] --> > </fieldset> >@@ -516,6 +524,7 @@ > [% BLOCK jsinclude %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >+[% INCLUDE 'columns_settings.inc' %] > <script> > $(document).ready(function() { > >@@ -737,15 +746,23 @@ > > return true; > }); >- $(".itemstable").each(function(){ >- $(this).DataTable({ >- dom: "t", >- initComplete: function() { >- this.find("input:radio").first().prop("checked", true ); >- }, >- paging: false >- }); >- }); >+ >+ columns_settings = [% TablesSettings.GetColumns( 'opac', 'opac_holds', 'opac_holds_items', 'json' ) | $raw %]; >+ KohaTable(".itemstable", { >+ "order": [[ 1, "desc" ]], >+ "dom": 't', >+ "autoWidth": false, >+ "responsive": { >+ "details": { "type": 'column',"target": -1 } >+ }, >+ "aoColumnDefs": [ >+ { "targets": [ 0 ], "sortable": false, "searchable": false }, >+ { "className": 'dtr-control', "orderable": false, "targets": -1 }, >+ ], >+ initComplete: function() { >+ this.find("input:radio").first().prop("checked", true ); >+ }, >+ }, columns_settings ); > }); > </script> > [% END %] >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37219
:
168465
|
168564
|
171455
|
174551