[freeside-commits] branch FREESIDE_2_3_BRANCH updated. a5e9d8372d96ef630beb17db3958163637dd73c6

Ivan ivan at 420.am
Sat Jan 19 18:35:50 PST 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  a5e9d8372d96ef630beb17db3958163637dd73c6 (commit)
      from  7858e5d1d31f2700f1deee1d861ffc3b297d05b0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a5e9d8372d96ef630beb17db3958163637dd73c6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Jan 19 18:35:47 2013 -0800

    add separate ACL for line item crediting, RT#18676

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index 90718b2..9bd3fd3 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -212,6 +212,7 @@ tie my %rights, 'Tie::IxHash',
   ###
   'Customer credit and refund rights' => [
     'Post credit',
+    'Credit line items', #NEWNEWNEW
     'Apply credit', #NEWNEW
     { rightname=>'Unapply credit', desc=>'Enable "unapplication" of unclosed credits.' }, #aka unapplycredits
     { rightname=>'Delete credit', desc=>'Enable deletion of unclosed credits. Be very careful!  Only delete credits that were data-entry errors, not adjustments.' }, #aka. deletecredits Optionally specify one or more comma-separated email addresses to be notified when a credit is deleted.
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index 648195d..32050a7 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -192,6 +192,7 @@ sub _upgrade_data { # class method
     'Cancel customer package immediately' => 'Un-cancel customer package',
     'Suspend customer package'            => 'Suspend customer',
     'Unsuspend customer package'          => 'Unsuspend customer',
+    'Post credit'                         => 'Credit line items',
 
     'List services'    => [ 'Services: Accounts',
                             'Services: Domains',
diff --git a/httemplate/edit/credit-cust_bill_pkg.html b/httemplate/edit/credit-cust_bill_pkg.html
index 3d1cf24..b53c277 100644
--- a/httemplate/edit/credit-cust_bill_pkg.html
+++ b/httemplate/edit/credit-cust_bill_pkg.html
@@ -244,7 +244,7 @@ function calc_total(what) {
 <%init>
 
 my $curuser = $FS::CurrentUser::CurrentUser;
-die "access denied" unless $curuser->access_right('Post credit');
+die "access denied" unless $curuser->access_right('Credit line items');
 
 #a tiny bit of false laziness w/search/cust_bill_pkg.cgi, but we're pretty
 # specialized and a piece of UI, not a report
diff --git a/httemplate/edit/process/credit-cust_bill_pkg.html b/httemplate/edit/process/credit-cust_bill_pkg.html
index cbcf619..8e66368 100644
--- a/httemplate/edit/process/credit-cust_bill_pkg.html
+++ b/httemplate/edit/process/credit-cust_bill_pkg.html
@@ -10,7 +10,7 @@
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
+  unless $FS::CurrentUser::CurrentUser->access_right('Credit line items');
 
 my @billpkgnum_setuprecurs =
   map { $_ =~ /^billpkgnum(\d+\-\w*)$/ or die 'gm#23'; $1; } 
diff --git a/httemplate/misc/xmlhttp-cust_bill_pkg-calculate_taxes.html b/httemplate/misc/xmlhttp-cust_bill_pkg-calculate_taxes.html
index 9935046..f618d55 100644
--- a/httemplate/misc/xmlhttp-cust_bill_pkg-calculate_taxes.html
+++ b/httemplate/misc/xmlhttp-cust_bill_pkg-calculate_taxes.html
@@ -2,7 +2,7 @@
 <%init>
 
 my $curuser = $FS::CurrentUser::CurrentUser;
-die "access denied" unless $curuser->access_right('Post credit');
+die "access denied" unless $curuser->access_right('Credit line items');
 
 my $DEBUG = 0;
 
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index 821309d..7cf47fa 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -34,7 +34,7 @@
   <A HREF="<% $p %>edit/cust_pay.cgi?payby=WEST;custnum=<% $custnum %>"><% mt('Enter Western Union payment') |h %></A>
 % } 
 
-<BR>
+<% $s ? '<BR>' : '' %>
 % $s=0;
 
 % if ( ( $payby{'CARD'} || $payby{'DCRD'} )
@@ -58,11 +58,13 @@
   <A HREF="<% $p %>edit/cust_pay.cgi?payby=MCRD;custnum=<% $custnum %>"><% mt('Post manual (offline/POS) credit card payment') |h %></A>
 % } 
 
-<BR>
+<% $s ? '<BR>' : '' %>
 
-%# credit link
+%# credit links
 
+% $s=0;
 % if ( $curuser->access_right('Post credit') ) { 
+  <% $s++ ? ' | ' : '' %>
   <& /elements/popup_link-cust_main.html,
                'label'       => emt('Enter credit'),
                'action'      => "${p}edit/cust_credit.cgi",
@@ -70,7 +72,9 @@
                'actionlabel' => emt('Enter credit'),
                'width'       => 616, #make room for reasons #540 default
   &>
-  |
+% }
+% if ( $curuser->access_right('Credit line items') ) { 
+  <% $s++ ? ' | ' : '' %>
   <& /elements/popup_link-cust_main.html,
                'label'       => emt('Credit line items'),
                #'action'      => "${p}search/cust_bill_pkg.cgi?nottax=1;type=select",
@@ -80,8 +84,8 @@
                'width'       => 968, #763,
                'height'      => 575,
   &>
-  <BR>
 % } 
+<% $s ? '<BR>' : '' %>
 
 %# refund links
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/AccessRight.pm                               |    1 +
 FS/FS/access_right.pm                              |    1 +
 httemplate/edit/credit-cust_bill_pkg.html          |    2 +-
 httemplate/edit/process/credit-cust_bill_pkg.html  |    2 +-
 .../xmlhttp-cust_bill_pkg-calculate_taxes.html     |    2 +-
 httemplate/view/cust_main/payment_history.html     |   14 +++++++++-----
 6 files changed, 14 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list