% include( '/elements/header.html', 'Cacti Graphs' ) %> % if ($load) {
<% include( '/elements/progress-init.html', 'CactiGraphForm', [ 'svcnum' ], $p.'misc/process/cacti_graphs.cgi', { url => 'javascript:window.location.replace("'.popurl(2).'misc/cacti_graphs.html?svcnum='.$svcnum.'")' }, ) %>Loading graphs, please wait...
% } elsif ($error) {<% emt($error) %>
% } else { <% $content %> % } <%init> use File::Slurp qw( slurp ); die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('View customer services'); my $svcnum = $cgi->param('svcnum') or die 'Illegal svcnum'; # false laziness with view/elements/svc_Common.html # only doing this to check agent access, don't actually use $svc_x my $svc_x = qsearchs({ 'select' => 'svc_broadband.*', 'table' => 'svc_broadband', '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 "Unknown svcnum $svcnum in svc_broadband table\n"; my $load = $cgi->param('load'); my $graphnum = $cgi->param('graphnum') || ''; my ($content,$error); unless ($load) { my $page = qsearchs({ 'table' => 'cacti_page', 'hashref' => { 'svcnum' => $svcnum, 'graphnum' => $graphnum }, }); if ($page) { $content = $page->content; } else { $error = 'No graphs found in import cache. Click below to retry import.'; } } %init>