X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_external.cgi;h=b87166a177783b988285879f42557d1af6b911b4;hb=79f1e3f6d8172bbb4e85bc063f19ba0010c9253f;hp=49183cd95cb63a181cf75a4dde4738630e7ce77e;hpb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15;p=freeside.git
diff --git a/httemplate/view/svc_external.cgi b/httemplate/view/svc_external.cgi
index 49183cd95..b87166a17 100644
--- a/httemplate/view/svc_external.cgi
+++ b/httemplate/view/svc_external.cgi
@@ -1,11 +1,50 @@
-
-<%
+<% 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) %>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services')
+ || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me
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,
+}) or die "svc_external: Unknown svcnum $svcnum";
my $conf = new FS::Conf;
@@ -22,33 +61,4 @@ if ($pkgnum) {
}
#eofalse
-
-%>
-
-<%= header('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) %>
-