From 195cccd4ef56401cad8aaa0f404348cadfadd54e Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 23 Feb 2024 10:02:16 +0000 Subject: [PATCH] Bug 34478: (follow-up) patroncards: cud-delete from edit-batch and manage Signed-off-by: Jonathan Druart --- .../prog/en/modules/patroncards/edit-batch.tt | 9 +++++- .../prog/en/modules/patroncards/manage.tt | 28 +++++++++++++------ 2 files changed, 27 insertions(+), 10 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 9e3a2c7264..cc92019c8a 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 @@ -147,6 +147,10 @@ +
+ [% INCLUDE 'csrf-token.inc' %] + +
[% ELSE %]
  1. @@ -176,7 +180,10 @@ var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id | html %]"); var answer = confirm(msg); if (answer) { - window.location = "/cgi-bin/koha/patroncards/manage.pl?op=delete&card_element=batch&element_id=[% batch_id | html %]"; + $('#batch_form input[name="op"]').val('cud-delete'); + $('#batch_form').append( '' ); + $('#batch_form').append( '' ); + $('#batch_form').submit(); } else { return; // abort delete } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt index 7e56354364..d9978b45b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/manage.tt @@ -96,11 +96,15 @@ [% FOREACH text_field IN table_loo.text_fields %] [% IF ( text_field.select_field ) %] - Edit - [% IF ( print ) %] Export[% END %] - Delete + Edit + [% IF ( print ) %] + Export + [% END %] + Delete - [% IF ( print ) %][% END %] + [% IF ( print ) %] + + [% END %] [% ELSIF ( text_field.field_value ) %] [% text_field.field_value | html %] [% ELSE %] @@ -138,6 +142,10 @@
[% END %] +
+ [% INCLUDE 'csrf-token.inc' %] + +
[% ELSE %]
@@ -277,10 +285,6 @@ Edit(); return false; }); - $("#delete").click(function(){ - DeleteConfirm(); - return false; - }); $("#print").click(function(){ Xport(); return false; @@ -290,7 +294,13 @@ return false; }); $(".delete").on("click", function(){ - return confirmDelete( _("Are you sure you want to delete this?") ); + if( confirmDelete( _("Are you sure you want to delete this?") ) ) { + $('#manage_form input[name="op"]').val('cud-delete'); + $('#manage_form').append( '' ); + var id = $(this).data('element-id'); + $('#manage_form').append( '' ); + $('#manage_form').submit(); + } }); $(".export").on("click", function(e){ e.preventDefault(); -- 2.39.5