[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi process_svc_phone.html, NONE, 1.1 provision_svc_phone.html, 1.1, 1.2 selfservice.cgi, 1.53, 1.54
Erik Levinson
levinse at wavetail.420.am
Tue Dec 21 15:44:56 PST 2010
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv18279/fs_selfservice/FS-SelfService/cgi
Modified Files:
provision_svc_phone.html selfservice.cgi
Added Files:
process_svc_phone.html
Log Message:
self-service improvements: DIDs, RT10885; re-do all of my changes which were undone by Mark
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -w -d -r1.53 -r1.54
--- selfservice.cgi 21 Dec 2010 09:12:45 -0000 1.53
+++ selfservice.cgi 21 Dec 2010 23:44:54 -0000 1.54
@@ -16,7 +16,7 @@
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
+ myaccount_passwd list_invoices create_ticket get_ticket did_report
mason_comp
);
@@ -128,8 +128,8 @@
warn Dumper($result) if $DEBUG;
-if ( $result->{error} eq "Can't resume session"
- || $result->{error} eq "Expired session" ) { #ick
+if ( $result->{error} && ( $result->{error} eq "Can't resume session"
+ || $result->{error} eq "Expired session") ) { #ick
my $login_info = login_info();
do_template('login', $login_info);
@@ -679,6 +679,15 @@
FS::SelfService::logout( 'session_id' => $session_id );
}
+sub didreport {
+ my $result = did_report( 'session_id' => $session_id,
+ 'format' => $cgi->param('type'),
+ 'recentonly' => $cgi->param('recentonly'),
+ );
+ die $result->{'error'} if exists $result->{'error'} && $result->{'error'};
+ $result;
+}
+
sub provision {
my $result = list_pkgs( 'session_id' => $session_id );
die $result->{'error'} if exists $result->{'error'} && $result->{'error'};
@@ -865,7 +874,24 @@
)
or die $Text::Template::ERROR;
- #warn "filling in $template with $fill_in\n";
+ if($result && ref($result) && $result->{'format'} && $result->{'content'}
+ && $result->{'format'} eq 'csv') {
+ print $cgi->header('-expires' => 'now',
+ '-Content-Type' => 'text/csv',
+ '-Content-Disposition' => "attachment;filename=output.csv",
+ ),
+ $result->{'content'};
+ }
+ elsif($result && ref($result) && $result->{'format'} && $result->{'content'}
+ && $result->{'format'} eq 'xls') {
+ print $cgi->header('-expires' => 'now',
+ '-Content-Type' => 'application/vnd.ms-excel',
+ '-Content-Disposition' => "attachment;filename=output.xls",
+ '-Content-Length' => length($result->{'content'}),
+ ),
+ $result->{'content'};
+ }
+ else {
my $data = $template->fill_in(
PACKAGE => 'FS::SelfService::_selfservicecgi',
HASH => $fill_in,
@@ -873,6 +899,7 @@
print $cgi->header( '-expires' => 'now' );
print $data;
}
+ }
#*FS::SelfService::_selfservicecgi::include = \&Text::Template::fill_in_file;
--- NEW FILE: process_svc_phone.html ---
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('header', "$svc setup successfully") %>
<FONT SIZE=4><%= $svc %> setup successfully.</FONT>
<%= include('footer') %>
Index: provision_svc_phone.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/provision_svc_phone.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- provision_svc_phone.html 21 Dec 2010 06:26:12 -0000 1.1
+++ provision_svc_phone.html 21 Dec 2010 23:44:54 -0000 1.2
@@ -1,11 +1,17 @@
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
<%= include('header', 'Setup phone number') %>
+<%=
+if($error) {
+ $OUT .= qq!<div style="color:red; font-size: 115%">$error</div>!;
+}
+%>
<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 %>">
+<INPUT TYPE="hidden" NAME="numavail" VALUE="<%= $numavail %>">
<%= didselector('field' => 'phonenum',
'svcpart' => $svcpart,
'bulknum' => $numavail,
More information about the freeside-commits
mailing list