[freeside-commits] branch FREESIDE_3_BRANCH updated. dd268209494ce9fc3491d02b8c3034a7dffc84e4

Jonathan Prykop jonathan at 420.am
Tue Aug 25 21:45:52 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  dd268209494ce9fc3491d02b8c3034a7dffc84e4 (commit)
       via  8550a95443b6e3ddc9d8438d65b5e38e45b638c0 (commit)
       via  fec109316e1aa49651b72fd31cc938d2ea6ee5cf (commit)
      from  147d171069905e80a47442ee4b35515534989909 (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 dd268209494ce9fc3491d02b8c3034a7dffc84e4
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 9aa14b8..abcde29 100644
--- a/httemplate/elements/tr-pkg_svc.html
+++ b/httemplate/elements/tr-pkg_svc.html
@@ -97,6 +97,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 8550a95443b6e3ddc9d8438d65b5e38e45b638c0
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 [v3 merge]

diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html
index c355c20..9aa14b8 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}
@@ -80,7 +79,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++;
@@ -144,13 +143,20 @@ 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=-2>Primary</FONT></TH>'.
-             '<TH BGCOLOR="#dcdcdc">Service</TH>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hide</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" 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 fec109316e1aa49651b72fd31cc938d2ea6ee5cf
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 [v3 merge]

diff --git a/httemplate/elements/tr-pkg_svc.html b/httemplate/elements/tr-pkg_svc.html
index b3bf802..c355c20 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}
@@ -61,9 +67,13 @@
       <INPUT TYPE="checkbox" NAME="hidden<% $svcpart %>" VALUE="Y"<% $pkg_svc->hidden =~ /^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 ) {
@@ -75,10 +85,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>
@@ -118,7 +149,7 @@ my $thead =  "\n\n". ntable('#cccccc', 2).
              '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-2>Primary</FONT></TH>'.
              '<TH BGCOLOR="#dcdcdc">Service</TH>'.
              '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hide</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 |   64 ++++++++++++++++++++++++++++-------
 1 file changed, 52 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list