X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_forward.cgi;h=ff84a282fb2d0f61cd33f0d289e2fa11d60b8901;hb=7bc780834a604a2e678d028f875fd4b546412cfb;hp=6509724292bbff12399eb55c2db5b9a61da2d28f;hpb=68b54c10131ae55a6ac537673fa70ac103fed22b;p=freeside.git
diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi
index 650972429..ff84a282f 100755
--- a/httemplate/view/svc_forward.cgi
+++ b/httemplate/view/svc_forward.cgi
@@ -1,38 +1,79 @@
-
-<%
+<% include('/elements/header.html', 'Mail Forward View', menubar(
+ ( ( $pkgnum || $custnum )
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) mail forward" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ )
+))
+%>
+
+Edit this information
+
+<% ntable("#cccccc",2) %>
+
+
+ Service number |
+ <% $svcnum %> |
+
+
+ Service |
+ <% $svc %> |
+
+
+ Email to |
+ <% $source %> |
+
+
+ Forwards to |
+ <% $destination %> |
+
+
+% foreach (sort { $a cmp $b } $svc_forward->virtual_fields) {
+ <% $svc_forward->pvf($_)->widget('HTML', 'view', $svc_forward->getfield($_)) %>
+% }
+
+
+
+
+<% joblisting({'svcnum'=>$svcnum}, 1) %>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
my $conf = new FS::Conf;
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
my $svcnum = $1;
-my $svc_forward = qsearchs('svc_forward',{'svcnum'=>$svcnum});
+my $svc_forward = qsearchs({
+ 'select' => 'svc_forward.*',
+ 'table' => 'svc_forward',
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
+ 'hashref' => {'svcnum'=>$svcnum},
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+});
die "Unknown svcnum" unless $svc_forward;
my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
+my($cust_pkg, $custnum, $display_custnum);
if ($pkgnum) {
$cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
$custnum=$cust_pkg->getfield('custnum');
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
} else {
$cust_pkg = '';
$custnum = '';
}
my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
- or die "Unkonwn svcpart";
-
-print header('Mail Forward View', menubar(
- ( ( $pkgnum || $custnum )
- ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ( "Cancel this (unaudited) mail forward" =>
- "${p}misc/cancel-unaudited.cgi?$svcnum" )
- ),
- "Main menu" => $p,
-));
+ or die "Unknown svcpart";
my($srcsvc,$dstsvc,$dst) = (
$svc_forward->srcsvc,
@@ -61,25 +102,4 @@ if ($dstsvc) {
$destination = $dst;
}
-print qq!Edit this information!.
- ntable("#cccccc",2).
- 'Service number | '.
- qq!$svcnum |
!.
- 'Service | '.
- qq!$svc |
!.
- qq!Email to | !.
- qq!$source |
!.
- qq!Forwards to | !.
- qq!$destination |
!;
-
-foreach (sort { $a cmp $b } $svc_forward->virtual_fields) {
- print $svc_forward->pvf($_)->widget('HTML', 'view', $svc_forward->getfield($_)),
- "\n";
-}
-
-print qq! !.
- '
'. joblisting({'svcnum'=>$svcnum}, 1).
- '