diff options
| author | ivan <ivan> | 2010-02-22 03:24:22 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2010-02-22 03:24:22 +0000 | 
| commit | 0689d75b6c0c2d30565b64d72b276cad5b195b70 (patch) | |
| tree | 942d7b342ccbdb83ef10fc8dc6d5e3f39fe1b796 /httemplate | |
| parent | a6c0ee2ce16aa6edad33242e802b1388519a8faf (diff) | |
communigate: domain aliases, enabled services, RT#7083
Diffstat (limited to 'httemplate')
| -rwxr-xr-x | httemplate/edit/process/svc_acct.cgi | 2 | ||||
| -rwxr-xr-x | httemplate/edit/process/svc_domain.cgi | 12 | ||||
| -rwxr-xr-x | httemplate/edit/svc_domain.cgi | 45 | ||||
| -rwxr-xr-x | httemplate/view/svc_domain.cgi | 33 | 
4 files changed, 69 insertions, 23 deletions
diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi index a4c60ef9e..0d2c007f1 100755 --- a/httemplate/edit/process/svc_acct.cgi +++ b/httemplate/edit/process/svc_acct.cgi @@ -31,7 +31,7 @@ foreach (map { $_,$_."_threshold" } qw( upbytes downbytes totalbytes )) {    $cgi->param($_, FS::UI::bytecount::parse_bytecount($cgi->param($_)) );  } -#unmunge cgp_accessmodes (falze laziness-ish w/part_svc.pm::process) +#unmunge cgp_accessmodes (falze laziness-ish w/part_svc.pm::process &svc_domain)  unless ( $cgi->param('cgp_accessmodes') ) {    $cgi->param('cgp_accessmodes',       join(' ', diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi index d8c1a1298..ea97918e8 100755 --- a/httemplate/edit/process/svc_domain.cgi +++ b/httemplate/edit/process/svc_domain.cgi @@ -15,6 +15,18 @@ $FS::svc_domain::whois_hack = 1;  $cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";  my $svcnum = $1; +#unmunge cgp_accessmodes (falze laziness-ish w/part_svc.pm::process & svc_acct) +unless ( $cgi->param('cgp_accessmodes') ) { +  $cgi->param('cgp_accessmodes',  +    join(' ', +      sort map { /^cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; } +               grep $cgi->param($_), +                    grep /^cgp_accessmodes_([\w\/]+)$/, +                         $cgi->param() +        ) +  ); +} +  my $new = new FS::svc_domain ( {    map {      $_, scalar($cgi->param($_)); diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi index 369d6a0fe..a2b87e4fa 100755 --- a/httemplate/edit/svc_domain.cgi +++ b/httemplate/edit/svc_domain.cgi @@ -38,6 +38,18 @@ Available top-level domains: <% $export->option('tlds') %>    </TD>  </TR> +% if ( $communigate +%      && $part_svc->part_svc_column('max_accounts')->columnflag !~ /^[FA]$/ ) { + +    <TR> +      <TD ALIGN="right">Aliases</TD> +      <TD><INPUT TYPE="text" NAME="cgp_aliases" VALUE="<% $svc_domain->cgp_aliases %>"></TD> +    </TR> + +% } else { +    <INPUT TYPE="text" NAME="cgp_aliases" VALUE="<% $svc_domain->cgp_aliases %>"> +% } +  % if ( $part_svc->part_svc_column('max_accounts')->columnflag =~ /^[FA]$/ ) {      <INPUT TYPE="hidden" NAME="max_accounts" VALUE="<% $svc_domain->max_accounts %>">  % } else { @@ -49,6 +61,24 @@ Available top-level domains: <% $export->option('tlds') %>      </TR>  % } +% if ( $communigate +%      && $part_svc->part_svc_column('cgp_accessmodes')->columnflag ne 'F' ) +% { + +  <TR> +    <TD ALIGN="right">Enabled services</TD> +    <TD> +      <% include( '/elements/communigate_pro-accessmodes.html', +                    'curr_value' => $svc_domain->cgp_accessmodes, +                ) +      %> +    </TD> +  </TR> + +% } else { +    <INPUT TYPE="hidden" NAME="cgp_accessmodes" VALUE="<% $svc_domain->cgp_accessmodes() |h %>"> +% } +  </TABLE>  <BR> @@ -118,19 +148,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 $registrar = $export ? $export->registrar : '';  my $otaker = getotaker; diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index b0f4ef0cf..51caa5c99 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -62,7 +62,14 @@ Service #<B><% $svcnum %></B>    </TR>  % } -% if ( $svc_domain->max_accounts ) { +% if ( $communigate ) { +  <TR> +    <TD ALIGN="right">Aliases</TD> +    <TD BGCOLOR="#ffffff"><% $svc_domain->cgp_aliases %></TD> +  </TR> +% } + +% if ( $communigate && $svc_domain->max_accounts ) {    <TR>      <TD ALIGN="right">Maximum number of Accounts</TD>      <TD BGCOLOR="#ffffff"><% $svc_domain->max_accounts %></TD> @@ -78,6 +85,11 @@ Service #<B><% $svcnum %></B>    </TD>  </TR> +<TR> +  <TD ALIGN="right">Enabled services</TD> +  <TD BGCOLOR="#ffffff"><% $svc_domain->cgp_accessmodes %></TD> +</TR> +  </TABLE></TD></TR></TABLE>  <BR> @@ -122,7 +134,7 @@ DNS records  %        ) {   %   ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g;        (<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $recdata %>\' ?' )">delete</A>) -% }  +% }        </td>      </tr> @@ -221,19 +233,16 @@ if ($svc_domain->catchall) {  my $domain = $svc_domain->domain; -my $status = 'Unknown'; -my %ops = (); - -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 +my $registrar; +my $status = 'Unknown'; +my %ops = ();  if ($export) {  	$registrar = $export->registrar;  	my $domstat = $export->get_status( $svc_domain );  | 
