diff options
author | ivan <ivan> | 2002-03-22 12:49:43 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-03-22 12:49:43 +0000 |
commit | b159f42fa3f48cc2ca3b43773e7661e17d2fb072 (patch) | |
tree | a824f6d34a643fad9f381f010637d9dbfd8b01c6 /httemplate | |
parent | 415150fe1997eb2688dfd492710f644574e29daf (diff) |
more new export...
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/browse/part_svc.cgi | 21 | ||||
-rw-r--r-- | httemplate/edit/part_export.cgi | 2 | ||||
-rw-r--r-- | httemplate/edit/process/part_export.cgi | 16 | ||||
-rwxr-xr-x | httemplate/misc/delete-part_export.cgi | 15 |
4 files changed, 39 insertions, 15 deletions
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) ) %> +<SCRIPT> +function part_export_areyousure(href) { + if (confirm("Are you sure you want to delete this export?") == true) + window.location.href = href; +} +</SCRIPT> + Services are items you offer to your customers.<BR><BR> <%= $total %> services <%= $cgi->param('showdisabled') @@ -61,10 +68,17 @@ my $total = scalar(@part_svc); foreach my $part_export ( @part_export ) { %> <TR> - <TD><%= $part_export->exporttype %> to <%= $part_export->machine %></TD> - <TD>(options)</TD> + <TD><%= $part_export->exporttype %> to <%= $part_export->machine %> (<A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>">edit</A> | <A HREF="javascript:part_export_areyousure('<%= $p %>misc/delete-part_export.cgi?<%= $part_export->exportnum %>')">delete</A>)</TD> + <TD> + <%= itable() %> + <% my %opt = $part_export->options; + foreach my $opt ( keys %opt ) { %> + <TR><TD><%= $opt %></TD><TD><%= $opt{$opt} %></TD></TR> + <% } %> + </TABLE> + </TD> <% } %> - </TR><TR><TD COLSPAN=2><A HREF="<%= $p %>edit/part_export.cgi?new_with_svcpart=<%= $part_svc->svcpart %>"><I>Add a new export</I><A></TD></TR> + </TR><TR><TD COLSPAN=2><A HREF="<%= $p %>edit/part_export.cgi?new_with_svcpart=<%= $part_svc->svcpart %>"><I>Add a new export</I></A></TD></TR> <% if (@part_export) { %> <TR><TD COLSPAN=2> <FORM METHOD="POST" ACTION="<%= $p %>edit/part_export.cgi"> @@ -75,6 +89,7 @@ my $total = scalar(@part_svc); <%= $part_export->exporttype %> to <%= $part_export->machine %> </OPTION> <% } %> + </SELECT> <INPUT TYPE="submit" VALUE="clone existing export"> </FORM></TD></TR> <% } %> 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"); + +%> |