From e17528c356bb137bcff4c6934a2c7e254202838e Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Feb 2010 07:13:29 +0000 Subject: [PATCH] communigate: domain aliases, enabled services & administrator domain, RT#7083 --- FS/FS/part_export/communigate_pro.pm | 5 +++++ FS/FS/svc_domain.pm | 9 +++++++++ httemplate/edit/svc_domain.cgi | 16 ++++++++++++++++ httemplate/view/svc_domain.cgi | 14 ++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/FS/FS/part_export/communigate_pro.pm b/FS/FS/part_export/communigate_pro.pm index fcd6b1ce3..a62df8335 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 b5f91f1df..ab45e00a6 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 a2b87e4fa..a3589c4a7 100755 --- a/httemplate/edit/svc_domain.cgi +++ b/httemplate/edit/svc_domain.cgi @@ -38,6 +38,22 @@ Available top-level domains: <% $export->option('tlds') %> +% if ( $communigate ) { + + Administrator domain + + <% include('/elements/select-domain.html', + 'element_name' => 'parent_svcnum', + 'curr_value' => $svc_domain->parent_svcnum, + 'empty_label' => '(none)', + ) + %> + + +% } else { + +% } + % 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 51caa5c99..3fd898ba5 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -63,10 +63,24 @@ Service #<% $svcnum %> % } % if ( $communigate ) { + + + Administrator domain + +% if ( $svc_domain->parent_svcnum ) { +% #XXX agent-virt aware the link + <% $svc_domain->parent_svc_x->domain %> +% } else { + (none) +% } + + + Aliases <% $svc_domain->cgp_aliases %> + % } % if ( $communigate && $svc_domain->max_accounts ) { -- 2.11.0