X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_forward.cgi;h=75c8f5c2572195073e612b0abbf252c85b236089;hp=52360bcc201fbbb13da5b6ff1865df12507c1dc2;hb=877a4eb85cb847bd314d6a9192fedb1dc35c5d02;hpb=2041a9143fac20b79ead4a1ae01224dedf5b27c2 diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi index 52360bcc2..75c8f5c25 100755 --- a/httemplate/view/svc_forward.cgi +++ b/httemplate/view/svc_forward.cgi @@ -1,37 +1,100 @@ - -<% +% if ( $custnum ) { + + <% include("/elements/header.html","View mail forward") %> + <% include( '/elements/small_custview.html', $custnum, '', 1, + "${p}view/cust_main.cgi") %> +
+ +% } else { + + <% include("/elements/header.html",'View mail forward', menubar( + "Cancel this (unaudited) mail forward" => + "javascript:areyousure('${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($_)) %> +% } + + + +
+ +<% include('elements/svc_export_settings.html', $svc_forward) %> + +<& /elements/table-tickets.html, object => $cust_svc &> + +<% 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( + 'null_right' => 'View/link unlinked services' + ), +}); 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 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, @@ -60,25 +123,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). - '' -; - -%> +