Bugzilla – Attachment 191169 Details for
Bug 41580
Tidy kohaTable block - tools
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41580: Tidy kohaTable - tools/modborrowers.tt
c175ba8.patch (text/plain), 5.46 KB, created by
Jonathan Druart
on 2026-01-09 14:53:43 UTC
(
hide
)
Description:
Bug 41580: Tidy kohaTable - tools/modborrowers.tt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:53:43 UTC
Size:
5.46 KB
patch
obsolete
>From c175ba82d1ff39d4e590bf2224cf2879c0f0ca25 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jan 2026 16:12:31 +0100 >Subject: [PATCH] Bug 41580: Tidy kohaTable - tools/modborrowers.tt > >--- > .../prog/en/modules/tools/modborrowers.tt | 73 ++++++++++--------- > 1 file changed, 39 insertions(+), 34 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 8a96bdb1c3d..b4bc3fa94ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt >@@ -482,48 +482,66 @@ > [% Asset.js("js/tools-menu.js") | $raw %] > [% Asset.js("js/members-patron-selections.js") | $raw %] > <script> >+ 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 %] >+ >+ const has_patrons = [% borrowers ? 1 : 0 | html %] >+ const op = "[% op | html %]"; >+ addPermissions({ >+ CanUpdatePasswordExpiration: [% CanUpdatePasswordExpiration ? 1 : 0 | html %], >+ CanUpdateProtectPatron: [% CanUpdateProtectPatron ? 1 : 0 | html %], >+ }); > var patron_attributes_lib = new Array(); > var patron_attributes_values = new Array(); >+ var values = new Array(); >+ var lib = new Array(); >+ [% FOREACH pav IN patron_attributes_values %] >+ values = new Array(); >+ lib = new Array(); >+ [% FOREACH option IN pav.options %] >+ values.push("[% option.lib | html %]"); >+ lib.push("[% option.authorised_value | html %]"); >+ [% END %] >+ patron_attributes_lib["[% pav.attribute_code | html %]"] = values; >+ patron_attributes_values["[% pav.attribute_code | html %]"] = lib; >+ [% END %] >+ </script> > >+ <script> > $(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 %] >- >+ if (has_patrons){ > 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' %] >+ if (op == 'show'){ > selections_column.is_hidden = 0; >- [% ELSE %] >+ } else { > selections_column.is_hidden = 1; >- [% END %] >+ } > >- [% UNLESS CanUpdatePasswordExpiration %] >+ if (!permissions.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 %] >+ if (!permissions.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( > { >@@ -546,20 +564,7 @@ > }); > return false; > }); >- [% END %] >- >- var values = new Array(); >- var lib = new Array(); >- [% FOREACH pav IN patron_attributes_values %] >- values = new Array(); >- lib = new Array(); >- [% FOREACH option IN pav.options %] >- values.push("[% option.lib | html %]"); >- lib.push("[% option.authorised_value | html %]"); >- [% END %] >- patron_attributes_lib["[% pav.attribute_code | html %]"] = values; >- patron_attributes_values["[% pav.attribute_code | html %]"] = lib; >- [% END %] >+ } > > $('select[name="patron_attributes"]').change(function() { > updateAttrValues(this); >-- >2.43.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 41580
:
191163
|
191164
|
191165
|
191166
|
191167
|
191168
| 191169 |
191170
|
191171