X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-part_pkg.html;h=1f7b42f8698b4510f2d9c0e05d6ca041d8fe7d1c;hp=fb45c0efac093f2c4daee805428ecac8c4415a54;hb=37e92c220a54636ebc7900cd59ec6ce56790ede8;hpb=3d8dcf062ffb2da2aa4969a516c210680dab266d diff --git a/httemplate/elements/select-part_pkg.html b/httemplate/elements/select-part_pkg.html index fb45c0efa..1f7b42f86 100644 --- a/httemplate/elements/select-part_pkg.html +++ b/httemplate/elements/select-part_pkg.html @@ -79,7 +79,7 @@ function toggle_disabled_part_pkg (id,showdisabled,noload) { if (showdisabled || selected[pkginfo.pkgpart] || !pkginfo.disabled) { var newopt = document.createElement('option'); newopt.value = pkginfo.pkgpart; - newopt.label = pkginfo.label; + newopt.text = pkginfo.label; newopt.selected = selected[newopt.value] ? true : false; selectbox.appendChild(newopt); } @@ -125,6 +125,7 @@ if ($opt{'toggle_disabled'}) { order_by pre_options post_options + select ) ) { die "Cannot use toggle_disabled with $someopt" if exists $opt{$someopt}; @@ -153,7 +154,15 @@ if ( exists($opt{'classnum'}) && defined($opt{'classnum'}) ) { # currently can't handle this, either die 'Use of toggle_disabled with classnum has not been implemented' - if exists $hash{'classnum'}; + if $opt{'toggle_disabled'} && exists($hash{'classnum'}); + +# CAUTION: For proper functioning of toggle_disabled, +# please ensure changes to default options are synced with misc/xmlhttp-part_pkg.cgi + +$opt{'select'} = 'part_pkg.*, setup_option.optionvalue AS _setup_fee, + recur_option.optionvalue AS _recur_fee' + unless $opt{'select'}; +$opt{'addl_from'} .= FS::part_pkg->join_options_sql; $opt{'extra_sql'} .= ( keys(%hash) ? ' AND ' : ' WHERE ' ). FS::part_pkg->curuser_pkgs_sql;