X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_external.cgi;h=833e86247153d9505896ba386b1a199750b8b40b;hb=d02f1d8fb338e4dd1b401892b3408a65cad3b4d4;hp=7816d88dc76918325bfa0dd624c9c4943ec6ec3e;hpb=580330233cbf32c58d9f29dc391bd2ebd83e16d5;p=freeside.git
diff --git a/httemplate/view/svc_external.cgi b/httemplate/view/svc_external.cgi
index 7816d88dc..833e86247 100644
--- a/httemplate/view/svc_external.cgi
+++ b/httemplate/view/svc_external.cgi
@@ -1,53 +1,69 @@
-<%
+<% include("/elements/header.html",'External Service View', menubar(
+ ( ( $custnum )
+ ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) external service" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ ),
+)) %>
+
+Edit this information
+<% ntable("#cccccc") %>
<% ntable("#cccccc",2) %>
+
+ |
Service number |
+ <% $svcnum %> |
+<% FS::Msgcat::_gettext('svc_external-id') || 'External ID' %> |
+ <% $conf->config('svc_external-display_type') eq 'artera_turbo' ? sprintf('%010d', $svc_external->id) : $svc_external->id %> |
+<% FS::Msgcat::_gettext('svc_external-title') || 'Title' %> |
+ <% $svc_external->title %> |
+% foreach (sort { $a cmp $b } $svc_external->virtual_fields) {
+
+ <% $svc_external->pvf($_)->widget('HTML', 'view', $svc_external->getfield($_)) %>
+% }
+
+
+
+
+
+<& /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($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
my $svcnum = $1;
-my $svc_external = qsearchs( 'svc_external', { 'svcnum' => $svcnum } )
- or die "svc_external: Unknown svcnum $svcnum";
+my $svc_external = qsearchs({
+ 'select' => 'svc_external.*',
+ 'table' => 'svc_external',
+ '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'
+ ),
+}) or die "svc_external: Unknown svcnum $svcnum";
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 = '';
}
#eofalse
-
-%>
-
-<%= include("/elements/header.html",'External Service View', menubar(
- ( ( $custnum )
- ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ( "Cancel this (unaudited) external service" =>
- "${p}misc/cancel-unaudited.cgi?$svcnum" )
- ),
- "Main menu" => $p,
-)) %>
-
-Edit this information
-<%= ntable("#cccccc") %><%= ntable("#cccccc",2) %>
-
- |
Service number |
- <%= $svcnum %> |
-<%= FS::Msgcat::_gettext('svc_external-id') || 'External ID' %> |
- <%= $conf->config('svc_external-display_type') eq 'artera_turbo' ? sprintf('%010d', $svc_external->id) : $svc_external->id %> |
-<%= FS::Msgcat::_gettext('svc_external-title') || 'Title' %> |
- <%= $svc_external->title %> |
-
-<% foreach (sort { $a cmp $b } $svc_external->virtual_fields) { %>
- <%= $svc_external->pvf($_)->widget('HTML', 'view', $svc_external->getfield($_)) %>
-<% } %>
-
-
-
<%= joblisting({'svcnum'=>$svcnum}, 1) %>
-