3 <% include("/elements/header.html","View mail forward") %>
4 <% include( '/elements/small_custview.html', $custnum, '', 1,
5 "${p}view/cust_main.cgi") %>
10 <% include("/elements/header.html",'View mail forward', menubar(
11 "Cancel this (unaudited) mail forward" =>
12 "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum')",
17 function areyousure(href) {
18 if (confirm("Permanently delete this mail forward?") == true)
19 window.location.href = href;
25 <A HREF="<% $p %>edit/svc_forward.cgi?<% $svcnum %>">Edit this information</A>
27 <% ntable("#cccccc",2) %>
30 <TD ALIGN="right">Service number</TD>
31 <TD BGCOLOR="#ffffff"><% $svcnum %></TD>
34 <TD ALIGN="right">Service</TD>
35 <TD BGCOLOR="#ffffff"><% $svc %></TD>
38 <TD ALIGN="right">Email to</TD>
39 <TD BGCOLOR="#ffffff"><% $source %></TD>
42 <TD ALIGN="right">Forwards to </TD>
43 <TD BGCOLOR="#ffffff"><% $destination %></TD>
46 % foreach (sort { $a cmp $b } $svc_forward->virtual_fields) {
47 <% $svc_forward->pvf($_)->widget('HTML', 'view', $svc_forward->getfield($_)) %>
54 <% include('elements/svc_export_settings.html', $svc_forward) %>
56 <& /elements/table-tickets.html, object => $cust_svc &>
58 <% joblisting({'svcnum'=>$svcnum}, 1) %>
60 <% include('/elements/footer.html') %>
64 unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
66 my $conf = new FS::Conf;
68 my($query) = $cgi->keywords;
71 my $svc_forward = qsearchs({
72 'select' => 'svc_forward.*',
73 'table' => 'svc_forward',
74 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
75 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
76 ' LEFT JOIN cust_main USING ( custnum ) ',
77 'hashref' => {'svcnum'=>$svcnum},
78 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
79 'null_right' => 'View/link unlinked services'
82 die "Unknown svcnum" unless $svc_forward;
84 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
85 my $pkgnum = $cust_svc->getfield('pkgnum');
86 my($cust_pkg, $custnum, $display_custnum);
88 $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
89 $custnum=$cust_pkg->getfield('custnum');
90 $display_custnum = $cust_pkg->cust_main->display_custnum;
96 my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
97 or die "Unknown svcpart";
99 my($srcsvc,$dstsvc,$dst) = (
100 $svc_forward->srcsvc,
101 $svc_forward->dstsvc,
104 my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
106 my $svc = $part_svc->svc;
110 my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc})
111 or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc";
112 $source = $svc_acct->email;
119 my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$dstsvc})
120 or die "Corrupted database: no svc_acct.svcnum matching dstsvc $dstsvc";
121 $destination = $svc_acct->email;