Bugzilla – Attachment 188306 Details for
Bug 41079
Checkboxes visible on the batch patron modification results view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41079: Force visibility for columns depending on sysprefs
Bug-41079-Force-visibility-for-columns-depending-o.patch (text/plain), 5.00 KB, created by
Jonathan Druart
on 2025-10-23 08:12:51 UTC
(
hide
)
Description:
Bug 41079: Force visibility for columns depending on sysprefs
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-23 08:12:51 UTC
Size:
5.00 KB
patch
obsolete
>From a69ca8ad2ad092dd7bbcb385a131a2651c49505c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 23 Oct 2025 10:00:35 +0200 >Subject: [PATCH] Bug 41079: Force visibility for columns depending on sysprefs > >If two sysprefs are disabled we must hide the two related columns. >We should also force the visibility of the checkboxes: on the first >screen (op=show/edition) they must be displayed, on the result screen >(op=show_results) the must be hidden. > >Test plan: >1. Create a report to see some patrons: > SELECT cardnumber FROM borrowers WHERE cardnumber LIKE '%2' >2. Run report and select 'Batch operations ...' >3. Batch patron modification >=> Notice that the table has the checkboxes in the first column >=> The table is sorted by cardnumber >4. Perform the modification >=> Notice that the result table does not have the checkboxes in the first column >=> The table is still sorted by cardnumber > >Additional tests: >1. If the logged in user is superlibrarian then the columns "Password expiration date" >and "Protected" are displayed >2. Play with the table's settings and columns visibility to confirm that >they are working correctly (they were not before this patch set) >--- > .../prog/en/modules/tools/modborrowers.tt | 51 +++++++++++++++---- > 1 file changed, 40 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >index 64ae308ec05..8a96bdb1c3d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -251,7 +251,7 @@ > <tbody> > [% FOREACH borrower IN borrowers %] > <tr> >- <td [% IF op != 'show' %]class="NoVisible"[% END %]> >+ <td> > <input type="checkbox" name="borrowernumber" value="[% borrower.borrowernumber | html %]" checked="checked" /> > </td> > <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | uri %]">[% borrower.cardnumber | html %]</a></td> >@@ -484,18 +484,47 @@ > <script> > var patron_attributes_lib = new Array(); > var patron_attributes_values = new Array(); >- var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_patron_modification', 'borrowerst', 'json' ) | $raw %]; >- >- [% FOREACH attrh IN attributes_header %] >- table_settings["columns"].push({ >- columname: "[% attrh.attribute | html %]", >- cannot_be_modified: 0, >- cannot_be_toggled: 0, >- is_hidden: 0 >- }); >- [% END %] >+ > $(document).ready(function() { > [% IF borrowers %] >+ >+ var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'batch_patron_modification', 'borrowerst', 'json' ) | $raw %]; >+ >+ [% FOREACH attrh IN attributes_header %] >+ table_settings["columns"].push({ >+ columname: "[% attrh.attribute | html %]", >+ cannot_be_modified: 0, >+ cannot_be_toggled: 0, >+ is_hidden: 0 >+ }); >+ [% END %] >+ >+ let selections_column = table_settings.columns.find(c => c.columnname == 'batch_patron_edit_selections'); >+ selections_column.cannot_be_modified = 1; >+ selections_column.cannot_be_toggled = 1; >+ selections_column.force_visibility = 1; >+ [% IF op == 'show' %] >+ selections_column.is_hidden = 0; >+ [% ELSE %] >+ selections_column.is_hidden = 1; >+ [% END %] >+ >+ [% UNLESS CanUpdatePasswordExpiration %] >+ let password_expiration_date_column = table_settings.columns.find(c => c.columnname == 'batch_patron_edit_password_expiration_date'); >+ password_expiration_date_column.is_hidden = 1; >+ password_expiration_date_column.cannot_be_modified = 1; >+ password_expiration_date_column.cannot_be_toggled = 1; >+ password_expiration_date_column.force_visibility = 1; >+ [% END %] >+ >+ [% UNLESS CanUpdateProtectPatron %] >+ let protected_column = table_settings.columns.find(c => c.columnname == 'batch_patron_edit_protected'); >+ protected_column.is_hidden = 1; >+ protected_column.cannot_be_modified = 1; >+ protected_column.cannot_be_toggled = 1; >+ protected_column.force_visibility = 1; >+ [% END %] >+ > let patron_table = $("#borrowerst").kohaTable( > { > order: [[1, "asc"]], >-- >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 41079
:
188305
|
188306
|
188329
|
188330