1 <% include("/elements/header.html",'Domain View', menubar(
2 ( ( $pkgnum || $custnum )
3 ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
5 : ( "Delete this (unaudited) domain" =>
6 "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" )
11 Service #<% $svcnum %>
12 <BR>Service: <B><% $part_svc->svc %></B>
13 <BR>Domain name: <B><% $domain %></B>
14 <BR>Catch all email <A HREF="<% ${p} %>misc/catchall.cgi?<% $svcnum %>">(change)</A>:
15 <% $email ? "<B>$email</B>" : "<I>(none)<I>" %>
16 <BR><BR><A HREF="<% ${p} %>misc/whois.cgi?custnum=<%$custnum%>;svcnum=<%$svcnum%>;domain=<%$domain%>">View whois information.</A>
19 function areyousure(href, message) {
20 if ( confirm(message) == true )
21 window.location.href = href;
23 function slave_areyousure() {
24 return confirm("Remove all records and slave from " + document.SlaveForm.recdata.value + "?");
28 % my @records; if ( @records = $svc_domain->domain_record ) {
30 <% include('/elements/table-grid.html') %>
32 % my $bgcolor1 = '#eeeeee';
33 % my $bgcolor2 = '#ffffff';
34 % my $bgcolor = $bgcolor2;
37 <th CLASS="grid" BGCOLOR="#cccccc">Zone</th>
38 <th CLASS="grid" BGCOLOR="#cccccc">Type</th>
39 <th CLASS="grid" BGCOLOR="#cccccc">Data</th>
42 % foreach my $domain_record ( @records ) {
43 % my $type = $domain_record->rectype eq '_mstr'
45 % : $domain_record->recaf. ' '. $domain_record->rectype;
49 <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->reczone %></td>
50 <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $type %></td>
51 <td CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $domain_record->recdata %>
53 % unless ( $domain_record->rectype eq 'SOA' ) {
54 % ( my $recdata = $domain_record->recdata ) =~ s/"/\\'\\'/g;
55 (<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $recdata %>\' ?' )">delete</A>)
61 % if ( $bgcolor eq $bgcolor1 ) {
62 % $bgcolor = $bgcolor2;
64 % $bgcolor = $bgcolor1;
74 <FORM METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
75 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
76 <INPUT TYPE="text" NAME="reczone">
77 <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN
78 <SELECT NAME="rectype">
79 % foreach (qw( A NS CNAME MX PTR TXT) ) {
81 <OPTION VALUE="<%$_%>"><%$_%></OPTION>
85 <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Add record">
86 </FORM><BR><BR>or<BR><BR>
87 <FORM NAME="SlaveForm" METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
88 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
90 Delete all records and
93 Slave from nameserver IP
94 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
95 <INPUT TYPE="hidden" NAME="reczone" VALUE="@">
96 <INPUT TYPE="hidden" NAME="recaf" VALUE="IN">
97 <INPUT TYPE="hidden" NAME="rectype" VALUE="_mstr">
98 <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Slave domain" onClick="return slave_areyousure()">
100 <BR><BR><% joblisting({'svcnum'=>$svcnum}, 1) %>
102 <% include('/elements/footer.html') %>
106 unless $FS::CurrentUser::CurrentUser->access_right('View customer services')
107 || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me
109 my($query) = $cgi->keywords;
112 my $svc_domain = qsearchs({
113 'select' => 'svc_domain.*',
114 'table' => 'svc_domain',
115 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
116 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
117 ' LEFT JOIN cust_main USING ( custnum ) ',
118 'hashref' => {'svcnum'=>$svcnum},
119 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
121 die "Unknown svcnum" unless $svc_domain;
123 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
124 my $pkgnum = $cust_svc->getfield('pkgnum');
125 my($cust_pkg, $custnum);
127 $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
128 $custnum=$cust_pkg->getfield('custnum');
134 my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
135 die "Unknown svcpart" unless $part_svc;
138 if ($svc_domain->catchall) {
139 my $svc_acct = qsearchs('svc_acct',{'svcnum'=> $svc_domain->catchall } );
140 die "Unknown svcpart" unless $svc_acct;
141 $email = $svc_acct->email;
144 my $domain = $svc_domain->domain;