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 (<A HREF="javascript:areyousure('<%$p%>misc/delete-domain_record.cgi?<%$domain_record->recnum%>', 'Delete \'<% $domain_record->reczone %> <% $type %> <% $domain_record->recdata %>\' ?' )">delete</A>)
60 % if ( $bgcolor eq $bgcolor1 ) {
61 % $bgcolor = $bgcolor2;
63 % $bgcolor = $bgcolor1;
73 <FORM METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
74 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
75 <INPUT TYPE="text" NAME="reczone">
76 <INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN
77 <SELECT NAME="rectype">
78 % foreach (qw( A NS CNAME MX PTR TXT) ) {
80 <OPTION VALUE="<%$_%>"><%$_%></OPTION>
84 <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Add record">
85 </FORM><BR><BR>or<BR><BR>
86 <FORM NAME="SlaveForm" METHOD="POST" ACTION="<%$p%>edit/process/domain_record.cgi">
87 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
89 Delete all records and
92 Slave from nameserver IP
93 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%$svcnum%>">
94 <INPUT TYPE="hidden" NAME="reczone" VALUE="@">
95 <INPUT TYPE="hidden" NAME="recaf" VALUE="IN">
96 <INPUT TYPE="hidden" NAME="rectype" VALUE="_mstr">
97 <INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Slave domain" onClick="return slave_areyousure()">
99 <BR><BR><% joblisting({'svcnum'=>$svcnum}, 1) %>
101 <% include('/elements/footer.html') %>
105 unless $FS::CurrentUser::CurrentUser->access_right('View customer services')
106 || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me
108 my($query) = $cgi->keywords;
111 my $svc_domain = qsearchs({
112 'select' => 'svc_domain.*',
113 'table' => 'svc_domain',
114 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
115 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
116 ' LEFT JOIN cust_main USING ( custnum ) ',
117 'hashref' => {'svcnum'=>$svcnum},
118 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
120 die "Unknown svcnum" unless $svc_domain;
122 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
123 my $pkgnum = $cust_svc->getfield('pkgnum');
124 my($cust_pkg, $custnum);
126 $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
127 $custnum=$cust_pkg->getfield('custnum');
133 my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
134 die "Unknown svcpart" unless $part_svc;
137 if ($svc_domain->catchall) {
138 my $svc_acct = qsearchs('svc_acct',{'svcnum'=> $svc_domain->catchall } );
139 die "Unknown svcpart" unless $svc_acct;
140 $email = $svc_acct->email;
143 my $domain = $svc_domain->domain;