From cee85d7a5a2435a40cd9e130fb4b55d2d7492651 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Feb 2024 14:19:18 +0100 Subject: [PATCH] Bug 34478: Fix saveitem and delete for additem Signed-off-by: Jonathan Druart --- cataloguing/additem.pl | 6 +++--- .../prog/en/modules/cataloguing/additem.tt | 17 +++++++++++++---- .../intranet-tmpl/prog/js/cataloging_additem.js | 10 ++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index ea384f59f2..affbf89ee5 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -486,7 +486,7 @@ if ($op eq "cud-additem") { #------------------------------------------------------------------------------- # retrieve item if exist => then, it's a modif $current_item = Koha::Items->find($itemnumber)->unblessed; - $nextop = "saveitem"; + $nextop = "cud-saveitem"; #------------------------------------------------------------------------------- } elsif ($op eq "dupeitem") { #------------------------------------------------------------------------------- @@ -502,7 +502,7 @@ if ($op eq "cud-additem") { $nextop = "cud-additem"; #------------------------------------------------------------------------------- -} elsif ($op eq "delitem") { +} elsif ($op eq "cud-delitem") { #------------------------------------------------------------------------------- # check that there is no issue on this item before deletion. my $item = Koha::Items->find($itemnumber); @@ -547,7 +547,7 @@ if ($op eq "cud-additem") { exit; } #------------------------------------------------------------------------------- -} elsif ($op eq "saveitem") { +} elsif ($op eq "cud-saveitem") { #------------------------------------------------------------------------------- my $itemnumber = $input->param('itemnumber'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 1cf3bcb028..ae409d5270 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -136,7 +136,16 @@
  • Duplicate
  • [% UNLESS item.nomod %] -
  • Delete
  • +
  • +
    + [% INCLUDE 'csrf-token.inc' %] + + + + +
    + Delete +
  • [% END %] [% END %] [% IF ( OPACBaseURL ) %] @@ -182,7 +191,7 @@ [% END %] - [% IF op != 'saveitem' %] + [% IF op != 'cud-saveitem' %]

    Add item [% IF (circborrowernumber) %](fast cataloging)[% END %]

    [% ELSE %]

    Edit item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]

    @@ -251,7 +260,7 @@ [% END %] -[% IF item_groups.size && op != 'saveitem' && CAN_user_editcatalogue_manage_item_groups %] +[% IF item_groups.size && op != 'cud-saveitem' && CAN_user_editcatalogue_manage_item_groups %]
    Add to item group [% FOREACH ig IN item_groups %] @@ -280,7 +289,7 @@
    [% END %] -
    [% IF op != 'saveitem' %] +
    [% IF op != 'cud-saveitem' %]