freeside/httemplate/edit part_pkg.cgi,1.45,1.46
ivan
ivan at pouncequick.420.am
Wed Nov 17 05:19:17 PST 2004
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory pouncequick:/tmp/cvs-serv31828
Modified Files:
part_pkg.cgi
Log Message:
fix package options to be sticky on clone-ing (customize package)
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- part_pkg.cgi 26 Oct 2004 11:26:34 -0000 1.45
+++ part_pkg.cgi 17 Nov 2004 13:19:14 -0000 1.46
@@ -20,11 +20,11 @@
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});
@@ -230,7 +230,8 @@
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;
More information about the freeside-commits
mailing list