From cacbeffcc0c5da3f994b9d093d47501a27e62ab6 Mon Sep 17 00:00:00 2001 From: Mathieu Saby Date: Mon, 18 Mar 2013 20:30:46 +0100 Subject: [PATCH] Bug 9806 : Add new columns to basket groups lists Revised to fix whitespace problems. Cosmetic changes put in an other patch. In the list of all the open/closed basketgroups for a vendor, you just have the name of each basketgroup, and 3 action buttons. It is not sufficient for libraries using basketgroup. Warning : this patch must be tested with BZ 9771 applied. If BZ 9771 is not pushed to master when you test, apply it before. This patch adds the following columns : - number (id of basketgroup) - billingplace (name of the library) - deliveryplace (name of the library, or "free delivery place") - number of baskets in each basketgroup To test : 1) make some basketgroups with 0, 1, 2 baskets 2) make some basketgroups with different billing and deliveryplace 3) check the list of open and closed basketgroups 4) check action buttons are working like before Signed-off-by: Owen Leonard This is a nice improvement! Signed-off-by: Jonathan Druart --- acqui/basketgroup.pl | 7 ++++++- .../prog/en/modules/acqui/basketgroup.tt | 22 ++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index d6bd5d1..8d22e24 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -56,7 +56,7 @@ use C4::Bookseller qw/GetBookSellerFromId/; use C4::Budgets qw/ConvertCurrency/; use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/; use C4::Bookseller qw/GetBookSellerFromId/; -use C4::Branch qw/GetBranches/; +use C4::Branch qw/GetBranches GetBranchName/; use C4::Members qw/GetMember/; our $input=new CGI; @@ -156,17 +156,22 @@ sub displaybasketgroups { my $baskets = shift; if (scalar @$basketgroups != 0) { foreach my $basketgroup (@$basketgroups){ + $basketgroup -> {'billingplacename'} = GetBranchName($basketgroup -> {'billingplace'}); + $basketgroup -> {'deliveryplacename'} = GetBranchName($basketgroup -> {'deliveryplace'}); my $i = 0; + my $basketsqty = 0; while($i < scalar(@$baskets)){ my $basket = @$baskets[$i]; if($basket->{'basketgroupid'} && $basket->{'basketgroupid'} == $basketgroup->{'id'}){ $basket->{total} = BasketTotal($basket->{basketno}, $bookseller); push(@{$basketgroup->{'baskets'}}, $basket); splice(@$baskets, $i, 1); + ++$basketsqty; --$i; } ++$i; } + $basketgroup -> {'basketsqty'} = $basketsqty; } $template->param(basketgroups => $basketgroups); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt index deb20e9..0247222 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt @@ -246,7 +246,12 @@ function submitForm(form) { - + + + + + + @@ -259,6 +264,10 @@ function submitForm(form) { Basket group no. [% basketgroup.id %] [% END %] + + + +
Basket groupActionNameNumberBilling placeDelivery placeNumber of basketsAction
[% basketgroup.id %][% basketgroup.billingplacename %][% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplacename %][% END %][% basketgroup.basketsqty %]
@@ -274,7 +283,12 @@ function submitForm(form) { - + + + + + + @@ -288,6 +302,10 @@ function submitForm(form) { Basket group no. [% basketgroup.id %] [% END %] + + + +
Basket groupActionNameNumberBilling placeDelivery placeNumber of basketsAction
[% basketgroup.id %][% basketgroup.billingplacename %][% IF (basketgroup.freedeliveryplace) %]Free delivery place[% ELSE %][% basketgroup.deliveryplacename %][% END %][% basketgroup.basketsqty %]
-- 1.7.10.4