Bugzilla – Attachment 14757 Details for
Bug 9448
Add separate permission for writing off fees
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9448 - Add separate permission for writing off fees
Bug-9448---Add-separate-permission-for-writing-off.patch (text/plain), 15.44 KB, created by
Kyle M Hall (khall)
on 2013-01-22 18:57:31 UTC
(
hide
)
Description:
Bug 9448 - Add separate permission for writing off fees
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-01-22 18:57:31 UTC
Size:
15.44 KB
patch
obsolete
>From d0db1862469d06a9f08c6c5e4320e924d6eaa7ac Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 22 Jan 2013 13:54:38 -0500 >Subject: [PATCH] Bug 9448 - Add separate permission for writing off fees > >Adds new sub-permissions to updatecharges, 'writeoff' for writing off fees >and 'remaining_permissions' for all other fee related activites. > >Test plan: >1) Apply patch >2) Run updatedatabase.pl >3) Remove the 'writeoff' permission from your privileges >4) Attempt to write off a fee, you should not be able to >5) Re-add the 'writeoff' permission >6) Attempt to write off a fee, you should now be able to do so >--- > .../data/mysql/de-DE/mandatory/userpermissions.sql | 2 ++ > .../data/mysql/en/mandatory/userpermissions.sql | 2 ++ > .../data/mysql/es-ES/mandatory/userpermissions.sql | 2 ++ > .../mysql/fr-FR/1-Obligatoire/userpermissions.sql | 2 ++ > .../data/mysql/it-IT/necessari/userpermissions.sql | 2 ++ > .../mysql/nb-NO/1-Obligatorisk/userpermissions.sql | 2 ++ > .../data/mysql/pl-PL/mandatory/userpermissions.sql | 2 ++ > .../ru-RU/mandatory/permissions_and_user_flags.sql | 2 ++ > .../uk-UA/mandatory/permissions_and_user_flags.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > .../intranet-tmpl/prog/en/modules/members/pay.tt | 4 ++-- > members/boraccount.pl | 2 +- > members/mancredit.pl | 2 +- > members/maninvoice.pl | 2 +- > members/pay.pl | 3 ++- > members/paycollect.pl | 3 ++- > members/printfeercpt.pl | 2 +- > members/printinvoice.pl | 2 +- > 18 files changed, 37 insertions(+), 9 deletions(-) > >diff --git a/installer/data/mysql/de-DE/mandatory/userpermissions.sql b/installer/data/mysql/de-DE/mandatory/userpermissions.sql >index ec5a22a..e298335 100644 >--- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql >+++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql >@@ -8,6 +8,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Katalogdaten bearbeiten (Titel- und Exemplardaten ändern)'), > ( 9, 'fast_cataloging', 'Schnellaufnahmen anlegen'), > ( 9, 'edit_items', 'Exemplare bearbeiten'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Lieferanten verwalten'), > (11, 'contracts_manage', 'Vereinbarungen verwalten'), > (11, 'period_manage', 'Etats verwalten'), >diff --git a/installer/data/mysql/en/mandatory/userpermissions.sql b/installer/data/mysql/en/mandatory/userpermissions.sql >index 070e8f5..bfa108e 100644 >--- a/installer/data/mysql/en/mandatory/userpermissions.sql >+++ b/installer/data/mysql/en/mandatory/userpermissions.sql >@@ -8,6 +8,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), > ( 9, 'fast_cataloging', 'Fast cataloging'), > ( 9, 'edit_items', 'Edit Items'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Manage vendors'), > (11, 'contracts_manage', 'Manage contracts'), > (11, 'period_manage', 'Manage periods'), >diff --git a/installer/data/mysql/es-ES/mandatory/userpermissions.sql b/installer/data/mysql/es-ES/mandatory/userpermissions.sql >index 070e8f5..bfa108e 100644 >--- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql >+++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql >@@ -8,6 +8,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), > ( 9, 'fast_cataloging', 'Fast cataloging'), > ( 9, 'edit_items', 'Edit Items'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Manage vendors'), > (11, 'contracts_manage', 'Manage contracts'), > (11, 'period_manage', 'Manage periods'), >diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >index 3147bed..b42b3de 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >+++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >@@ -8,6 +8,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Ajouter et modifier des notices au catalogue'), > ( 9, 'fast_cataloging', 'Catalogage rapide'), > ( 9, 'edit_items', 'Modifier des exemplaires'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (13, 'edit_news', 'Ecrire des nouvelles pour l''OPAC et l''interface professionnelle'), > (13, 'label_creator', 'Créer des étiquettes à partir des données du catalogues et des adhérents'), > (13, 'edit_calendar', 'Définir les jours de fermeture de la bibliothèque'), >diff --git a/installer/data/mysql/it-IT/necessari/userpermissions.sql b/installer/data/mysql/it-IT/necessari/userpermissions.sql >index cf5424e..78fe28b 100644 >--- a/installer/data/mysql/it-IT/necessari/userpermissions.sql >+++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql >@@ -10,6 +10,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'), > ( 9, 'fast_cataloging', 'Catalogazione veloce'), > ( 9, 'edit_items', 'Crea/modifica copie'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Crea/modifica fornitori'), > (11, 'contracts_manage', 'Crea/modifica contratti'), > (11, 'period_manage', 'Gestisci scadenze budgets'), >diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql >index 36c03f3..6692d60 100644 >--- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql >+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql >@@ -28,6 +28,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Endre katalogen (Endre bibliografiske poster og eksemplaropplysninger)'), > ( 9, 'fast_cataloging', 'Hurtigkatalogisering'), > ( 9, 'edit_items', 'Endre eksmeplarer'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Administrere leverandører'), > (11, 'contracts_manage', 'Administrere kontrakter'), > (11, 'period_manage', 'Administrere perioder'), >diff --git a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql >index 1165af1..d9b11c0 100644 >--- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql >+++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql >@@ -8,6 +8,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Edit catalogue'), > ( 9, 'fast_cataloging', 'Szybkie katalogowanie'), > ( 9, 'edit_items', 'Edit Items'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'ZarzÄdzanei dostawcami'), > (11, 'contracts_manage', 'ZarzÄdzanie kontraktami'), > (11, 'period_manage', 'Manage periods'), >diff --git a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql >index 00d6538..c346960 100644 >--- a/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql >+++ b/installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql >@@ -32,6 +32,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), > ( 9, 'fast_cataloging', 'Fast cataloging'), > ( 9, 'edit_items', 'Edit Items'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Manage vendors'), > (11, 'contracts_manage', 'Manage contracts'), > (11, 'period_manage', 'Manage periods'), >diff --git a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql >index 188a146..e1ec23f 100644 >--- a/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql >+++ b/installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql >@@ -32,6 +32,8 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), > ( 9, 'fast_cataloging', 'Fast cataloging'), > ( 9, 'edit_items', 'Edit Items'), >+ (10, 'writeoff', 'Write off charges'), >+ (10, 'remaining_permissions', 'Remaining updatecharges permissions'), > (11, 'vendors_manage', 'Manage vendors'), > (11, 'contracts_manage', 'Manage contracts'), > (11, 'period_manage', 'Manage periods'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 77265f4..9b5ff1b 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6339,6 +6339,14 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.11.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ('10', 'writeoff', 'Write off charges')"); >+ $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES ('10', 'remaining_permissions', 'Remaining updatecharges permissions')"); >+ print "Upgrade to $DBversion done (Bug 9448 - Add separate permission for writing off fees)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index 2780c3f..f536964 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -67,7 +67,7 @@ > <td> > [% IF ( line.amountoutstanding > 0 ) %] > <input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" /> >- <input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" /> >+ [% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />[% END %] > [% END %] > <input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" /> > <input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" /> >@@ -106,7 +106,7 @@ > </table> > <fieldset class="action"> > <input type="submit" name="paycollect" value="Pay amount" class="submit" /> >-<input type="submit" name="woall" id="woall" value="Write off all" class="submit" /> >+[% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall" id="woall" value="Write off all" class="submit" />[% END %] > <input type="submit" name="payselected" value="Pay selected" class="submit" /> > <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a> > </fieldset> >diff --git a/members/boraccount.pl b/members/boraccount.pl >index eebc8d3..a987035 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -42,7 +42,7 @@ my ($template, $loggedinuser, $cookie) > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {borrowers => 1, updatecharges => 1}, >+ flagsrequired => {borrowers => 1, updatecharges => 'remaining_permissions'}, > debug => 1, > }); > >diff --git a/members/mancredit.pl b/members/mancredit.pl >index 88200d0..2af4243 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -64,7 +64,7 @@ if ($add){ > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {borrowers => 1, updatecharges => 1}, >+ flagsrequired => {borrowers => 1, updatecharges => 'remaining_permissions'}, > debug => 1, > }); > >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index f1c572c..38eb347 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -82,7 +82,7 @@ if ($add){ > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {borrowers => 1, updatecharges => 1}, >+ flagsrequired => {borrowers => 1, updatecharges => 'remaining_permissions'}, > debug => 1, > }); > >diff --git a/members/pay.pl b/members/pay.pl >index 7580daf..4372efd 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -45,12 +45,13 @@ our $input = CGI->new; > our $writeoff_sth; > our $add_writeoff_sth; > >+my $updatecharges_permissions = $input->param('woall') ? 'writeoff' : 'remaining_permissions'; > our ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { template_name => 'members/pay.tmpl', > query => $input, > type => 'intranet', > authnotrequired => 0, >- flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ flagsrequired => { borrowers => 1, updatecharges => $updatecharges_permissions }, > debug => 1, > } > ); >diff --git a/members/paycollect.pl b/members/paycollect.pl >index d66702e..8ff6e81 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -30,12 +30,13 @@ use C4::Branch; > > my $input = CGI->new(); > >+my $updatecharges_permissions = $input->param('writeoff_individual') ? 'writeoff' : 'remaining_permissions'; > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { template_name => 'members/paycollect.tmpl', > query => $input, > type => 'intranet', > authnotrequired => 0, >- flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ flagsrequired => { borrowers => 1, updatecharges => $updatecharges_permissions }, > debug => 1, > } > ); >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 59d5cb3..e475451 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -41,7 +41,7 @@ my ($template, $loggedinuser, $cookie) > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {borrowers => 1, updatecharges => 1}, >+ flagsrequired => {borrowers => 1, updatecharges => 'remaining_permissions'}, > debug => 1, > }); > >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index 3e04fcc..a9ef6aa 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -41,7 +41,7 @@ my ($template, $loggedinuser, $cookie) > query => $input, > type => "intranet", > authnotrequired => 0, >- flagsrequired => {borrowers => 1, updatecharges => 1}, >+ flagsrequired => {borrowers => 1, updatecharges => 'remaining_permissions'}, > debug => 1, > }); > >-- >1.7.2.5
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 9448
:
14757
|
16606
|
21732
|
23515
|
23519
|
27235
|
27236
|
27237
|
27238
|
27239
|
27240