Bugzilla – Attachment 188287 Details for
Bug 30633
Move OPACHoldingsDefaultSortField to table settings configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30633: Hide columns when needed
Bug-30633-Hide-columns-when-needed.patch (text/plain), 8.87 KB, created by
Martin Renvoize (ashimema)
on 2025-10-22 11:04:26 UTC
(
hide
)
Description:
Bug 30633: Hide columns when needed
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-10-22 11:04:26 UTC
Size:
8.87 KB
patch
obsolete
>From 32dedd1eda6eb39e623f8c66e201a5c44ef2d67d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 Oct 2025 11:13:04 +0200 >Subject: [PATCH] Bug 30633: Hide columns when needed > >We can use the force_visibility flag to hide column when they are empty >or should not be displayed because of syspref. > >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > .../bootstrap/en/modules/opac-detail.tt | 43 +++++++++++++++++-- > 1 file changed, 40 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 7df5dc40d2f..dec3ac998f3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -63,6 +63,7 @@ > [% INCLUDE 'bodytag.inc' bodyid='opac-detail' bodyclass='scrollto' %] > [% INCLUDE 'masthead.inc' %] > >+[% SET hidden_columns_force = {} %] > <main class="main"> > [% WRAPPER breadcrumbs %] > [% WRAPPER breadcrumb_item bc_active= 1 %] >@@ -1291,6 +1292,7 @@ > [%# End of template %] > > [% BLOCK items_table %] >+ [% SET hidden_columns_force.$table_id = [] %] > <table class="table table-bordered table-striped" id="[% table_id | html %]"> > <caption class="sr-only">Holdings</caption> > <thead> >@@ -1334,6 +1336,7 @@ > </div> > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_cover') %] > <td></td> > [% END %] > >@@ -1347,6 +1350,7 @@ > <span class="itypetext">[% ITEM_RESULT.description | html %]</span> > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_itemtype') %] > <td></td> > [% END %] > [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] >@@ -1372,6 +1376,7 @@ > [% END %] > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_current_location') %] > <td></td> > [% END %] > >@@ -1398,18 +1403,21 @@ > [% END %] > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_home_location') %] > <td></td> > [% END %] > > [% IF ( itemdata_ccode ) %] > <td class="collection">[% ITEM_RESULT.ccode | html %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_ccode') %] > <td></td> > [% END %] > > [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %] > <td class="shelving_location"><span class="shelvingloc">[% ITEM_RESULT.location_description | html %]</span></td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_shelving_location') %] > <td></td> > [% END %] > >@@ -1436,12 +1444,14 @@ > [% END %] > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_callnumber') %] > <td></td> > [% END %] > > [% IF ( itemdata_materials ) %] > <td class="materials">[% ITEM_RESULT.materials | html %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_materials') %] > <td></td> > [% END %] > >@@ -1464,6 +1474,7 @@ > [% END %] > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_enumchron') %] > <td></td> > [% END %] > >@@ -1509,12 +1520,14 @@ > [% END %] > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_url') %] > <td></td> > [% END # /IF itemdata_uri %] > > [% IF ( itemdata_copynumber ) %] > <td class="copynumber">[% ITEM_RESULT.copynumber | html %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_copy') %] > <td></td> > [% END %] > >@@ -1523,18 +1536,21 @@ > [% IF ( itemdata_itemnotes ) %] > <td class="notes" property="description">[% ITEM_RESULT.itemnotes | $raw %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_notes') %] > <td></td> > [% END %] > > [% IF item_checkouts %] > <td class="date_due" data-order="[% ITEM_RESULT.checkout.date_due | html %]">[% ITEM_RESULT.checkout.date_due | $KohaDates as_due_date => 1 %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_datedue') %] > <td></td> > [% END %] > > [% IF ( itemdata_barcode ) %] > <td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode | html %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_barcode') %] > <td></td> > [% END %] > >@@ -1549,12 +1565,16 @@ > [% END %] > [% END %] > </td> >+ [% hidden_columns_force.$table_id.push('item_priority') %] > <td></td> > [% ELSIF show_priority %] >+ [% hidden_columns_force.$table_id.push('item_holds') %] > <td></td> > <td class="holds_priority">[% priority | html %]</td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_holds') %] > <td></td> >+ [% hidden_columns_force.$table_id.push('item_priority') %] > <td></td> > [% END %] > >@@ -1576,6 +1596,7 @@ > [% END %] > </td> > [% ELSE %] >+ [% hidden_columns_force.$table_id.push('item_coursereserves') %] > <td></td> > [% END # /IF ShowCourseReservesHeader %] > <td></td> >@@ -1892,7 +1913,23 @@ > }); > [% END # /IF OpacBrowseResults %] > >- var table_settings = [% TablesSettings.GetTableSettings( 'opac', 'biblio-detail', 'holdingst', 'json' ) | $raw %]; >+ var holdingst_table_settings = [% TablesSettings.GetTableSettings( 'opac', 'biblio-detail', 'holdingst', 'json' ) | $raw %]; >+ var otherholdingst_table_settings = JSON.parse(JSON.stringify(holdingst_table_settings)); // Clone >+ >+ let column; >+ [% FOR k IN hidden_columns_force.holdingst %] >+ column = holdingst_table_settings.columns.find(c => c.columnname == '[% k | html %]'); >+ column.is_hidden = 1; >+ column.cannot_be_toggled = 1; >+ column.force_visibility = 1; >+ [% END %] >+ >+ [% FOR k IN hidden_columns_force.otherholdingst %] >+ column = otherholdingst_table_settings.columns.find(c => c.columnname == '[% k | html %]'); >+ column.is_hidden = 1; >+ column.cannot_be_toggled = 1; >+ column.force_visibility = 1; >+ [% END %] > > $("#holdingst").kohaTable( > { >@@ -1902,7 +1939,7 @@ > details: { type: "column", target: -1 }, > }, > }, >- table_settings >+ holdingst_table_settings, > ); > $("#otherholdingst").kohaTable( > { >@@ -1912,7 +1949,7 @@ > details: { type: "column", target: -1 }, > }, > }, >- table_settings >+ otherholdingst_table_settings, > ); > > var serial_table_settings = [% TablesSettings.GetTableSettings( 'opac', 'biblio-detail', 'subscriptionst', 'json' ) | $raw %]; >-- >2.51.0
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 30633
:
187856
|
187857
|
187858
|
187859
|
187886
|
187887
|
187888
|
187889
|
188067
|
188068
|
188069
|
188070
|
188071
|
188072
|
188073
|
188074
|
188192
|
188286
| 188287 |
188288
|
188289
|
188290
|
188291
|
188292