X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_external.cgi;h=77679d81ce9f5d89e68f6fdda8ace746d3969ca6;hb=d7a9f5c6dbf89aa85c281578bb553e04a573cbd0;hp=b87166a177783b988285879f42557d1af6b911b4;hpb=17856ff5c299e4db21da28116f2666655c03f2c7;p=freeside.git
diff --git a/httemplate/view/svc_external.cgi b/httemplate/view/svc_external.cgi
index b87166a17..77679d81c 100644
--- a/httemplate/view/svc_external.cgi
+++ b/httemplate/view/svc_external.cgi
@@ -1,11 +1,10 @@
<% include("/elements/header.html",'External Service View', menubar(
( ( $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
)
: ( "Cancel this (unaudited) external service" =>
"${p}misc/cancel-unaudited.cgi?$svcnum" )
),
- "Main menu" => $p,
)) %>
Edit this information
@@ -30,8 +29,7 @@
<%init>
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('View customer services')
- || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
@@ -43,7 +41,9 @@ my $svc_external = qsearchs({
' LEFT JOIN cust_pkg USING ( pkgnum ) '.
' LEFT JOIN cust_main USING ( custnum ) ',
'hashref' => { 'svcnum' => $svcnum },
- 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
+ 'null_right' => 'View/link unlinked services'
+ ),
}) or die "svc_external: Unknown svcnum $svcnum";
my $conf = new FS::Conf;
@@ -51,10 +51,11 @@ my $conf = new FS::Conf;
#false laziness w/all svc_*.cgi
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->custnum;
+ $display_custnum = $cust_pkg->cust_main->display_custnum;
} else {
$cust_pkg = '';
$custnum = '';