diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-06-13 15:18:37 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-06-13 15:18:37 -0700 |
| commit | 7beec7068e00be5ae1b2599fdf2b494bc19e31d0 (patch) | |
| tree | 055e1d25694ccfdac3a2d5aca79441cf7a3d89b5 /httemplate/edit/elements | |
| parent | 9e8d2a5bafb21c42f54cdd9b3703e2f88a36e0a8 (diff) | |
| parent | eb6536b41456955fc425dba2e156a996e8fe2837 (diff) | |
Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH
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 | 18 | ||||
| -rw-r--r-- | httemplate/edit/elements/svc_Common.html | 3 | ||||
| -rw-r--r-- | httemplate/edit/elements/svc_forward.html | 83 |
4 files changed, 102 insertions, 3 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 2bb4f5e41..d9500320a 100644 --- a/httemplate/edit/elements/part_svc_column.html +++ b/httemplate/edit/elements/part_svc_column.html @@ -77,6 +77,7 @@ that field. <TH BGCOLOR="#cccccc">Field</TH> <TH BGCOLOR="#cccccc">Label</TH> <TH BGCOLOR="#cccccc" COLSPAN=2>Modifier</TH> + <TH BGCOLOR="#cccccc"><% $manual_require ? 'Required?' : '' %></TH> </TR> % $part_svc->set('svcpart' => $opt{'clone'}) if $opt{'clone'}; # for now % my $i = 0; @@ -210,9 +211,19 @@ that field. &> % } </TD> + <TD> +% 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' : '' %> + > +% } + </TD> </TR> <TR CLASS="row<%$i%>"> - <TD COLSPAN=2 CLASS="def_info"> + <TD COLSPAN=3 CLASS="def_info"> % if ( $def->{def_info} ) { (<% $def->{def_info} %>) </TD> @@ -228,7 +239,7 @@ that field. <TD COLSPAN=3 ALIGN="right"> <% emt('Require "Provision" access right to edit password') %> </TD> - <TD> + <TD COLSPAN=2> <INPUT TYPE="checkbox" NAME="restrict_edit_password" VALUE="Y" \ <% $part_svc->restrict_edit_password ? 'CHECKED' : '' %>> </TD> @@ -244,7 +255,7 @@ that field. <TD COLSPAN=3 ALIGN="right"> <% emt('This service has an attached router') %> </TD> - <TD> + <TD COLSPAN=2> <INPUT TYPE="checkbox" NAME="has_router" VALUE="Y" \ <% $part_svc->has_router ? 'CHECKED' : '' %>> </TD> @@ -301,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)) { diff --git a/httemplate/edit/elements/svc_forward.html b/httemplate/edit/elements/svc_forward.html new file mode 100644 index 000000000..e40ebe807 --- /dev/null +++ b/httemplate/edit/elements/svc_forward.html @@ -0,0 +1,83 @@ +<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $opt{'svcnum'} %>"> +<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $opt{'pkgnum'} %>"> +<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $opt{'svcpart'} %>"> + +<SCRIPT TYPE="text/javascript"> +function srcchanged(what) { + if ( what.options[what.selectedIndex].value == 0 ) { + what.form.src.disabled = false; + what.form.src.style.backgroundColor = "white"; + } else { + what.form.src.disabled = true; + what.form.src.style.backgroundColor = "lightgrey"; + } +} +function dstchanged(what) { + if ( what.options[what.selectedIndex].value == 0 ) { + what.form.dst.disabled = false; + what.form.dst.style.backgroundColor = "white"; + } else { + what.form.dst.disabled = true; + what.form.dst.style.backgroundColor = "lightgrey"; + } +} +</SCRIPT> + +<% ntable("#cccccc",2) %> + +<TR> + <TD ALIGN="right">Email to</TD> + <TD> +% if ( $conf->exists('svc_forward-no_srcsvc') ) { + <INPUT NAME="srcsrc" TYPE="hidden" VALUE="0"> +% } else { + <SELECT NAME="srcsvc" SIZE=1 onChange="srcchanged(this)"> +% foreach my $somesvc (keys %email) { + <OPTION VALUE="<% $somesvc %>" + <% $somesvc eq $opt{'srcsvc'} ? 'SELECTED' : '' %> + ><% $email{$somesvc} %></OPTION> +% } + <OPTION VALUE="0" <% $opt{'src'} ? 'SELECTED' : '' %> + >(other email address)</OPTION> + </SELECT> +% } + +% my $src_disabled = $opt{'src'} +% || $conf->exists('svc_forward-no_srcsvc') +% || !scalar(%email); + <INPUT NAME = "src" + TYPE = "text" + VALUE = "<% $opt{'src'} %>" + <% $src_disabled ? '' : 'DISABLED STYLE="background-color: lightgrey"' %> + > + + </TD> +</TR> + +<TR><TD ALIGN="right">Forwards to</TD> +<TD><SELECT NAME="dstsvc" SIZE=1 onChange="dstchanged(this)"> +% foreach my $somesvc (keys %email) { + + <OPTION<% $somesvc eq $opt{'dstsvc'} ? " SELECTED" : "" %> VALUE="<% $somesvc %>"><% $email{$somesvc} %></OPTION> +% } + +<OPTION <% $opt{'dst'} ? 'SELECTED' : '' %> VALUE="0">(other email address)</OPTION> +</SELECT> +<INPUT TYPE="text" NAME="dst" VALUE="<% $opt{'dst'} %>" <% ( $opt{'dst'} || !scalar(%email) ) ? '' : 'DISABLED STYLE="background-color: lightgrey"' %>> +</TD></TR> +</TABLE> + +<%init> + +# This is used directly by selfservice, only use what's passed +# Do not look up sensitive information here + +my %opt = @_; + +my $conf = $opt{'conf'}; +$conf ||= new FS::Conf; + +my %email; +%email = %{$opt{'email'}} if ref($opt{'email'}) eq 'HASH'; + +</%init> |
