[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 7bef15b442c2dbc34b7e30ee4a8f9fe753bd456d

Ivan ivan at 420.am
Wed May 2 15:47:53 PDT 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  7bef15b442c2dbc34b7e30ee4a8f9fe753bd456d (commit)
       via  38e073b041ca806372226c0fface8142857e0415 (commit)
      from  fd27bcec7ff4b225b13951494607c6877df69b24 (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 7bef15b442c2dbc34b7e30ee4a8f9fe753bd456d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 2 15:47:52 2012 -0700

    fix ACL upgrade, RT#17056

diff --git a/FS/FS/AccessRight.pm b/FS/FS/AccessRight.pm
index a39fb37..a11ad7f 100644
--- a/FS/FS/AccessRight.pm
+++ b/FS/FS/AccessRight.pm
@@ -288,7 +288,6 @@ tie my %rights, 'Tie::IxHash',
     'Usage: Call Detail Records (CDRs)',
     'Usage: Unrateable CDRs',
     'Usage: Time worked',
-    'Usage: Time worked summary',
 
     #{ rightname => 'List customers of all agents', global=>1 },
   ],
diff --git a/FS/FS/access_right.pm b/FS/FS/access_right.pm
index 719577f..fc01746 100644
--- a/FS/FS/access_right.pm
+++ b/FS/FS/access_right.pm
@@ -183,9 +183,28 @@ sub _upgrade_data { # class method
   my @all_groups = qsearch('access_group', {});
 
   my %onetime = (
-    'List customers' => 'List all customers',
-    'List packages'  => 'Summarize packages',
-    'Post payment'   => 'Backdate payment',
+    'List customers'   => 'List all customers',
+    'List packages'    => 'Summarize packages',
+    'Post payment'     => 'Backdate payment',
+    'List services'    => [ 'Services: Accounts',
+                            'Services: Domains',
+                            'Services: Certificates',
+                            'Services: Mail forwards',
+                            'Services: Virtual hosting services',
+                            'Services: Wireless broadband services',
+                            'Services: DSLs',
+                            'Services: Dish services',
+                            'Services: Hardware',
+                            'Services: Phone numbers',
+                            'Services: PBXs',
+                            'Services: Ports',
+                            'Services: Mailing lists',
+                            'Services: External services',
+                          ],
+    'List rating data' => [ 'Usage: RADIUS sessions',
+                            'Usage: Call Detail Records (CDRs)',
+                            'Usage: Unrateable CDRs',
+                          ],
   );
 
   foreach my $old_acl ( keys %onetime ) {
@@ -196,20 +215,20 @@ sub _upgrade_data { # class method
 
     foreach my $new_acl ( @new_acl ) {
 
-      ( my $journal = 'ACL_'.lc($new_acl) ) =~ s/ /_/g;
+      ( my $journal = 'ACL_'.lc($new_acl) ) =~ s/\W/_/g;
       next if FS::upgrade_journal->is_done($journal);
 
       # grant $new_acl to all groups who have $old_acl
       for my $group (@all_groups) {
-        if ( $group->access_right($old_acl) ) {
-          my $access_right = FS::access_right->new( {
-              'righttype'   => 'FS::access_group',
-              'rightobjnum' => $group->groupnum,
-              'rightname'   => $new_acl,
-          } );
-          my $error = $access_right->insert;
-          die $error if $error;
-        }
+        next unless $group->access_right($old_acl);
+        next if     $group->access_right($new_acl);
+        my $access_right = FS::access_right->new( {
+            'righttype'   => 'FS::access_group',
+            'rightobjnum' => $group->groupnum,
+            'rightname'   => $new_acl,
+        } );
+        my $error = $access_right->insert;
+        die $error if $error;
       }
     
       FS::upgrade_journal->set_done($journal);
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 7848047..c3faf4c 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -254,15 +254,17 @@ tie my %report_inventory, 'Tie::IxHash',
   'Inventory activity' => [ $fsurl.'search/report_h_inventory_item.html', '' ],
 ;
 
-my @report_rating = ();
-push(@report_rating, 'RADIUS sessions' => [ $fsurl.'search/sqlradius.html', '' ]) if $curuser->access_right("Usage: RADIUS sessions");
-push(@report_rating, 'Call Detail Records (CDRs)' => [ $fsurl.'search/report_cdr.html', '' ]) if $curuser->access_right("Usage: Call Detail Records (CDRs)");
-push(@report_rating, 'Unrateable CDRs' => [ $fsurl.'search/cdr.html?freesidestatus=failed'.
-    ';cdrbatchnum=_ALL_' ]) if $curuser->access_right("Usage: Unrateable CDRs");
-push(@report_rating, 'Time worked' => [ $fsurl.'search/report_rt_transaction.html', '' ]) if $curuser->access_right("Usage: Time worked");
-push(@report_rating, 'Time worked summary' => [ $fsurl.'search/report_rt_ticket.html', '' ]) if $curuser->access_right("Usage: Time worked summary");
-
-tie my %report_rating, 'Tie::IxHash', @report_rating;
+tie my %report_rating, 'Tie::IxHash';
+$report_rating{'RADIUS sessions'} = [ $fsurl.'search/sqlradius.html', '' ]
+  if $curuser->access_right("Usage: RADIUS sessions");
+$report_rating{'Call Detail Records (CDRs)'} = [ $fsurl.'search/report_cdr.html', '' ]
+  if $curuser->access_right("Usage: Call Detail Records (CDRs)");
+$report_rating{'Unrateable CDRs'} = [ $fsurl.'search/cdr.html?freesidestatus=failed;cdrbatchnum=_ALL_' ]
+  if $curuser->access_right("Usage: Unrateable CDRs");
+if ( $curuser->access_right("Usage: Time worked") ) {
+  $report_rating{'Time worked'} = [ $fsurl.'search/report_rt_transaction.html', '' ];
+  $report_rating{'Time worked summary'} = [ $fsurl.'search/report_rt_ticket.html', '' ];
+}
 
 tie my %report_ticketing_statistics, 'Tie::IxHash',
   'Tickets per day per Queue'         => [ $fsurl.'rt/RTx/Statistics/CallsQueueDay', 'View the number of tickets created, resolved or deleted in a specific Queue, over the requested period of days' ],

commit 38e073b041ca806372226c0fface8142857e0415
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 2 15:45:50 2012 -0700

    fix wireless broadband ACL on upgrade, RT#17056

diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 3074932..cc960dd 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -91,9 +91,9 @@ points to.  You can ask the object for a copy with the I<hash> method.
 
 sub table_info {
   {
-    'name' => 'Broadband',
-    'name_plural' => 'Broadband services',
-    'longname_plural' => 'Fixed (username-less) broadband services',
+    'name' => 'Wireless broadband',
+    'name_plural' => 'Wireless broadband services',
+    'longname_plural' => 'Fixed wireless broadband services',
     'display_weight' => 50,
     'cancel_weight'  => 70,
     'ip_field' => 'ip_addr',

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

Summary of changes:
 FS/FS/AccessRight.pm          |    1 -
 FS/FS/access_right.pm         |   45 +++++++++++++++++++++++++++++-----------
 FS/FS/svc_broadband.pm        |    6 ++--
 httemplate/elements/menu.html |   20 ++++++++++--------
 4 files changed, 46 insertions(+), 26 deletions(-)




More information about the freeside-commits mailing list