diff options
author | ivan <ivan> | 2008-04-16 20:00:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-04-16 20:00:59 +0000 |
commit | 6eae00a74907ad88924641a9079c59b55102fb5f (patch) | |
tree | 5b91b9c3418065c9ce56a905e0f73602757816b4 | |
parent | 9e4bc4c0c9c77d75618196f4f0eeeeeb35e2ee08 (diff) |
show package add-on links in browse
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 68 | ||||
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 3 |
2 files changed, 53 insertions, 18 deletions
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 77f6261d6..45fa8f216 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -93,28 +93,51 @@ push @header, 'Pricing'; $align .= 'r'; #? push @fields, sub { my $part_pkg = shift; + (my $plan = $plan_labels{$part_pkg->plan} ) =~ s/ / /g; + my $is_recur = ( $part_pkg->freq ne '0' ); [ [ - { data=>$plan_labels{$part_pkg->plan}, - align=>'center' + { data =>$plan, + align=>'center', + colspan=>2, }, ], [ - { data=>$money_char. - sprintf('%.2f setup', $part_pkg->option('setup_fee') ), + { data =>$money_char. + sprintf('%.2f', $part_pkg->option('setup_fee') ), align=>'right' }, + { data => ( $is_recur ? ' setup' : ' one-time' ), + align=>'left', + }, ], [ - { data=>( $part_pkg->freq ne '0' + { data=>( $is_recur ? $money_char.sprintf('%.2f ', $part_pkg->option('recur_fee') ) - : '' - ). - $part_pkg->freq_pretty, - align=>'right' + : $part_pkg->freq_pretty + ), + align=> ( $is_recur ? 'right' : 'center' ), + colspan=> ( $is_recur ? 1 : 2 ), }, + ( $is_recur + ? { data => ( $is_recur ? $part_pkg->freq_pretty : '' ), + align=>'left', + } + : () + ), ], + ( map { + my $dst_pkg = $_->dst_pkg; + [ + { data => 'Add-on: '.$dst_pkg->pkg_comment, + align=>'center', #? + colspan=>2, + } + ] + } + $part_pkg->bill_part_pkg_link + ), ]; # $plan_labels{$part_pkg->plan}.'<BR>'. @@ -190,18 +213,21 @@ push @fields, my $part_pkg = shift; if ( $part_pkg->plan ) { + my %options = $part_pkg->options; + [ map { - /^(\w+)=(.*)$/; #or something; [ - { 'data' => $1, + { 'data' => $_, 'align' => 'right', }, - { 'data' => $part_pkg->format($1,$2), + { 'data' => $part_pkg->format($_,$options{$_}), 'align' => 'left', }, ]; } - split(/\n/, $part_pkg->plandata) + grep { $options{$_} =~ /\S/ } + grep { $_ !~ /^(setup|recur)_fee$/ } + keys %options ]; } else { @@ -226,7 +252,8 @@ push @fields, sub { my $part_pkg = shift; - [ map { + [ + (map { my $pkg_svc = $_; my $part_svc = $pkg_svc->part_svc; my $svc = $part_svc->svc; @@ -252,7 +279,18 @@ push @fields, <=> $a->primary_svc =~ /^Y/i } $part_pkg->pkg_svc - + ), + ( map { + my $dst_pkg = $_->dst_pkg; + [ + { data => 'Add-on: '.$dst_pkg->pkg_comment, + align=>'center', #? + colspan=>2, + } + ] + } + $part_pkg->svc_part_pkg_link + ) ]; }; diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 2468f304a..55d1d0ebf 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -148,11 +148,8 @@ die "access denied" #XXX # - tr-part_pkg_freq: month_increments_only (from price plans) -# - display add-ons in browse... yeah -# -QIS- thank goodness # - test cloning # - test custom pricing -#recur_flat->recur_fee migration, ugh # - move the selectlayer divs away from lame layer_callback #my ($query) = $cgi->keywords; |