RT#73993 - updated selfservice and ngselfservice to allow for the control of changes...
authorChristopher Burger <burgerc@freeside.biz>
Mon, 1 May 2017 19:09:18 +0000 (15:09 -0400)
committerChristopher Burger <burgerc@freeside.biz>
Mon, 1 May 2017 19:09:18 +0000 (15:09 -0400)
FS/FS/ClientAPI/MasonComponent.pm
FS/FS/Conf.pm
ng_selfservice/elements/error.php
ng_selfservice/elements/menu.php
ng_selfservice/services.php

index 3a4bfe1..d09d6da 100644 (file)
@@ -145,7 +145,7 @@ sub mason_comp {
     return { 'error' => 'Illegal component' };
   }
 
-  my @args = $packet->{'args'} ? @{ $packet->{'args'} } : ();
+  my @args = $packet->{'args'} ? $packet->{'args'} : ();
 
   if ( $session_comps{$comp} ) {
 
index 714190a..a53fedb 100644 (file)
@@ -4821,6 +4821,7 @@ and customer address. Include units.',
                        'Change billing address',
                        'Change service address',
                        'Change payment information',
+                       'Change packages',
                        'Change password(s)',
                        'Logout',
                      ],
index 2cff74f..ee60c6e 100644 (file)
@@ -1,2 +1,3 @@
-<FONT SIZE="+1" COLOR="#ff0000"><? echo htmlspecialchars($error); ?><? if ($error) { echo '<BR><BR>'; } ?></FONT>
-
+<? if (isset($error)) { ?>
+       <FONT SIZE="+1" COLOR="#ff0000"><? echo htmlspecialchars($error); echo '<BR><BR>'; ?></FONT>
+<? } ?>
index cb9d617..b68c8c1 100644 (file)
@@ -32,15 +32,15 @@ extract($skin_info);
 
   foreach ($menu_array AS $menu_item) {
     if ( preg_match('/^\s*$/', $menu_item) ) {
-      print_menu($submenu, $current_menu);
+      print_menu($submenu, $current_menu, $menu_disable);
       $submenu = array();
     } else {
       $submenu[] = $menu_item;
     }
   }
-  print_menu($submenu, $current_menu);
+  print_menu($submenu, $current_menu, $menu_disable);
 
-  function print_menu($submenu_array, $current_menu) {
+  function print_menu($submenu_array, $current_menu, $menu_disable) {
     if ( count($submenu_array) == 0 ) { return; }
 
     $links = array();
@@ -71,8 +71,10 @@ extract($skin_info);
       echo '<ul>';
       foreach ($links AS $link) {
         $label = array_shift($labels);
-        print_link($link, $label, $current_menu, array($link) );
-        echo '</a></li>';
+        if ( in_array($label, $menu_disable) == 0) {
+          print_link($link, $label, $current_menu, array($link) );
+          echo '</a></li>';
+        }
       }
       echo '</ul>';
     }
index ce47e9e..25fbdde 100644 (file)
@@ -17,6 +17,7 @@ extract($list_pkgs);
 ?>
 <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=1>
 <TR>
+  <TH ALIGN="LEFT">&nbsp;</TH>
   <TH ALIGN="LEFT">Product</TH>
   <TH ALIGN="LEFT">Status</TH>
   <TH ALIGN="LEFT" COLSPAN=2>Service(s)</TH>
@@ -29,11 +30,17 @@ extract($list_pkgs);
     $rowspan = count($pkg['cust_svc']);
     if ( $rowspan == 0 ) { $rowspan = 1; }
     $td = '<TD ALIGN="LEFT" VALIGN="top" ROWSPAN="'. $rowspan. '">';
+
+    $change_link = '';
+    if ( in_array("Change packages", $menu_disable) == 0) {
+      $change_link = '<a href="packages_change.php?pkgnum=' . $pkg['pkgnum'] . '&pkg=' . $pkg['pkg_label'] . '">[change]</a>';
+    }
 ?>
   <TR>
     <TD COLSPAN=4 STYLE="border-top:1px solid #999999"></TD>
   </TR>
   <TR>
+    <? echo $td ?><? echo $change_link ?>&nbsp;&nbsp;</TD>
     <? echo $td ?><? echo $pkg['pkg_label']; ?></TD>
     <? echo $td ?>
       <FONT COLOR="#<? echo $pkg['statuscolor'] ?>"><B>