Bugzilla – Attachment 193361 Details for
Bug 30221
Make the tables on opac-user.tt column configurable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30221: (QA follow-up) make DOM consistent for modified tables
Bug-30221-QA-follow-up-make-DOM-consistent-for-mod.patch (text/plain), 38.84 KB, created by
Arthur Suzuki
on 2026-02-18 15:23:49 UTC
(
hide
)
Description:
Bug 30221: (QA follow-up) make DOM consistent for modified tables
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2026-02-18 15:23:49 UTC
Size:
38.84 KB
patch
obsolete
>From a203463d576c00bcfcc4b74a58fc6933fde78954 Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Wed, 18 Feb 2026 13:13:12 +0000 >Subject: [PATCH] Bug 30221: (QA follow-up) make DOM consistent for modified > tables > >Sponsored-by: BibLibre >--- > .../bootstrap/en/includes/holds-table.inc | 58 ++--- > .../bootstrap/en/modules/opac-holdshistory.tt | 22 +- > .../en/modules/opac-readingrecord.tt | 15 +- > .../bootstrap/en/modules/opac-user.tt | 231 ++++++++++++++---- > .../bootstrap/en/modules/sco/sco-main.tt | 67 ++++- > 5 files changed, 287 insertions(+), 106 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >index f2384fe7124..4b4014c3997 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >@@ -10,28 +10,14 @@ > <thead> > <tr> > <th data-colname="title" class="all anti-the">Title</th> >- [% IF ( showpriority ) %] >- <th data-colname="placed_on">Placed on</th> >- [% ELSE %] >- <th data-colname="placed_on" class="psort">Placed on</th> >- [% END %] >+ <th data-colname="placed_on" class="psort">Placed on</th> > <th data-colname="expires_on">Expires on</th> >- [% UNLESS( singleBranchMode) %] >- <th data-colname="pickup_location">Pickup location</th> >- [% END %] >- [% IF ( showpriority ) %] >- <th data-colname="priority" class="psort">Priority</th> >- [% END %] >- [% IF Koha.Preference('OpacHoldNotes') %] >- <th data-colname="notes">Notes</th> >- [% END %] >+ <th data-colname="pickup_location">Pickup location</th> >+ <th data-colname="priority" class="psort">Priority</th> >+ <th data-colname="notes">Notes</th> > <th>Status</th> >- [% IF SuspendHoldsOpac and ! onlyinfo %] >- <th data-colname="suspend" class="nosort">Suspend</th> >- [% END %] >- [% IF ! onlyinfo %] >- <th data-colname="modify" class="nosort">Modify</th> >- [% END %] >+ <th data-colname="suspend" class="nosort">Suspend</th> >+ <th data-colname="modify" class="nosort">Modify</th> > <th></th> > </tr> > </thead> >@@ -94,8 +80,8 @@ > - > [% END %] > </td> >- [% UNLESS( singleBranchMode) %] >- <td class="branch"> >+ <td class="branch"> >+ [% IF !singleBranchMode %] > [% HOLD.branch.branchname | html %] > [% IF ( HOLD.can_update_pickup_location_opac ) %] > <button type="button" class="btn btn-sm btn-link" data-bs-toggle="modal" data-bs-target="#changePickup[% HOLD.reserve_id | html %]"> <i class="fa fa-pencil-alt" aria-hidden="true"></i> Change </button> >@@ -131,14 +117,10 @@ > </div> > <!-- /.modal --> > [% END %] >- </td> >- [% END %] >- [% IF ( showpriority ) %] >- <td data-order="[% HOLD.priority | html %]" class="priority"> [% HOLD.priority | html %] </td> >- [% END %] >- [% IF Koha.Preference('OpacHoldNotes') %] >- <td>[% HOLD.reservenotes | html | html_line_break %]</td> >- [% END %] >+ [% END %] >+ </td> >+ <td data-order="[% HOLD.priority | html %]" class="priority"> [% IF showpriority %][% HOLD.priority | html %][% END %] </td> >+ <td> [% IF Koha.Preference('OpacHoldNotes') %][% HOLD.reservenotes | html | html_line_break %][% END %] </td> > <td class="status"> > [% IF ( HOLD.is_waiting ) %] > <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i> >@@ -180,8 +162,8 @@ > [% END %] > [% END %] > </td> >- [% IF SuspendHoldsOpac and ! onlyinfo %] >- <td> >+ <td> >+ [% IF SuspendHoldsOpac and ! onlyinfo %] > [% IF ( HOLD.is_cancelable_from_opac ) %] > [% IF HOLD.suspend %] > <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post"> >@@ -211,10 +193,10 @@ > [% END # / IF AutoResumeSuspendedHolds %] > [% END # / IF HOLD.suspend %] > [% END # / IF ( HOLD.is_cancelable_from_opac ) %] >- </td> >- [% END # / IF SuspendHoldsOpac %] >- [% IF ! onlyinfo %] >- <td class="modify"> >+ [% END # / IF SuspendHoldsOpac %] >+ </td> >+ <td class="modify"> >+ [% IF ! onlyinfo %] > [% IF ( HOLD.is_cancelable_from_opac ) %] > <form id="delete_hold_[% HOLD.reserve_id | html %]" action="/cgi-bin/koha/opac-modrequest.pl" method="post"> > [% INCLUDE 'csrf-token.inc' %] >@@ -236,8 +218,8 @@ > > > </form> > [% END %] >- </td> >- [% END # / IF onlyinfo %] >+ [% END # / IF onlyinfo %] >+ </td> > <td></td> > </tr> > [% END # /FOREACH HOLDS %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt >index a25646d4777..7800d430d7d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt >@@ -71,7 +71,6 @@ > [% IF !holds %] > No data available > [% ELSE %] >- [% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %] > <div id="opac-user-holdsrec"> > <div id="tabs-container"> > <div class="controls"> >@@ -105,9 +104,7 @@ > <th data-colname="expiration_date">Expiration date</th> > <th data-colname="waiting_date">Waiting date</th> > <th data-colname="cancellation_date">Cancellation date</th> >- [% IF show_itemtype_column %] >- <th data-colname="item_type">Requested item type</th> >- [% END %] >+ <th data-colname="item_type">Requested item type</th> > <th data-colname="status">Status</th> > </tr> > </thead> >@@ -139,15 +136,15 @@ > [% hold.cancellationdate | $KohaDates %] > [% END %] > </td> >- [% IF show_itemtype_column %] >- <td> >+ <td> >+ [% IF show_itemtype_column %] > [% IF hold.itemtype %] > [% ItemTypes.GetDescription( hold.itemtype ) | html %] > [% ELSE %] > <span>Any item type</span> > [% END %] >- </td> >- [% END %] >+ [% END %] >+ </td> > <td> > [% IF hold.found == 'F' %] > <span>Fulfilled</span> >@@ -196,9 +193,16 @@ > $("#sort").change(function () { > $("#sortform").submit(); > }); >- var table_settings = [% TablesSettings.GetColumns( 'opac', 'patron_details', 'table_holdshistory', 'json') | $raw %]; >+ let table_settings = [% TablesSettings.GetTableSettings( 'opac', 'patron_details', 'table_holdshistory', 'json') | $raw %]; >+ [% IF ! Koha.Preference('AllowHoldItemTypeSelection') %] >+ let itemtype_column = table_settings.columns.find(c => c.columnname == 'item_type'); >+ itemtype_column.is_hidden = 1; >+ itemtype_column.cannot_be_toggled = 1; >+ itemtype_column.force_visibility = 1; >+ [% END %] > var table = $("#table_holdshistory").kohaTable({ > dom: '<"top"<"table_entries"i><"table_controls"fB>>t', >+ bKohaColumnsUseNames: true, > autoWidth: false, > order: [[4, "desc"]], > language: { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >index c10f1743616..3c0d1df5c04 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt >@@ -126,9 +126,7 @@ > <th data-colname="vol_info">Vol info</th> > <th data-colname="date">Date</th> > <th data-colname="checkout_branch">Checkout branch</th> >- [% IF Koha.Preference('OPACMySummaryHTML') %] >- <th data-colname="links" class="no-sort no-export">Links</th> >- [% END %] >+ <th data-colname="links" class="no-sort no-export">Links</th> > <th class="dtr-control-col"></th> > </tr> > </thead> >@@ -217,9 +215,7 @@ > </td> > [% END %] > <td> [% checkout.library.branchname | html %] </td> >- [% IF Koha.Preference('OPACMySummaryHTML') %] >- <td>[% biblio.opac_summary_html | $raw %]</td> >- [% END %] >+ <td> [% IF Koha.Preference('OPACMySummaryHTML') %][% biblio.opac_summary_html | $raw %][% END %]</td> > <td></td> > </tr> > [% END # / FOREACH checkout %] >@@ -238,9 +234,16 @@ > }); > > var table_settings = [% TablesSettings.GetTableSettings( 'opac', 'patron_details', 'readingrec', 'json') | $raw %]; >+ [% IF !Koha.Preference('OPACMySummaryHTML') %] >+ let opac_summary_column = table_settings.columns.find(c => c.columnname == 'links'); >+ opac_summary_column.is_hidden = 1; >+ opac_summary_column.cannot_be_toggled = 1; >+ opac_summary_column.force_visibility = 1; >+ [% END %] > var table = $("#readingrec").kohaTable( > { > dom: '<"top"<"table_entries"i><"table_controls"fB>>t', >+ bKohaColumnsUseNames: true, > language: { > search: "_INPUT_", > searchPlaceholder: _("Search"), >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 63288466b0d..8d3bfa687ca 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -322,19 +322,11 @@ > <th id="checkoutdate" data-colname="checkoutdate" class="psort">Checked out on</th> > <th id="duedate" data-colname="duedate" class="psort">Due</th> > <th id="checkout_branch" data-colname="checkout_branch">Checkout branch</th> >- [% IF ( Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes ) %] >- <th data-colname="itemtype">Item type</th> >- [% END %] >- [% IF ( show_barcode ) %] >- <th data-colname="barcode">Barcode</th> >- [% END %] >+ <th data-colname="itemtype">Item type</th> >+ <th data-colname="barcode">Barcode</th> > <th data-colname="callnumber">Call number</th> >- [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] >- <th data-colname="renew">Renew</th> >- [% END %] >- [% IF ( OPACFinesTab ) %] >- <th data-colname="fines">Fines</th> >- [% END %] >+ <th data-colname="renew">Renew</th> >+ <th data-colname="fines">Fines</th> > [% IF Koha.Preference('OPACMySummaryHTML') %] > <th class="no-sort" data-colname="links">Links</th> > [% END %] >@@ -415,19 +407,17 @@ > <td class="date_due" data-order="[% ISSUE.date_due | html %]"> [% ISSUE.date_due | $KohaDates as_due_date => 1 %] </td> > [% END %] > <td class="checkout_branch" data-order="[% ISSUE.branchname | html %]">[% ISSUE.branchname | html %]</td> >- [% IF ( Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes ) %] >- <td class="itype"> >+ <td class="itype"> >+ [% IF ( Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes ) %] > [% IF ( ISSUE.imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %] > <img class="itemtype-image" src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" /> > [% END %] <span class="itypetext">[% ISSUE.description | html %]</span> >- </td> >- [% END %] >- [% IF ( show_barcode ) %] >- <td class="barcode"> [% ISSUE.barcode | html %] </td> >- [% END %] >+ [% END %] >+ </td> >+ <td class="barcode"> [% IF ( show_barcode ) %][% ISSUE.barcode | html %][% END %] </td> > <td class="call_no"> [% ISSUE.itemcallnumber | html %] </td> >- [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] >- <td class="renew" data-order="[% ISSUE.status && canrenew ? ISSUE.renewsleft : 0 | html %]"> >+ <td class="renew" data-order="[% ISSUE.status && canrenew ? ISSUE.renewsleft : 0 | html %]"> >+ [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] > [% IF ISSUE.renewed %]<span class="badge text-bg-success">Renewed!</span><br />[% END %] > [% IF ( ISSUE.status ) %] > [% IF ( canrenew ) %] >@@ -493,10 +483,10 @@ > [% IF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %] > <br /><span class="usr-msg automatic-renewal">This item is scheduled for auto renewal.</span> > [% END %] >- </td> >- [% END %] >- [% IF ( OPACFinesTab ) %] >- <td class="fines"> >+ [% END %] >+ </td> >+ <td class="fines"> >+ [% IF ( OPACFinesTab ) %] > [% IF ( ISSUE.charges ) %] > <span>Yes (Item overdue or lost)</span> > [% ELSIF ( ISSUE.rentalfines ) %] >@@ -504,8 +494,8 @@ > [% ELSE %] > <span>No</span> > [% END %] >- </td> >- [% END %] >+ [% END %] >+ </td> > [% IF Koha.Preference('OPACMySummaryHTML') %] > <td class="links">[% ISSUE.biblio_object.opac_summary_html| $raw %]</td> > [% END %] >@@ -705,17 +695,13 @@ > <tr> > [% IF ( JacketImages ) %]<th class="no-sort"> </th>[% END %] > <th data-colname="title" class="all anti-the">Title</th> >- [% UNLESS ( item_level_itypes ) %]<th data-colname="itemtype">Item type</th>[% END %] >- [% IF ( show_barcode ) %]<th data-colname="barcode">Barcode</th>[% END %] >+ <th data-colname="itemtype">Item type</th> >+ <th data-colname="barcode">Barcode</th> > <th data-colname="callnumber">Call number</th> > <th data-colname="checkoutdate">Checked out on</th> > <th data-colname="duedate" class="psort">Due</th> >- [% IF ( OpacRenewalAllowed ) %] >- <th data-colname="renew" class="no-sort">Renew</th> >- [% END %] >- [% IF ( OPACFinesTab ) %] >- <th data-colname="fines">Fines</th> >- [% END %] >+ <th data-colname="renew" class="no-sort">Renew</th> >+ <th data-colname="fines">Fines</th> > <th class="dtr-control-col"></th> > </tr> > </thead> >@@ -767,23 +753,21 @@ > <span class="item-details">[% OVERDUE.author | html %]</span> > </td> > >- [% UNLESS ( item_level_itypes ) %] >- <td> >+ <td> >+ [% IF ( !item_level_itypes ) %] > [% IF ( OVERDUE.imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %] > <img src="[% OVERDUE.imageurl | html %]" title="[% OVERDUE.description | html %]" alt="[% OVERDUE.description | html %]" /> > [% END %] > [% OVERDUE.description | html %] >- </td> >- [% END %] >- [% IF ( show_barcode ) %] >- <td> [% OVERDUE.barcode | html %] </td> >- [% END %] >+ [% END %] >+ </td> >+ <td> [% IF ( show_barcode ) %][% OVERDUE.barcode | html %][% END %] </td> > <td> [% OVERDUE.itemcallnumber | html %] </td> > <td data-order="[% OVERDUE.issuedate | html %]"> [% OVERDUE.issuedate | $KohaDates as_due_date => 1 %] </td> > <td data-order="[% OVERDUE.date_due | html %]"> [% OVERDUE.date_due | $KohaDates as_due_date => 1 %] </td> > <td class="checkout_branch" data-order="[% OVERDUE.branchname | html %]">[% OVERDUE.branchname | html %]</td> >- [% IF ( OpacRenewalAllowed ) %] >- <td> >+ <td> >+ [% IF ( OpacRenewalAllowed ) %] > [% IF ( OVERDUE.debarred ) %] > Account frozen > [% ELSIF ( OVERDUE.status ) %] >@@ -814,17 +798,17 @@ > [% ELSE %] > <span>No renewals left</span> > [% END %] >- </td> >- [% END %] >- [% IF ( OPACFinesTab ) %] >- <td> >+ [% END %] >+ </td> >+ <td> >+ [% IF ( OPACFinesTab ) %] > [% IF ( OVERDUE.charges ) %] > <span>Yes</span> > [% ELSE %] > <span>No</span> > [% END %] >- </td> >- [% END %] >+ [% END %] >+ </td> > <td></td> > </tr> > [% END %] >@@ -1192,6 +1176,152 @@ > [% FOREACH table IN ['checkoutst', 'holdst', 'overduest','opac_user_relative_issues_table'] %] > tables_settings.set("[% table | $raw %]", [% TablesSettings.GetTableSettings( 'opac', 'patron_details', table, 'json') | $raw %]); > [% END %] >+ >+ [% IF !(Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes) %] >+ var checkoutst_settings = tables_settings.get('checkoutst'); >+ if (checkoutst_settings && checkoutst_settings.columns) { >+ var itemtype_column = checkoutst_settings.columns.find(c => c.columnname == 'itemtype'); >+ if (itemtype_column) { >+ itemtype_column.is_hidden = 1; >+ itemtype_column.cannot_be_toggled = 1; >+ itemtype_column.force_visibility = 1; >+ } >+ } >+ [% END %] >+ >+ [% IF !show_barcode %] >+ var checkoutst_settings = tables_settings.get('checkoutst'); >+ if (checkoutst_settings && checkoutst_settings.columns) { >+ var barcode_column = checkoutst_settings.columns.find(c => c.columnname == 'barcode'); >+ if (barcode_column) { >+ barcode_column.is_hidden = 1; >+ barcode_column.cannot_be_toggled = 1; >+ barcode_column.force_visibility = 1; >+ } >+ } >+ >+ var overduest_settings = tables_settings.get('overduest'); >+ if (overduest_settings && overduest_settings.columns) { >+ var barcode_column = overduest_settings.columns.find(c => c.columnname == 'barcode'); >+ if (barcode_column) { >+ barcode_column.is_hidden = 1; >+ barcode_column.cannot_be_toggled = 1; >+ barcode_column.force_visibility = 1; >+ } >+ } >+ [% END %] >+ >+ [% IF !(OpacRenewalAllowed && !(logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew'))) %] >+ var checkoutst_settings = tables_settings.get('checkoutst'); >+ if (checkoutst_settings && checkoutst_settings.columns) { >+ var renew_column = checkoutst_settings.columns.find(c => c.columnname == 'renew'); >+ if (renew_column) { >+ renew_column.is_hidden = 1; >+ renew_column.cannot_be_toggled = 1; >+ renew_column.force_visibility = 1; >+ } >+ } >+ [% END %] >+ >+ [% IF !OpacRenewalAllowed %] >+ var overduest_settings = tables_settings.get('overduest'); >+ if (overduest_settings && overduest_settings.columns) { >+ var renew_column = overduest_settings.columns.find(c => c.columnname == 'renew'); >+ if (renew_column) { >+ renew_column.is_hidden = 1; >+ renew_column.cannot_be_toggled = 1; >+ renew_column.force_visibility = 1; >+ } >+ } >+ [% END %] >+ >+ [% IF !OPACFinesTab %] >+ var checkoutst_settings = tables_settings.get('checkoutst'); >+ if (checkoutst_settings && checkoutst_settings.columns) { >+ var fines_column = checkoutst_settings.columns.find(c => c.columnname == 'fines'); >+ if (fines_column) { >+ fines_column.is_hidden = 1; >+ fines_column.cannot_be_toggled = 1; >+ fines_column.force_visibility = 1; >+ } >+ } >+ >+ var overduest_settings = tables_settings.get('overduest'); >+ if (overduest_settings && overduest_settings.columns) { >+ var fines_column = overduest_settings.columns.find(c => c.columnname == 'fines'); >+ if (fines_column) { >+ fines_column.is_hidden = 1; >+ fines_column.cannot_be_toggled = 1; >+ fines_column.force_visibility = 1; >+ } >+ } >+ [% END %] >+ >+ [% IF item_level_itypes %] >+ var overduest_settings = tables_settings.get('overduest'); >+ if (overduest_settings && overduest_settings.columns) { >+ var itemtype_column = overduest_settings.columns.find(c => c.columnname == 'itemtype'); >+ if (itemtype_column) { >+ itemtype_column.is_hidden = 1; >+ itemtype_column.cannot_be_toggled = 1; >+ itemtype_column.force_visibility = 1; >+ } >+ } >+ [% END %] >+ >+ // Hide holds table columns conditionally >+ var holdst_settings = tables_settings.get('holdst'); >+ if (holdst_settings && holdst_settings.columns) { >+ // Hide pickup_location column if singleBranchMode >+ [% IF singleBranchMode %] >+ var pickup_location_column = holdst_settings.columns.find(c => c.columnname == 'pickup_location'); >+ if (pickup_location_column) { >+ pickup_location_column.is_hidden = 1; >+ pickup_location_column.cannot_be_toggled = 1; >+ pickup_location_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide priority column if !showpriority >+ [% IF !showpriority %] >+ var priority_column = holdst_settings.columns.find(c => c.columnname == 'priority'); >+ if (priority_column) { >+ priority_column.is_hidden = 1; >+ priority_column.cannot_be_toggled = 1; >+ priority_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide notes column if !OpacHoldNotes >+ [% IF !Koha.Preference('OpacHoldNotes') %] >+ var notes_column = holdst_settings.columns.find(c => c.columnname == 'notes'); >+ if (notes_column) { >+ notes_column.is_hidden = 1; >+ notes_column.cannot_be_toggled = 1; >+ notes_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide suspend column if !SuspendHoldsOpac or onlyinfo >+ [% IF !SuspendHoldsOpac || onlyinfo %] >+ var suspend_column = holdst_settings.columns.find(c => c.columnname == 'suspend'); >+ if (suspend_column) { >+ suspend_column.is_hidden = 1; >+ suspend_column.cannot_be_toggled = 1; >+ suspend_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide modify column if onlyinfo >+ [% IF onlyinfo %] >+ var modify_column = holdst_settings.columns.find(c => c.columnname == 'modify'); >+ if (modify_column) { >+ modify_column.is_hidden = 1; >+ modify_column.cannot_be_toggled = 1; >+ modify_column.force_visibility = 1; >+ } >+ [% END %] >+ } > var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table"); > dTables.each(function(){ > var thIndex = $(this).find("th.psort").index(); >@@ -1201,6 +1331,7 @@ > .kohaTable({ > order: [[ thIndex, 'asc' ]], > dom: '<"top"<"table_entries"><"table_controls"fB>>t', >+ bKohaColumnsUseNames:true, > columnDefs: [ > { visible: false, "targets" : [ "hidden" ] }, > { className: 'dtr-control', orderable: false, targets: -1 } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 6a7f5d00a23..9c4d1e24522 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -6,6 +6,7 @@ > [% USE To %] > [% USE Price %] > [% USE AdditionalContents %] >+[% USE TablesSettings %] > [% USE Branches %] > [% SET SCOMainUserBlock = AdditionalContents.get( location => "SCOMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% PROCESS 'html_helpers.inc' %] >@@ -385,7 +386,7 @@ > </div> > <!-- / .container-fluid --> > [% END # / IF validuser %] >- [% ELSE # / UNLESS ( hide_main %] >+ [% ELSE # / UNLESS ( hide_main ) %] > <div class="container-fluid"> > <div class="row"> > <div class="[% main_div_class | html %]"> >@@ -476,10 +477,63 @@ > dofocus(); > [% IF ( patronid ) %]sco_init();[% END %] > >+ // Hide holds table columns conditionally >+ let holdst_settings = [% TablesSettings.GetTableSettings( 'opac', 'patron_details', 'holdst', 'json') | $raw %]; >+ if (holdst_settings && holdst_settings.columns) { >+ // Hide pickup_location column if singleBranchMode >+ [% IF singleBranchMode %] >+ var pickup_location_column = holdst_settings.columns.find(c => c.columnname == 'pickup_location'); >+ if (pickup_location_column) { >+ pickup_location_column.is_hidden = 1; >+ pickup_location_column.cannot_be_toggled = 1; >+ pickup_location_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide priority column if !showpriority >+ [% IF !showpriority %] >+ var priority_column = holdst_settings.columns.find(c => c.columnname == 'priority'); >+ if (priority_column) { >+ priority_column.is_hidden = 1; >+ priority_column.cannot_be_toggled = 1; >+ priority_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide notes column if !OpacHoldNotes >+ [% IF !Koha.Preference('OpacHoldNotes') %] >+ var notes_column = holdst_settings.columns.find(c => c.columnname == 'notes'); >+ if (notes_column) { >+ notes_column.is_hidden = 1; >+ notes_column.cannot_be_toggled = 1; >+ notes_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide suspend column if !SuspendHoldsOpac or onlyinfo >+ [% IF !SuspendHoldsOpac || onlyinfo %] >+ var suspend_column = holdst_settings.columns.find(c => c.columnname == 'suspend'); >+ if (suspend_column) { >+ suspend_column.is_hidden = 1; >+ suspend_column.cannot_be_toggled = 1; >+ suspend_column.force_visibility = 1; >+ } >+ [% END %] >+ >+ // Hide modify column if onlyinfo >+ [% IF onlyinfo %] >+ var modify_column = holdst_settings.columns.find(c => c.columnname == 'modify'); >+ if (modify_column) { >+ modify_column.is_hidden = 1; >+ modify_column.cannot_be_toggled = 1; >+ modify_column.force_visibility = 1; >+ } >+ [% END %] >+ } > var dTables = $("#loanTable, #holdst, #finestable"); > dTables.each(function(){ > var thIndex = $(this).find("th.psort").index(); >- $(this).kohaTable({ >+ koha_table_def={ > order: [[thIndex, "asc"]], > dom: '<"top"<"table_entries"><"table_controls"f>>t<"clear">', > columnDefs: [ >@@ -497,7 +551,14 @@ > target: -1, > }, > }, >- }); >+ }; >+ if (this.id == 'holdst') { >+ koha_table_def['bKohaColumnsUseNames'] = true; >+ $(this).kohaTable(koha_table_def,holdst_settings); >+ } >+ else{ >+ $(this).kohaTable(koha_table_def); >+ } > }); > > $('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (event) { >-- >2.39.5
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 30221
:
172214
|
172451
|
172452
|
172453
|
172454
|
172455
|
172456
|
172581
|
172610
|
172611
|
172613
|
172615
|
172616
|
172618
|
172620
|
174014
|
174015
|
174016
|
174046
|
174047
|
174048
|
192154
|
192155
|
192156
|
192157
|
192158
|
192159
|
192160
| 193361