Bugzilla – Attachment 100286 Details for
Bug 24157
Additional acquisitions permissions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24157: New permission - delete_invoices
Bug-24157-New-permission---deleteinvoices.patch (text/plain), 5.22 KB, created by
Owen Leonard
on 2020-03-06 19:19:33 UTC
(
hide
)
Description:
Bug 24157: New permission - delete_invoices
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-03-06 19:19:33 UTC
Size:
5.22 KB
patch
obsolete
>From 3dfb551fd335cc7b69b7a1f392ede9a0087a6d71 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Dec 2019 16:37:46 +0100 >Subject: [PATCH] Bug 24157: New permission - delete_invoices > >Add a new permission to delete invoices > >Test plan: >- Remove the new permission "delete_invoices" for a given patron, >use it to log in into Koha >- Create an invoice, try to delete it >=> There is no way to delete it >- Add the permission >=> Now you can delete the invoice > >Sponsored-by: Galway-Mayo Institute of Technology > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > acqui/invoice.pl | 4 ++++ > installer/data/mysql/atomicupdate/bug_24157.perl | 7 ++++++- > installer/data/mysql/userpermissions.sql | 1 + > koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt | 2 +- > 5 files changed, 17 insertions(+), 2 deletions(-) > >diff --git a/acqui/invoice.pl b/acqui/invoice.pl >index f784b3e4d09..a65b6d8939b 100755 >--- a/acqui/invoice.pl >+++ b/acqui/invoice.pl >@@ -110,6 +110,10 @@ elsif ( $op && $op eq 'mod' ) { > $template->param( modified => 1 ); > } > elsif ( $op && $op eq 'delete' ) { >+ >+ output_and_exit( $input, $cookie, $template, 'insufficient_permission' ) >+ unless $logged_in_patron->has_permission( { acquisition => 'delete_invoices' } ); >+ > DelInvoice($invoiceid); > defined($invoice_files) && $invoice_files->DelAllFiles(); > my $referer = $input->param('referer') || 'invoices.pl'; >diff --git a/installer/data/mysql/atomicupdate/bug_24157.perl b/installer/data/mysql/atomicupdate/bug_24157.perl >index f03c3a37dee..031b7a0a393 100644 >--- a/installer/data/mysql/atomicupdate/bug_24157.perl >+++ b/installer/data/mysql/atomicupdate/bug_24157.perl >@@ -11,6 +11,11 @@ if( CheckVersion( $DBversion ) ) { > |); > > >+ $dbh->do(q| >+ INSERT IGNORE INTO permissions (module_bit, code, description) VALUES >+ (11, 'delete_invoices', 'Delete invoices') >+ |); >+ > SetVersion( $DBversion ); >- print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices)\n"; >+ print "Upgrade to $DBversion done (Bug 24157: Add new permissions reopen_closed_invoices, edit_invoices delete_invoices)\n"; > } >diff --git a/installer/data/mysql/userpermissions.sql b/installer/data/mysql/userpermissions.sql >index abb9e68d4f1..3294ae3e591 100644 >--- a/installer/data/mysql/userpermissions.sql >+++ b/installer/data/mysql/userpermissions.sql >@@ -65,6 +65,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (11, 'edi_manage', 'Manage EDIFACT transmissions'), > (11, 'reopen_closed_invoices', 'Reopen closed invoices'), > (11, 'edit_invoices', 'Edit invoices'), >+ (11, 'delete_invoices', 'Delete invoices'), > (12, 'suggestions_manage', 'Manage purchase suggestions'), > (13, 'edit_news', 'Write news for the OPAC and staff interfaces'), > (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 881d4fa9f29..2e8f81cb8b8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -677,6 +677,11 @@ > Edit invoices > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'delete_invoices' -%] >+ <span class="sub_permission delete_invoices_subpermission"> >+ Delete invoices >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%# self_check %] > [%- CASE 'self_checkin_module' -%] > <span class="sub_permission self_checkin_module_subpermission"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >index 6704fb1f25a..d58a40593fb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >@@ -90,7 +90,7 @@ > [% END %] > [% END %] > [% UNLESS invoice.receivedbiblios || invoice.receiveditems %] >- [% IF CAN_user_acquisition_edit_invoices %] >+ [% IF CAN_user_acquisition_delete_invoices %] > <li><a href="invoice.pl?op=delete&invoiceid=[% invoice.invoiceid | uri %]&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> > [% END %] > [% END %] >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24157
:
96274
|
96275
|
96276
|
96277
|
96278
|
98651
|
98652
|
98653
|
98654
|
98655
|
100283
|
100284
|
100285
|
100286
|
100287
|
100288
|
107132
|
107133
|
107134
|
107135
|
107136
|
107137
|
107138
|
107139
|
107309
|
107346
|
107347
|
107348
|
107349
|
107350
|
107351
|
107352
|
107353
|
107354