diff options
author | Mitch Jackson <mitch@freeside.biz> | 2018-02-13 18:11:03 -0600 |
---|---|---|
committer | Mitch Jackson <mitch@freeside.biz> | 2018-02-13 18:11:03 -0600 |
commit | d2b55d07a9e6e64a38877136d7974ab93e14f1ed (patch) | |
tree | efd6794f4d996ea4dca931578fd581fc5ecefed6 /httemplate/elements/select-table.html | |
parent | 908b5627cc5899b00d3b9e83602403eb956dd038 (diff) |
RT# 79284 Updated discounts UI for Change Package screen
Diffstat (limited to 'httemplate/elements/select-table.html')
-rw-r--r-- | httemplate/elements/select-table.html | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 6fb6b388b..a52fdfaaa 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -195,13 +195,22 @@ if ( ref( $value ) eq 'ARRAY' ) { $value = { map { $_ => 1 } @$value }; } -unless ( !ref($value) && $value < 1 # !$value #ignore negatives too - or ! exists( $opt{hashref}->{disabled} ) #?? - #or grep { $value == $_->$key() } @records - ) { + +if ( + (ref $value && $value) + or (ref $opt{hashref} && exists $opt{hashref}->{disabled}) + or $opt{also_show_option} +) { + delete $opt{hashref}->{disabled}; - foreach my $v ( ref($value) ? keys %$value : ($value) ) { + # also_show_option: (hack for change_pkg form): + # Include an absent select option, without selecting it + # as the curr_value + my @also_show = ref($value) ? keys %$value : ($value); + push @also_show, $opt{also_show_option} if $opt{also_show_option}; + + foreach my $v ( @also_show ) { next if grep { $v == $_->$key() } @records; $opt{hashref}->{$key} = $v; |