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/browse/part_svc.cgi | 21 ++++++++++++++++++--- httemplate/edit/part_export.cgi | 2 +- httemplate/edit/process/part_export.cgi | 16 +++++----------- httemplate/misc/delete-part_export.cgi | 15 +++++++++++++++ 4 files changed, 39 insertions(+), 15 deletions(-) create mode 100755 httemplate/misc/delete-part_export.cgi (limited to 'httemplate') diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index cf0f0408c..c66b8ac63 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -14,6 +14,13 @@ my $total = scalar(@part_svc); %> <%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %> + + Services are items you offer to your customers.

<%= $total %> services <%= $cgi->param('showdisabled') @@ -61,10 +68,17 @@ my $total = scalar(@part_svc); foreach my $part_export ( @part_export ) { %> - <%= $part_export->exporttype %> to <%= $part_export->machine %> - (options) + <%= $part_export->exporttype %> to <%= $part_export->machine %> (edit | delete) + + <%= itable() %> + <% my %opt = $part_export->options; + foreach my $opt ( keys %opt ) { %> + <%= $opt %><%= $opt{$opt} %> + <% } %> + + <% } %> - Add a new export + Add a new export <% if (@part_export) { %>
@@ -75,6 +89,7 @@ my $total = scalar(@part_svc); <%= $part_export->exporttype %> to <%= $part_export->machine %> <% } %> +
<% } %> diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index 7ba6fa12b..3d867f50a 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -27,7 +27,7 @@ if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) { $action = 'Add'; my $old_part_export = qsearchs('part_export', { 'exportnum' => $1 } ); unless ( $part_export ) { - ($part_export, $options) = $old_part_export->clone; + ($part_export, $options) = $old_part_export->clone($cgi->param('svcpart')); } } elsif ( $cgi->param('new_with_svcpart') && $cgi->param('new_with_svcpart') =~ /^(\d+)$/ ) { 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; } diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi new file mode 100755 index 000000000..a5166d944 --- /dev/null +++ b/httemplate/misc/delete-part_export.cgi @@ -0,0 +1,15 @@ +<% + +#untaint paynum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal exportnum"; +my $exportnum = $1; + +my $part_export = qsearchs('part_export',{'exportnum'=>$exportnum}); + +my $error = $part_export->delete; +eidiot($error) if $error; + +print $cgi->redirect($p. "browse/part_svc.cgi"); + +%> -- cgit v1.2.1