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

(-)a/acqui/invoice.pl (+4 lines)
Lines 110-115 elsif ( $op && $op eq 'mod' ) { Link Here
110
    $template->param( modified => 1 );
110
    $template->param( modified => 1 );
111
}
111
}
112
elsif ( $op && $op eq 'delete' ) {
112
elsif ( $op && $op eq 'delete' ) {
113
114
    output_and_exit( $input, $cookie, $template, 'insufficient_permission' )
115
        unless $logged_in_patron->has_permission( { acquisition => 'delete_invoices' } );
116
113
    DelInvoice($invoiceid);
117
    DelInvoice($invoiceid);
114
    defined($invoice_files) && $invoice_files->DelAllFiles();
118
    defined($invoice_files) && $invoice_files->DelAllFiles();
115
    my $referer = $input->param('referer') || 'invoices.pl';
119
    my $referer = $input->param('referer') || 'invoices.pl';
(-)a/installer/data/mysql/atomicupdate/bug_24157.perl (-1 / +6 lines)
Lines 11-16 if( CheckVersion( $DBversion ) ) { Link Here
11
    |);
11
    |);
12
12
13
13
14
    $dbh->do(q|
15
        INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
16
        (11, 'delete_invoices', 'Delete invoices')
17
    |);
18
14
    SetVersion( $DBversion );
19
    SetVersion( $DBversion );
15
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices)\n";
20
    print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices delete_invoices)\n";
16
}
21
}
(-)a/installer/data/mysql/userpermissions.sql (+1 lines)
Lines 62-67 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
62
   (11, 'edi_manage', 'Manage EDIFACT transmissions'),
62
   (11, 'edi_manage', 'Manage EDIFACT transmissions'),
63
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
63
   (11, 'reopen_closed_invoices', 'Reopen closed invoices'),
64
   (11, 'edit_invoices', 'Edit invoices'),
64
   (11, 'edit_invoices', 'Edit invoices'),
65
   (11, 'delete_invoices', 'Delete invoices'),
65
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
66
   (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
66
   (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
67
   (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
67
   (13, 'edit_calendar', 'Define days when the library is closed'),
68
   (13, 'edit_calendar', 'Define days when the library is closed'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 659-664 Link Here
659
            Edit invoices
659
            Edit invoices
660
        </span>
660
        </span>
661
        <span class="permissioncode">([% name | html %])</span>
661
        <span class="permissioncode">([% name | html %])</span>
662
    [%- CASE 'delete_invoices' -%]
663
        <span class="sub_permission delete_invoices_subpermission">
664
            Delete invoices
665
        </span>
666
        <span class="permissioncode">([% name | html %])</span>
662
  [%# self_check %]
667
  [%# self_check %]
663
    [%- CASE 'self_checkin_module' -%]
668
    [%- CASE 'self_checkin_module' -%]
664
        <span class="sub_permission self_checkin_module_subpermission">
669
        <span class="sub_permission self_checkin_module_subpermission">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (-2 / +1 lines)
Lines 90-96 Link Here
90
                                [% END %]
90
                                [% END %]
91
                            [% END %]
91
                            [% END %]
92
                            [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
92
                            [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
93
                                [% IF CAN_user_acquisition_edit_invoices %]
93
                                [% IF CAN_user_acquisition_delete_invoices %]
94
                                    <li><a href="invoice.pl?op=delete&amp;invoiceid=[% invoice.invoiceid | uri %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]" class="delete_invoice"><i class="fa fa-trash"></i> Delete</a></li>
94
                                    <li><a href="invoice.pl?op=delete&amp;invoiceid=[% invoice.invoiceid | uri %]&amp;referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]" class="delete_invoice"><i class="fa fa-trash"></i> Delete</a></li>
95
                                [% END %]
95
                                [% END %]
96
                            [% END %]
96
                            [% END %]
97
- 

Return to bug 24157