From: Mark Wells Date: Thu, 1 May 2014 00:32:38 +0000 (-0700) Subject: option to hide CDR price in selfservice, #27186 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=ab0ab909b5861b9ee60dd3b99d3afca4574bc780 option to hide CDR price in selfservice, #27186 --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index f21ff54c0..30cddd901 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -2121,6 +2121,7 @@ sub list_cdr_usage { sub _usage_details { my($callback, $p, %opt) = @_; + my $conf = FS::Conf->new; my($context, $session, $custnum) = _custoragent_session_custnum($p); return { 'error' => $session } if $context eq 'error'; @@ -2139,7 +2140,6 @@ sub _usage_details { my %callback_opt; my $header = []; if ( $svcdb eq 'svc_phone' ) { - my $conf = FS::Conf->new; my $format = ''; if ( $p->{inbound} ) { $format = $cust_pkg->part_pkg->option('selfservice_inbound_format') @@ -2173,6 +2173,14 @@ sub _usage_details { %callback_opt ); + if ( $conf->exists('selfservice-hide_cdr_price') ) { + # ugly kludge, I know + my ($delete_col) = grep { $header->[$_] eq 'Price' } (0..scalar(@$header)); + if (defined $delete_col) { + delete($_->[$delete_col]) foreach ($header, @usage); + } + } + #kinda false laziness with FS::cust_main::bill, but perhaps #we should really change this bit to DateTime and DateTime::Duration # diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 5663c1939..0a29b7e20 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -5581,6 +5581,13 @@ and customer address. Include units.', }, { + 'key' => 'selfservice-hide_cdr_price', + 'section' => 'self-service', + 'description' => 'Don\'t show the "Price" column on CDRs in self-service.', + 'type' => 'checkbox', + }, + + { 'key' => 'logout-timeout', 'section' => 'UI', 'description' => 'If set, automatically log users out of the backoffice after this many minutes.',