improve svc_broadband "manage device" link, #14696
authormark <mark>
Fri, 11 Nov 2011 03:13:16 +0000 (03:13 +0000)
committermark <mark>
Fri, 11 Nov 2011 03:13:16 +0000 (03:13 +0000)
FS/FS/Conf.pm
httemplate/elements/tr-cust_svc.html
httemplate/view/cust_main/packages/section.html

index 8d26e91..e49174b 100644 (file)
@@ -4275,6 +4275,25 @@ and customer address. Include units.',
     'type'        => 'text',
   },
 
     'type'        => 'text',
   },
 
+  {
+    'key'         => 'svc_broadband-manage_link_text',
+    'section'     => 'UI',
+    'description' => 'Label for "Manage Device" link',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'svc_broadband-manage_link_loc',
+    'section'     => 'UI',
+    'description' => 'Location for "Manage Device" link',
+    'type'        => 'select',
+    'select_hash' => [
+      'bottom' => 'Near Unprovision link',
+      'right'  => 'With export-related links',
+    ],
+  },
+
+
   #more fine-grained, service def-level control could be useful eventually?
   {
     'key'         => 'svc_broadband-allow_null_ip_addr',
   #more fine-grained, service def-level control could be useful eventually?
   {
     'key'         => 'svc_broadband-allow_null_ip_addr',
index dd81ce5..8bd7712 100644 (file)
@@ -12,7 +12,9 @@ Usage:
                 'cust_pkg' => $cust_pkg,
                 #optional
                 'cust_pkg-display_times'    => '', #bool
                 'cust_pkg' => $cust_pkg,
                 #optional
                 'cust_pkg-display_times'    => '', #bool
-                'svc_broadband-manage_link' => '',
+                'manage_link'               => '', #for svc_broadband
+                'manage_link_text'          => '', #default 'Manage Device'
+                'manage_link_loc'           => '', #default 'bottom', or 'right'
                 'maestro-status_test'       => '',
             )
   %>
                 'maestro-status_test'       => '',
             )
   %>
@@ -25,7 +27,11 @@ FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
   <TD STYLE="padding-bottom:0px"><B><%
 FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
 %></B></TD>
   <TD STYLE="padding-bottom:0px"><B><%
 FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
 %></B></TD>
-<TD><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %></TD>
+<TD ALIGN="right"><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %>
+%   if ( $manage_link and $opt{'manage_link_loc'} eq 'right' ) {
+      <A HREF="<% $manage_link %>"><% $opt{'manage_link_text'} |h %></A>
+% }
+</TD>
 </TR>
 % if ( $cust_svc->overlimit ) {
 <TR>
 </TR>
 % if ( $cust_svc->overlimit ) {
 <TR>
@@ -55,16 +61,12 @@ $cust_svc->overlimit )
 % # second column: all other action links
   <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
 % if ( $part_svc->svcdb eq 'svc_broadband' ) {
 % # second column: all other action links
   <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
 % if ( $part_svc->svcdb eq 'svc_broadband' ) {
-    <FONT SIZE="-1" STYLE="float:left">(&nbsp;<%
+    <FONT SIZE="-2">(&nbsp;<%
       include('/elements/popup_link-ping.html',
               'ip' => $svc_x->ip_addr
       ) %>&nbsp;)</FONT>
       include('/elements/popup_link-ping.html',
               'ip' => $svc_x->ip_addr
       ) %>&nbsp;)</FONT>
-%   my $manage_link = $opt{'svc_broadband-manage_link'};
-%   if ( $manage_link ) {
-%     my $ip_addr = $svc_x->ip_addr; #substitution for $manage_link
-      <FONT SIZE="-1" STYLE="float:left">(&nbsp;<A HREF="<% 
-        eval(qq("$manage_link")) 
-      %>"><% mt('Manage Device') |h %></A>&nbsp;)</FONT>
+%   if ( $manage_link and $opt{'manage_link_loc'} eq 'bottom' ) {
+      <FONT SIZE="-2">(&nbsp;<A HREF="<% $manage_link %>"><% $opt{'manage_link_text'} |h %></A>&nbsp;)</FONT>
 %   }
 % } #svc_broadband
 % if ( $curuser->access_right('Unprovision customer service') ) {
 %   }
 % } #svc_broadband
 % if ( $curuser->access_right('Unprovision customer service') ) {
@@ -91,4 +93,15 @@ my $svc_unprovision_link =
   $cust_svc->svcnum .
   qq!', '!.emt('Permanently unprovision and delete this service?').qq!')">!.emt('Unprovision').'</A>';
 
   $cust_svc->svcnum .
   qq!', '!.emt('Permanently unprovision and delete this service?').qq!')">!.emt('Unprovision').'</A>';
 
+my $manage_link = $opt{'manage_link'};
+if ( $part_svc->svcdb eq 'svc_broadband' and $manage_link ) {
+  my $ip_addr = $svc_x->ip_addr; #substitution for $manage_link
+  $manage_link = eval(qq("$manage_link"));
+  $opt{'manage_link_text'} ||= mt('Manage Device');
+  $opt{'manage_link_loc'}  ||= 'bottom';
+}
+else {
+  $manage_link = '';
+}
+
 </%init>
 </%init>
index 4ac2e77..638e88c 100755 (executable)
@@ -83,7 +83,9 @@ my %conf_opt = (
   #for services.html
   'svc_external-skip_manual'  => $conf->exists('svc_external-skip_manual'),
   'legacy_link'               => $conf->exists('legacy_link'),
   #for services.html
   'svc_external-skip_manual'  => $conf->exists('svc_external-skip_manual'),
   'legacy_link'               => $conf->exists('legacy_link'),
-  'svc_broadband-manage_link' => scalar($conf->config('svc_broadband-manage_link')),
+  'manage_link'               => scalar($conf->config('svc_broadband-manage_link')),
+  'manage_link_text'          => scalar($conf->config('svc_broadband-manage_link_text')),
+  'manage_link_loc'           => scalar($conf->config('svc_broadband-manage_link_loc')),
   'maestro-status_test'       => $conf->exists('maestro-status_test'),
   'cust_pkg-large_pkg_size'   => $conf->config('cust_pkg-large_pkg_size'),
 
   'maestro-status_test'       => $conf->exists('maestro-status_test'),
   'cust_pkg-large_pkg_size'   => $conf->config('cust_pkg-large_pkg_size'),