[freeside-commits] branch FREESIDE_4_BRANCH updated. d411726f4af13e1abf80c3c355827c1012e3004f

Jonathan Prykop jonathan at 420.am
Tue Aug 25 21:24:47 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  d411726f4af13e1abf80c3c355827c1012e3004f (commit)
       via  b5122b2d847a16d61fd5e6aa59561dbe69779146 (commit)
       via  718693443056b47d4dd8e72a2f8b06e5af3c58be (commit)
      from  a0c126a974fed07ccc90e76c6ac5834af0f8144b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d411726f4af13e1abf80c3c355827c1012e3004f
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Aug 25 21:46:01 2015 -0500

    RT#18361: Delay package from billing until services are provisioned [bug fix to javascript]

diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html
index 7ac67b7..de3f95a 100644
--- a/httemplate/elements/tr-pkg_svc.html
+++ b/httemplate/elements/tr-pkg_svc.html
@@ -114,6 +114,9 @@ function provision_hold_check () {
     for (i = 0; i < provision_hold_td.length; i++) {
       provision_hold_td[i].style.display = start_on_hold.checked ? '' : 'none';
     }
+    for (i = 0; i < provision_hold_input.length; i++) {
+      provision_hold_input[i].disabled = start_on_hold.checked ? false : true;
+    }
   }
 }
 function provision_hold_init () {

commit b5122b2d847a16d61fd5e6aa59561dbe69779146
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Aug 25 21:25:15 2015 -0500

    RT#18361: Delay package from billing until services are provisioned [bug fix to javascript]

diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html
index 1e9c0a3..7ac67b7 100644
--- a/httemplate/elements/tr-pkg_svc.html
+++ b/httemplate/elements/tr-pkg_svc.html
@@ -1,15 +1,14 @@
 <TR>
   <TD CLASS="background" COLSPAN=99>
 
-<% 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>
 
+<% itable('', 4, 1) %><TR><TD VALIGN="top">
+<% pkg_svc_thead() %>
+
 %foreach my $part_svc ( @part_svc ) {
 %  my $svcpart = $part_svc->svcpart;
 %  my $pkg_svc = $pkg_svc{$svcpart}
@@ -97,7 +96,7 @@ provision_hold_input.push(document.getElementById('input_provision_hold<% $svcpa
 %       if ( $count == int( $_ * scalar(@part_svc) / $columns ) ) { 
 %  
 
-         </TABLE></TD><TD VALIGN="top"><% $thead %>
+         </TABLE></TD><TD VALIGN="top"><% pkg_svc_thead() %>
 %   }
 %     }
 %     $count++;
@@ -161,15 +160,21 @@ provision_hold_init();
 my %opt = @_;
 my $cgi = $opt{'cgi'};
 
-my $thead =  "\n\n". ntable('#cccccc', 2).
-             '<TR>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Quan.</FONT></TH>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Primary</FONT></TH>'.
-             '<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" ID="th_provision_hold"><FONT SIZE=-1>Remove Hold After Provisioning</FONT></TH>'.
-             '</TR>';
+my $thead_count = 0;
+sub pkg_svc_thead {
+  $thead_count += 1;
+  return "\n\n". ntable('#cccccc', 2).
+         '<TR>'.
+         '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Quan.</FONT></TH>'.
+         '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Primary</FONT></TH>'.
+         '<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" ID="th_provision_hold' . $thead_count . '"><FONT SIZE=-1>Remove Hold After Provisioning</FONT></TH>'.
+         '</TR>'.
+         qq!<SCRIPT>provision_hold_td.push(document.getElementById('th_provision_hold$thead_count'))</SCRIPT>!;
+;
+}
 
 my $part_pkg = $opt{'object'};
 my $pkgpart = $part_pkg->pkgpart;

commit 718693443056b47d4dd8e72a2f8b06e5af3c58be
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Aug 25 01:17:24 2015 -0500

    RT#18361: Delay package from billing until services are provisioned [start_on_hold toggles checkboxes display]

diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html
index cfef51c..1e9c0a3 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'};

-----------------------------------------------------------------------

Summary of changes:
 httemplate/elements/tr-pkg_svc.html |   67 +++++++++++++++++++++++++++--------
 1 file changed, 53 insertions(+), 14 deletions(-)




More information about the freeside-commits mailing list