Bugzilla – Attachment 16606 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]
Kyle M Hall <kyle@bywatersolutions.com>
Bug-9448---Add-separate-permission-for-writing-off.patch (text/plain), 15.49 KB, created by
Brendan Gallagher
on 2013-03-21 11:25:24 UTC
(
hide
)
Description:
Kyle M Hall <kyle@bywatersolutions.com>
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2013-03-21 11:25:24 UTC
Size:
15.49 KB
patch
obsolete
>From 50f5935d82486fe9205c7cb2c2ce85b96372f72f Mon Sep 17 00:00:00 2001 >From: Brendan <info@bywatersolutions.com> >Date: Thu, 21 Mar 2013 04:18:50 -0700 >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 dc281a9..690f2be 100644 >--- a/installer/data/mysql/de-DE/mandatory/userpermissions.sql >+++ b/installer/data/mysql/de-DE/mandatory/userpermissions.sql >@@ -9,6 +9,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 124e030..09ad86a 100644 >--- a/installer/data/mysql/en/mandatory/userpermissions.sql >+++ b/installer/data/mysql/en/mandatory/userpermissions.sql >@@ -9,6 +9,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 f731eab..ae55d3b 100644 >--- a/installer/data/mysql/es-ES/mandatory/userpermissions.sql >+++ b/installer/data/mysql/es-ES/mandatory/userpermissions.sql >@@ -9,6 +9,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 8edc356..a8a4398 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >+++ b/installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql >@@ -9,6 +9,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 96746cc..4df74a9 100644 >--- a/installer/data/mysql/it-IT/necessari/userpermissions.sql >+++ b/installer/data/mysql/it-IT/necessari/userpermissions.sql >@@ -11,6 +11,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 ba56e3a..d4fffee 100644 >--- a/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql >+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/userpermissions.sql >@@ -29,6 +29,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 5659aba..df2a307 100644 >--- a/installer/data/mysql/pl-PL/mandatory/userpermissions.sql >+++ b/installer/data/mysql/pl-PL/mandatory/userpermissions.sql >@@ -9,6 +9,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 a7123ba..4a09ddc 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 >@@ -34,6 +34,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 366764c..e16ce03 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 >@@ -34,6 +34,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 222428d..83320d6 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6655,6 +6655,14 @@ if ( C4::Context->preference("Version") < TransformToNum($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 e575df8..a228292 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -76,7 +76,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 %]" /> >@@ -110,7 +110,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 4b918ae..702c8f7 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -43,12 +43,13 @@ use C4::Members::Attributes qw(GetBorrowerAttributes); > > our $input = CGI->new; > >+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