summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-11-28 08:55:29 -0500
committerChristopher Burger <burgerc@freeside.biz>2018-11-28 08:55:29 -0500
commit8f377efa3643b02c7ab25c989903813591888a1a (patch)
treedb8e0049c927637015c6096893df49b20f5467f6 /httemplate/edit
parenta8d62307b05d924d3304fd7cf18177e2fc1c91f7 (diff)
RT# 81126 - IP address field now shows required when required, IP address and Radius Group sticky on error when provisioning svc broadband
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/elements/edit.html3
-rw-r--r--httemplate/edit/process/elements/process.html6
-rw-r--r--httemplate/edit/svc_broadband.cgi1
3 files changed, 10 insertions, 0 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 1d472099b..feec098f3 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -869,6 +869,7 @@ Example:
my(%opt) = @_;
+my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
#false laziness w/process.html
@@ -881,6 +882,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 d2b037053..0e9edb064 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -109,6 +109,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);
},
},