diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2015-08-25 01:17:24 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-08-25 01:17:24 -0500 |
commit | 33b89d345f9f3f687c958056aeb85471f7f4c8f5 (patch) | |
tree | cb4507ce9be2a79e489e03ae8da670e0f3878c9f | |
parent | ed673c4be67ad4d3b549df3b5f20fe5d76d6e944 (diff) |
RT#18361: Delay package from billing until services are provisioned [start_on_hold toggles checkboxes display]
-rw-r--r-- | httemplate/elements/tr-pkg_svc.html | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html index cfef51ce2..1e9c0a38b 100644 --- a/httemplate/elements/tr-pkg_svc.html +++ b/httemplate/elements/tr-pkg_svc.html @@ -4,6 +4,12 @@ <% itable('', 4, 1) %><TR><TD VALIGN="top"> <% $thead %> +<SCRIPT> +var provision_hold_td = []; +var provision_hold_input = []; +provision_hold_td.push(document.getElementById('th_provision_hold')); +</SCRIPT> + %foreach my $part_svc ( @part_svc ) { % my $svcpart = $part_svc->svcpart; % my $pkg_svc = $pkg_svc{$svcpart} @@ -78,9 +84,13 @@ <INPUT TYPE="checkbox" NAME="no_bulk_skip<% $svcpart %>" VALUE="Y"<% $bulk_skip =~ /^Y/i ? '' : ' CHECKED' %>> </TD> - <TD ALIGN="center"> - <INPUT TYPE="checkbox" NAME="provision_hold<% $svcpart %>" VALUE="Y"<% $provision_hold =~ /^Y/i ? ' CHECKED' : ''%>> + <TD ALIGN="center" ID="td_provision_hold<% $svcpart %>"> + <INPUT TYPE="checkbox" ID="input_provision_hold<% $svcpart %>" NAME="provision_hold<% $svcpart %>" VALUE="Y"<% $provision_hold =~ /^Y/i ? ' CHECKED' : ''%>> </TD> +<SCRIPT> +provision_hold_td.push(document.getElementById('td_provision_hold<% $svcpart %>')); +provision_hold_input.push(document.getElementById('input_provision_hold<% $svcpart %>')); +</SCRIPT> </TR> % foreach ( 1 .. $columns-1 ) { @@ -92,10 +102,31 @@ % } % $count++; % -% } +% } # foreach $part_svc </TR></TABLE></TD></TR></TABLE> +<SCRIPT> +// start_on_hold from edit/part_pkg.cgi +// toggles display of provision_hold checkboxes when that changes +function provision_hold_check () { + var start_on_hold = document.getElementById('start_on_hold'); + if (start_on_hold) { + for (i = 0; i < provision_hold_td.length; i++) { + provision_hold_td[i].style.display = start_on_hold.checked ? '' : 'none'; + } + } +} +function provision_hold_init () { + var start_on_hold = document.getElementById('start_on_hold'); + if (start_on_hold) { + start_on_hold.onchange = provision_hold_check; + provision_hold_check(); + } +} +provision_hold_init(); +</SCRIPT> + % if ( scalar(@possible_exports) > 0 || scalar(@mapped_exports) > 0 ) { <TABLE><TR> <TH BGCOLOR="#dcdcdc">Export</TH> @@ -137,7 +168,7 @@ my $thead = "\n\n". ntable('#cccccc', 2). '<TH BGCOLOR="#dcdcdc">Service</TH>'. '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hide<BR>from<BR>Invoices</FONT></TH>'. '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Bulk<BR>Charge</FONT></TH>'. - '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hold<BR>Until<BR>Provision</FONT></TH>'. + '<TH BGCOLOR="#dcdcdc" ID="th_provision_hold"><FONT SIZE=-1>Remove Hold After Provisioning</FONT></TH>'. '</TR>'; my $part_pkg = $opt{'object'}; |