X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Fsvc_domain.cgi;h=a9fc775ee6f8b30da1b7e7be9120840c94a4d364;hb=65f5beea6aaa52a92aceab6bce324f28d7ad2cad;hp=7fdce37dfe6eee4af974737df2f5415d56e210b5;hpb=17856ff5c299e4db21da28116f2666655c03f2c7;p=freeside.git
diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi
index 7fdce37df..a9fc775ee 100755
--- a/httemplate/view/svc_domain.cgi
+++ b/httemplate/view/svc_domain.cgi
@@ -1,17 +1,41 @@
<% include("/elements/header.html",'Domain View', menubar(
( ( $pkgnum || $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
: ( "Delete this (unaudited) domain" =>
"javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" )
- ),
- "Main menu" => $p,
+ )
)) %>
+<% include('/elements/error.html') %>
+
Service #<% $svcnum %>
Service: <% $part_svc->svc %>
Domain name: <% $domain %>
-
Catch all email (change):
+% if ($export) {
+
Status: <% $status %>
+% if ( $FS::CurrentUser::CurrentUser->access_right('Manage domain registration') ) {
+% if ( defined($ops{'register'}) ) {
+ Register at <% $registrar->{'name'} %>
+% }
+% if ( defined($ops{'transfer'}) ) {
+ Transfer to <% $registrar->{'name'} %>
+% }
+% if ( defined($ops{'renew'}) ) {
+ Renew at <% $registrar->{'name'} %>
+% }
+% if ( defined($ops{'revoke'}) ) {
+ Revoke
+% }
+% }
+% }
+
+% if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain catchall') ) {
+
Catch all email (change):
+% } else {
+
Catch all email:
+% }
+
<% $email ? "$email" : "(none)" %>
View whois information.
@@ -50,8 +74,11 @@ Service #<% $svcnum %>
<% $type %> |
<% $domain_record->recdata %>
-% unless ( $domain_record->rectype eq 'SOA' ) {
- (delete)
+% unless ( $domain_record->rectype eq 'SOA'
+% || ! $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice')
+% ) {
+% ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g;
+ (delete)
% }
|
@@ -68,42 +95,50 @@ Service #<% $svcnum %>
% }
+% if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain nameservice') ) {
+
+
+
+
+ or
+
+
+
+
+% }
-
-
or
-
-
<% joblisting({'svcnum'=>$svcnum}, 1) %>
+<% joblisting({'svcnum'=>$svcnum}, 1) %>
<% include('/elements/footer.html') %>
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('View customer services')
- || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
@@ -115,16 +150,19 @@ my $svc_domain = qsearchs({
' LEFT JOIN cust_pkg USING ( pkgnum ) '.
' LEFT JOIN cust_main USING ( custnum ) ',
'hashref' => {'svcnum'=>$svcnum},
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
+ 'null_right' => 'View/link unlinked services'
+ ),
});
die "Unknown svcnum" unless $svc_domain;
my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
+my($cust_pkg, $custnum, $display_custnum);
if ($pkgnum) {
- $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- $custnum=$cust_pkg->getfield('custnum');
+ $cust_pkg = qsearchs('cust_pkg', {'pkgnum'=>$pkgnum} );
+ $custnum = $cust_pkg->custnum;
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
} else {
$cust_pkg = '';
$custnum = '';
@@ -142,4 +180,37 @@ if ($svc_domain->catchall) {
my $domain = $svc_domain->domain;
+my $status = 'Unknown';
+my %ops = ();
+
+my @exports = $part_svc->part_export();
+
+my $registrar;
+my $export;
+
+# Find the first export that does domain registration
+foreach (@exports) {
+ $export = $_ if $_->can('registrar');
+}
+# If we have a domain registration export, get the registrar object
+if ($export) {
+ $registrar = $export->registrar;
+ my $domstat = $export->get_status( $svc_domain );
+ if (defined($domstat->{'message'})) {
+ $status = $domstat->{'message'};
+ } elsif (defined($domstat->{'unregistered'})) {
+ $status = 'Not registered';
+ $ops{'register'} = "Register";
+ } elsif (defined($domstat->{'status'})) {
+ $status = $domstat->{'status'} . ' ' . $domstat->{'contact_email'} . ' ' . $domstat->{'last_update_time'};
+ } elsif (defined($domstat->{'expdate'})) {
+ $status = "Expires " . $domstat->{'expdate'};
+ $ops{'renew'} = "Renew";
+ $ops{'revoke'} = "Revoke";
+ } else {
+ $status = $domstat->{'reason'};
+ $ops{'transfer'} = "Transfer";
+ }
+}
+
%init>