Bugzilla – Attachment 191126 Details for
Bug 41569
Tidy kohaTable block - clubs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41569: clubs - auto tidy
679a79e.patch (text/plain), 7.13 KB, created by
Jonathan Druart
on 2026-01-09 14:47:43 UTC
(
hide
)
Description:
Bug 41569: clubs - auto tidy
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2026-01-09 14:47:43 UTC
Size:
7.13 KB
patch
obsolete
>From 679a79e3474daab256135fdb63cd4149c436f8f5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Jan 2026 13:13:35 +0100 >Subject: [PATCH] Bug 41569: clubs - auto tidy > >--- > .../prog/en/modules/clubs/patron-clubs-tab.tt | 56 ++++++++--------- > .../bootstrap/en/modules/clubs/clubs-tab.tt | 63 +++++++++---------- > 2 files changed, 57 insertions(+), 62 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >index ee1769d36d6..b2d812dc646 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/patron-clubs-tab.tt >@@ -61,7 +61,6 @@ > <script> > const borrowernumber = "[% borrowernumber | html %]"; > </script> >- > <script> > var clubs_dt_params = { > paging: true, >@@ -69,37 +68,36 @@ > $("#table_clubnoenrollmemnts").kohaTable(clubs_dt_params); > $("#table_clubenrollments").kohaTable(clubs_dt_params); > </script> >- > [% IF CAN_user_clubs_enroll %] >-<script> >- function loadEnrollmentForm( id, enrollent_id = 0 ) { >- $("body").css("cursor", "progress"); >- $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=" + borrowernumber + " &id=' + id +'&enrollent_id='+ enrollent_id, function() { >- $("body").css("cursor", "default"); >- }); >+ <script> >+ function loadEnrollmentForm(id, enrollent_id = 0) { >+ $("body").css("cursor", "progress"); >+ $("#clubs_panel").load('/cgi-bin/koha/clubs/patron-enroll.pl?borrowernumber=" + borrowernumber + " &id=' + id + "&enrollent_id=" + enrollent_id, function () { >+ $("body").css("cursor", "default"); >+ }); > >- return false; >- } >+ return false; >+ } > >- function cancelEnrollment( id ) { >- $("body").css("cursor", "progress"); >- const client = APIClient.club; >- client.enrollments.cancel(id).then( >- success => { >- if ( success.success ) { >- $('#clubs_panel').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=" + borrowernumber + "', function() { >- $("body").css("cursor", "default"); >- }); >- } else { >+ function cancelEnrollment(id) { >+ $("body").css("cursor", "progress"); >+ const client = APIClient.club; >+ client.enrollments.cancel(id).then( >+ success => { >+ if (success.success) { >+ $("#clubs_panel").load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=" + borrowernumber + "', function () { >+ $("body").css("cursor", "default"); >+ }); >+ } else { >+ alert(_("Unable to cancel enrollment!")); >+ } >+ }, >+ error => { >+ console.warn("Something wrong happened: %s".format(error)); > alert(_("Unable to cancel enrollment!")); > } >- }, >- error => { >- console.warn("Something wrong happened: %s".format(error)); >- alert(_("Unable to cancel enrollment!")); >- } >- ); >- return false; >- } >-</script> >+ ); >+ return false; >+ } >+ </script> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt >index 93208c9c7e5..949d8c22049 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/clubs/clubs-tab.tt >@@ -69,61 +69,58 @@ > <script> > const patron_id = "[% borrower.borrowernumber | html %]"; > </script> >- > <script> >- function loadEnrollmentForm( id ) { >+ function loadEnrollmentForm(id) { > $("body").css("cursor", "progress"); >- $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/enroll.pl?borrowernumber=' + patron_id + '&id=' + id, function() { >+ $("#opac-user-clubs_panel").load("/cgi-bin/koha/clubs/enroll.pl?borrowernumber=" + patron_id + "&id=" + id, function () { > $("body").css("cursor", "default"); > }); > > return false; > } > >- function cancelEnrollment( id ) { >+ function cancelEnrollment(id) { > $("body").css("cursor", "progress"); > $.ajax({ > type: "POST", >- url: '/cgi-bin/koha/svc/club/cancel_enrollment', >- data: { id: id, csrf_token: $('meta[name="csrf-token"]').attr('content'), }, >- success: function( data ) { >- if ( data.success ) { >- $('#opac-user-clubs_panel').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=' + patron_id, function() { >+ url: "/cgi-bin/koha/svc/club/cancel_enrollment", >+ data: { id: id, csrf_token: $('meta[name="csrf-token"]').attr("content") }, >+ success: function (data) { >+ if (data.success) { >+ $("#opac-user-clubs_panel").load("/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=" + patron_id, function () { > $("body").css("cursor", "default"); > }); > } else { > alert(_("Unable to cancel enrollment!")); > } > }, >- dataType: 'json' >+ dataType: "json", > }); > return false; > } > >- var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled"); >- Tables.each(function(){ >- $(this).kohaTable({ >- searching: false, >- paging: false, >- info: false, >- responsive: { >- details: { type: "column", target: -1 }, >- }, >- columnDefs: [ >- { className: "dtr-control", orderable: false, targets: -1 }, >- ], >- }); >+ var Tables = $("#clubs-table-enrolled,#clubs-table-unenrolled"); >+ Tables.each(function () { >+ $(this).kohaTable({ >+ searching: false, >+ paging: false, >+ info: false, >+ responsive: { >+ details: { type: "column", target: -1 }, >+ }, >+ columnDefs: [{ className: "dtr-control", orderable: false, targets: -1 }], > }); >+ }); > >- $(".cancel_enrollment").on("click", function(e){ >- e.preventDefault(); >- let clubid = $(this).data("id"); >- cancelEnrollment( clubid ); >- }); >+ $(".cancel_enrollment").on("click", function (e) { >+ e.preventDefault(); >+ let clubid = $(this).data("id"); >+ cancelEnrollment(clubid); >+ }); > >- $(".load_enrollment").on("click", function(e){ >- e.preventDefault(); >- let clubid = $(this).data("id"); >- loadEnrollmentForm( clubid ); >- }); >+ $(".load_enrollment").on("click", function (e) { >+ e.preventDefault(); >+ let clubid = $(this).data("id"); >+ loadEnrollmentForm(clubid); >+ }); > </script> >-- >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 41569
:
191124
|
191125
| 191126