From bf22d5209889591b6447a3921b139397f06b9e00 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 15 Feb 2024 18:02:02 +0000 Subject: [PATCH] Bug 34478: Classification config - Convert delete links to form POSTS This patch converts the delete links on the classification configuration page for sources, filing rules, and splitting rules to POST forms. A couple of op checks in the script are corrected to match. Signed-off-by: Jonathan Druart --- admin/classsources.pl | 6 ++--- .../prog/en/modules/admin/classsources.tt | 22 ++++++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/admin/classsources.pl b/admin/classsources.pl index 65a55d5b88..53aa3252c1 100755 --- a/admin/classsources.pl +++ b/admin/classsources.pl @@ -109,7 +109,7 @@ elsif ( $op eq "cud-add_source_validate" ) { $op = 'list'; } -elsif ( $op eq "delete_source_confirmed" ) { +elsif ( $op eq "cud-delete_source_confirmed" ) { my $class_source = Koha::ClassSources->find($cn_source); my $deleted = eval { $class_source->delete }; if ( $@ or not $deleted ) { @@ -166,7 +166,7 @@ elsif ( $op eq "cud-add_sort_rule_validate" ) { } $op = 'list'; } -elsif ( $op eq "delete_sort_rule" ) { +elsif ( $op eq "cud-delete_sort_rule" ) { my $sort_rule = Koha::ClassSortRules->find($class_sort_rule); my $deleted = eval { $sort_rule->delete }; if ( $@ or not $deleted ) { @@ -237,7 +237,7 @@ elsif ( $op eq "cud-add_split_rule_validate" ) { } $op = 'list'; } -elsif ( $op eq "delete_split_rule" ) { +elsif ( $op eq "cud-delete_split_rule" ) { my $split_rule = Koha::ClassSplitRules->find($class_split_rule); my $deleted = eval { $split_rule->delete }; if ( $@ or not $deleted ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt index 52db26d482..5ed97a5bdd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tt @@ -357,7 +357,12 @@ [% class_source.class_split_rule | html %] Edit - Delete +
+ [% INCLUDE 'csrf-token.inc' %] + + + +
[% END %] @@ -380,7 +385,12 @@ [% rule.sort_routine | html %] Edit - Delete +
+ [% INCLUDE 'csrf-token.inc' %] + + + +
[% END %] @@ -403,7 +413,13 @@ [% rule.split_routine | html %] Edit - Delete +
+ [% INCLUDE 'csrf-token.inc' %] + + + + +
[% END %] -- 2.39.5