[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi myaccount_menu.html, 1.16, 1.17 provision_svc_phone.html, NONE, 1.1 selfservice.cgi, 1.51, 1.52 ws_list.html, 1.3, 1.4
Erik Levinson
levinse at wavetail.420.am
Mon Dec 20 22:26:14 PST 2010
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv32090/fs_selfservice/FS-SelfService/cgi
Modified Files:
myaccount_menu.html selfservice.cgi ws_list.html
Added Files:
provision_svc_phone.html
Log Message:
self-service improvements: DIDs, RT10885
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -w -d -r1.51 -r1.52
--- selfservice.cgi 20 Dec 2010 03:14:47 -0000 1.51
+++ selfservice.cgi 21 Dec 2010 06:26:12 -0000 1.52
@@ -13,7 +13,7 @@
access_info login_info login customer_info edit_info invoice
payment_info process_payment realtime_collect process_prepay
list_pkgs order_pkg signup_info order_recharge
- part_svc_info provision_acct provision_external
+ part_svc_info provision_acct provision_external provision_phone
unprovision_svc change_pkg suspend_pkg domainselector
list_svcs list_svc_usage list_cdr_usage list_support_usage
myaccount_passwd list_invoices create_ticket get_ticket did_report
@@ -73,7 +73,7 @@
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|tktcreate|tktview|didreport|invoices|view_invoice|make_payment|make_ach_payment|make_term_payment|make_thirdparty_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_cdr_details|view_support_details|change_password|process_change_password|customer_suspend_pkg|process_suspend_pkg)$/
+ /^(myaccount|tktcreate|tktview|didreport|invoices|view_invoice|make_payment|make_ach_payment|make_term_payment|make_thirdparty_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|change_pay|process_change_bill|process_change_ship|process_change_pay|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_phone|process_svc_external|delete_svc|view_usage|view_usage_details|view_cdr_details|view_support_details|change_password|process_change_password|customer_suspend_pkg|process_suspend_pkg)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
@@ -649,6 +649,34 @@
or die 'Unknown svcdb '. $result->{'svcdb'};
$action .= "_$1";
+ $result->{'numavail'} = $cgi->param('numavail');
+
+ $result;
+}
+
+sub process_svc_phone {
+ my @bulkdid = $cgi->param('bulkdid');
+ my $phonenum = $cgi->param('phonenum');
+
+ my $result = provision_phone (
+ 'session_id' => $session_id,
+ 'bulkdid' => [ @bulkdid ],
+ 'countrycode' => '1',
+ map { $_ => $cgi->param($_) } qw( pkgnum svcpart phonenum )
+ );
+
+ if ( exists $result->{'error'} && $result->{'error'} ) {
+ $action = 'provision_svc_phone';
+ return {
+ $cgi->Vars,
+ %{ part_svc_info( 'session_id' => $session_id,
+ map { $_ => $cgi->param($_) } qw( pkgnum svcpart )
+ )
+ },
+ 'error' => $result->{'error'},
+ };
+ }
+
$result;
}
@@ -818,9 +846,10 @@
package FS::SelfService::_selfservicecgi;
-#use FS::SelfService qw(regionselector expselect popselector);
use HTML::Entities;
-use FS::SelfService qw(regionselector popselector domainselector location_form);
+use FS::SelfService qw(
+ regionselector popselector domainselector location_form didselector
+);
#false laziness w/agent.cgi
use vars qw(@INCLUDE_ARGS);
Index: myaccount_menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -d -r1.16 -r1.17
--- myaccount_menu.html 14 Dec 2010 23:27:19 -0000 1.16
+++ myaccount_menu.html 21 Dec 2010 06:26:12 -0000 1.17
@@ -28,7 +28,7 @@
#XXXFIXME still a bit sloppy for multi-gateway of differing namespace
my $i = 0;
while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CARD/; $i++ }
- if ( $cust_paybys[$i] =~ /^CARD/ ) {
+ if ( $cust_paybys[$i] && $cust_paybys[$i] =~ /^CARD/ ) {
push @menu, { title => 'Recharge my account with a credit card',
url => $hide_payment_fields[$i]
? 'make_thirdparty_payment&payby_method=CC'
@@ -39,7 +39,7 @@
$i = 0;
while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CHEK/; $i++ }
- if ( $cust_paybys[$i] =~ /^CHEK/ ) {
+ if ( $cust_paybys[$i] && $cust_paybys[$i] =~ /^CHEK/ ) {
push @menu, { title => 'Recharge my account with a check',
url => $hide_payment_fields[$i]
? 'make_thirdparty_payment&payby_method=ECHECK'
--- NEW FILE: provision_svc_phone.html ---
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('header', 'Setup phone number') %>
<FORM name="OneTrueForm" action="<%= $url %>" METHOD="POST">
<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
<INPUT TYPE="hidden" NAME="action" VALUE="process_svc_phone">
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%= $pkgnum %>">
<INPUT TYPE="hidden" NAME="svcpart" VALUE="<%= $svcpart %>">
<%= didselector('field' => 'phonenum',
'svcpart' => $svcpart,
'bulknum' => $numavail,
);
%>
<BR><BR><INPUT TYPE="submit" VALUE="Setup">
</FORM>
<%= include('footer') %>
Index: ws_list.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/ws_list.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- ws_list.html 20 Dec 2010 03:14:47 -0000 1.3
+++ ws_list.html 21 Dec 2010 06:26:12 -0000 1.4
@@ -19,19 +19,20 @@
sub pdate {
my($field,$date_format) = (shift,shift);
return "<TD>".Date::Format::time2str($date_format,$field)."</TD>"
- if $field > 0;
+ if $field && $field > 0;
'<TD></TD>';
}
if ( $pkgpart ) {
- $OUT .= qq! <TABLE BORDER="1"><TR><TH>Package</TH><TH>Status</TH> !;
+ $OUT .= qq! <TABLE BORDER="1" style="empty-cells: show"><TR><TH>Package</TH><TH>Status</TH> !;
$OUT .= "<TH>Setup</TH><TH>Last Bill</TH><TH>Next Bill</TH><TH>Adjourn</TH>";
$OUT .= "<TH>Suspend</TH><TH>Expire</TH><TH>Contract End</TH>";
- $OUT .= "<TH>Cancel</TH></TR>";
+ $OUT .= "<TH>Cancel</TH><TH>Services</TH></TR>";
foreach my $pkg ( @cust_pkg ) {
my $part_pkg = $pkg->{part_pkg}[0];
$status = ws_pkgstatus($pkg);
- if($pkg->{pkgpart} == $pkgpart && ($filter eq $status || !$filter) ) {
+ if($pkg->{pkgpart} == $pkgpart &&
+ ( ($filter && $filter eq $status) || !$filter) ) {
$OUT .= "<TR><TD>$part_pkg->{pkg}</TD><TD>$status</TD>";
$OUT .= pdate($pkg->{setup},$date_format);
$OUT .= pdate($pkg->{last_bill},$date_format);
@@ -41,7 +42,24 @@
$OUT .= pdate($pkg->{expire},$date_format);
$OUT .= pdate($pkg->{contract_end},$date_format);
$OUT .= pdate($pkg->{cancel},$date_format);
- $OUT .= "</TR>";
+
+ $OUT .= "<TD style='font-size: 85%'>";
+ my @cust_svc = @{$pkg->{cust_svc}};
+ foreach my $cust_svc ( @cust_svc ) {
+ my @label = @{$cust_svc->{'label'}};
+ $OUT .= qq!$label[0]: $label[1] <BR><BR>!;
+ }
+ my @part_svc = @{$pkg->{part_svc}};
+ foreach my $part_svc ( @part_svc ) {
+ my $link = qq!<A HREF="${url}provision_svc;!
+ . qq!pkgnum=$pkg->{'pkgnum'};svcpart=$part_svc->{'svcpart'}!
+ . qq!;numavail=$part_svc->{'num_avail'}">Setup !
+ . qq!$part_svc->{'svc'}</A> ($part_svc->{'num_avail'}!
+ . qq! available)<BR><BR>!;
+ $OUT .= $link if $part_svc->{'can_get_dids'};
+ }
+
+ $OUT .= "</TD></TR>";
}
}
$OUT .= "</TABLE>";
More information about the freeside-commits
mailing list