summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2010-02-22 07:13:29 +0000
committerivan <ivan>2010-02-22 07:13:29 +0000
commite17528c356bb137bcff4c6934a2c7e254202838e (patch)
treed2e4932b952e8927659cd5f8bd09112772632388
parentbe61853021954c3cf8f6e63a41b1fa693e3af6d8 (diff)
communigate: domain aliases, enabled services & administrator domain, RT#7083
-rw-r--r--FS/FS/part_export/communigate_pro.pm5
-rw-r--r--FS/FS/svc_domain.pm9
-rwxr-xr-xhttemplate/edit/svc_domain.cgi16
-rwxr-xr-xhttemplate/view/svc_domain.cgi14
4 files changed, 44 insertions, 0 deletions
diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm
index fcd6b1c..a62df83 100644
--- a/FS/FS/part_export/communigate_pro.pm
+++ b/FS/FS/part_export/communigate_pro.pm
@@ -139,6 +139,8 @@ sub _export_insert_svc_domain {
);
$settings{'AccountsLimit'} = $svc_domain->max_accounts
if $svc_domain->max_accounts;
+ $settings{'AdminDomainName'} = $svc_domain->parent_svc_x->domain
+ if $svc_domain->parent_svcnum;
my @options = ( $create, $svc_domain->domain, \%settings );
@@ -279,6 +281,9 @@ sub _export_replace_svc_domain {
if $old->max_accounts ne $new->max_accounts;
$settings{'DomainAccessModes'} = $new->cgp_accessmodes
if $old->cgp_accessmodes ne $new->cgp_accessmodes;
+ $settings{'AdminDomainName'} =
+ $new->parent_svcnum ? $new->parent_svc_x->domain : ''
+ if $old->parent_svcnum != $new->parent_svcnum;
if ( keys %settings ) {
my $error = $self->communigate_pro_queue( $new->svcnum,
diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm
index b5f91f1..ab45e00 100644
--- a/FS/FS/svc_domain.pm
+++ b/FS/FS/svc_domain.pm
@@ -111,6 +111,15 @@ sub table_info {
'cancel_weight' => 60,
'fields' => {
'domain' => 'Domain',
+ 'parent_svcnum' => {
+ label => 'Parent domain / Communigate administrator domain',
+ type => 'select',
+ select_table => 'svc_domain',
+ select_key => 'svcnum',
+ select_label => 'domain',
+ disable_inventory => 1,
+ disable_select => 1,
+ },
'max_accounts' => { label => 'Maximum number of accounts',
'disable_inventory' => 1,
},
diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi
index a2b87e4..a3589c4 100755
--- a/httemplate/edit/svc_domain.cgi
+++ b/httemplate/edit/svc_domain.cgi
@@ -38,6 +38,22 @@ Available top-level domains: <% $export->option('tlds') %>
</TD>
</TR>
+% if ( $communigate ) {
+ <TR>
+ <TD ALIGN="right">Administrator domain</TD>
+ <TD>
+ <% include('/elements/select-domain.html',
+ 'element_name' => 'parent_svcnum',
+ 'curr_value' => $svc_domain->parent_svcnum,
+ 'empty_label' => '(none)',
+ )
+ %>
+ </TD>
+ </TR>
+% } else {
+ <INPUT TYPE="hidden" NAME="parent_svcnum" VALUE="<% $svc_domain->parent_svcnum %>">
+% }
+
% if ( $communigate
% && $part_svc->part_svc_column('max_accounts')->columnflag !~ /^[FA]$/ ) {
diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi
index 51caa5c..3fd898b 100755
--- a/httemplate/view/svc_domain.cgi
+++ b/httemplate/view/svc_domain.cgi
@@ -63,10 +63,24 @@ Service #<B><% $svcnum %></B>
% }
% if ( $communigate ) {
+
+ <TR>
+ <TD ALIGN="right">Administrator domain</TD>
+ <TD BGCOLOR="#ffffff">
+% if ( $svc_domain->parent_svcnum ) {
+% #XXX agent-virt aware the link
+ <A HREF="svc_domain.cgi?<% $svc_domain->parent_svcnum %>"><% $svc_domain->parent_svc_x->domain %></A>
+% } else {
+ <I>(none)</I>
+% }
+ </TD>
+ </TR>
+
<TR>
<TD ALIGN="right">Aliases</TD>
<TD BGCOLOR="#ffffff"><% $svc_domain->cgp_aliases %></TD>
</TR>
+
% }
% if ( $communigate && $svc_domain->max_accounts ) {