diff options
| author | Jonathan Prykop <jonathan@freeside.biz> | 2015-05-05 15:49:51 -0500 |
|---|---|---|
| committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-05-21 17:50:56 -0500 |
| commit | fb7f3203c7d839ae3964d5e2cac71892422a10d1 (patch) | |
| tree | 59baf4406ffd32c82bf8c45430f44770fe505ca2 /httemplate/edit/elements | |
| parent | ec271a1445bf232cd172c38e2dd3fd9d3c5c7c4e (diff) | |
RT#34289: Flag service fields as mandatory
Diffstat (limited to 'httemplate/edit/elements')
| -rw-r--r-- | httemplate/edit/elements/edit.html | 1 | ||||
| -rw-r--r-- | httemplate/edit/elements/part_svc_column.html | 7 | ||||
| -rw-r--r-- | httemplate/edit/elements/svc_Common.html | 3 |
3 files changed, 9 insertions, 2 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index c80cdae19..c9eceb459 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -395,6 +395,7 @@ Example: % 'value' => $opt{curr_value}, % 'label' => $label, % 'noinit' => $f->{noinit}, +% 'required' => $f->{'required'}, % } % ); % } diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html index a6ccaf867..d9500320a 100644 --- a/httemplate/edit/elements/part_svc_column.html +++ b/httemplate/edit/elements/part_svc_column.html @@ -77,7 +77,7 @@ that field. <TH BGCOLOR="#cccccc">Field</TH> <TH BGCOLOR="#cccccc">Label</TH> <TH BGCOLOR="#cccccc" COLSPAN=2>Modifier</TH> - <TH BGCOLOR="#cccccc">Required?</TH> + <TH BGCOLOR="#cccccc"><% $manual_require ? 'Required?' : '' %></TH> </TR> % $part_svc->set('svcpart' => $opt{'clone'}) if $opt{'clone'}; # for now % my $i = 0; @@ -212,7 +212,9 @@ that field. % } </TD> <TD> -% if (!$def->{'type'} || !(grep {$_ eq $def->{'type'}} ('checkbox','disabled'))) { +% if ($manual_require && +% (!$def->{'type'} || !(grep {$_ eq $def->{'type'}} ('checkbox','disabled'))) +% ) { <INPUT ID="<% $name.'_required' %>" TYPE="checkbox" NAME="<% $svcdb %>__<% $field %>_required" VALUE="Y" <% ($part_svc_column->required || $def->{'required'}) ? 'CHECKED' : '' %> <% $def->{'required'} ? 'DISABLED' : '' %> @@ -310,4 +312,5 @@ if ( $svcdb eq 'svc_acct' } my @defs = map { FS::part_svc->svc_table_fields($svcdb)->{$_} } @fields; +my $manual_require = FS::part_svc->svc_table_info($svcdb)->{'manual_require'}; </%init> diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index 97b630f76..a4e345e40 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -102,6 +102,9 @@ my $columndef = $part_svc->part_svc_column($f->{'field'}); my $flag = $columndef->columnflag; + $f->{'required'} = 1 + if $columndef->required; + if ( $flag eq 'F' ) { #fixed $f->{'value'} = $columndef->columnvalue; if (length($columndef->columnvalue)) { |
