Bugzilla – Attachment 191392 Details for
Bug 41570
Tidy kohaTable block - course_reserves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41570: (follow-up) i18n correction, course deletion fix
Bug-41570-follow-up-i18n-correction-course-deletio.patch (text/plain), 3.69 KB, created by
Owen Leonard
on 2026-01-13 19:43:51 UTC
(
hide
)
Description:
Bug 41570: (follow-up) i18n correction, course deletion fix
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2026-01-13 19:43:51 UTC
Size:
3.69 KB
patch
obsolete
>From 4cb7df34485cb2d964861a3e5e2ee01e65d9be9a Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 13 Jan 2026 14:31:38 -0500 >Subject: [PATCH] Bug 41570: (follow-up) i18n correction, course deletion fix > >The template's i18n function, I18N.tnx, doesn't work with JavaScript >variables, so I've updated it to use the template variable. > >I also found that I couldn't properly test the course deletion function >without fixing a problem which exists in main: The delete course button >didn't trigger the confirmation, and the event which was supposed to >trigger the confirmation was attached to the whole form. > >The confirmation is now triggered on form submit. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../en/modules/course_reserves/course-details.tt | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >index 93b5d06b5b0..7e9ae6ee0ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/course-details.tt >@@ -84,8 +84,8 @@ > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-del" /> > <input type="hidden" name="course_id" value="[% course.course_id | html %]" /> >+ <button type="submit" class="btn btn-default" id="delete_course_button"> <i class="fa fa-trash-can"></i> Delete course </button> > </form> >- <a href="#" id="delete_course_button" class="btn btn-default"><i class="fa fa-trash-can"></i> Delete course</a> > [% END %] </div > ><!-- /toolbar --> > [% END %] >@@ -362,18 +362,14 @@ > [% INCLUDE 'datatables.inc' %] > <script> > var table_settings = [% TablesSettings.GetTableSettings( 'coursereserves', 'reserves', 'course_reserves_table', 'json' ) | $raw %]; >- const course_reserves_size = [% course_reserves.size || 0 | html %] >+ const course_reserves_size = [% course_reserves.size || 0 | html %]; > const i18n = { >- are_you_sure_items: [% I18N.tnx("Are you sure you want to delete this course? There is one attached item.", "Are you sure you want to delete this course? There are {count} attached items.", course_reserves_size, { count: course_reserves_size}) | html %], >- are_you_sure_no_item: [% I18N.t("Are you sure you want to delete this course?") | html %], >+ are_you_sure_items: "[% I18N.tnx('Are you sure you want to delete this course? There is one attached item.', 'Are you sure you want to delete this course? There are {count} attached items.', course_reserves.size, { count = course_reserves.size}) | html %]", >+ are_you_sure_no_item: "[% I18N.t('Are you sure you want to delete this course?') | html %]", > }; > </script> > <script> > $(document).ready(function () { >- $("#delete_course_button").on("click", function (e) { >- e.preventDefault(); >- $("#delete_course").submit(); >- }); > $("#rm_items_button").on("click", function (e) { > e.preventDefault(); > $("#rm_items").submit(); >@@ -399,7 +395,7 @@ > return confirmDelete(_("Are you sure you want to remove all items from the course?")); > }); > >- $("#delete_course").click(function () { >+ $("#delete_course").on("submit", function () { > return confirmDelete(course_reserves_size > 0 ? i18n.are_you_sure_items : i18n.are_you_sure_no_item); > }); > }); >-- >2.39.5
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 41570
:
191127
|
191128
|
191129
|
191389
|
191390
|
191391
| 191392