From 65c0c01161751e9634adf0119ec6fc52d50b8a37 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 6 Mar 2024 12:44:18 -0300 Subject: [PATCH] Bug 36193: cud- treatment for tools/stockrotation.pl Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer --- .../prog/en/modules/tools/stockrotation.tt | 81 +++++++++++++------ tools/stockrotation.pl | 12 +-- 2 files changed, 62 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt index a231a2cbc7..a1fa55af07 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt @@ -147,14 +147,18 @@ [% END %] - - +
+ [% INCLUDE 'csrf-token.inc' %] + + + +
Delete @@ -380,8 +384,15 @@

Are you sure you wish to remove this item from its rota

- Yes - No +

+ [% INCLUDE 'csrf-token.inc' %] + + + + + +
+ No

[% ELSIF (op == 'confirm_delete_rota') %] @@ -396,8 +407,13 @@ [% END %] [% END %]

- Yes - No +

+ [% INCLUDE 'csrf-token.inc' %] + + + +
+ No

[% ELSIF (op == 'confirm_delete_stage') %] @@ -413,8 +429,13 @@ [% END %]

- Yes - No +

+ [% INCLUDE 'csrf-token.inc' %] + + + +
+ No

[% ELSIF (op == 'manage_items') %] @@ -517,26 +538,36 @@ [% in_transit = sritem.item.get_transfer %] [% IF stages.size < 2 %] - [% ELSIF !in_transit %] - [% ELSE %] - +
+ [% INCLUDE 'csrf-token.inc' %] + + + + + [% IF !in_transit %] + + [% ELSE %] + + [% END %] +
[% END %] - - Move to next stage -
+ [% IF !in_transit %] - - [% ELSE %] - +
+ [% INCLUDE 'csrf-token.inc' %] + + + + + [% IF sritem.indemand %] + + [% ELSE %] + + [% END %] +
[% END %] - - [% IF sritem.indemand %] - Remove "In demand" - [% ELSE %] - Add "In demand" - [% END %] -
+ [% IF !in_transit %] [% ELSE %] diff --git a/tools/stockrotation.pl b/tools/stockrotation.pl index 992cf71086..b818a38f7d 100755 --- a/tools/stockrotation.pl +++ b/tools/stockrotation.pl @@ -107,7 +107,7 @@ if (!defined $op) { op => $op ); -} elsif ($op eq 'toggle_rota') { +} elsif ($op eq 'cud-toggle_rota') { # Find and update the active status of the rota my $rota = Koha::StockRotationRotas->find($params{rota_id}); @@ -223,7 +223,7 @@ if (!defined $op) { op => $op ); -} elsif ($op eq 'delete_rota') { +} elsif ($op eq 'cud-delete_rota') { # Get the rota we're deleting my $rota = Koha::StockRotationRotas->find($params{rota_id}); @@ -243,7 +243,7 @@ if (!defined $op) { stage => $stage ); -} elsif ($op eq 'delete_stage') { +} elsif ($op eq 'cud-delete_stage') { # Get the stage we're deleting my $stage = Koha::StockRotationStages->find($params{stage_id}); @@ -315,14 +315,14 @@ if (!defined $op) { op => $op ); -} elsif ($op eq 'move_to_next_stage') { +} elsif ($op eq 'cud-move_to_next_stage') { move_to_next_stage($params{item_id}, $params{stage_id}); # Return to the items list print $input->redirect("?op=manage_items&rota_id=" . $params{rota_id}); -} elsif ($op eq 'toggle_in_demand') { +} elsif ($op eq 'cud-toggle_in_demand') { # Toggle the item's in_demand toggle_indemand($params{item_id}, $params{stage_id}); @@ -330,7 +330,7 @@ if (!defined $op) { # Return to the items list print $input->redirect("?op=manage_items&rota_id=".$params{rota_id}); -} elsif ($op eq 'remove_item_from_stage') { +} elsif ($op eq 'cud-remove_item_from_stage') { # Remove the item from the stage remove_from_stage($params{item_id}, $params{stage_id}); -- 2.39.5