From 3a7f3a2e81cc7423ba9a08fd4b28b3b5f4f227a2 Mon Sep 17 00:00:00 2001 From: "C.J. Adams-Collier" Date: Fri, 26 Sep 2014 12:00:43 -0700 Subject: [PATCH] FS RT #30363 - Hide Account usage template output in an HTML comment when $hide_usage is true --- FS/FS/ClientAPI/MyAccount.pm | 3 ++- fs_selfservice/FS-SelfService/cgi/view_usage.html | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 86e4b8946..bcfe35c2a 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -398,11 +398,12 @@ sub access_info { $info->{'timeout'} = $conf->config('selfservice-timeout') || 3600; + $info->{'hide_usage'} = $conf->exists('selfservice_hide-usage'); + return { %$info, 'custnum' => $custnum, 'access_pkgnum' => $session->{'pkgnum'}, 'access_svcnum' => $session->{'svcnum'}, - 'hide_usage' => $conf->exists('selfservice_hide-usage'), }; } diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html index f50f77078..c43f7d3da 100644 --- a/fs_selfservice/FS-SelfService/cgi/view_usage.html +++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html @@ -18,6 +18,8 @@ ''; %> <%= include('header', 'Account usage') %> +<%= if( $hide_usage ){ $OUT .= '<' . '!--' } %> + <%= if ( $error ) { $OUT .= qq!$error

!; @@ -216,4 +218,6 @@ foreach my $svc_port ( @svc_port ) { +<%= if( $hide_usage ){ $OUT .= '--'. '>' } %> <%= include('footer') %> + -- 2.11.0