[freeside-commits] freeside/httemplate/elements tr-select-cust-part_pkg.html, 1.2.4.1, 1.2.4.2 order_pkg.js, 1.1.2.2, 1.1.2.3 select-part_pkg.html, 1.7, 1.7.4.1
Ivan,,,
ivan at wavetail.420.am
Wed Aug 10 17:39:02 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv14755/httemplate/elements
Modified Files:
Tag: FREESIDE_2_1_BRANCH
tr-select-cust-part_pkg.html order_pkg.js select-part_pkg.html
Log Message:
hide start date on package order for specific package definitions, RT#13783
Index: order_pkg.js
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/order_pkg.js,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -d -r1.1.2.2 -r1.1.2.3
--- order_pkg.js 11 Apr 2011 23:06:23 -0000 1.1.2.2
+++ order_pkg.js 11 Aug 2011 00:39:00 -0000 1.1.2.3
@@ -1,8 +1,9 @@
-function enable_order_pkg () {
+function pkg_changed () {
var form = document.OrderPkgForm;
var discountnum = form.discountnum;
if ( form.pkgpart.selectedIndex > 0 ) {
+
form.submitButton.disabled = false;
if ( discountnum ) {
if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_discount') == 1 ) {
@@ -11,6 +12,20 @@
form.discountnum.disabled = true;
}
}
+
+ if ( form.pkgpart.options[form.pkgpart.selectedIndex].getAttribute('data-can_start_date') == 1 ) {
+ form.start_date_text.disabled = false;
+ form.start_date.style.backgroundColor = '#ffffff';
+ form.start_date_button.style.display = '';
+ form.start_date_button_disabled.style.display = 'none';
+ form.invoice_terms.disabled = true;
+ } else {
+ form.start_date_text.disabled = true;
+ form.start_date.style.backgroundColor = '#dddddd';
+ form.start_date_button.style.display = 'none';
+ form.start_date_button_disabled.style.display = '';
+ }
+
} else {
form.submitButton.disabled = true;
if ( discountnum ) { form.discountnum.disabled = true; }
Index: tr-select-cust-part_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-select-cust-part_pkg.html,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -u -w -d -r1.2.4.1 -r1.2.4.2
--- tr-select-cust-part_pkg.html 9 Apr 2011 22:50:03 -0000 1.2.4.1
+++ tr-select-cust-part_pkg.html 11 Aug 2011 00:39:00 -0000 1.2.4.2
@@ -8,9 +8,10 @@
<SCRIPT TYPE="text/javascript">
- function part_pkg_opt(what,value,text,can_discount) {
+ function part_pkg_opt(what, value, text, can_discount, can_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);
var length = what.length;
what.options[length] = optionName;
}
@@ -38,11 +39,12 @@
// add the new packages
opt(what.form.pkgpart, '', 'Select package');
var packagesArray = eval('(' + part_pkg + ')' );
- for ( var s = 0; s < packagesArray.length; s=s+3 ) {
+ for ( var s = 0; s < packagesArray.length; s=s+4 ) {
var packagesLabel = packagesArray[s+1];
var can_discount = packagesArray[s+2];
+ var can_start_date = packagesArray[s+3];
part_pkg_opt(
- what.form.pkgpart, packagesArray[s], packagesLabel, can_discount
+ what.form.pkgpart, packagesArray[s], packagesLabel, can_discount, can_start_date
);
}
@@ -73,13 +75,12 @@
<TR>
<TH ALIGN="right">Package</TH>
<TD COLSPAN=7>
- <% include('/elements/select-cust-part_pkg.html',
+ <& /elements/select-cust-part_pkg.html,
'curr_value' => $opt{'curr_value'}, #$pkgpart
'classnum' => $opt{'classnum'},
'cust_main' => $opt{'cust_main'}, #$cust_main
- 'onchange' => 'enable_order_pkg',
- )
- %>
+ 'onchange' => 'pkg_changed',
+ &>
</TD>
</TR>
Index: select-part_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-part_pkg.html,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -u -w -d -r1.7 -r1.7.4.1
--- select-part_pkg.html 21 Apr 2010 09:31:34 -0000 1.7
+++ select-part_pkg.html 11 Aug 2011 00:39:00 -0000 1.7.4.1
@@ -23,7 +23,7 @@
'empty_label' => 'Select package', #should this be the default?
'label_callback' => sub { shift->pkg_comment },
'hashref' => \%hash,
- 'extra_option_attributes' => [ 'can_discount' ],
+ 'extra_option_attributes' => [ 'can_discount', 'can_start_date' ],
%opt,
)
%>
More information about the freeside-commits
mailing list