diff options
author | ivan <ivan> | 2010-02-22 09:18:10 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-02-22 09:18:10 +0000 |
commit | 5fa9ce1b7c8b934e96a6a2f850a4e788eb76f495 (patch) | |
tree | 44ee491d16cf72bfa72fbe573d83901c6729d5c5 /httemplate/edit | |
parent | a1807414d26dd7d4c3ce67310047944178b07363 (diff) |
communigate: domain account defaults, RT#7083
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 8 | ||||
-rwxr-xr-x | httemplate/edit/process/svc_domain.cgi | 12 | ||||
-rwxr-xr-x | httemplate/edit/svc_acct.cgi | 2 | ||||
-rwxr-xr-x | httemplate/edit/svc_domain.cgi | 90 |
4 files changed, 112 insertions, 0 deletions
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 6428960dd..80f61a100 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -266,6 +266,14 @@ that field. % 'empty_label' => 'Select inventory class', % ); % +% } elsif ( $def->{type} eq 'checkbox' ) { +% +% $html .= include('/elements/checkbox.html', +% 'field' => $layer.'__'.$field, +% 'curr_value' => $value, +% 'value' => 'Y', +% ); +% % } elsif ( $def->{type} eq 'select' ) { % % $html .= qq!<SELECT NAME="${layer}__${field}" $disabled!; diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi index ea97918e8..381339bc8 100755 --- a/httemplate/edit/process/svc_domain.cgi +++ b/httemplate/edit/process/svc_domain.cgi @@ -27,6 +27,18 @@ unless ( $cgi->param('cgp_accessmodes') ) { ); } +#unmunge acct_def_cgp_accessmodes (falze laziness-ahoy) +unless ( $cgi->param('acct_def_cgp_accessmodes') ) { + $cgi->param('acct_def_cgp_accessmodes', + join(' ', + sort map { /^acct_def_cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; } + grep $cgi->param($_), + grep /^acct_def_cgp_accessmodes_([\w\/]+)$/, + $cgi->param() + ) + ); +} + my $new = new FS::svc_domain ( { map { $_, scalar($cgi->param($_)); diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index c842b1b57..99e4b74a4 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -279,6 +279,7 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR> % } +% #false laziness w/svc_domain % if ( $communigate % && $part_svc->part_svc_column('cgp_accessmodes')->columnflag ne 'F' ) % { @@ -330,6 +331,7 @@ Service # <% $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR> % if ( $communigate ) { +%# false laziness w/svc_domain acct_def <TR> <TD ALIGN="right">Message delete method</TD> <TD> diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi index a3589c4a7..78faf12b2 100755 --- a/httemplate/edit/svc_domain.cgi +++ b/httemplate/edit/svc_domain.cgi @@ -96,8 +96,98 @@ Available top-level domains: <% $export->option('tlds') %> % } </TABLE> +<BR> + +% if ( $communigate ) { +Account defaults +<% ntable("#cccccc",2) %> + + <% include('/elements/tr-checkbox.html', + 'label' =>'Password modification', + 'field' => 'acct_def_password_selfchange', + 'curr_value' => $svc_domain->acct_def_password_selfchange, + 'value' => 'Y', + ) + %> + <% include('/elements/tr-checkbox.html', + 'label' =>'Password recovery', + 'field' => 'acct_def_password_recover', + 'curr_value' => $svc_domain->acct_def_password_recover, + 'value' => 'Y', + ) + %> + + <TR> + <TD ALIGN="right">Enabled services + </TD> + <TD><% include('/elements/communigate_pro-accessmodes.html', + 'element_name_prefix' => 'acct_def_cgp_accessmodes_', + 'curr_value' => $svc_domain->acct_def_cgp_accessmodes, + ) + %> + </TD> + </TR> + + <% include('/elements/tr-input-text.html', + 'label' => 'Mail storage limit', + 'field' => 'acct_def_quota', + 'curr_value' => $svc_domain->acct_def_quota, + ) + %> + <% include('/elements/tr-input-text.html', + 'label' => 'File storage limit', + 'field' => 'acct_def_file_quota', + 'curr_value' => $svc_domain->acct_def_file_quota, + ) + %> + <% include('/elements/tr-input-text.html', + 'label' => 'Files limit', + 'field' => 'acct_def_file_maxnum', + 'curr_value' => $svc_domain->acct_def_file_maxnum, + ) + %> + <% include('/elements/tr-input-text.html', + 'label' => 'File size limit', + 'field' => 'acct_def_file_maxsize', + 'curr_value' => $svc_domain->acct_def_file_maxsize, + ) + %> + +%# false laziness w/svc_acct acct_def + <TR> + <TD ALIGN="right">Message delete method</TD> + <TD> + <SELECT NAME="acct_def_cgp_deletemode"> +% for ( 'Move To Trash', 'Immediately', 'Mark' ) { + <OPTION VALUE="<% $_ %>" + <% $_ eq $svc_domain->acct_def_cgp_deletemode ? 'SELECTED' : '' %> + ><% $_ %> +% } + </SELECT> + </TD> + </TR> + + <% include('/elements/tr-input-text.html', + 'label' => 'On logout remove trash', + 'curr_value' => $svc_domain->acct_def_cgp_emptytrash, + ) + %> + +</TABLE> <BR> + +% } else { + +% foreach my $f (qw( password_selfchange password_recover cgp_accessmodes +% quota file_quota file_maxnum file_maxsize +% cgp_deletemode cgp_emptytrash +% )) { + <INPUT TYPE="hidden" NAME="acct_def_<%$f%>" VALUE="<% $svc_domain->get("acct_def_$f") %>"> +% } + +% } + <INPUT TYPE="submit" VALUE="Submit"> </FORM> |