From c6ab59b93fd1a4ff40653f4d6a1a430e892aa9ea Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 29 Nov 2010 11:19:51 +0100 Subject: [PATCH] Bug 4959 (Language inconsistencies on basket groups; skip confirmation when closing basket) Content-Type: text/plain; charset="utf-8" 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. --- acqui/basket.pl | 7 +++++-- .../prog/en/modules/acqui/basket.tmpl | 9 ++++----- .../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 005fcb9..330ddbf 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.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl index 9079b6d..3084b48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tmpl @@ -39,8 +39,8 @@ @@ -313,7 +312,7 @@

Are you sure you want to close basket ?

- +

" name="basketno" /> 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 2a900f0..43a7ad5 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 @@ -9,6 +9,13 @@ Acquisitions: 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 choices: -- 1.6.0.6