1 <% include( '/elements/header.html', 'Cacti Graphs' ) %>
5 <FORM NAME="CactiGraphForm" ID="CactiGraphForm" style="margin-top: 0">
6 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
8 <% include( '/elements/progress-init.html',
11 $p.'misc/process/cacti_graphs.cgi',
12 { url => 'javascript:window.location.replace("'.popurl(2).'misc/cacti_graphs.html?svcnum='.$svcnum.'")' },
15 note we use window.location.replace for the callback url above
16 so that this page gets removed from browser history after processing
17 so that process() doesn't get triggered by the back button
19 <P>Loading graphs, please wait...</P>
20 <SCRIPT TYPE="text/javascript">
26 <P><% emt($error) %></P>
27 <FORM NAME="CactiGraphForm" ID="CactiGraphForm" style="margin-top: 0">
28 <INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
29 <INPUT TYPE="hidden" NAME="load" VALUE="1">
30 <INPUT TYPE="submit" VALUE="Reload Graphs">
40 use File::Slurp qw( slurp );
43 unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
45 my $svcnum = $cgi->param('svcnum') or die 'Illegal svcnum';
47 # false laziness with view/elements/svc_Common.html
48 # only doing this to check agent access, don't actually use $svc_x
49 my $svc_x = qsearchs({
50 'select' => 'svc_broadband.*',
51 'table' => 'svc_broadband',
52 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
53 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
54 ' LEFT JOIN cust_main USING ( custnum ) ',
55 'hashref' => { 'svcnum' => $svcnum },
56 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
57 'null_right' => 'View/link unlinked services'
59 }) or die "Unknown svcnum $svcnum in svc_broadband table\n";
61 my $load = $cgi->param('load');
62 my $graphnum = $cgi->param('graphnum') || '';
67 'table' => 'cacti_page',
68 'hashref' => { 'svcnum' => $svcnum, 'graphnum' => $graphnum },
71 $content = $page->content;
73 $error = 'No graphs found in import cache. Click below to retry import.';