[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi selfservice.cgi, 1.38, 1.39 order_pkg.html, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Fri Aug 21 17:22:10 PDT 2009
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv19067/fs_selfservice/FS-SelfService/cgi
Modified Files:
selfservice.cgi order_pkg.html
Log Message:
order svc_phone services from self-service too, RT#5085
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- selfservice.cgi 10 Aug 2009 11:50:03 -0000 1.38
+++ selfservice.cgi 22 Aug 2009 00:22:07 -0000 1.39
@@ -17,6 +17,7 @@
unprovision_svc change_pkg domainselector
list_svcs list_svc_usage list_cdr_usage list_support_usage
myaccount_passwd
+ mason_comp
);
$template_dir = '.';
@@ -199,11 +200,24 @@
my $customer_info = customer_info( 'session_id' => $session_id );
return $customer_info if ( $customer_info->{'error'} );
+ my $pkgselect = mason_comp(
+ 'session_id' => $session_id,
+ 'comp' => '/edit/cust_main/first_pkg/select-part_pkg.html',
+ 'args' => [ 'password_verify' => 1,
+ 'onchange' => 'enable_order_pkg()',
+ 'relurls' => 1,
+ 'empty_label' => 'Select package',
+ ],
+ );
+
+ $pkgselect = $pkgselect->{'error'} || $pkgselect->{'output'};
+
return {
( map { $_ => $init_data->{$_} }
qw( part_pkg security_phrase svc_acct_pop ),
),
%$customer_info,
+ 'pkg_selector' => $pkgselect,
};
}
@@ -229,23 +243,46 @@
my $results = '';
- unless ( length($cgi->param('_password')) ) {
- my $init_data = signup_info( 'customer_session_id' => $session_id );
- $results = { 'error' => $init_data->{msgcat}{empty_password} };
- $results = { 'error' => $init_data->{error} } if($init_data->{error});
+ my @params = (qw( custnum pkgpart ));
+ my $svcdb = '';
+ if ( $cgi->param('pkgpart_svcpart') =~ /^(\d+)_(\d+)$/ ) {
+ $cgi->param('pkgpart', $1);
+ $cgi->param('svcpart', $2);
+ push @params, 'svcpart';
+ $svcdb = $cgi->param('svcdb');
+ push @params, 'domsvc' if $svcdb eq 'svc_acct';
+ } else {
+ $svcdb = 'svc_acct';
}
- if ( $cgi->param('_password') ne $cgi->param('_password2') ) {
- my $init_data = signup_info( 'customer_session_id' => $session_id );
- $results = { 'error' => $init_data->{msgcat}{passwords_dont_match} };
- $results = { 'error' => $init_data->{error} } if($init_data->{error});
- $cgi->param('_password', '');
- $cgi->param('_password2', '');
+
+ if ( $svcdb eq 'svc_acct' ) {
+
+ push @params, qw( username _password _password2 sec_phrase popnum );
+
+ unless ( length($cgi->param('_password')) ) {
+ my $init_data = signup_info( 'customer_session_id' => $session_id );
+ $results = { 'error' => $init_data->{msgcat}{empty_password} };
+ $results = { 'error' => $init_data->{error} } if($init_data->{error});
+ }
+ if ( $cgi->param('_password') ne $cgi->param('_password2') ) {
+ my $init_data = signup_info( 'customer_session_id' => $session_id );
+ $results = { 'error' => $init_data->{msgcat}{passwords_dont_match} };
+ $results = { 'error' => $init_data->{error} } if($init_data->{error});
+ $cgi->param('_password', '');
+ $cgi->param('_password2', '');
+ }
+
+ } elsif ( $svcdb eq 'svc_phone' ) {
+
+ push @params, qw( phonenum sip_password pin phone_name );
+
+ } else {
+ die "$svcdb not handled on process_order_pkg yet";
}
$results ||= order_pkg (
'session_id' => $session_id,
- map { $_ => $cgi->param($_) }
- qw( custnum pkgpart username _password _password2 sec_phrase popnum )
+ map { $_ => $cgi->param($_) } @params
);
Index: order_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/order_pkg.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- order_pkg.html 24 Aug 2004 11:16:56 -0000 1.1
+++ order_pkg.html 22 Aug 2009 00:22:07 -0000 1.2
@@ -1,6 +1,6 @@
<SCRIPT TYPE="text/javascript">
function enable_order_pkg () {
- if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
+ if ( document.OrderPkgForm.pkgpart_svcpart.selectedIndex > 0 ) {
document.OrderPkgForm.submit.disabled = false;
} else {
document.OrderPkgForm.submit.disabled = true;
@@ -16,46 +16,16 @@
<INPUT TYPE="hidden" NAME="action" VALUE="process_order_pkg">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $custnum %>">
<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
-<TR>
- <TD COLSPAN=2><SELECT NAME="pkgpart" onChange="enable_order_pkg()">
- <OPTION VALUE="">
- <%=
- foreach my $part_pkg ( @part_pkg ) {
- $OUT .= '<OPTION VALUE="'. $part_pkg->{'pkgpart'}. '"';
- $OUT .= ' SELECTED' if $pkgpart && $part_pkg->{'pkgpart'} == $pkgpart;
- $OUT .= '>'. $part_pkg->{'pkg'};
- }
- %>
-
- </SELECT></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Username</TD>
- <TD><INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Password</TD>
- <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $_password %>"></TD>
-</TR>
<TR>
- <TD ALIGN="right">Re-enter Password</TD>
- <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $_password2 %>"></TD>
-</TR>
-<%=
- if ( $security_phrase ) {
- $OUT .= <<ENDOUT;
-<TR>
- <TD ALIGN="right">Security Phrase</TD>
- <TD><INPUT TYPE="text" NAME="sec_phrase" VALUE="$sec_phrase">
+ <TD COLSPAN=2>
+ <TABLE><TR><TD> <%= $pkg_selector %>
+
</TD>
</TR>
-ENDOUT
- } else {
- $OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
- }
-%>
+
<%=
+ if ( 0 ) {
if ( @svc_acct_pop ) {
$OUT .= '<TR><TD ALIGN="right">Access number</TD><TD>'.
popselector( 'popnum' => $popnum,
@@ -68,8 +38,10 @@
} else {
$OUT .= popselector(popnum=>$popnum, pops=>\@svc_acct_pop);
}
+ }
+ '';
%>
</TABLE>
-<INPUT NAME="submit" TYPE="submit" VALUE="Purchase" disabled>
+<INPUT NAME="submit" TYPE="submit" VALUE="Purchase" DISABLED>
</FORM>
More information about the freeside-commits
mailing list