[freeside-commits] branch master updated. 19045b18ba6413064a82c5453ac62125b3bb73f4

Ivan ivan at 420.am
Tue Feb 19 13:07:58 PST 2013


The branch, master has been updated
       via  19045b18ba6413064a82c5453ac62125b3bb73f4 (commit)
      from  d400497171a162ed270922097adc382ce537de51 (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 19045b18ba6413064a82c5453ac62125b3bb73f4
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Feb 19 13:07:54 2013 -0800

    config setting to disable menu entries in self-service, RT#14866

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 789e370..faf3778 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -121,6 +121,7 @@ sub skin_info {
             font title_color title_align title_size menu_bgcolor menu_fontsize
           )
       ),
+      'menu_disable' => [ $conf->config('selfservice-menu_disable',$agentnum) ],
       ( map { $_ => $conf->exists("selfservice-$_", $agentnum ) }
         qw( menu_skipblanks menu_skipheadings menu_nounderline no_logo )
       ),
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index af2fcf5..65da631 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4491,6 +4491,31 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'selfservice-menu_disable',
+    'section'     => 'self-service',
+    'description' => 'Disable the selected menu entries in the self-service menu',
+    'type'        => 'selectmultiple',
+    'select_enum' => [ #false laziness w/myaccount_menu.html
+                       'Overview',
+                       'Purchase',
+                       'Purchase additional package',
+                       'Recharge my account with a credit card',
+                       'Recharge my account with a check',
+                       'Recharge my account with a prepaid card',
+                       'View my usage',
+                       'Create a ticket',
+                       'Setup my services',
+                       'Change my information',
+                       'Change billing address',
+                       'Change service address',
+                       'Change payment information',
+                       'Change password(s)',
+                       'Logout',
+                     ],
+    'per_agent'   => 1,
+  },
+
+  {
     'key'         => 'selfservice-menu_skipblanks',
     'section'     => 'self-service',
     'description' => 'Skip blank (spacer) entries in the self-service menu',
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
index c7d2bb2..4a31b12 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
@@ -88,11 +88,13 @@ push @menu,
   { title=>'Logout',   url=>'logout', size=>'+1', },
 ;
 
+my %menu_disable = map { $_=>1 } @menu_disable;
 foreach my $item ( @menu ) {
 
-  next if $menu_skipblanks && $item->{'title'} =~ /^\s*$/;
-  next if $menu_skipheadings && ! $item->{'url'};
-
+  next if ( $menu_skipblanks && $item->{'title'} =~ /^\s*$/ )
+       || ( $menu_skipheadings && ! $item->{'url'} )
+       || $menu_disable{$item->{'title'}};
+  
   $OUT .= '<TR><TD'; 
   if ( $menu_body_image ) {
     if ( exists $item->{'url'} && $action eq $item->{'url'} ) {

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

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm                       |    1 +
 FS/FS/Conf.pm                                      |   25 ++++++++++++++++++++
 .../FS-SelfService/cgi/myaccount_menu.html         |    8 ++++--
 3 files changed, 31 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list