[freeside-commits] branch FREESIDE_3_BRANCH updated. 52e1a09b0f426bf572e0af9d97bc1c00dd22f427
Mark Wells
mark at 420.am
Fri May 31 17:02:54 PDT 2013
The branch, FREESIDE_3_BRANCH has been updated
via 52e1a09b0f426bf572e0af9d97bc1c00dd22f427 (commit)
from 58f7ac18d2f510c2332fcb9d3b66b718852d186f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 52e1a09b0f426bf572e0af9d97bc1c00dd22f427
Author: Mark Wells <mark at freeside.biz>
Date: Fri May 31 17:02:21 2013 -0700
better multiple-select behavior in part_svc edit, #23251
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html
index d03c49d..fbea9bd 100644
--- a/httemplate/edit/elements/part_svc_column.html
+++ b/httemplate/edit/elements/part_svc_column.html
@@ -157,6 +157,9 @@ that field.
'multiple' => $def->{'multiple'},
'disable_empty' => 1,
'curr_value' => $value,
+ # these can be switched between multiple and singular,
+ # so put the complete curr_value in an attribute
+ 'element_etc' => 'default="'.encode_entities($value).'"',
&>
% } else {
% my (@options, %labels);
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
index 58c237e..2ec0242 100755
--- a/httemplate/edit/part_svc.cgi
+++ b/httemplate/edit/part_svc.cgi
@@ -72,6 +72,17 @@ function flag_changed(obj) {
select.className = 'enabled';
if ( newflag == 'S' || select.getAttribute('should_be_multiple') ) {
select.multiple = true;
+ var defaults = select.getAttribute('default');
+ if ( defaults ) {
+ defaults = defaults.split(',');
+ for (var i = 0; i < defaults.length; i++) {
+ for (j = 0; j < select.options.length; j++ ) {
+ if ( defaults[i] == select.options[j].value ) {
+ select.options[j].selected = true;
+ }
+ }
+ }
+ }
} else {
select.multiple = false;
}
-----------------------------------------------------------------------
Summary of changes:
httemplate/edit/elements/part_svc_column.html | 3 +++
httemplate/edit/part_svc.cgi | 11 +++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
More information about the freeside-commits
mailing list