[freeside-commits] branch master updated. afe6bb2515f2bde29a74c056221fd154dc10001f

Christopher Burger burgerc at 420.am
Mon May 1 12:11:08 PDT 2017


The branch, master has been updated
       via  afe6bb2515f2bde29a74c056221fd154dc10001f (commit)
      from  512dd310b4095d5163913acaeb9a6df34d882f6f (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 afe6bb2515f2bde29a74c056221fd154dc10001f
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon May 1 15:09:18 2017 -0400

    RT#73993 - updated selfservice and ngselfservice to allow for the control of changes packages by agent.

diff --git a/FS/FS/ClientAPI/MasonComponent.pm b/FS/FS/ClientAPI/MasonComponent.pm
index 3a4bfe1..d09d6da 100644
--- a/FS/FS/ClientAPI/MasonComponent.pm
+++ b/FS/FS/ClientAPI/MasonComponent.pm
@@ -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} ) {
 
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 714190a..a53fedb 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4821,6 +4821,7 @@ and customer address. Include units.',
                        'Change billing address',
                        'Change service address',
                        'Change payment information',
+                       'Change packages',
                        'Change password(s)',
                        'Logout',
                      ],
diff --git a/ng_selfservice/elements/error.php b/ng_selfservice/elements/error.php
index 2cff74f..ee60c6e 100644
--- a/ng_selfservice/elements/error.php
+++ b/ng_selfservice/elements/error.php
@@ -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>
+<? } ?>
diff --git a/ng_selfservice/elements/menu.php b/ng_selfservice/elements/menu.php
index cb9d617..b68c8c1 100644
--- a/ng_selfservice/elements/menu.php
+++ b/ng_selfservice/elements/menu.php
@@ -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>';
     }
diff --git a/ng_selfservice/services.php b/ng_selfservice/services.php
index ce47e9e..25fbdde 100644
--- a/ng_selfservice/services.php
+++ b/ng_selfservice/services.php
@@ -17,6 +17,7 @@ extract($list_pkgs);
 ?>
 <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=1>
 <TR>
+  <TH ALIGN="LEFT"> </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 ?>  </TD>
     <? echo $td ?><? echo $pkg['pkg_label']; ?></TD>
     <? echo $td ?>
       <FONT COLOR="#<? echo $pkg['statuscolor'] ?>"><B>

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

Summary of changes:
 FS/FS/ClientAPI/MasonComponent.pm |    2 +-
 FS/FS/Conf.pm                     |    1 +
 ng_selfservice/elements/error.php |    5 +++--
 ng_selfservice/elements/menu.php  |   12 +++++++-----
 ng_selfservice/services.php       |    7 +++++++
 5 files changed, 19 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list