remove customer deletion
[freeside.git] / httemplate / view / svc_domain.cgi
1 % if ( $custnum ) {
2
3 %#  <% include("/elements/header.html","View $svcdomain") %>
4   <% include("/elements/header.html","View domain") %>
5   <% include( '/elements/small_custview.html', $custnum, '', 1,
6      "${p}view/cust_main.cgi") %>
7   <BR>
8
9 % } else {
10
11   <% include("/elements/header.html",'View domain', menubar(
12        "Cancel this (unaudited) domain" =>
13          "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?')",
14      ))
15   %>
16
17 % }
18
19 <% include('/elements/error.html') %>
20
21 <% include('svc_domain/basics.html', $svc_domain,
22              'part_svc' => $part_svc,
23              'custnum'  => $custnum,
24           )
25 %>
26 <BR>
27
28 <% include('svc_domain/acct_defaults.html', $svc_domain,
29              'part_svc' => $part_svc,
30           )
31 %>
32 <BR>
33
34 <% include('svc_domain/dns.html', $svc_domain ) %>
35 <BR>
36
37 <% include('elements/svc_export_settings.html', $svc_domain) %>
38
39 <& /elements/table-tickets.html, object => $cust_svc &>
40
41 <% joblisting({'svcnum'=>$svcnum}, 1) %>
42
43 <% include('/elements/footer.html') %>
44 <%init>
45
46 die "access denied"
47   unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
48
49 my $conf = new FS::Conf;
50
51 my($query) = $cgi->keywords;
52 $query =~ /^(\d+)$/;
53 my $svcnum = $1;
54 my $svc_domain = qsearchs({
55   'select'    => 'svc_domain.*',
56   'table'     => 'svc_domain',
57   'addl_from' => ' LEFT JOIN cust_svc  USING ( svcnum  ) '.
58                  ' LEFT JOIN cust_pkg  USING ( pkgnum  ) '.
59                  ' LEFT JOIN cust_main USING ( custnum ) ',
60   'hashref'   => {'svcnum'=>$svcnum},
61   'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
62                             'null_right' => 'View/link unlinked services'
63                           ),
64 });
65 die "Unknown svcnum" unless $svc_domain;
66
67 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
68 my $pkgnum = $cust_svc->getfield('pkgnum');
69 my($cust_pkg, $custnum, $display_custnum);
70 if ($pkgnum) {
71   $cust_pkg = qsearchs('cust_pkg', {'pkgnum'=>$pkgnum} );
72   $custnum = $cust_pkg->custnum;
73   $display_custnum = $cust_pkg->cust_main->display_custnum;
74 } else {
75   $cust_pkg = '';
76   $custnum = '';
77 }
78
79 my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
80 die "Unknown svcpart" unless $part_svc;
81
82 my $domain = $svc_domain->domain;
83
84 </%init>