From 02a6274b9eec3668afe0835df2009790f010a0b9 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 15 Jan 2014 22:15:42 -0800 Subject: [PATCH] fix part_pkg.comment showing in signup and self-service package order, RT#25557 --- FS/FS/ClientAPI/MasonComponent.pm | 1 + FS/FS/part_pkg.pm | 5 +++++ httemplate/edit/cust_main/first_pkg/select-part_pkg.html | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/FS/FS/ClientAPI/MasonComponent.pm b/FS/FS/ClientAPI/MasonComponent.pm index c4094ffe0..8a31185bd 100644 --- a/FS/FS/ClientAPI/MasonComponent.pm +++ b/FS/FS/ClientAPI/MasonComponent.pm @@ -99,6 +99,7 @@ my %session_callbacks = ( my %args = @$argsref; $args{part_pkg} = \@part_pkg; $args{first_svc} = \@first_svc; + $args{no_comment} = 1; @$argsref = ( %args ); return ''; #no error diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 2cccce051..c908c917e 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -784,6 +784,11 @@ sub custom_comment { $price_info; } +sub pkg_price_info { + my $self = shift; + $self->pkg. ' - '. ($self->price_info || 'No charge'); +} + =item pkg_class Returns the package class, as an FS::pkg_class object, or the empty string diff --git a/httemplate/edit/cust_main/first_pkg/select-part_pkg.html b/httemplate/edit/cust_main/first_pkg/select-part_pkg.html index 709a8ad6c..3c2eac018 100644 --- a/httemplate/edit/cust_main/first_pkg/select-part_pkg.html +++ b/httemplate/edit/cust_main/first_pkg/select-part_pkg.html @@ -144,8 +144,9 @@ foreach my $part_pkg ( @part_pkg ) { my @options = (); push @options, '' unless $opt{'disable_empty'}; push @options, map $pkgpart_svcpart{ $_->pkgpart }, @part_pkg; +my $label_method = $opt{no_comment} ? 'pkg_price_info' : 'pkg_comment' ; my %labels = ( '' => ( $opt{'empty_label'} || '(none)' ), - map { $pkgpart_svcpart{ $_->pkgpart } => $_->pkg_comment } + map { $pkgpart_svcpart{ $_->pkgpart } => $_->$label_method() } @part_pkg ); -- 2.11.0