From 14d6b3092a296ada5a0252752fd15a0087c63374 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 18 Mar 2002 15:52:12 +0000 Subject: added (incomplete) export foo --- httemplate/edit/process/part_export.cgi | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 httemplate/edit/process/part_export.cgi (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi new file mode 100644 index 000000000..9ee1c5974 --- /dev/null +++ b/httemplate/edit/process/part_export.cgi @@ -0,0 +1,43 @@ +<% + +my $dbh = dbh; + +my $exportnum = $cgi->param('exportnum'); + +my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; + +my $new = new FS::part_export ( { + map { + $_, scalar($cgi->param($_)); + } fields('part_export') +} ); + +local $SIG{HUP} = 'IGNORE'; +local $SIG{INT} = 'IGNORE'; +local $SIG{QUIT} = 'IGNORE'; +local $SIG{TERM} = 'IGNORE'; +local $SIG{TSTP} = 'IGNORE'; +local $SIG{PIPE} = 'IGNORE'; + +local $FS::UID::AutoCommit = 0; + +my $error; +if ( $exportnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $exportnum = $new->exportnum; +} +if ( $error ) { + $dbh->rollback; + $cgi->param('error', $error ); + print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); + myexit(); +} + +#options + +$dbh->commit or die $dbh->errstr; +print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); + +%> -- cgit v1.2.1 From f1038a648b3d53db925b23519e7cd2a30c6837ed Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 20 Mar 2002 21:31:49 +0000 Subject: new export! infostreet and sqlradius provisioning switched over (Bug #299 - doesn't close it, but all the groundwork is done) also removes non-transactional ICRADIUS export from svc_acct.export (closes: Bug#347) --- httemplate/edit/process/part_export.cgi | 3 +++ 1 file changed, 3 insertions(+) (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 9ee1c5974..8160527f6 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -6,6 +6,9 @@ my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; +#fixup options +my %options = map { $_=>$cgi->param($_) } $cgi->param('options'); + my $new = new FS::part_export ( { map { $_, scalar($cgi->param($_)); -- cgit v1.2.1 From 415150fe1997eb2688dfd492710f644574e29daf Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 21 Mar 2002 06:57:20 +0000 Subject: more for the new world of export... --- httemplate/edit/process/part_export.cgi | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 8160527f6..b4ce0b352 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -1,7 +1,5 @@ <% -my $dbh = dbh; - my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; @@ -26,21 +24,17 @@ local $FS::UID::AutoCommit = 0; my $error; if ( $exportnum ) { - $error = $new->replace($old); + $error = $new->replace($old,\%options); } else { - $error = $new->insert; - $exportnum = $new->exportnum; + $error = $new->insert,\%options); +# $exportnum = $new->exportnum; } + if ( $error ) { - $dbh->rollback; $cgi->param('error', $error ); print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); - myexit(); +} else { + print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); } -#options - -$dbh->commit or die $dbh->errstr; -print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); - %> -- cgit v1.2.1 From b159f42fa3f48cc2ca3b43773e7661e17d2fb072 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Mar 2002 12:49:43 +0000 Subject: more new export... --- httemplate/edit/process/part_export.cgi | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index b4ce0b352..d0c87a02a 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -5,7 +5,8 @@ my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; #fixup options -my %options = map { $_=>$cgi->param($_) } $cgi->param('options'); +warn join('-', split(',',$cgi->param('options'))); +my %options = map { $_=>$cgi->param($_) } split(',',$cgi->param('options')); my $new = new FS::part_export ( { map { @@ -13,20 +14,13 @@ my $new = new FS::part_export ( { } fields('part_export') } ); -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; -local $SIG{PIPE} = 'IGNORE'; - -local $FS::UID::AutoCommit = 0; - my $error; if ( $exportnum ) { + warn $old; + warn $exportnum; $error = $new->replace($old,\%options); } else { - $error = $new->insert,\%options); + $error = $new->insert(\%options); # $exportnum = $new->exportnum; } -- cgit v1.2.1 From a7c1b602f88c177db34477ed4cdc1f72603f8995 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 11 Apr 2002 22:05:31 +0000 Subject: (almost) everything for bug#375 - create export_svc table - part_svc to part_export is now properly many-to-many, not one-to-many still need to finish service editing (choosing exports) in httemplate/edit/part_svc.cgi and httemplate/edti/process/part_svc.cgi and do somethinga about that manual $svcdb = 'svc_acct' in httemplate/edit/part_export.cgi (do part_export records need a svcdb? probably not... should be able to just pass an svcdb on creation of new exports, move the big %exports hash into part_export.pm and allow httemplate/edit/part_svc.cgi to query it for exports that can apply to a given svcdb.... --- httemplate/edit/process/part_export.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index d0c87a02a..34eb699bf 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -18,6 +18,7 @@ my $error; if ( $exportnum ) { warn $old; warn $exportnum; + warn $new->machine; $error = $new->replace($old,\%options); } else { $error = $new->insert(\%options); @@ -28,7 +29,7 @@ if ( $error ) { $cgi->param('error', $error ); print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); } else { - print $cgi->redirect(popurl(3). "browse/part_svc.cgi"); + print $cgi->redirect(popurl(3). "browse/part_export.cgi"); } %> -- cgit v1.2.1 From e6ea57971831f25d682d97a0ba508c39b66ecd8b Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 12 Apr 2002 13:22:03 +0000 Subject: - should finish off the part_svc -> part_export s/one-to-many/many-to-many/ transition (closes: Bug#375) - fixes a nasty export scoping bug with message catalogs, whew --- httemplate/edit/process/part_export.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 34eb699bf..6b4d007e4 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -5,7 +5,7 @@ my $exportnum = $cgi->param('exportnum'); my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; #fixup options -warn join('-', split(',',$cgi->param('options'))); +#warn join('-', split(',',$cgi->param('options'))); my %options = map { $_=>$cgi->param($_) } split(',',$cgi->param('options')); my $new = new FS::part_export ( { @@ -16,9 +16,9 @@ my $new = new FS::part_export ( { my $error; if ( $exportnum ) { - warn $old; - warn $exportnum; - warn $new->machine; + #warn $old; + #warn $exportnum; + #warn $new->machine; $error = $new->replace($old,\%options); } else { $error = $new->insert(\%options); -- cgit v1.2.1 From cf6020a0c273d549d33f3e9999bd8b68d9b6d133 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Jun 2002 01:29:21 +0000 Subject: shellcommands w/passwords --- httemplate/edit/process/part_export.cgi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process/part_export.cgi') diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi index 6b4d007e4..fa009edbb 100644 --- a/httemplate/edit/process/part_export.cgi +++ b/httemplate/edit/process/part_export.cgi @@ -6,7 +6,11 @@ my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; #fixup options #warn join('-', split(',',$cgi->param('options'))); -my %options = map { $_=>$cgi->param($_) } split(',',$cgi->param('options')); +my %options = map { + my $value = $cgi->param($_); + $value =~ s/\r\n/\n/g; #browsers? (textarea) + $_ => $value; +} split(',', $cgi->param('options')); my $new = new FS::part_export ( { map { -- cgit v1.2.1