summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/part_svc.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process/part_svc.cgi')
-rwxr-xr-xhttemplate/edit/process/part_svc.cgi35
1 files changed, 35 insertions, 0 deletions
diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi
new file mode 100755
index 000000000..423db93b5
--- /dev/null
+++ b/httemplate/edit/process/part_svc.cgi
@@ -0,0 +1,35 @@
+<%
+
+my $svcpart = $cgi->param('svcpart');
+
+my $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart;
+
+my $new = new FS::part_svc ( {
+ map {
+ $_, scalar($cgi->param($_));
+# } qw(svcpart svc svcdb)
+ } ( fields('part_svc'),
+ map { my $svcdb = $_;
+ map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) }
+ fields($svcdb)
+ } grep defined( $FS::Record::dbdef->table($_) ),
+ qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www )
+ )
+} );
+
+my $error;
+if ( $svcpart ) {
+ $error = $new->replace($old, '1.3-COMPAT');
+} else {
+ $error = $new->insert;
+ $svcpart=$new->getfield('svcpart');
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3)."browse/part_svc.cgi");
+}
+
+%>