<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
-<INPUT TYPE="radio" NAME="action" VALUE="N"<% $kludge_action eq 'N' ? ' CHECKED' : '' %>>New
+<% ntable("#cccccc",2) %>
+
+<TR>
+ <TD ALIGN="right">Domain</TD>
+ <TD>
+% if ( !$svcnum || $conf->exists('svc_domain-edit_domain') ) {
+ <INPUT TYPE="text" NAME="domain" VALUE="<% $domain %>" SIZE=28 MAXLENGTH=63>
+% } else {
+ <B><% $domain %></B>
+ <INPUT TYPE="hidden" NAME="domain" VALUE="<% $domain %>">
+% }
+
+% if ($export) {
<BR>
+Available top-level domains: <% $export->option('tlds') %>
+</TR>
-<INPUT TYPE="radio" NAME="action" VALUE="M"<% $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer
+<TR>
+<INPUT TYPE="radio" NAME="action" VALUE="N"<% $kludge_action eq 'N' ? ' CHECKED' : '' %>>Register at <% $registrar->{'name'} %>
+<BR>
+
+<INPUT TYPE="radio" NAME="action" VALUE="M"<% $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer to <% $registrar->{'name'} %>
+<BR>
-<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="<% $domain %>" SIZE=28 MAXLENGTH=63>
+<INPUT TYPE="radio" NAME="action" VALUE="I"<% $kludge_action eq 'I' ? ' CHECKED' : '' %>>Registered elsewhere
+
+</TR>
+
+% if($export->option('auoptions')) {
+% # XXX: this whole thing should be done like svc_Common with label_fixup, etc. eventually
+ <% include('/elements/tr-select.html',
+ 'field' => 'au_eligibiilty_type',
+ 'label' => 'AU Eligibility Type',
+ 'value' => $svc_domain->au_eligibility_type,
+ 'options' => $svc_domain->au_eligibility_type_values,
+ )
+ %>
+ <% include('/elements/tr-input-text.html',
+ 'field' => 'au_registrant_name',
+ 'label' => 'AU Registrant Name',
+ 'value' => $svc_domain->au_registrant_name,
+ )
+ %>
+% }
+
+% }
+ </TD>
+</TR>
+
+% if ( $part_svc->part_svc_column('quota')->columnflag =~ /^[FA]$/ ) {
+ <INPUT TYPE="hidden" NAME="quota" VALUE="<% $svc_domain->quota %>">
+% } else {
+ <TR>
+ <TD ALIGN="right">Quota</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="quota" SIZE=8 VALUE="<% $svc_domain->quota %>">
+ </TD>
+ </TR>
+% }
+
+<% include('svc_domain/communigate-basics.html',
+ 'svc_domain' => $svc_domain,
+ 'part_svc' => $part_svc,
+ 'communigate' => $communigate,
+ )
+%>
+
+</TABLE>
+<BR>
-<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="<% $purpose %>" SIZE=64>
+<% include('svc_domain/communigate-acct_defaults.html',
+ 'svc_domain' => $svc_domain,
+ 'part_svc' => $part_svc,
+ 'communigate' => $communigate,
+ )
+%>
-<P><INPUT TYPE="submit" VALUE="Submit">
+<INPUT TYPE="submit" VALUE="Submit">
</FORM>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
-my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
+my $conf = new FS::Conf;
+
+my($svcnum, $pkgnum, $svcpart, $kludge_action, $part_svc,
$svc_domain);
if ( $cgi->param('error') ) {
$pkgnum = $cgi->param('pkgnum');
$svcpart = $cgi->param('svcpart');
$kludge_action = $cgi->param('action');
- $purpose = $cgi->param('purpose');
$part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
die "No part_svc entry!" unless $part_svc;
} else { #editing
$kludge_action = '';
- $purpose = '';
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ or die "unparsable svcnum";
$svcnum=$1;
my $svc = $part_svc->getfield('svc');
-my $otaker = getotaker;
+my $communigate = scalar($part_svc->part_export('communigate_pro'));
+ # || scalar($part_svc->part_export('communigate_pro_singledomain'));
+
+# Find the first export that does domain registration
+my @exports = grep $_->can('registrar'), $part_svc->part_export;
+my $export = $exports[0];
+# If we have a domain registration export, get the registrar object
+my $registrar = $export ? $export->registrar : '';
my $domain = $svc_domain->domain;