X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=b3c389c9da459065b60194b8e386349298692013;hb=e9e81be2ffe4c08e52ccd9609838ffddab0ed6f2;hp=546e0711326a87a6b61684803aba4bdf1c942aaf;hpb=2041a9143fac20b79ead4a1ae01224dedf5b27c2;p=freeside.git diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 546e07113..b3c389c9d 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -20,11 +20,11 @@ if ( $cgi->param('error') ) { map { $_, scalar($cgi->param($_)) } fields('part_pkg') } ); } +my $clone_part_pkg = ''; if ( $cgi->param('clone') ) { - $action='Custom Pricing'; - my $old_part_pkg = - qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } ); - $part_pkg ||= $old_part_pkg->clone; + $action = 'Custom Pricing'; + $clone_part_pkg= qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } ); + $part_pkg ||= $clone_part_pkg->clone; $part_pkg->disabled('Y'); } elsif ( $query && $query =~ /^(\d+)$/ ) { $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); @@ -93,7 +93,12 @@ Package information - + + Promotional code + + + + Disable new orders @@ -230,7 +235,8 @@ print ''; tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() }; my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); } - split("\n", $part_pkg->plandata ); + split("\n", ($clone_part_pkg||$part_pkg)->plandata ); +#warn join("\n", map { "$_: $plandata{$_}" } keys %plandata ). "\n"; tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans; @@ -256,7 +262,9 @@ my $widget = new HTML::Widgets::SelectLayers( 'options' => \%options, 'form_name' => 'dummy', 'form_action' => 'process/part_pkg.cgi', - 'form_text' => [ qw(pkg comment clone pkgnum pkgpart), @fixups ], + 'form_text' => [ qw(pkg comment promo_code clone pkgnum pkgpart), + @fixups + ], 'form_checkbox' => [ qw(setuptax recurtax disabled) ], 'form_radio' => \@form_radio, 'form_select' => \@form_select, @@ -294,8 +302,11 @@ my $widget = new HTML::Widgets::SelectLayers( ? $plandata{$field} : $href->{$field}{'default'} ). qq!" onChange="fchanged(this)">!; - } elsif ( $href->{$field}{'type'} eq 'select_multiple' ) { - $html .= qq!