Bugzilla – Attachment 191143 Details for
Bug 41574
Tidy kohaTable block - patroncards
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41574: Tidy kohaTable - patroncards/edit-batch.tt
4a160f8.patch (text/plain), 4.80 KB, created by
Jonathan Druart
on 2026-01-09 14:50:56 UTC
(
hide
)
Description:
Bug 41574: Tidy kohaTable - patroncards/edit-batch.tt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:50:56 UTC
Size:
4.80 KB
patch
obsolete
>From 4a160f864d71ba4529a8529084e924c40c5fb72d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 8 Jan 2026 14:21:26 +0100 >Subject: [PATCH] Bug 41574: Tidy kohaTable - patroncards/edit-batch.tt > >--- > .../prog/en/modules/patroncards/edit-batch.tt | 35 +++++++++++-------- > 1 file changed, 21 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >index bcbed141cdf..dc79644a09c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >@@ -175,13 +175,21 @@ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% Asset.js("js/tools-menu.js") | $raw %] >+ <script> >+ const batch_id = "[% batch_id | html %]"; >+ addPrefs({ >+ PatronsPerPage: "[% Koha.Preference('PatronsPerPage') | html %]", >+ }); >+ const has_entries = [% table_loop ? 1 : 0 | html %]; >+ </script> >+ > <script> > function DeleteConfirm() { >- var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id | html %]"); >+ var msg = _("Are you sure you want to delete batch %s?").format(batch_id); > var answer = confirm(msg); > if (answer) { > $('#batch_form input[name="op"]').val('cud-delete'); >- $('#batch_form').append( '<input type="hidden" name="element_id" value="[% batch_id | html %]" />' ); >+ $('#batch_form').append( `<input type="hidden" name="element_id" value="${batch_id}" />` ); > $('#batch_form').append( '<input type="hidden" name="card_element" value="batch" />' ); > $('#batch_form').submit(); > } else { >@@ -209,7 +217,7 @@ > var answer = confirm(msg); > if (answer) { > $('#patron_form input[name="op"]').val('cud-remove'); >- $('#patron_form input[name="batch_id"]').val( [% batch_id | html %] ); >+ $('#patron_form input[name="batch_id"]').val(batch_id); > $('#patron_form input[name="label_id"]').remove(); > items.forEach( (item_id) => { > $('#patron_form').append( '<input type="hidden" name="label_id" value="' + item_id + '" />' ); >@@ -240,7 +248,7 @@ > > function DeDuplicate() { > $('#patron_form input[name="op"]').val('cud-dedup'); >- $('#patron_form input[name="batch_id"]').val('[% batch_id | html %]'); >+ $('#patron_form input[name="batch_id"]').val(batch_id); > $('#patron_form').submit(); > } > >@@ -264,9 +272,9 @@ > alert(_("Please select at least one card to export.")); > return; // no batch selected > } >- location.href = "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id | html %]&" + getstr; >+ location.href = `/cgi-bin/koha/patroncards/print.pl?batch_id=${batch_id}&${getstr}`; > } else if (mode == 'batch') { >- location.href = "/cgi-bin/koha/patroncards/print.pl?batch_id=[% batch_id | html %]"; >+ location.href = `/cgi-bin/koha/patroncards/print.pl?batch_id=${batch_id`; > } else { > // some pass-through error trapping just in case... > } >@@ -291,23 +299,22 @@ > // Prepare DataTables settings > var aLengthMenu = [10, 20, 50, 100, -1]; > var aLengthMenuLabel = [10, 20, 50, 100, _("All")]; >- var patronsPerPage = [% Koha.Preference('PatronsPerPage') | html %]; > for ( var i = 0; i < aLengthMenu.length; i++ ) { >- if ( aLengthMenu[i] == patronsPerPage ) { >+ if ( aLengthMenu[i] == prefs.PatronsPerPage ) { > break; > } >- if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) { >- aLengthMenu.splice(i, 0, patronsPerPage); >- aLengthMenuLabel.splice(i, 0, patronsPerPage); >+ if ( aLengthMenu[i] > prefs.PatronsPerPage || aLengthMenu[i] == -1 ) { >+ aLengthMenu.splice(i, 0, prefs.PatronsPerPage); >+ aLengthMenuLabel.splice(i, 0, prefs.PatronsPerPage); > break; > } > } > >- [% IF table_loop %] >+ if (has_entries){ > $("#description").show(); >- [% ELSE %] >+ } else { > $("#description").hide(); >- [% END %] >+ } > $("#batcht").kohaTable({ > dom: '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"f>>tr<"bottom pager"ip>', > order: [[0, "asc"]], >-- >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 41574
: 191143 |
191144