RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / edit / svc_domain.cgi
index 10079ce..9b54422 100755 (executable)
@@ -8,10 +8,19 @@
 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
 
 <% ntable("#cccccc",2) %>
+
 <TR>
-<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="<% $domain %>" SIZE=28 MAXLENGTH=63>
-<BR>
+  <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>
 
@@ -26,12 +35,57 @@ Available top-level domains: <% $export->option('tlds') %>
 
 </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,
+                     )
+           %>
+%    }
 
-<TR>
-<P><INPUT TYPE="submit" VALUE="Submit">
+% }
+  </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>
+
+<% include('svc_domain/communigate-acct_defaults.html',
+             'svc_domain'  => $svc_domain,
+             'part_svc'    => $part_svc,
+             'communigate' => $communigate,
+          )
+%>
+
+<INPUT TYPE="submit" VALUE="Submit">
+
 </FORM>
 
 <% include('/elements/footer.html') %>
@@ -41,6 +95,8 @@ Available top-level domains: <% $export->option('tlds') %>
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
 
+my $conf = new FS::Conf;
+
 my($svcnum, $pkgnum, $svcpart, $kludge_action, $part_svc,
    $svc_domain);
 if ( $cgi->param('error') ) {
@@ -94,21 +150,14 @@ my $action = $svcnum ? 'Edit' : 'Add';
 
 my $svc = $part_svc->getfield('svc');
 
-my @exports = $part_svc->part_export();
-
-my $registrar;
-my $export;
+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
-foreach (@exports) {
-       $export = $_ if $_->can('registrar');
-}
+my @exports = grep $_->can('registrar'), $part_svc->part_export;
+my $export = $exports[0];
 # If we have a domain registration export, get the registrar object
-if ($export) {
-       $registrar = $export->registrar;
-}
-
-my $otaker = getotaker;
+my $registrar = $export ? $export->registrar : '';
 
 my $domain = $svc_domain->domain;