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 <% joblisting({'svcnum'=>$svcnum}, 1) %>
58 <% include('/elements/footer.html') %>
62 unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
64 my $conf = new FS::Conf;
66 my($query) = $cgi->keywords;
69 my $svc_forward = qsearchs({
70 'select' => 'svc_forward.*',
71 'table' => 'svc_forward',
72 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
73 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
74 ' LEFT JOIN cust_main USING ( custnum ) ',
75 'hashref' => {'svcnum'=>$svcnum},
76 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
77 'null_right' => 'View/link unlinked services'
80 die "Unknown svcnum" unless $svc_forward;
82 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
83 my $pkgnum = $cust_svc->getfield('pkgnum');
84 my($cust_pkg, $custnum, $display_custnum);
86 $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
87 $custnum=$cust_pkg->getfield('custnum');
88 $display_custnum = $cust_pkg->cust_main->display_custnum;
94 my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
95 or die "Unknown svcpart";
97 my($srcsvc,$dstsvc,$dst) = (
102 my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
104 my $svc = $part_svc->svc;
108 my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc})
109 or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc";
110 $source = $svc_acct->email;
117 my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$dstsvc})
118 or die "Corrupted database: no svc_acct.svcnum matching dstsvc $dstsvc";
119 $destination = $svc_acct->email;