diff options
author | ivan <ivan> | 2009-09-18 22:35:29 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-09-18 22:35:29 +0000 |
commit | 5ea78c9342c376406271472cee971aa971c4a696 (patch) | |
tree | 1166a5b53c666dec21504e2bea29ab69a8bf3e37 | |
parent | 20727883e43b7abed5160870b3fa3059a7cb1d83 (diff) |
fix customer and package status conditions not sticky on edit, noticed on RT#6150
-rw-r--r-- | httemplate/elements/select-cust_main-status.html | 7 | ||||
-rw-r--r-- | httemplate/elements/select-cust_pkg-status.html | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/httemplate/elements/select-cust_main-status.html b/httemplate/elements/select-cust_main-status.html index 2e0b6cb..bdbaac7 100644 --- a/httemplate/elements/select-cust_main-status.html +++ b/httemplate/elements/select-cust_main-status.html @@ -8,7 +8,9 @@ % foreach my $option ( @{ $opt{'statuses'} } ) { <OPTION VALUE="<% $option %>" - <% $option eq $curr_value ? 'SELECTED' : '' %> + <% ref($value) && $value->{$option} || $option eq $value + ? 'SELECTED' : '' + %> ><% $option %> % } @@ -25,6 +27,7 @@ my $onchange = $opt{'onchange'} ? 'onChange="'. $opt{'onchange'}. '(this)"' : ''; -my $curr_value = $opt{'curr_value'} || $opt{'value'}; +my $value = $opt{'curr_value'} || $opt{'value'}; +$value = [ split(/\s*,\s*/, $value) ] if $opt{'multiple'} && $value =~ /,/; </%init> diff --git a/httemplate/elements/select-cust_pkg-status.html b/httemplate/elements/select-cust_pkg-status.html index 2d545c0..ec37eaf 100644 --- a/httemplate/elements/select-cust_pkg-status.html +++ b/httemplate/elements/select-cust_pkg-status.html @@ -8,7 +8,9 @@ % foreach my $option ( @{ $opt{'statuses'} } ) { <OPTION VALUE="<% $option %>" - <% $option eq $curr_value ? 'SELECTED' : '' %> + <% ref($value) && $value->{$option} || $option eq $value + ? 'SELECTED' : '' + %> ><% $option %> % } @@ -25,6 +27,7 @@ my $onchange = $opt{'onchange'} ? 'onChange="'. $opt{'onchange'}. '(this)"' : ''; -my $curr_value = $opt{'curr_value'} || $opt{'value'}; +my $value = $opt{'curr_value'} || $opt{'value'}; +$value = [ split(/\s*,\s*/, $value) ] if $opt{'multiple'} && $value =~ /,/; </%init> |