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>
19 <INPUT TYPE="hidden" NAME="domain" VALUE="<% $domain %>">
24 Available top-level domains: <% $export->option('tlds') %>
28 <INPUT TYPE="radio" NAME="action" VALUE="N"<% $kludge_action eq 'N' ? ' CHECKED' : '' %>>Register at <% $registrar->{'name'} %>
31 <INPUT TYPE="radio" NAME="action" VALUE="M"<% $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer to <% $registrar->{'name'} %>
34 <INPUT TYPE="radio" NAME="action" VALUE="I"<% $kludge_action eq 'I' ? ' CHECKED' : '' %>>Registered elsewhere
38 % if($export->option('auoptions')) {
39 % # XXX: this whole thing should be done like svc_Common with label_fixup, etc. eventually
40 <% include('/elements/tr-select.html',
41 'field' => 'au_eligibiilty_type',
42 'label' => 'AU Eligibility Type',
43 'value' => $svc_domain->au_eligibility_type,
44 'options' => $svc_domain->au_eligibility_type_values,
47 <% include('/elements/tr-input-text.html',
48 'field' => 'au_registrant_name',
49 'label' => 'AU Registrant Name',
50 'value' => $svc_domain->au_registrant_name,
59 <% include('svc_domain/communigate-basics.html',
60 'svc_domain' => $svc_domain,
61 'part_svc' => $part_svc,
62 'communigate' => $communigate,
69 <% include('svc_domain/communigate-acct_defaults.html',
70 'svc_domain' => $svc_domain,
71 'part_svc' => $part_svc,
72 'communigate' => $communigate,
76 <INPUT TYPE="submit" VALUE="Submit">
80 <% include('/elements/footer.html') %>
85 unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
87 my $conf = new FS::Conf;
89 my($svcnum, $pkgnum, $svcpart, $kludge_action, $part_svc,
91 if ( $cgi->param('error') ) {
93 $svc_domain = new FS::svc_domain ( {
94 map { $_, scalar($cgi->param($_)) } fields('svc_domain')
96 $svcnum = $svc_domain->svcnum;
97 $pkgnum = $cgi->param('pkgnum');
98 $svcpart = $cgi->param('svcpart');
99 $kludge_action = $cgi->param('action');
100 $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
101 die "No part_svc entry!" unless $part_svc;
103 } elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
105 $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
107 $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
110 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
111 die "No part_svc entry!" unless $part_svc;
113 $svc_domain = new FS::svc_domain({});
117 $svc_domain->set_default_and_fixed;
122 my($query) = $cgi->keywords;
123 $query =~ /^(\d+)$/ or die "unparsable svcnum";
125 $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
126 or die "Unknown (svc_domain) svcnum!";
128 my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
129 or die "Unknown (cust_svc) svcnum!";
131 $pkgnum=$cust_svc->pkgnum;
132 $svcpart=$cust_svc->svcpart;
134 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
135 die "No part_svc entry!" unless $part_svc;
138 my $action = $svcnum ? 'Edit' : 'Add';
140 my $svc = $part_svc->getfield('svc');
142 my $communigate = scalar($part_svc->part_export('communigate_pro'));
143 # || scalar($part_svc->part_export('communigate_pro_singledomain'));
145 # Find the first export that does domain registration
146 my @exports = grep $_->can('registrar'), $part_svc->part_export;
147 my $export = $exports[0];
148 # If we have a domain registration export, get the registrar object
149 my $registrar = $export ? $export->registrar : '';
151 my $otaker = getotaker;
153 my $domain = $svc_domain->domain;