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

(-)a/acqui/basket.pl (+6 lines)
Lines 91-96 our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( Link Here
91
    }
91
    }
92
);
92
);
93
93
94
my $logged_in_patron = Koha::Patrons->find( $loggedinuser );
95
94
our $basket = GetBasket($basketno);
96
our $basket = GetBasket($basketno);
95
$booksellerid = $basket->{booksellerid} unless $booksellerid;
97
$booksellerid = $basket->{booksellerid} unless $booksellerid;
96
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
98
my $bookseller = Koha::Acquisition::Booksellers->find( $booksellerid );
Lines 123-128 $template->param( skip_confirm_reopen => 1) if $confirm_pref eq '2'; Link Here
123
my @messages;
125
my @messages;
124
126
125
if ( $op eq 'delete_confirm' ) {
127
if ( $op eq 'delete_confirm' ) {
128
129
    output_and_exit( $query, $cookie, $template, 'insufficient_permission' )
130
      unless $logged_in_patron->has_permission( { acquisition => 'delete_baskets' } );
131
126
    my $basketno = $query->param('basketno');
132
    my $basketno = $query->param('basketno');
127
    my $delbiblio = $query->param('delbiblio');
133
    my $delbiblio = $query->param('delbiblio');
128
    my @orders = GetOrders($basketno);
134
    my @orders = GetOrders($basketno);
(-)a/installer/data/mysql/atomicupdate/bug_24157.perl (-1 / +5 lines)
Lines 10-15 if( CheckVersion( $DBversion ) ) { Link Here
10
        (11, 'edit_invoices', 'Edit invoices')
10
        (11, 'edit_invoices', 'Edit invoices')
11
    |);
11
    |);
12
12
13
    $dbh->do(q|
14
        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
15
        (11, 'delete_baskets', 'Delete baskets')
16
    |);
13
17
14
    $dbh->do(q|
18
    $dbh->do(q|
15
        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
19
        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
Lines 17-21 if( CheckVersion( $DBversion ) ) { Link Here
17
    |);
21
    |);
18
22
19
    SetVersion( $DBversion );
23
    SetVersion( $DBversion );
20
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices delete_invoices)\n";
24
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices, delete_invoices, delete_baskets)\n";
21
}
25
}
(-)a/installer/data/mysql/userpermissions.sql (+1 lines)
Lines 66-71 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
66
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
66
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
67
   (11, 'edit_invoices', 'Edit invoices'),
67
   (11, 'edit_invoices', 'Edit invoices'),
68
   (11, 'delete_invoices', 'Delete invoices'),
68
   (11, 'delete_invoices', 'Delete invoices'),
69
   (11, 'delete_baskets', 'Delete baskets'),
69
   (12, 'suggestions_manage', 'Manage purchase suggestions'),
70
   (12, 'suggestions_manage', 'Manage purchase suggestions'),
70
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
71
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
71
   (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
72
   (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 682-687 Link Here
682
            Delete invoices
682
            Delete invoices
683
        </span>
683
        </span>
684
        <span class="permissioncode">([% name | html %])</span>
684
        <span class="permissioncode">([% name | html %])</span>
685
    [%- CASE 'delete_baskets' -%]
686
        <span class="sub_permission delete_baskets_subpermission">
687
            Delete baskets
688
        </span>
689
        <span class="permissioncode">([% name | html %])</span>
685
  [%# self_check %]
690
  [%# self_check %]
686
    [%- CASE 'self_checkin_module' -%]
691
    [%- CASE 'self_checkin_module' -%]
687
        <span class="sub_permission self_checkin_module_subpermission">
692
        <span class="sub_permission self_checkin_module_subpermission">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-3 / +3 lines)
Lines 59-66 Link Here
59
                        <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-default" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
59
                        <div class="btn-group"><a href="#addtoBasket" role="button" class="btn btn-default" data-toggle="modal"><i class="fa fa-plus"></i> Add to basket</a></div>
60
                    [% END %]
60
                    [% END %]
61
                    <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;op=add_form" class="btn btn-default" id="basketheadbutton"><i class="fa fa-pencil"></i> Edit basket</a></div>
61
                    <div class="btn-group"><a href="basketheader.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;op=add_form" class="btn btn-default" id="basketheadbutton"><i class="fa fa-pencil"></i> Edit basket</a></div>
62
                    [%# FIXME This action should not be available for everyone %]
62
                    [% IF CAN_user_acquisition_delete_baskets %]
63
                    <div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-default" data-toggle="modal" id="delbasketbutton"><i class="fa fa-trash"></i> Delete this basket</a></div>
63
                        <div class="btn-group"><a href="#deleteBasketModal" role="button" class="btn btn-default" data-toggle="modal" id="delbasketbutton"><i class="fa fa-trash"></i> Delete this basket</a></div>
64
                    [% END %]
64
                   [% IF ( unclosable ) %]
65
                   [% IF ( unclosable ) %]
65
                    [% ELSIF ( uncertainprices ) %]
66
                    [% ELSIF ( uncertainprices ) %]
66
                        <div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid | uri %]&amp;owner=1" class="btn btn-default" id="uncertpricesbutton"><i class="fa fa-usd"></i> Uncertain prices</a></div>
67
                        <div class="btn-group"><a href="/cgi-bin/koha/acqui/uncertainprice.pl?booksellerid=[% booksellerid | uri %]&amp;owner=1" class="btn btn-default" id="uncertpricesbutton"><i class="fa fa-usd"></i> Uncertain prices</a></div>
67
- 

Return to bug 24157