% % %if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) { % $cgi->param('clone', $1); %} else { % $cgi->param('clone', ''); %} %if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { % $cgi->param('pkgnum', $1); %} else { % $cgi->param('pkgnum', ''); %} % %my ($query) = $cgi->keywords; % %my $part_pkg = ''; %if ( $cgi->param('error') ) { % $part_pkg = new FS::part_pkg ( { % map { $_, scalar($cgi->param($_)) } fields('part_pkg') % } ); %} % %my $action = ''; %my $clone_part_pkg = ''; %my $pkgpart = ''; %if ( $cgi->param('clone') ) { % $pkgpart = $cgi->param('clone'); % $action = 'Custom Pricing'; % $clone_part_pkg= qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } ); % $part_pkg ||= $clone_part_pkg->clone; % $part_pkg->disabled('Y'); #isn't sticky on errors %} elsif ( $query && $query =~ /^(\d+)$/ ) { % $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); % $pkgpart = $part_pkg->pkgpart; %} else { % unless ( $part_pkg ) { % $part_pkg = new FS::part_pkg {}; % $part_pkg->plan('flat'); % } %} %unless ( $part_pkg->plan ) { #backwards-compat % $part_pkg->plan('flat'); % $part_pkg->plandata("setup_fee=". $part_pkg->setup. "\n". % "recur_fee=". $part_pkg->recur. "\n"); %} %$action ||= $part_pkg->pkgpart ? 'Edit' : 'Add'; %my $hashref = $part_pkg->hashref; % % <% include("/elements/header.html","$action Package Definition", menubar( 'Main Menu' => popurl(2), 'View all packages' => popurl(2). 'browse/part_pkg.cgi', )) %> % #), ' onLoad="visualize()"'); % if ( $cgi->param('error') ) { Error: <% $cgi->param('error') %> % }