[freeside-commits] freeside/httemplate/elements tr-select-discount.html, 1.5, 1.5.2.1 order_pkg.js, 1.1.4.1, 1.1.4.2
Ivan,,,
ivan at wavetail.420.am
Sun Oct 23 18:16:02 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv6577/httemplate/elements
Modified Files:
Tag: FREESIDE_2_3_BRANCH
tr-select-discount.html order_pkg.js
Log Message:
fix discounts not appearing for one-time charge packages, RT#13654
Index: tr-select-discount.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-discount.html,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -w -d -r1.5 -r1.5.2.1
--- tr-select-discount.html 27 May 2011 05:56:42 -0000 1.5
+++ tr-select-discount.html 24 Oct 2011 01:15:59 -0000 1.5.2.1
@@ -81,12 +81,14 @@
function <% $name %>_changed(what) {
var <% $name %> = what.options[what.selectedIndex].value;
- if ( <% $name %> == '-1' ) {
+ if ( <% $name %> == '-1' && ! what.disabled ) {
<% $ge %>('<% $name %>__type_label0').style.display = '';
<% $ge %>('<% $name %>__type_label0').style.visibility = '';
<% $ge %>('<% $name %>__type').style.display = '';
<% $ge %>('<% $name %>__type').style.visibility = '';
-% #XXX retrieve previous visibility for amount, percent :/
+
+ <% $name %>__type_changed( <% $ge %>('<% $name %>__type') );
+
<% $ge %>('<% $name %>_months_label0').style.display = '';
<% $ge %>('<% $name %>_months_label0').style.visibility = '';
<% $ge %>('<% $name %>_months').style.display = '';
@@ -104,19 +106,7 @@
<% $ge %>('<% $name %>__type').style.display = 'none';
<% $ge %>('<% $name %>__type').style.visibility = 'hidden';
-% #XXX save visibility settings for amount, percent :/
- <% $ge %>('<% $name %>_amount_label0').style.display = 'none';
- <% $ge %>('<% $name %>_amount_label0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_amount_input0').style.display = 'none';
- <% $ge %>('<% $name %>_amount_input0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_amount_input0').style.display = 'none';
- <% $ge %>('<% $name %>_amount_input0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_percent_label0').style.display = 'none';
- <% $ge %>('<% $name %>_percent_label0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_percent_input0').style.display = 'none';
- <% $ge %>('<% $name %>_percent_input0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_percent_input0').style.display = 'none';
- <% $ge %>('<% $name %>_percent_input0').style.visibility = 'hidden';
+ <% $name %>__type_changed( <% $ge %>('<% $name %>__type') );
<% $ge %>('<% $name %>_months_label0').style.display = 'none';
<% $ge %>('<% $name %>_months_label0').style.visibility = 'hidden';
@@ -137,15 +127,15 @@
function <% $name %>__type_changed(what) {
var <% $name %>__type = what.options[what.selectedIndex].value;
- if ( <% $name %>__type == '<% $select %>' ) {
+ if ( <% $name %>__type == '<% $select %>' || what.style.display == 'none' ) {
<% $ge %>('<% $name %>_amount_label0').style.display = 'none';
<% $ge %>('<% $name %>_amount_label0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_amount').style.display = 'none';
- <% $ge %>('<% $name %>_amount').style.visibility = 'hidden';
+ <% $ge %>('<% $name %>_amount_input0').style.display = 'none';
+ <% $ge %>('<% $name %>_amount_input0').style.visibility = 'hidden';
<% $ge %>('<% $name %>_percent_label0').style.display = 'none';
<% $ge %>('<% $name %>_percent_label0').style.visibility = 'hidden';
- <% $ge %>('<% $name %>_percent').style.display = 'none';
- <% $ge %>('<% $name %>_percent').style.visibility = 'hidden';
+ <% $ge %>('<% $name %>_percent_input0').style.display = 'none';
+ <% $ge %>('<% $name %>_percent_input0').style.visibility = 'hidden';
} else if ( <% $name %>__type == 'Amount' ) {
<% $ge %>('<% $name %>_amount_label0').style.display = '';
<% $ge %>('<% $name %>_amount_label0').style.visibility = '';
Index: order_pkg.js
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/order_pkg.js,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -w -d -r1.1.4.1 -r1.1.4.2
--- order_pkg.js 11 Aug 2011 00:38:14 -0000 1.1.4.1
+++ order_pkg.js 24 Oct 2011 01:15:59 -0000 1.1.4.2
@@ -8,8 +8,10 @@
if ( discountnum ) {
if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
form.discountnum.disabled = false;
+ discountnum_changed(form.discountnum);
} else {
form.discountnum.disabled = true;
+ discountnum_changed(form.discountnum);
}
}
@@ -29,6 +31,7 @@
} else {
form.submitButton.disabled = true;
if ( discountnum ) { form.discountnum.disabled = true; }
+ discountnum_changed(form.discountnum);
}
}
More information about the freeside-commits
mailing list