From f53dcce0adb9d60e19dfa32a3421508356744746 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 12 Apr 2011 17:00:45 +0100 Subject: [PATCH] Bug 4959 (Language inconsistencies on basket groups; skip confirmation when closing basket) This patch adds a new pref BasketConfirmations. This adds the option to skip confirmations on closing and reopening a basket. If you skip the confirmation, you do not create a new basket group. The confusing line Create a purchase order (when closing a basket) is replaced by Attach basket to a new basket group with the same name. A warning for a null value on basketgroupid is fixed. Rebased April 11. Signed-off-by: Colin Campbell Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- acqui/basket.pl | 7 +++++-- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 9 ++++----- .../prog/en/modules/admin/preferences/acquisitions.pref | 7 +++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 0261e8622e..9cd76d853f 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -90,6 +90,9 @@ if (!defined $op) { $op = q{}; } +my $confirm_pref= C4::Context->preference("BasketConfirmations") || '1'; +$template->param( skip_confirm_reopen => 1) if $confirm_pref eq '2'; + if ( $op eq 'delete_confirm' ) { my $basketno = $query->param('basketno'); DelBasket($basketno); @@ -144,7 +147,7 @@ if ( $op eq 'delete_confirm' ) { print GetBasketAsCSV($query->param('basketno')); exit; } elsif ($op eq 'close') { - my $confirm = $query->param('confirm'); + my $confirm = $query->param('confirm') || $confirm_pref eq '2'; if ($confirm) { my $basketno = $query->param('basketno'); my $booksellerid = $query->param('booksellerid'); @@ -197,7 +200,7 @@ if ( $op eq 'delete_confirm' ) { if ($basket->{closedate} && haspermission({ flagsrequired => { acquisition => 'group_manage'} })) { $basketgroups = GetBasketgroups($basket->{booksellerid}); for my $bg ( @{$basketgroups} ) { - if ($basket->{basketgroupid} == $bg->{id}){ + if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){ $bg->{default} = 1; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index d34e3d5135..26543034f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -46,8 +46,8 @@ [% UNLESS ( grouped ) %] [% END %] @@ -308,7 +307,7 @@

Are you sure you want to close basket [% basketname %]?

- +

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index 2a900f0146..43a7ad57fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -8,6 +8,13 @@ Acquisitions: ordering: placing an order. receiving: receiving an order. cataloguing: cataloging the record. + - + - When closing or reopening a basket, + - pref: BasketConfirmations + default: 1 + choices: + 1: always ask for confirmation. + 2: do not ask for confirmation. - - Display currencies using the following format - pref: CurrencyFormat -- 2.39.2