X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_export.cgi;h=f3127403e96f1b5a9795ad20c95daccb2a29225b;hp=0ca964e0241d196ed4ec7300092a9d4424b1e68e;hb=a7c1b602f88c177db34477ed4cdc1f72603f8995;hpb=52a07a405e197fda1654fc61eefa538450f269e8 diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index 0ca964e02..f3127403e 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -6,34 +6,18 @@ #} else { # $cgi->param('clone', ''); #} -#if ( $cgi->param('svcpart') && $cgi->param('svcpart') =~ /^(\d+)$/ ) { -# $cgi->param('svcpart', $1); -#} else { -# $cgi->param('svcpart', ''); -#} my($query) = $cgi->keywords; my $action = ''; my $part_export = ''; -my $options = {}; if ( $cgi->param('error') ) { $part_export = new FS::part_export ( { map { $_, scalar($cgi->param($_)) } fields('part_export') } ); -} - -#warn "***$query***"; -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($cgi->param('svcpart')); - } -} elsif ( $cgi->param('new_with_svcpart') - && $cgi->param('new_with_svcpart') =~ /^(\d+)$/ ) { - $part_export ||= new FS::part_export ( { 'svcpart' => $1 } ); } elsif ( $query =~ /^(\d+)$/ ) { - $part_export ||= qsearchs('part_export', { 'exportnum' => $1 } ); + $part_export = qsearchs('part_export', { 'exportnum' => $1 } ); +} else { + $part_export = new FS::part_export; } $action ||= $part_export->exportnum ? 'Edit' : 'Add'; @@ -101,18 +85,20 @@ my %exports = ( ); -my $svcdb = $part_export->part_svc->svcdb; +#my $svcdb = $part_export->part_svc->svcdb; +#YUCK +my $svcdb = 'svc_acct'; + my %layers = map { $_ => "$_ - ". $exports{$svcdb}{$_}{desc} } keys %{$exports{$svcdb}}; $layers{''}=''; my $widget = new HTML::Widgets::SelectLayers( 'selected_layer' => $part_export->exporttype, - 'selected_layer' => $part_export->exporttype, 'options' => \%layers, 'form_name' => 'dummy', 'form_action' => 'process/part_export.cgi', - 'form_text' => [qw( exportnum svcpart machine )], + 'form_text' => [qw( exportnum machine )], # 'form_checkbox' => [qw()], 'html_between' => "\n", 'layer_callback' => sub { @@ -123,7 +109,7 @@ my $widget = new HTML::Widgets::SelectLayers( # foreach my $option ( qw(url login password groupID ) ) { my $optinfo = $exports{$svcdb}->{$layer}{options}{$option}; my $label = $optinfo->{label}; - my $value = $part_export->option($option); + my $value = $cgi->param($option) || $part_export->option($option); $html .= qq!$label!. qq!!. ''; @@ -160,13 +146,6 @@ my $widget = new HTML::Widgets::SelectLayers( <%= ntable("#cccccc",2) %> - Service - - <%= $part_export->svcpart %> - <%= $part_export->part_svc->svc %> - - - - Export host