[freeside-commits] branch FREESIDE_3_BRANCH updated. 3f36d52bbd1d5be4c9f81cc0b1ce96e22a217052

Christopher Burger burgerc at freeside.biz
Wed Nov 28 08:23:03 PST 2018


The branch, FREESIDE_3_BRANCH has been updated
       via  3f36d52bbd1d5be4c9f81cc0b1ce96e22a217052 (commit)
       via  d616680361b7e453260fa1eb062f016982f8e836 (commit)
      from  a4c7d2df1a8e03a5bc4ee51a16734e4a255a0eb2 (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 3f36d52bbd1d5be4c9f81cc0b1ce96e22a217052
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Nov 28 10:30:35 2018 -0500

    RT# 81126 - fixed require svc_broadband ip check

diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 45c6b1158..7c18edac3 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -97,7 +97,7 @@ points to.  You can ask the object for a copy with the I<hash> method.
 
 sub table_info {
   my $conf = new FS::Conf;
-  my $ip_addr_required = $conf->exists('svc_broadband-allow_null_ip_addr');
+  my $ip_addr_required = $conf->exists('svc_broadband-allow_null_ip_addr') ? '' : '1';
   {
     'name' => 'Wireless broadband',
     'name_plural' => 'Wireless broadband services',

commit d616680361b7e453260fa1eb062f016982f8e836
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Nov 28 08:55:29 2018 -0500

    RT# 81126 - IP address field now shows required when required, IP address and Radius Group sticky on error when provisioning svc broadband
    
    Conflicts:
            FS/FS/svc_broadband.pm

diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 9cd085942..45c6b1158 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -96,6 +96,8 @@ points to.  You can ask the object for a copy with the I<hash> method.
 =cut
 
 sub table_info {
+  my $conf = new FS::Conf;
+  my $ip_addr_required = $conf->exists('svc_broadband-allow_null_ip_addr');
   {
     'name' => 'Wireless broadband',
     'name_plural' => 'Wireless broadband services',
@@ -117,7 +119,10 @@ sub table_info {
                          'type'     => 'fcc_477_speed',
                          'def_info' => 'both upload and download speed must be set to FCC 477 information if using that modifier',
                        },
-      'ip_addr'     => 'IP address',
+      'ip_addr'     => {
+                         'label' => 'IP address',
+                         'required' => $ip_addr_required,
+                       },
       'blocknum'    => 
       { 'label' => 'Address block',
                          'type'  => 'select',
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index a238a3f04..a919c0376 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -833,6 +833,7 @@ Example:
 
 my(%opt) = @_;
 
+my $conf = new FS::Conf;
 my $curuser = $FS::CurrentUser::CurrentUser;
 
 #false laziness w/process.html
@@ -845,6 +846,8 @@ my $fields = $opt{'fields'}
 my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields;
 
 push @actualfields, $pkey;
+push @actualfields, 'ip_addr' if $table eq 'svc_broadband';
+push @actualfields, 'usergroup' if ($table eq 'svc_broadband' && $conf->exists('svc_broadband-radius'));
 
 my $js_form_validate = {};
 
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 11757237a..7933717b0 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -105,6 +105,12 @@ Example:
 
 </%doc>
 %if ( $error ) {
+%  ## flatten any array refs so multi selects are sticky on error
+%  for my $param ($cgi->param) {
+%    if (ref($cgi->param($param)) eq "ARRAY") {
+%      $cgi->param($param, (join ",", @{$cgi->param($param)}));
+%    }
+%  }
 %
 %  #my $query = $m->scomp('/elements/create_uri_query');
 %  #$cgi->redirect("$url?$query");
diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi
index bcf55fe11..374af4770 100644
--- a/httemplate/edit/svc_broadband.cgi
+++ b/httemplate/edit/svc_broadband.cgi
@@ -109,6 +109,7 @@ my @fields = (
       return () unless $part_svc; #sanity check
       my $col = $part_svc->part_svc_column('ip_addr');
       return () unless $col; #sanity check
+      $col->set('required', 'Y') unless $conf->exists('svc_broadband-allow_null_ip_addr');
       return ('ip_addr_required' => $col->required);
     },
   },

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

Summary of changes:
 FS/FS/svc_broadband.pm                        | 7 ++++++-
 httemplate/edit/elements/edit.html            | 3 +++
 httemplate/edit/process/elements/process.html | 6 ++++++
 httemplate/edit/svc_broadband.cgi             | 1 +
 4 files changed, 16 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list