diff options
| author | mark <mark> | 2011-11-11 03:13:16 +0000 | 
|---|---|---|
| committer | mark <mark> | 2011-11-11 03:13:16 +0000 | 
| commit | 5157ebd894ad02c85bac66ed89313d0c0dea7aeb (patch) | |
| tree | ead9edb9d1cb4e9fd22856dde827095e48df14b9 | |
| parent | 7cc0bade6f2c58681a86f93f237978e8a5e3260b (diff) | |
improve svc_broadband "manage device" link, #14696
| -rw-r--r-- | FS/FS/Conf.pm | 19 | ||||
| -rw-r--r-- | httemplate/elements/tr-cust_svc.html | 31 | ||||
| -rwxr-xr-x | httemplate/view/cust_main/packages/section.html | 4 | 
3 files changed, 44 insertions, 10 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 8d26e91aa..e49174b20 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4275,6 +4275,25 @@ and customer address. Include units.',      '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', diff --git a/httemplate/elements/tr-cust_svc.html b/httemplate/elements/tr-cust_svc.html index dd81ce5e8..8bd77124d 100644 --- a/httemplate/elements/tr-cust_svc.html +++ b/httemplate/elements/tr-cust_svc.html @@ -12,7 +12,9 @@ Usage:                  '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'       => '',              )    %> @@ -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><% 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> @@ -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' ) { -    <FONT SIZE="-1" STYLE="float:left">( <% +    <FONT SIZE="-2">( <%        include('/elements/popup_link-ping.html',                'ip' => $svc_x->ip_addr        ) %> )</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">( <A HREF="<%  -        eval(qq("$manage_link"))  -      %>"><% mt('Manage Device') |h %></A> )</FONT> +%   if ( $manage_link and $opt{'manage_link_loc'} eq 'bottom' ) { +      <FONT SIZE="-2">( <A HREF="<% $manage_link %>"><% $opt{'manage_link_text'} |h %></A> )</FONT>  %   }  % } #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>'; +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> diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html index 4ac2e7779..638e88cab 100755 --- a/httemplate/view/cust_main/packages/section.html +++ b/httemplate/view/cust_main/packages/section.html @@ -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'), -  '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'),  | 
