1 <% include('/elements/header.html', "$action $svc", '') %>
3 <% include('/elements/error.html') %>
5 <FORM ACTION="<% $p1 %>process/svc_domain.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
7 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
8 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
10 <% ntable("#cccccc",2) %>
13 <TD ALIGN="right">Domain</TD>
15 % if ( !$svcnum || $conf->exists('svc_domain-edit_domain') ) {
16 <INPUT TYPE="text" NAME="domain" VALUE="<% $domain %>" SIZE=28 MAXLENGTH=63>
23 Available top-level domains: <% $export->option('tlds') %>
27 <INPUT TYPE="radio" NAME="action" VALUE="N"<% $kludge_action eq 'N' ? ' CHECKED' : '' %>>Register at <% $registrar->{'name'} %>
30 <INPUT TYPE="radio" NAME="action" VALUE="M"<% $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer to <% $registrar->{'name'} %>
33 <INPUT TYPE="radio" NAME="action" VALUE="I"<% $kludge_action eq 'I' ? ' CHECKED' : '' %>>Registered elsewhere
41 % if ( $communigate ) {
43 <TD ALIGN="right">Administrator domain</TD>
45 <% include('/elements/select-domain.html',
46 'element_name' => 'parent_svcnum',
47 'curr_value' => $svc_domain->parent_svcnum,
48 'empty_label' => '(none)',
54 <INPUT TYPE="hidden" NAME="parent_svcnum" VALUE="<% $svc_domain->parent_svcnum %>">
58 % && $part_svc->part_svc_column('cgp_aliases')->columnflag !~ /^[FA]$/ ) {
61 <TD ALIGN="right">Aliases</TD>
62 <TD><INPUT TYPE="text" NAME="cgp_aliases" VALUE="<% $svc_domain->cgp_aliases %>"></TD>
66 <INPUT TYPE="hidden" NAME="cgp_aliases" VALUE="<% $svc_domain->cgp_aliases %>">
69 % if ( $part_svc->part_svc_column('max_accounts')->columnflag =~ /^[FA]$/ ) {
70 <INPUT TYPE="hidden" NAME="max_accounts" VALUE="<% $svc_domain->max_accounts %>">
73 <TD ALIGN="right">Maximum number of accounts</TD>
75 <INPUT TYPE="text" NAME="max_accounts" SIZE=5 MAXLENGTH=6 VALUE="<% $svc_domain->max_accounts %>">
81 % && $part_svc->part_svc_column('cgp_accessmodes')->columnflag ne 'F' )
85 <TD ALIGN="right">Enabled services</TD>
87 <% include( '/elements/communigate_pro-accessmodes.html',
88 'curr_value' => $svc_domain->cgp_accessmodes,
95 <INPUT TYPE="hidden" NAME="cgp_accessmodes" VALUE="<% $svc_domain->cgp_accessmodes() |h %>">
99 % && $part_svc->part_svc_column('trailer')->columnflag ne 'F' )
103 <TD ALIGN="right">Mail trailer</TD>
105 <TEXTAREA NAME="trailer" ROWS=5 COLS=60><% $svc_domain->trailer() |h %></TEXTAREA>
110 <INPUT TYPE="hidden" NAME="trailer" VALUE="<% $svc_domain->trailer() |h %>">
117 % if ( $communigate ) {
120 <% ntable("#cccccc",2) %>
122 <% include('/elements/tr-checkbox.html',
123 'label' => 'Password modification',
124 'field' => 'acct_def_password_selfchange',
125 'curr_value' => $svc_domain->acct_def_password_selfchange,
130 <% include('/elements/tr-checkbox.html',
131 'label' => 'Password recovery',
132 'field' => 'acct_def_password_recover',
133 'curr_value' => $svc_domain->acct_def_password_recover,
139 <TD ALIGN="right">Enabled services
141 <TD><% include('/elements/communigate_pro-accessmodes.html',
142 'element_name_prefix' => 'acct_def_cgp_accessmodes_',
143 'curr_value' => $svc_domain->acct_def_cgp_accessmodes,
149 <% include('/elements/tr-input-text.html',
150 'label' => 'Mail storage limit',
151 'field' => 'acct_def_quota',
152 'curr_value' => $svc_domain->acct_def_quota,
155 <% include('/elements/tr-input-text.html',
156 'label' => 'File storage limit',
157 'field' => 'acct_def_file_quota',
158 'curr_value' => $svc_domain->acct_def_file_quota,
161 <% include('/elements/tr-input-text.html',
162 'label' => 'Files limit',
163 'field' => 'acct_def_file_maxnum',
164 'curr_value' => $svc_domain->acct_def_file_maxnum,
167 <% include('/elements/tr-input-text.html',
168 'label' => 'File size limit',
169 'field' => 'acct_def_file_maxsize',
170 'curr_value' => $svc_domain->acct_def_file_maxsize,
174 <% include('/elements/tr-select.html',
175 'label' => 'Allowed mail rules',
176 'field' => 'acct_def_cgp_rulesallowed',
177 'options' => [ '', 'No', 'Filter Only', 'All But Exec', 'Any' ],
179 '' => 'default (No)', #No always the default?
181 'curr_value' => $svc_domain->acct_def_cgp_rulesallowed,
185 <% include('/elements/tr-checkbox.html',
186 'label' => 'RPOP modifications',
187 'field' => 'acct_def_cgp_rpopallowed',
188 'curr_value' => $svc_domain->acct_def_cgp_rpopallowed,
193 <% include('/elements/tr-checkbox.html',
194 'label' => 'Accepts mail to "all"',
195 'field' => 'acct_def_cgp_mailtoall',
196 'curr_value' => $svc_domain->acct_def_cgp_mailtoall,
201 <% include('/elements/tr-checkbox.html',
202 'label' => 'Add trailer to sent mail',
203 'field' => 'acct_def_cgp_addmailtrailer',
204 'curr_value' => $svc_domain->acct_def_cgp_addmailtrailer,
209 %# false laziness w/svc_acct acct_def
211 <TD ALIGN="right">Message delete method</TD>
213 <SELECT NAME="acct_def_cgp_deletemode">
214 % for ( 'Move To Trash', 'Immediately', 'Mark' ) {
215 <OPTION VALUE="<% $_ %>"
216 <% $_ eq $svc_domain->acct_def_cgp_deletemode ? 'SELECTED' : '' %>
223 <% include('/elements/tr-select.html',
224 'label' => 'On logout remove trash',
225 'field' => 'acct_def_cgp_emptytrash',
226 'options' => $svc_domain->cgp_emptytrash_values,
228 '' => 'default (92 days)', #right?
230 'curr_value' => $svc_domain->acct_def_cgp_emptytrash,
234 <% include('/elements/tr-select.html',
235 'label' => 'Language',
236 'field' => 'acct_def_cgp_language',
237 'options' => [ '', qw( English Arabic Chinese Dutch French German Hebrew Italian Japanese Portuguese Russian Slovak Spanish Thai ) ],
239 '' => 'default (English)',
241 'curr_value' => $svc_domain->acct_def_cgp_language,
245 <% include('/elements/tr-select.html',
246 'label' => 'Time zone',
247 'field' => 'acct_def_cgp_timezone',
248 'options' => $svc_domain->cgp_timezone_values,
250 '' => 'default (HostOS)',
252 'curr_value' => $svc_domain->acct_def_cgp_timezone,
256 <% include('/elements/tr-select.html',
258 'field' => 'acct_def_cgp_skinname',
259 'options' => [ '', '***', 'GoldFleece', 'Skin2' ],
261 '' => 'default (***)',
263 'curr_value' => $svc_domain->acct_def_cgp_skinname,
267 <% include('/elements/tr-select.html',
268 'label' => 'Pronto style',
269 'field' => 'acct_def_cgp_prontoskinname',
270 'options' => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ],
271 'curr_value' => $svc_domain->acct_def_cgp_prontoskinname,
275 <% include('/elements/tr-select.html',
276 'label' => 'Send read receipts',
277 'field' => 'acct_def_cgp_sendmdnmode',
278 'options' => [ '', 'Never', 'Manually', 'Automatically' ],
280 '' => 'default (Automatically)',
282 'curr_value' => $svc_domain->acct_def_cgp_language,
286 % #XXX rules, archive rule, spam foldering rule(s)
293 % foreach my $f (qw( password_selfchange password_recover cgp_accessmodes
294 % quota file_quota file_maxnum file_maxsize
295 % cgp_rulesallowed cgp_rpopallowed cgp_mailtoall
297 % cgp_deletemode cgp_emptytrash cgp_language
298 % cgp_timezone cgp_skinname cgp_sendmdnmode
300 <INPUT TYPE="hidden" NAME="acct_def_<%$f%>" VALUE="<% $svc_domain->get("acct_def_$f") %>">
305 <INPUT TYPE="submit" VALUE="Submit">
309 <% include('/elements/footer.html') %>
314 unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
316 my $conf = new FS::Conf;
318 my($svcnum, $pkgnum, $svcpart, $kludge_action, $part_svc,
320 if ( $cgi->param('error') ) {
322 $svc_domain = new FS::svc_domain ( {
323 map { $_, scalar($cgi->param($_)) } fields('svc_domain')
325 $svcnum = $svc_domain->svcnum;
326 $pkgnum = $cgi->param('pkgnum');
327 $svcpart = $cgi->param('svcpart');
328 $kludge_action = $cgi->param('action');
329 $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
330 die "No part_svc entry!" unless $part_svc;
332 } elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
334 $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
336 $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
339 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
340 die "No part_svc entry!" unless $part_svc;
342 $svc_domain = new FS::svc_domain({});
346 $svc_domain->set_default_and_fixed;
351 my($query) = $cgi->keywords;
352 $query =~ /^(\d+)$/ or die "unparsable svcnum";
354 $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
355 or die "Unknown (svc_domain) svcnum!";
357 my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
358 or die "Unknown (cust_svc) svcnum!";
360 $pkgnum=$cust_svc->pkgnum;
361 $svcpart=$cust_svc->svcpart;
363 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
364 die "No part_svc entry!" unless $part_svc;
367 my $action = $svcnum ? 'Edit' : 'Add';
369 my $svc = $part_svc->getfield('svc');
371 my $communigate = scalar($part_svc->part_export('communigate_pro'));
372 # || scalar($part_svc->part_export('communigate_pro_singledomain'));
374 # Find the first export that does domain registration
375 my @exports = grep $_->can('registrar'), $part_svc->part_export;
376 my $export = $exports[0];
377 # If we have a domain registration export, get the registrar object
378 my $registrar = $export ? $export->registrar : '';
380 my $otaker = getotaker;
382 my $domain = $svc_domain->domain;