[freeside-commits] freeside/fs_selfservice/FS-SelfService/SelfService XMLRPC.pm, 1.2, 1.3
Ivan,,,
ivan at wavetail.420.am
Sun Oct 30 19:33:30 PDT 2011
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/SelfService
In directory wavetail.420.am:/tmp/cvs-serv1038/fs_selfservice/FS-SelfService/SelfService
Modified Files:
XMLRPC.pm
Log Message:
fix fallout from fixing UTF-8 XML-RPC self-service issues, RT#13656
Index: XMLRPC.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- XMLRPC.pm 6 Aug 2007 19:45:22 -0000 1.2
+++ XMLRPC.pm 31 Oct 2011 02:33:28 -0000 1.3
@@ -26,19 +26,51 @@
use strict;
use vars qw($DEBUG $AUTOLOAD);
+use XMLRPC::Lite; # for XMLRPC::Data
use FS::SelfService;
$DEBUG = 0;
$FS::SelfService::DEBUG = $DEBUG;
+#false laziness w/FS::ClientAPI_XMLRPC.pm
+our %typefix = (
+ 'invoice_pdf' => { 'invoice_pdf' => 'base64', },
+ 'legacy_invoice_pdf' => { 'invoice_pdf' => 'base64', },
+ 'skin_info' => { 'logo' => 'base64',
+ 'title_left_image' => 'base64',
+ 'title_right_image' => 'base64',
+ 'menu_top_image' => 'base64',
+ 'menu_body_image' => 'base64',
+ 'menu_bottom_image' => 'base64',
+ },
+ 'invoice_logo' => { 'logo' => 'base64', },
+);
+
sub AUTOLOAD {
my $call = $AUTOLOAD;
$call =~ s/^FS::SelfService::XMLRPC:://;
+
if (exists($FS::SelfService::autoload{$call})) {
+
shift; #discard package name;
+
$call = "FS::SelfService::$call";
+
no strict 'refs';
- &{$call}(@_);
+
+ my $return = &{$call}(@_);
+
+ if ( exists($typefix{$call}) ) {
+ my $typefix = $typefix{$call};
+ foreach my $field ( grep exists($return->{$_}), keys %$typefix ) {
+ my $type = $typefix->{$field};
+ $return->{$field} = XMLRPC::Data->value($return->{$field})
+ ->type($type);
+ }
+ }
+
+ $return;
+
}else{
die "No such procedure: $call";
}
More information about the freeside-commits
mailing list