summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2011-11-11 03:13:07 +0000
committermark <mark>2011-11-11 03:13:07 +0000
commit1cc2f252d504829e7aa4394a4c788e6e6fc03756 (patch)
treeb1e9f19a83de45925c98947a87643882f1f3763f
parent7d964ae317fc7405a9428f3e06dbdd5dcdecf07f (diff)
improve svc_broadband "manage device" link, #14696
-rw-r--r--FS/FS/Conf.pm19
-rw-r--r--httemplate/elements/tr-cust_svc.html31
-rwxr-xr-xhttemplate/view/cust_main/packages/section.html4
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">(&nbsp;<%
+ <FONT SIZE="-2">(&nbsp;<%
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') ) {
@@ -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'),