diff options
| author | Mitch Jackson <mitch@freeside.biz> | 2018-02-13 18:11:03 -0600 |
|---|---|---|
| committer | Mitch Jackson <mitch@freeside.biz> | 2018-02-23 23:39:45 +0000 |
| commit | db13eb8cb9645a6fd8979541e831fe60ee771e7d (patch) | |
| tree | 234f4df7f38de119045aea7dca49c92a24202edd /httemplate/elements/select-table.html | |
| parent | 538be6f5067b982715c1ad062f2201fe1a44ccba (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; |
