[freeside-commits] freeside/httemplate/misc unprovision.cgi, 1.5, 1.6
Mark Wells
mark at wavetail.420.am
Mon Oct 25 15:22:44 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv22487/httemplate/misc
Modified Files:
unprovision.cgi
Log Message:
summary display of bulk packages with many services, RT#9821
Index: unprovision.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/unprovision.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- unprovision.cgi 13 Jan 2008 21:14:19 -0000 1.5
+++ unprovision.cgi 25 Oct 2010 22:22:42 -0000 1.6
@@ -1,6 +1,8 @@
%if ( $error ) {
% errorpage($error);
-%} else {
+%} elsif ( $pkgnum ) {
+<% $cgi->redirect(popurl(2)."search/cust_pkg_svc.html?svcpart=$svcpart;pkgnum=$pkgnum") %>
+%} else { # $custnum should always exist
<% $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum") %>
%}
<%init>
@@ -9,18 +11,28 @@
unless $FS::CurrentUser::CurrentUser->access_right('Unprovision customer service');
#untaint svcnum
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-my $svcnum = $1;
+my @svcnums;
+my ($pkgnum, $svcpart, $custnum);
+if( $cgi->param('svcnum') ) {
+ @svcnums = grep { $_ } map { /^(\d+)$/ && $1 } $cgi->param('svcnum');
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $custnum = $cgi->param('custnum');
+}
+else {
+ @svcnums = map { /^(\d+)$/ && $1 } $cgi->keywords;
+}
-#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
-#die "Unknown svcnum!" unless $svc_acct;
+my $error = '';
+foreach my $svcnum (@svcnums) {
my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
die "Unknown svcnum!" unless $cust_svc;
-my $custnum = $cust_svc->cust_pkg->custnum;
+ $custnum ||= $cust_svc->cust_pkg->custnum;
-my $error = $cust_svc->cancel;
+ $error .= $cust_svc->cancel;
+
+}
</%init>
More information about the freeside-commits
mailing list