Merge branch 'bug_7358' into 3.12-master

This commit is contained in:
Jared Camins-Esakov 2012-11-25 18:20:32 -05:00
commit eb27e4084d
2 changed files with 34 additions and 18 deletions

View file

@ -206,13 +206,14 @@ if ( $op eq 'delete_confirm' ) {
} }
} }
#if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups #if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
my $basketgroups; my ($basketgroup, $basketgroups);
my $member = GetMember(borrowernumber => $loggedinuser); my $member = GetMember(borrowernumber => $loggedinuser);
if ($basket->{closedate} && haspermission({ acquisition => 'group_manage'} )) { if ($basket->{closedate} && haspermission({ acquisition => 'group_manage'} )) {
$basketgroups = GetBasketgroups($basket->{booksellerid}); $basketgroups = GetBasketgroups($basket->{booksellerid});
for my $bg ( @{$basketgroups} ) { for my $bg ( @{$basketgroups} ) {
if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){ if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
$bg->{default} = 1; $bg->{default} = 1;
$basketgroup = $bg;
} }
} }
my %emptygroup = ( id => undef, my %emptygroup = ( id => undef,
@ -339,6 +340,7 @@ if ( $op eq 'delete_confirm' ) {
currency => $cur->{'currency'}, currency => $cur->{'currency'},
listincgst => $bookseller->{listincgst}, listincgst => $bookseller->{listincgst},
basketgroups => $basketgroups, basketgroups => $basketgroups,
basketgroup => $basketgroup,
grouped => $basket->{basketgroupid}, grouped => $basket->{basketgroupid},
unclosable => @orders ? 0 : 1, unclosable => @orders ? 0 : 1,
has_budgets => $has_budgets, has_budgets => $has_budgets,

View file

@ -232,24 +232,38 @@
[% IF ( closedate ) %] [% IF ( closedate ) %]
<div class="yui-u"> <div class="yui-u">
<form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post"> <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
<p>
<label for="basketgroupid"><strong>Basket group:</strong></label>
[% IF basketgroup.closed %]
[% basketgroup.name %] (closed)
[% ELSE %]
</p>
<p>
<select id="basketgroupid" name="basketgroupid">
<option value="new">Add new group</option>
[% FOREACH bg IN basketgroups %]
[% IF ( bg.default ) %]
<option value="[% bg.id %]" selected="selected">[% bg.name %]</option>
[% ELSE %]
[% UNLESS bg.closed %]
<option value="[% bg.id %]">[% bg.name %]</option>
[% ELSE %]
<option value="[% bg.id %]" disabled="disabled">[% bg.name %] (closed)</option>
[% END %]
[% END %]
[% END %]
</select>
[% END %]
</p>
<p><label for="basketgroupid"><strong>Basket group:</strong></label></p> [% UNLESS basketgroup.closed %]
<p><select id="basketgroupid" name="basketgroupid"> <p>
<option value="new">Add new group</option> <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
[% FOREACH basketgroup IN basketgroups %] <input type="hidden" value="mod_basket" name="op" />
[% IF ( basketgroup.default ) %] <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option> <input type="submit" value="Change basket group" />
[% ELSE %] </p>
<option value="[% basketgroup.id %]">[% basketgroup.name %]</option> [% END %]
[% END %]
[% END %]
</select></p>
<p><input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
<input type="hidden" value="mod_basket" name="op" />
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<input type="submit" value="Change basket group" /></p>
</form> </form>
[% IF ( basketgroupdeliveryplace ) %]<p>Basket group delivery place: [% basketgroupdeliveryplace %]</p>[% END %] [% IF ( basketgroupdeliveryplace ) %]<p>Basket group delivery place: [% basketgroupdeliveryplace %]</p>[% END %]
[% IF ( basketgroupbillingplace ) %]<p>Basket group billing place: [% basketgroupbillingplace %]</p>[% END %] [% IF ( basketgroupbillingplace ) %]<p>Basket group billing place: [% basketgroupbillingplace %]</p>[% END %]