projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1c38324
)
self-service view usage customization and CDR display fixes, RT11761
author
levinse
<levinse>
Thu, 5 May 2011 06:54:11 +0000
(06:54 +0000)
committer
levinse
<levinse>
Thu, 5 May 2011 06:54:11 +0000
(06:54 +0000)
FS/FS/ClientAPI/MyAccount.pm
patch
|
blob
|
history
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/cdr.pm
patch
|
blob
|
history
fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
patch
|
blob
|
history
fs_selfservice/FS-SelfService/cgi/view_usage.html
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
33143e2
..
fa0bbb8
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-1090,6
+1090,7
@@
sub list_svcs {
'svcnum' => $session->{'svcnum'},
'custnum' => $custnum,
'date_format' => $conf->config('date_format') || '%m/%d/%Y',
'svcnum' => $session->{'svcnum'},
'custnum' => $custnum,
'date_format' => $conf->config('date_format') || '%m/%d/%Y',
+ 'view_usage_nodomain' => $conf->exists('selfservice-view_usage_nodomain'),
'svcs' => [
map {
my $svc_x = $_->svc_x;
'svcs' => [
map {
my $svc_x = $_->svc_x;
@@
-1195,8
+1196,8
@@
sub list_support_usage {
sub _list_cdr_usage {
my($svc_phone, $begin, $end) = @_;
sub _list_cdr_usage {
my($svc_phone, $begin, $end) = @_;
- map [ $_->downstream_csv('format' => 'default') ], #XXX config for format
- $svc_phone->get_cdrs( 'begin'=>$begin, 'end'=>$end, );
+ map [ $_->downstream_csv('format' => 'default'
, 'keeparray' => 1
) ], #XXX config for format
+
$svc_phone->get_cdrs( 'begin'=>$begin, 'end'=>$end, );
}
sub list_cdr_usage {
}
sub list_cdr_usage {
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
92f2d9f
..
785b74a
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-3867,6
+3867,13
@@
and customer address. Include units.',
'type' => 'image',
'per_agent' => 1,
},
'type' => 'image',
'per_agent' => 1,
},
+
+ {
+ 'key' => 'selfservice-view_usage_nodomain',
+ 'section' => 'self-service',
+ 'description' => 'Show usernames without their domains in "View my usage" in the self-service interface.',
+ 'type' => 'checkbox',
+ },
{
'key' => 'selfservice-bulk_format',
{
'key' => 'selfservice-bulk_format',
diff --git
a/FS/FS/cdr.pm
b/FS/FS/cdr.pm
index
3157b6b
..
0107659
100644
(file)
--- a/
FS/FS/cdr.pm
+++ b/
FS/FS/cdr.pm
@@
-560,11
+560,11
@@
sub export_formats {
my $duration_sub = sub {
my($cdr, %opt) = @_;
my $sec = $opt{seconds} || $cdr->billsec;
my $duration_sub = sub {
my($cdr, %opt) = @_;
my $sec = $opt{seconds} || $cdr->billsec;
- if (
length($opt{granularity})
&&
+ if (
defined $opt{granularity}
&&
$opt{granularity} == 0 ) { #per call
return '1 call';
}
$opt{granularity} == 0 ) { #per call
return '1 call';
}
- elsif ( $opt{granularity} == 60 ) {#full minutes
+ elsif (
defined $opt{granularity} &&
$opt{granularity} == 60 ) {#full minutes
my $min = int($sec/60);
$min++ if $sec%60;
return $min.'m';
my $min = int($sec/60);
$min++ if $sec%60;
return $min.'m';
@@
-620,7
+620,10
@@
sub export_formats {
$duration_sub,
#PRICE
$duration_sub,
#PRICE
- sub { my($cdr, %opt) = @_; $opt{money_char}. $opt{charge}; },
+ sub { my($cdr, %opt) = @_;
+ $opt{charge} = '0.00' unless defined $opt{charge};
+ $opt{money_char}.$opt{charge};
+ },
],
);
],
);
@@
-660,6
+663,8
@@
sub downstream_csv {
}
@{ $formats{$format} };
}
@{ $formats{$format} };
+ return @columns if defined $opt{'keeparray'};
+
my $status = $csv->combine(@columns);
die "FS::CDR: error combining ". $csv->error_input(). "into downstream CSV"
unless $status;
my $status = $csv->combine(@columns);
die "FS::CDR: error combining ". $csv->error_input(). "into downstream CSV"
unless $status;
diff --git
a/fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
b/fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
index
6d4d847
..
620fa22
100644
(file)
--- a/
fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
+++ b/
fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
@@
-50,5
+50,4
@@
</TABLE>
<BR>
</TABLE>
<BR>
-</TD></TR></TABLE>
<%= include('footer') %>
<%= include('footer') %>
diff --git
a/fs_selfservice/FS-SelfService/cgi/view_usage.html
b/fs_selfservice/FS-SelfService/cgi/view_usage.html
index
170237a
..
fd5426a
100644
(file)
--- a/
fs_selfservice/FS-SelfService/cgi/view_usage.html
+++ b/
fs_selfservice/FS-SelfService/cgi/view_usage.html
@@
-27,8
+27,10
@@
<%= foreach my $svc ( @svc_acct ) {
my $link = "${url}view_usage_details;".
"svcnum=$svc->{'svcnum'};beginning=0;ending=0";
<%= foreach my $svc ( @svc_acct ) {
my $link = "${url}view_usage_details;".
"svcnum=$svc->{'svcnum'};beginning=0;ending=0";
+ my $username = $svc->{'value'};
+ $username =~ s/@.*?$//g if $view_usage_nodomain;
$OUT .= '<TR><TD>';
$OUT .= '<TR><TD>';
- $OUT .= qq!<A HREF="$link">!. $svc->{'label'}. ': '. $
svc->{'value'}
.'</A>';
+ $OUT .= qq!<A HREF="$link">!. $svc->{'label'}. ': '. $
username
.'</A>';
$OUT .= '</TD><TD ALIGN="right">';
$OUT .= $svc->{'seconds'};
$OUT .= '</TD><TD ALIGN="right">';
$OUT .= '</TD><TD ALIGN="right">';
$OUT .= $svc->{'seconds'};
$OUT .= '</TD><TD ALIGN="right">';