diff options
| author | Mark Wells <mark@freeside.biz> | 2012-09-29 16:36:46 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2012-09-29 16:36:46 -0700 |
| commit | 33beebf4cb42eba3e1dd868ad5e0af102de961da (patch) | |
| tree | 860712543dcc74ff2402a4ed8d73e8cd553e62d4 /fs_selfservice | |
| parent | 7ac86daf67b0a95153b736d5811f9050363f6553 (diff) | |
update address standardization for cust_location changes
Diffstat (limited to 'fs_selfservice')
| -rwxr-xr-x | fs_selfservice/DEPLOY | 2 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/SelfService.pm | 17 | ||||
| -rwxr-xr-x[-rw-r--r--] | fs_selfservice/FS-SelfService/cgi/agent.cgi | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi | 0 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/make_payment.html | 24 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/myaccount.html | 20 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/provision_list.html | 1 | ||||
| -rwxr-xr-x[-rw-r--r--] | fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 16 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/small_custview.html | 69 | ||||
| -rw-r--r-- | fs_selfservice/FS-SelfService/cgi/ticket_summary.html | 26 | ||||
| -rwxr-xr-x[-rw-r--r--] | fs_selfservice/FS-SelfService/cgi/xmlrpc.cgi | 0 | ||||
| -rw-r--r-- | fs_selfservice/php/freeside.class.new.php | 71 |
12 files changed, 189 insertions, 57 deletions
diff --git a/fs_selfservice/DEPLOY b/fs_selfservice/DEPLOY index e73012f4b..bedb5eca9 100755 --- a/fs_selfservice/DEPLOY +++ b/fs_selfservice/DEPLOY @@ -11,7 +11,7 @@ perl Makefile.PL && make && make install cd .. #( cd ..; make deploy; cd fs_selfservice ) -( cd ..; make clean; make install-perl-modules; /etc/init.d/freeside restart; cd fs_selfservice ) +( cd ..; make clean; make configure-rt; make install-perl-modules; /etc/init.d/freeside restart; cd fs_selfservice ) #cp /home/ivan/freeside/fs_selfservice/FS-SelfService/cgi/* /var/www/MyAccount #chown freeside /var/www/MyAccount/*.cgi diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm index af04fcc74..c22e4269e 100644 --- a/fs_selfservice/FS-SelfService/SelfService.pm +++ b/fs_selfservice/FS-SelfService/SelfService.pm @@ -32,6 +32,7 @@ $socket .= '.'.$tag if defined $tag && length($tag); 'switch_acct' => 'MyAccount/switch_acct', 'customer_info' => 'MyAccount/customer_info', 'customer_info_short' => 'MyAccount/customer_info_short', + 'billing_history' => 'MyAccount/billing_history', 'edit_info' => 'MyAccount/edit_info', #add to ss cgi! 'invoice' => 'MyAccount/invoice', 'invoice_pdf' => 'MyAccount/invoice_pdf', @@ -104,22 +105,6 @@ $socket .= '.'.$tag if defined $tag && length($tag); 'call_time' => 'PrepaidPhone/call_time', 'call_time_nanpa' => 'PrepaidPhone/call_time_nanpa', 'phonenum_balance' => 'PrepaidPhone/phonenum_balance', - #izoom - #'bulk_processrow' => 'Bulk/processrow', - #conflicts w/Agent one# 'check_username' => 'Bulk/check_username', - #sg - 'ping' => 'SGNG/ping', - 'decompify_pkgs' => 'SGNG/decompify_pkgs', - 'previous_payment_info' => 'SGNG/previous_payment_info', - 'previous_payment_info_renew_info' - => 'SGNG/previous_payment_info_renew_info', - 'previous_process_payment' => 'SGNG/previous_process_payment', - 'previous_process_payment_order_pkg' - => 'SGNG/previous_process_payment_order_pkg', - 'previous_process_payment_change_pkg' - => 'SGNG/previous_process_payment_change_pkg', - 'previous_process_payment_order_renew' - => 'SGNG/previous_process_payment_order_renew', ); @EXPORT_OK = ( keys(%autoload), diff --git a/fs_selfservice/FS-SelfService/cgi/agent.cgi b/fs_selfservice/FS-SelfService/cgi/agent.cgi index 0af94cd9e..0af94cd9e 100644..100755 --- a/fs_selfservice/FS-SelfService/cgi/agent.cgi +++ b/fs_selfservice/FS-SelfService/cgi/agent.cgi diff --git a/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi b/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi index 253f853f8..253f853f8 100644..100755 --- a/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi +++ b/fs_selfservice/FS-SelfService/cgi/cust_bill-logo.cgi diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html index bec37cac3..defd4a551 100644 --- a/fs_selfservice/FS-SelfService/cgi/make_payment.html +++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html @@ -9,29 +9,15 @@ <TH ALIGN="right">Amount Due</TH> <TD COLSPAN=7> <TABLE><TR><TD BGCOLOR="#ffffff"> - $<%=sprintf("%.2f",$balance)%> - </TD></TR></TABLE> - </TD> -</TR> -<TR> - <TH ALIGN="right">Payment amount</TH> - <TD COLSPAN=7> - <TABLE><TR><TD BGCOLOR="#ffffff"> -<%= - $amt = ''; - if ( $balance > 0 ) { - $amt = $balance; - $amt += $amt * $credit_card_surcharge_percentage/100 - if $credit_card_surcharge_percentage > 0; - $amt = sprintf("%.2f",$amt); - } - ''; -%> - $<INPUT TYPE="text" NAME="amount" SIZE=8 VALUE="<%=$amt%>"> + <FONT COLOR="#000000">$<%=sprintf("%.2f",$balance)%></FONT> </TD></TR></TABLE> </TD> </TR> + +<%= $tr_amount_fee %> + <%= include('discount_term') %> + <TR> <TH ALIGN="right">Card type</TH> <TD COLSPAN=7> diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html index d27f688e3..9ab262261 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html @@ -2,9 +2,11 @@ <%= include('header', 'My Account') %> Hello <%= $name %>!<BR><BR> -<%= $small_custview %> + +<%= include('small_custview') %> + <BR> -<%= if ( $access_pkgnum ) { +<%= unless ( $access_pkgnum ) { $OUT .= qq!Balance: <B>\$$balance</B><BR><BR>!; } ''; @@ -34,17 +36,17 @@ Hello <%= $name %>!<BR><BR> $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'. '<TR><TH BGCOLOR="#ff6666" COLSPAN=5>Open Invoices</TH></TR>'; my $link = qq!<A HREF="<%= $url %>myaccount!; - my $col1 = "ffffff"; - my $col2 = "dddddd"; + my $col1 = $stripe1_bgcolor || '#ffffff'; + my $col2 = $stripe2_bgcolor || '#dddddd'; my $col = $col1; foreach my $invoice ( @open_invoices ) { - my $td = qq!<TD BGCOLOR="#$col">!; + my $td = qq!<TD BGCOLOR="$col">!; my $a=qq!<A HREF="${url}view_invoice;invnum=!. $invoice->{'invnum'}. '">'; $OUT .= "<TR>$td${a}Invoice #". $invoice->{'invnum'}. "</A></TD>$td</TD>". "$td$a". $invoice->{'date'}. "</A></TD>$td</TD>". - qq!<TD BGCOLOR="#$col" ALIGN="right">$a\$!. $invoice->{'owed'}. + qq!<TD BGCOLOR="$col" ALIGN="right">$a\$!. $invoice->{'owed'}. '</A></TD>'. '</TR>'; $col = $col eq $col1 ? $col2 : $col1; @@ -61,12 +63,12 @@ Hello <%= $name %>!<BR><BR> '<TR><TH BGCOLOR="#ff6666" COLSPAN="3">Support Time Remaining</TH>'. '</TR><TR><TH>Package</TH><TH></TH>'. '<TH>Time Remaining</TH></TR>'; - my $col1 = "ffffff"; - my $col2 = "dddddd"; + my $col1 = $stripe1_bgcolor || '#ffffff'; + my $col2 = $stripe2_bgcolor || '#dddddd'; my $col = $col1; foreach my $support ( @support_services ) { - my $td = qq!<TD BGCOLOR="#$col">!; + my $td = qq!<TD BGCOLOR="$col">!; my $a = qq!<A HREF="${url}view_support_details;svcnum=!. $support->{'svcnum'}. '">'; $OUT .= diff --git a/fs_selfservice/FS-SelfService/cgi/provision_list.html b/fs_selfservice/FS-SelfService/cgi/provision_list.html index 22054e644..2a3a8e909 100644 --- a/fs_selfservice/FS-SelfService/cgi/provision_list.html +++ b/fs_selfservice/FS-SelfService/cgi/provision_list.html @@ -10,7 +10,6 @@ foreach my $pkg ( } @cust_pkg ) { my $susp = $pkg->{'susp'} || ''; - warn $pkg->{'pkg'}. ' '.$susp."\n"; my @pkg_actions = ( [ 'customer_change_pkg' => 'change' ] ); push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] if $self_suspend_reason and !$susp; diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi index fe8d08209..61361b8ee 100644..100755 --- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi +++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi @@ -476,7 +476,21 @@ sub process_order_recharge { } sub make_payment { - payment_info( 'session_id' => $session_id ); + + my $payment_info = payment_info( 'session_id' => $session_id ); + + my $tr_amount_fee = mason_comp( + 'session_id' => $session_id, + 'comp' => '/elements/tr-amount_fee.html', + 'args' => [ 'amount' => $payment_info->{'balance'}, + ], + ); + + $tr_amount_fee = $tr_amount_fee->{'error'} || $tr_amount_fee->{'output'}; + + $payment_info->{'tr_amount_fee'} = $tr_amount_fee; + + $payment_info; } sub payment_results { diff --git a/fs_selfservice/FS-SelfService/cgi/small_custview.html b/fs_selfservice/FS-SelfService/cgi/small_custview.html new file mode 100644 index 000000000..8d6e07368 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/small_custview.html @@ -0,0 +1,69 @@ +<DIV ID="fs_small_custview"> + +Customer #<B><%= $custnum %></B> + - <B><FONT COLOR="#<%= $statuscolor %>"><%= ucfirst($status)%></FONT></B> + +<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="<%= $box_bgcolor ||= '#c0c0c0' %>"> + <TR> + <TD VALIGN="top"> + <%= $has_ship_address + ? '<I><FONT SIZE="-1">Billing Address</FONT></I><BR>' + : '' + %> + <%= $first %> <%= $last %><BR> + <%= $company ? $company.'<BR>' : '' %> + <%= $address1 %><BR> + <%= $address2 ? $address2.'<BR>' : '' %> + <%= $city %>, <%= $state %> <%= $zip %><BR> + <%= $country && $country ne ($countrydefault||'US') + ? $country.'<BR>' + : '' + %> + <%= if ( $daytime && $night ) { + $OUT .= "<BR>Day Phone $daytime<BR>Night Phone $night"; + } elsif ( $daytime || $night ) { + $OUT .= '<BR>'. ($daytime || $night); + } + ''; + %> + <%= $fax ? "<BR>Fax $fax" : '' %> + + </TD> + +<%= if ( $has_ship_address ) { + + $OUT .= '<TD> </TD>'. + '<TD VALIGN="top">'. + '<I><FONT SIZE="-1">Service Address</FONT></I><BR>'. + "$ship_first $ship_last<BR>"; + $OUT .= "$ship_company<BR>" if $ship_company; + $OUT .= "$ship_address1<BR>"; + $OUT .= "$ship_address2<BR>" if $ship_address2; + $OUT .= "$ship_city, $ship_state $ship_zip<BR>"; + $OUT .= "$ship_country<BR>" + if $ship_country && $ship_country ne ($countrydefault||'US'); + + + if ( $ship_daytime && $ship_night ) { + $OUT .= "<BR>Day Phone $ship_daytime<BR>Night Phone $ship_night"; + } elsif ( $ship_daytime || $ship_night ) { + $OUT .= '<BR'. ($ship_daytime || $ship_night); + } + + $OUT .= "<BR>Fax $ship_fax" if $ship_fax; + + $OUT .= '</TD>'; +} +''; +%> + +</TR></TABLE> + +<%= unless ( $access_pkgnum ) { + $OUT .= '<BR>Balance: <B>$'. $balance. '</B><BR>'; + } + ''; +%> + +</DIV> + diff --git a/fs_selfservice/FS-SelfService/cgi/ticket_summary.html b/fs_selfservice/FS-SelfService/cgi/ticket_summary.html index c840ca9d6..4333c4e92 100644 --- a/fs_selfservice/FS-SelfService/cgi/ticket_summary.html +++ b/fs_selfservice/FS-SelfService/cgi/ticket_summary.html @@ -1,10 +1,10 @@ <SCRIPT TYPE="text/javascript" SRC="overlibmws.js"></SCRIPT> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee"> -<TR><TH BGCOLOR="#ff6666" COLSPAN=15>Open Tickets</TH></TR> +<TR><TH BGCOLOR="#ff6666" COLSPAN=16>Open Tickets</TH></TR> <TR> <%= -my $col1 = "ffffff"; -my $col2 = "dddddd"; +my $col1 = $stripe1_bgcolor || "#ffffff"; +my $col2 = $stripe2_bgcolor || "#dddddd"; my $col = $col1; my $can_set_priority = @@ -26,12 +26,15 @@ my @titles = ('#', qw(Subject Queue Status Created Due)); push @titles, 'Estimated<BR>Hours'; push @titles, 'Priority'; -$OUT .= join("\n", map { "<TH VALIGN=\"top\">$_</TH><TH> </TH>" } @titles) +$box_bgcolor ||= '#c0c0c0'; +my $th = qq(<TH BGCOLOR="$box_bgcolor"); + +$OUT .= join("\n", map { "$th VALIGN=\"top\">$_</TH>$th> </TH>" } @titles) . '</TR>'; foreach my $ticket ( @tickets ) { my $id = $ticket->{'id'}; - my $td = qq!<TD BGCOLOR="#$col">!; + my $td = qq!<TD BGCOLOR="$col">!; my $space = $td.' </TD>'; my $link = qq!<A HREF="${url}tktview;ticket_id=$id">!; $OUT .= '<TR>' . @@ -41,31 +44,34 @@ $td. $ticket->{'queue'} . '</TD>'. $space . $td. $ticket->{'status'} . '</TD>'. $space . $td. $date_formatter->($ticket->{'created'}) . '</TD>'. $space . $td. $date_formatter->($ticket->{'due'}) . '</TD>'. $space . -qq!<TD BGCOLOR="#$col" ALIGN="right">!. +qq!<TD BGCOLOR="$col" ALIGN="right">!. ($ticket->{'timeestimated'} ? sprintf('%.1f', $ticket->{'timeestimated'} / 60.0) # .1f? : '' ) . '</TD>'. $space . -qq!<TD BGCOLOR="#$col" ALIGN="right">!; +qq!<TD BGCOLOR="$col" ALIGN="right">!; if ( $can_set_priority ) { $OUT .= '<INPUT TYPE="hidden" NAME="ticket'.$id.'" VALUE="1">' . '<INPUT TYPE="text" SIZE=4 NAME="priority'.$id.'"' . 'VALUE="'.$ticket->{'_selfservice_priority'}.'"></TD>'; if ( exists($ticket_error{$id}) ) { # display error message compactly - $OUT .= '<TD><FONT COLOR="#ff0000" onmouseover="'. + $OUT .= $td. '<FONT COLOR="#ff0000" onmouseover="'. "return overlib('".$ticket_error{$id}."', AUTOSTATUS, WRAP);" . '" onmouseout="nd();">*</FONT></TD>'; + } else { + $OUT .= $td.'</TD>'; } } else { - $OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . '</TD>'; + $OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . '</TD>'. + $td.'</TD>'; } $OUT .= '</TR>'; $col = $col eq $col1 ? $col2 : $col1; } #foreach my $ticket if ( $can_set_priority ) { - $OUT .= '<TR><TD COLSPAN=15 ALIGN="right"> + $OUT .= '<TR><TD COLSPAN=16 ALIGN="right"> <INPUT TYPE="submit" VALUE="Save changes"></TD></TR></FORM>'; } %> diff --git a/fs_selfservice/FS-SelfService/cgi/xmlrpc.cgi b/fs_selfservice/FS-SelfService/cgi/xmlrpc.cgi index d5a8e2063..d5a8e2063 100644..100755 --- a/fs_selfservice/FS-SelfService/cgi/xmlrpc.cgi +++ b/fs_selfservice/FS-SelfService/cgi/xmlrpc.cgi diff --git a/fs_selfservice/php/freeside.class.new.php b/fs_selfservice/php/freeside.class.new.php new file mode 100644 index 000000000..b9d125eb6 --- /dev/null +++ b/fs_selfservice/php/freeside.class.new.php @@ -0,0 +1,71 @@ +<?php + +#pre-php 5.4 compatible version? +function flatten($hash) { + if ( !is_array($hash) ) return $hash; + $flat = array(); + + array_walk($hash, function($value, $key, &$to) { + array_push($to, $key, $value); + }, $flat); + + if ( PHP_VERSION_ID >= 50400 ) { + + #php 5.4+ (deb 7+) + foreach ($hash as $key => $value) { + $flat[] = $key; + $flat[] = $value; + } + + } + + return($flat); +} + +#php 5.4+? +#function flatten($hash) { +# if ( !is_array($hash) ) return $hash; +# +# $flat = array(); +# +# foreach ($hash as $key => $value) { +# $flat[] = $key; +# $flat[] = $value; +# } +# +# return($flat); +#} + +class FreesideSelfService { + + //Change this to match the location of your selfservice xmlrpc.cgi or daemon + #var $URL = 'https://localhost/selfservice/xmlrpc.cgi'; + var $URL = 'http://localhost/selfservice/xmlrpc.cgi'; + + function FreesideSelfService() { + $this; + } + + public function __call($name, $arguments) { + + error_log("[FreesideSelfService] $name called, sending to ". $this->URL); + + $request = xmlrpc_encode_request("FS.ClientAPI_XMLRPC.$name", flatten($arguments[0])); + $context = stream_context_create( array( 'http' => array( + 'method' => "POST", + 'header' => "Content-Type: text/xml", + 'content' => $request + ))); + $file = file_get_contents($this->URL, false, $context); + $response = xmlrpc_decode($file); + if (xmlrpc_is_fault($response)) { + trigger_error("[FreesideSelfService] XML-RPC communication error: $response[faultString] ($response[faultCode])"); + } else { + //error_log("[FreesideSelfService] $response"); + return $response; + } + } + +} + +?> |
