View | Details | Raw Unified | Return to bug 10258
Collapse All | Expand All

(-)a/acqui/basket.pl (-9 / +5 lines)
Lines 207-214 if ( $op eq 'delete_confirm' ) { Link Here
207
    }
207
    }
208
#if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
208
#if the basket is closed,and the user has the permission to edit basketgroups, display a list of basketgroups
209
    my ($basketgroup, $basketgroups);
209
    my ($basketgroup, $basketgroups);
210
    my $member = GetMember(borrowernumber => $loggedinuser);
210
    my $staffuser = GetMember(borrowernumber => $loggedinuser);
211
    if ($basket->{closedate} && haspermission({ acquisition => 'group_manage'} )) {
211
    if ($basket->{closedate} && haspermission($staffuser->{userid}, { acquisition => 'group_manage'} )) {
212
        $basketgroups = GetBasketgroups($basket->{booksellerid});
212
        $basketgroups = GetBasketgroups($basket->{booksellerid});
213
        for my $bg ( @{$basketgroups} ) {
213
        for my $bg ( @{$basketgroups} ) {
214
            if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
214
            if ($basket->{basketgroupid} && $basket->{basketgroupid} == $bg->{id}){
Lines 287-299 if ( $op eq 'delete_confirm' ) { Link Here
287
    my @orders = GetOrders($basketno);
287
    my @orders = GetOrders($basketno);
288
288
289
    if ($basket->{basketgroupid}){
289
    if ($basket->{basketgroupid}){
290
        my $basketgroup = GetBasketgroup($basket->{basketgroupid});
290
        $basketgroup = GetBasketgroup($basket->{basketgroupid});
291
        for my $key (keys %$basketgroup ){
291
        $basketgroup->{deliveryplacename} = C4::Branch::GetBranchName( $basketgroup->{deliveryplace} );
292
            $basketgroup->{"basketgroup$key"} = delete $basketgroup->{$key};
292
        $basketgroup->{billingplacename} = C4::Branch::GetBranchName( $basketgroup->{billingplace} );
293
        }
294
        $basketgroup->{basketgroupdeliveryplace} = C4::Branch::GetBranchName( $basketgroup->{basketgroupdeliveryplace} );
295
        $basketgroup->{basketgroupbillingplace} = C4::Branch::GetBranchName( $basketgroup->{basketgroupbillingplace} );
296
        $template->param(%$basketgroup);
297
    }
293
    }
298
    my $borrower= GetMember('borrowernumber' => $loggedinuser);
294
    my $borrower= GetMember('borrowernumber' => $loggedinuser);
299
    my $budgets = GetBudgetHierarchy;
295
    my $budgets = GetBudgetHierarchy;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-5 / +12 lines)
Lines 203-217 Link Here
203
                </div>
203
                </div>
204
                [% IF ( closedate ) %]
204
                [% IF ( closedate ) %]
205
                <div class="yui-u">
205
                <div class="yui-u">
206
                    [% IF ( CAN_user_acquisition_group_manage ) %]
206
                    <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
207
                    <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
208
                    [% END %]
207
                        <ol>
209
                        <ol>
208
                        <li>
210
                        <li>
209
                          <span class="label">Basket group:</span>
211
                          <span class="label">Basket group:</span>
210
                          [% IF basketgroup.closed %]
212
                          [% IF basketgroup.closed %]
211
                            [% basketgroup.name %] (closed)
213
                            [% basketgroup.name %] (closed)
214
                          [% ELSIF ( ! CAN_user_acquisition_group_manage ) %]
215
                            [%- IF basketgroup.name -%]
216
                                [% basketgroup.name %]
217
                            [%- ELSE -%]
218
                                No group
219
                            [%- END -%]
212
                          [% ELSE %]
220
                          [% ELSE %]
213
                            </li>
214
                            <li>
215
                            <select id="basketgroupid" name="basketgroupid">
221
                            <select id="basketgroupid" name="basketgroupid">
216
                              <option value="new">Add new group</option>
222
                              <option value="new">Add new group</option>
217
                              [% FOREACH bg IN basketgroups %]
223
                              [% FOREACH bg IN basketgroups %]
Lines 232-241 Link Here
232
                            <input type="submit" value="Change basket group" />
238
                            <input type="submit" value="Change basket group" />
233
                          [% END %]
239
                          [% END %]
234
                        </li>
240
                        </li>
235
                    [% IF ( basketgroupdeliveryplace ) %]<li><span class="label">Basket group delivery place:</span> [% basketgroupdeliveryplace %]</li>[% END %]
241
                    [% IF ( basketgroup.deliveryplacename ) %]<li><span class="label">Basket group delivery placename:</span> [% basketgroup.deliveryplacename %]</li>[% END %]
236
                    [% IF ( basketgroupbillingplace ) %]<li><span class="label">Basket group billing place:</span> [% basketgroupbillingplace %]</li>[% END %]
242
                    [% IF ( basketgroup.billingplacename ) %]<li><span class="label">Basket group billing place:</span> [% basketgroup.billingplacename %]</li>[% END %]
237
                        </ol>
243
                        </ol>
244
                    [% IF ( CAN_user_acquisition_group_manage ) %]
238
                    </form>
245
                    </form>
246
                    [% END %]
239
                </div>
247
                </div>
240
                [% END %]
248
                [% END %]
241
            </div>
249
            </div>
242
- 

Return to bug 10258