Bugzilla – Attachment 174763 Details for
Bug 38118
Removed empty columns on holdings table on details page are not restored when new items loaded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[24.05] Bug 38118: Display columns if not empty in drawCallback
Bug-38118-Display-columns-if-not-empty-in-drawCall.patch (text/plain), 3.26 KB, created by
Jonathan Druart
on 2024-11-19 09:09:58 UTC
(
hide
)
Description:
[24.05] Bug 38118: Display columns if not empty in drawCallback
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-19 09:09:58 UTC
Size:
3.26 KB
patch
obsolete
>From ec05f321fbfa0339779ed4dc05f35442da1675ef Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 8 Oct 2024 15:38:18 +0200 >Subject: [PATCH] Bug 38118: Display columns if not empty in drawCallback > >Instead of updating only when DT init is complete we are going to update >the visibility when the table will be redrawn. > >Test plan: >1 - Find/Add a bib record with no items >2 - Add 20 items from Centerville > Edit ->Edit items -> enter CENTER1 into barcode ->'Add multiple copies' -> 20 >3 - Add 20 items from Fairview as above but enter 'FAIR1' for barcode and 'FAIR ITEM' as callnumber >4 - Add 1 item from Midway with barcode MIDWAY1 >5 - Edit a midway patron to grant 'catalogue' and 'edit_items' permission - NOT edit_any_item >6 - Sign in as the patron above >7 - Find the record >8 - Note there is callnumber and actions/edit columns >9 - Go to page 2 of items - callnumber visible >10 - Go to page 3 - edit column >--- > .../tables/items/catalogue_detail.inc | 34 +++++++++++-------- > 1 file changed, 20 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 9a1db9f7817..90d80fca349 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -120,6 +120,24 @@ > } > } > >+ function update_columns_visibility(settings){ >+ let table = settings.oInstance.api(); >+ table.columns().visible(true); >+ table.columns().every(function(i){ >+ let is_empty = true; >+ let nodes = this.nodes(); >+ nodes.each((td, ii) => { >+ if ( $(td).html() !== '' ) { >+ is_empty = false; >+ return; >+ } >+ }); >+ if ( is_empty ) { >+ table.columns(i).visible(false); >+ } >+ }); >+ } >+ > $(document).ready(function() { > > $(".SelectAll").on("click",function(e){ >@@ -779,20 +797,6 @@ > [% END %] > ], > initComplete: function( settings, json ){ >- let table = settings.oInstance.api(); >- table.columns().every(function(i){ >- let is_empty = true; >- let nodes = this.nodes(); >- nodes.each((td, ii) => { >- if ( $(td).html() !== '' ) { >- is_empty = false; >- return; >- } >- }); >- if ( is_empty ) { >- table.columns(i).visible(false); >- } >- }); > [% IF StaffDetailItemSelection %] > itemSelectionBuildActionLinks(tab_id); > [% END %] >@@ -835,6 +839,8 @@ > }); > [% END %] > >+ update_columns_visibility(settings); >+ > if ( drawcallback ) { drawcallback(this); } > }, > [% END %] >-- >2.34.1
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 38118
:
172526
|
172541
|
172583
| 174763