summaryrefslogtreecommitdiff
path: root/FS/FS/part_export/communigate_pro.pm
diff options
context:
space:
mode:
authorivan <ivan>2010-08-04 01:22:34 +0000
committerivan <ivan>2010-08-04 01:22:34 +0000
commit6dcc4e277f46157a3df6c5d0b7ebde0fb848bb0b (patch)
tree99603af66ca7b4bb1b7c0814d5117d9003758483 /FS/FS/part_export/communigate_pro.pm
parentf07fc98b146cdaa5861d766cc7c84ea0136f38ec (diff)
better serialization on debugging data, RT#7514
Diffstat (limited to 'FS/FS/part_export/communigate_pro.pm')
-rw-r--r--FS/FS/part_export/communigate_pro.pm28
1 files changed, 17 insertions, 11 deletions
diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm
index 76fd608..a3847bf 100644
--- a/FS/FS/part_export/communigate_pro.pm
+++ b/FS/FS/part_export/communigate_pro.pm
@@ -823,17 +823,7 @@ sub export_getsettings_svc_acct {
foreach my $key ( grep ref($effective_settings->{$_}),
keys %$effective_settings )
{
- my $value = $effective_settings->{$key};
- if ( ref($value) eq 'ARRAY' ) {
- $effective_settings->{$key} =
- join(' ', map { ref($_) ? '['.join(', ', @$_).']' : $_ } @$value );
- } elsif ( ref($value) eq 'HASH' ) {
- $effective_settings->{$key} =
- join(', ', map { "$_:".$value->{$_} } keys %$value );
- } else {
- #XXX
- warn "serializing ". ref($value). " for table display not yet handled";
- }
+ $effective_settings->{$key} = _pretty( $effective_settings->{$key} );
}
%{$settingsref} = %$effective_settings;
@@ -843,6 +833,22 @@ sub export_getsettings_svc_acct {
}
+sub _pretty {
+ my $value = shift;
+ if ( ref($value) eq 'ARRAY' ) {
+ '['. join(' ', map { ref($_) ? _pretty($_) : $_ } @$value ). ']';
+ } elsif ( ref($value) eq 'HASH' ) {
+ my $hv = $value->{$_};
+ join(', ', map { my $v = $value->{$_};
+ "$_:". ref($v) ? _pretty($v) : $_
+ }
+ keys %$value
+ );
+ } else {
+ warn "serializing ". ref($value). " for table display not yet handled";
+ }
+}
+
sub export_getsettings_svc_forward {
my($self, $svc_forward, $settingsref, $defaultref ) = @_;