From 1415fee322a497a3dc7e511a61854a4099ea40a6 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 5 Mar 2024 11:23:36 -0300 Subject: [PATCH] Bug 36193: cud- treatment for cash_registers.pl Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- admin/cash_registers.pl | 8 +-- .../prog/en/modules/admin/cash_registers.tt | 51 +++++++++++++++++-- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/admin/cash_registers.pl b/admin/cash_registers.pl index 78abf749ad..94eebbd5a0 100755 --- a/admin/cash_registers.pl +++ b/admin/cash_registers.pl @@ -99,7 +99,7 @@ elsif ( $op eq 'cud-add_validate' ) { $op = 'list'; } -elsif ( $op eq 'archive' ) { +elsif ( $op eq 'cud-archive' ) { if ($registerid) { try { my $cash_register = Koha::Cash::Registers->find($registerid); @@ -113,7 +113,7 @@ elsif ( $op eq 'archive' ) { } $op = 'list'; } -elsif ( $op eq 'unarchive' ) { +elsif ( $op eq 'cud-unarchive' ) { if ($registerid) { try { my $cash_register = Koha::Cash::Registers->find($registerid); @@ -127,7 +127,7 @@ elsif ( $op eq 'unarchive' ) { $op = 'list'; } -elsif ( $op eq 'make_default' ) { +elsif ( $op eq 'cud-make_default' ) { if ($registerid) { try { my $cash_register = Koha::Cash::Registers->find($registerid); @@ -140,7 +140,7 @@ elsif ( $op eq 'make_default' ) { } $op = 'list'; } -elsif ( $op eq 'drop_default' ) { +elsif ( $op eq 'cud-drop_default' ) { if ($registerid) { try { my $cash_register = Koha::Cash::Registers->find($registerid); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt index 81a2a09c21..06ef94bcae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cash_registers.tt @@ -193,14 +193,34 @@ Edit [% IF cash_register.branch_default %] - Drop default +
+ [% INCLUDE 'csrf-token.inc' %] + + +
+ Drop default [% ELSE %] - Make default +
+ [% INCLUDE 'csrf-token.inc' %] + + +
+ Make default [% END %] - Archive +
+ [% INCLUDE 'csrf-token.inc' %] + + +
+ Archive [% ELSE %] - Restore +
+ [% INCLUDE 'csrf-token.inc' %] + + +
+ Restore [% END %] [% END %] @@ -257,6 +277,29 @@ filterDataTable( crtable, 2, opt ); }); + $("#drop_default_button").on("click", function(e){ + e.preventDefault(); + var id = $(this).data('id'); + $('#drop_default_'+id).submit(); + }); + + $(".make_default_button").on("click", function(e){ + e.preventDefault(); + var id = $(this).data('id'); + $('#make_default_'+id).submit(); + }); + + $(".archive_button").on("click", function(e){ + e.preventDefault(); + var id = $(this).data('id'); + $('#archive_'+id).submit(); + }); + + $(".unarchive_button").on("click", function(e){ + e.preventDefault(); + var id = $(this).data('id'); + $('#unarchive_'+id).submit(); + }); }); [% END %] -- 2.39.5