X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-cust-part_pkg.html;h=696baff9ff3bb04e64447d692b5e033105e1d02a;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hp=c9c50d27e23f1850b20d1bcba49f6c732736575a;hpb=8297a6375be5e9f0fed712745d15ef0b4907da00;p=freeside.git diff --git a/httemplate/elements/tr-select-cust-part_pkg.html b/httemplate/elements/tr-select-cust-part_pkg.html index c9c50d27e..696baff9f 100644 --- a/httemplate/elements/tr-select-cust-part_pkg.html +++ b/httemplate/elements/tr-select-cust-part_pkg.html @@ -1,5 +1,3 @@ -%if ( scalar(@pkg_class) > 1 && ! $conf->exists('disable-cust-pkg_class') ) { - <& /elements/xmlhttp.html, 'url' => $p.'misc/cust-part_pkg.cgi', 'subs' => [ 'get_part_pkg' ], @@ -20,7 +18,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; @@ -28,7 +26,7 @@ discountnum.disabled = true; //disable discount dropdown } - classnum = what.options[what.selectedIndex].value; + classnum = what.value; function update_part_pkg(part_pkg) { @@ -51,6 +49,9 @@ } what.form.pkgpart.disabled = ''; //re-enable part_pkg dropdown +% if ( $opt{'curr_value'} ) { + what.form.pkgpart.value = <% $opt{'curr_value'} %>; +% } } @@ -61,12 +62,13 @@ ); } - window.onload = function() { + <&| /elements/onload.js &> classnum_changed(document.getElementById('classnum')); - } + +% if ( scalar(@pkg_class) > 1 && ! $conf->exists('disable-cust-pkg_class') ) { <% mt('Package Class') |h %> @@ -78,7 +80,9 @@ -%} +% } else { # so that the rest of the page works correctly + +% } <% mt('Package') |h %>