X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fcacti_graphs.html;h=90a435091d1669ba4299e2a658ac3ecced431853;hb=af8b1f302097a43229b59cdc2ab9782fbff28dc9;hp=9cc5e24941805d3d5978059b570a34da82947c69;hpb=ecf01f1adf08cfbbb489d18c39a9626079112526;p=freeside.git diff --git a/httemplate/misc/cacti_graphs.html b/httemplate/misc/cacti_graphs.html index 9cc5e2494..90a435091 100644 --- a/httemplate/misc/cacti_graphs.html +++ b/httemplate/misc/cacti_graphs.html @@ -21,33 +21,43 @@ process(); -% } else { -% if ($error) { +% } elsif ($error) { -

<% $error %>

+

<% emt($error) %>

+
+ + + +
-% } else { +% } else { -<% slurp($htmlfile) %> +<% $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'; my $load = $cgi->param('load'); -my $graphnum = $cgi->param('graphnum'); - -my $htmlfile = $FS::UID::cache_dir - . '/cacti-graphs/' - . 'svc_' - . $svcnum; -$htmlfile .= '_graph_' . $graphnum - if $graphnum; -$htmlfile .= '.html'; +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.'; + } +} -my $error = (-e $htmlfile) ? '' : 'File not found';