X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI_XMLRPC.pm;h=f1988bff48cbd5fb73b06e627918d4e3bc8d1359;hb=573139dbd6c37808697bfa72a3a468bb0980d4dd;hp=b909519189a517c8ea519c455f2f7aab74161bf3;hpb=2ccf4816707444ca24aa64d6a928b41d44e356b9;p=freeside.git diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm index b90951918..f1988bff4 100644 --- a/FS/FS/ClientAPI_XMLRPC.pm +++ b/FS/FS/ClientAPI_XMLRPC.pm @@ -30,11 +30,26 @@ L, L use strict; use vars qw($DEBUG $AUTOLOAD); +use XMLRPC::Lite; # for XMLRPC::Data use FS::ClientAPI; $DEBUG = 0; $FS::ClientAPI::DEBUG = $DEBUG; +#false laziness w/FS::SelfService/XMLRPC.pm, same problem as below but worse +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::|ClientAPI_)XMLRPC:://; @@ -44,12 +59,27 @@ sub AUTOLOAD { my $autoload = &ss2clientapi; if (exists($autoload->{$call})) { + shift; #discard package name; + #$call = "FS::SelfService::$call"; #no strict 'refs'; #&{$call}(@_); #FS::ClientAPI->dispatch($autoload->{$call}, @_); - FS::ClientAPI->dispatch($autoload->{$call}, { @_ } ); + + my $return = FS::ClientAPI->dispatch($autoload->{$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"; } @@ -72,6 +102,8 @@ sub ss2clientapi { 'edit_info' => 'MyAccount/edit_info', #add to ss cgi! 'invoice' => 'MyAccount/invoice', 'invoice_pdf' => 'MyAccount/invoice_pdf', + 'legacy_invoice' => 'MyAccount/legacy_invoice', + 'legacy_invoice_pdf' => 'MyAccount/legacy_invoice_pdf', 'invoice_logo' => 'MyAccount/invoice_logo', 'list_invoices' => 'MyAccount/list_invoices', #? 'cancel' => 'MyAccount/cancel', #add to ss cgi! @@ -88,6 +120,9 @@ sub ss2clientapi { 'list_pkgs' => 'MyAccount/list_pkgs', #add to ss (added?) 'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?) 'list_svc_usage' => 'MyAccount/list_svc_usage', + 'svc_status_html' => 'MyAccount/svc_status_html', + 'acct_forward_info' => 'MyAccount/acct_forward_info', + 'process_acct_forward' => 'MyAccount/process_acct_forward', 'list_dsl_devices' => 'MyAccount/list_dsl_devices', 'add_dsl_device' => 'MyAccount/add_dsl_device', 'delete_dsl_device' => 'MyAccount/delete_dsl_device', @@ -109,6 +144,8 @@ sub ss2clientapi { 'unprovision_svc' => 'MyAccount/unprovision_svc', 'myaccount_passwd' => 'MyAccount/myaccount_passwd', 'reset_passwd' => 'MyAccount/reset_passwd', + 'check_reset_passwd' => 'MyAccount/check_reset_passwd', + 'process_reset_passwd' => 'MyAccount/process_reset_passwd', 'create_ticket' => 'MyAccount/create_ticket', 'get_ticket' => 'MyAccount/get_ticket', 'adjust_ticket_priority' => 'MyAccount/adjust_ticket_priority',