diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-07-17 09:04:06 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-07-17 09:04:06 -0700 |
commit | 91dbe4c3834f38d428367d9a1e2c6cf9ea9d84a4 (patch) | |
tree | e4d6a63b75a2e3df13fdd35e24ae98ec8b3567cb /httemplate/elements/tr-select-cust-part_pkg.html | |
parent | 2101a32bdf12abdb2afdb654d6da30975ddd4fc9 (diff) | |
parent | d0fcbc3d04250ec54cb5dea7abcc58d1f45d78b1 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements/tr-select-cust-part_pkg.html')
-rw-r--r-- | httemplate/elements/tr-select-cust-part_pkg.html | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/httemplate/elements/tr-select-cust-part_pkg.html b/httemplate/elements/tr-select-cust-part_pkg.html index 848ab0a4b..488f04a13 100644 --- a/httemplate/elements/tr-select-cust-part_pkg.html +++ b/httemplate/elements/tr-select-cust-part_pkg.html @@ -7,10 +7,11 @@ <SCRIPT TYPE="text/javascript"> - function part_pkg_opt(what, value, text, can_discount, can_start_date) { + function part_pkg_opt(what, value, text, can_discount, can_start_date, start_date) { var optionName = new Option(text, value, false, false); optionName.setAttribute('data-can_discount', can_discount); optionName.setAttribute('data-can_start_date', can_start_date); + optionName.setAttribute('data-start_date', start_date || ''); var length = what.length; what.options[length] = optionName; } @@ -19,7 +20,7 @@ what.form.pkgpart.disabled = 'disabled'; //disable part_pkg dropdown var submitButton = what.form.submitButton; // || what.form.submit; - if ( submitButton ) { + if ( submitButton && <% $opt{'curr_value'} ? 0 : 1 %> ) { submitButton.disabled = true; //disable the submit button } var discountnum = what.form.discountnum; @@ -38,16 +39,21 @@ // add the new packages opt(what.form.pkgpart, '', 'Select package'); var packagesArray = eval('(' + part_pkg + ')' ); - for ( var s = 0; s < packagesArray.length; s=s+4 ) { + for ( var s = 0; s < packagesArray.length; s=s+5 ) { + //surely this should be some kind of JSON structure var packagesLabel = packagesArray[s+1]; var can_discount = packagesArray[s+2]; var can_start_date = packagesArray[s+3]; + var start_date = packagesArray[s+4]; part_pkg_opt( - what.form.pkgpart, packagesArray[s], packagesLabel, can_discount, can_start_date + what.form.pkgpart, packagesArray[s], packagesLabel, can_discount, can_start_date, start_date ); } what.form.pkgpart.disabled = ''; //re-enable part_pkg dropdown +% if ( $opt{'curr_value'} ) { + what.form.pkgpart.value = <% $opt{'curr_value'} %>; +% } } @@ -58,6 +64,10 @@ ); } + window.onload = function() { + classnum_changed(document.getElementById('classnum')); + } + </SCRIPT> <TR> |