From: Florian G. <re...@us...> - 2007-08-12 00:11:55
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7758/phpgui Modified Files: perfparse.php utils.php Log Message: Made saved graphs working - some bugs still unresolved Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** utils.php 18 Jun 2007 22:12:38 -0000 1.39 --- utils.php 12 Aug 2007 00:11:45 -0000 1.40 *************** *** 580,584 **** // sanatize grapharray list($grapharray['sizex'],$grapharray['sizey'])=split('x',$grapharray['size'],2); ! $notempty=array('graph_name','refresh_time','metric_id','scale','timerange','output','sizex','sizey','s_val','s_war','s_cri','s_sta','g_sigma'); foreach($notempty as $checkvar) { if(!isset($grapharray[$checkvar]) || (is_string($grapharray[$checkvar]) && empty($grapharray[$checkvar]))) { --- 580,584 ---- // sanatize grapharray list($grapharray['sizex'],$grapharray['sizey'])=split('x',$grapharray['size'],2); ! $notempty=array('graph_name','refresh_time','metric_id','scale','timerange','output','sizex','sizey','s_val','s_war','s_cri','s_sta','s_smo','g_sigma'); foreach($notempty as $checkvar) { if(!isset($grapharray[$checkvar]) || (is_string($grapharray[$checkvar]) && empty($grapharray[$checkvar]))) { *************** *** 589,594 **** $query='insert into perfdata_graphs (title,descript,refresh_time,metric_id,scale,minin,maxin,timerange,'; ! $query.='relativetime,fromtime,totime,output,sizex,sizey,s_val,s_war,s_cri,s_sta,graphtitle,g_sigma) '; ! $query.='values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'; $bindarray=array($grapharray['graph_name'],$grapharray['desc'],$grapharray['refresh_time'],$grapharray['metric_id'], $grapharray['scale'],$grapharray['minin'],$grapharray['maxin'],$grapharray['timerange']); --- 589,594 ---- $query='insert into perfdata_graphs (title,descript,refresh_time,metric_id,scale,minin,maxin,timerange,'; ! $query.='relativetime,fromtime,totime,output,sizex,sizey,s_val,s_war,s_cri,s_sta,s_smo,graphtitle,g_sigma) '; ! $query.='values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'; $bindarray=array($grapharray['graph_name'],$grapharray['desc'],$grapharray['refresh_time'],$grapharray['metric_id'], $grapharray['scale'],$grapharray['minin'],$grapharray['maxin'],$grapharray['timerange']); *************** *** 631,634 **** --- 631,635 ---- $bindarray[]=$grapharray['s_cri']; $bindarray[]=$grapharray['s_sta']; + $bindarray[]=$grapharray['s_smo']; $bindarray[]=$grapharray['title']; $bindarray[]=$grapharray['g_sigma']; Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** perfparse.php 18 Jun 2007 22:12:38 -0000 1.51 --- perfparse.php 12 Aug 2007 00:11:45 -0000 1.52 *************** *** 1,5 **** <?php ! // Copyright (c) 2004,2005,2006 Florian Gleixner // Licensed under the GNU GENERAL PUBLIC LICENSE or the BSD License // --- 1,5 ---- <?php ! // Copyright (c) 2004-2007 Florian Gleixner // Licensed under the GNU GENERAL PUBLIC LICENSE or the BSD License // *************** *** 277,281 **** if(isset($actgraph[$fvar])) { $actgraph[$fvar]=1; ! } } // if(!isset($graphs .... } // foreach($formvars ... --- 277,283 ---- if(isset($actgraph[$fvar])) { $actgraph[$fvar]=1; ! } else { ! $actgraph[$fvar]=0; ! } } // if(!isset($graphs .... } // foreach($formvars ... *************** *** 500,508 **** $smarty->assign('graphs',$graphs); ! if(isset($_REQUEST['view']) && saved_graph_exists($db,$_REQUEST['view'])) { ! $smarty->assign('view',$_REQUEST['view']); ! $graphdetails=get_graph_details($db,$_REQUEST['view']); ! $smarty->assign('graphurl', $graphdetails['url']); ! $smarty->assign('graphtitle', $graphdetails['title']); } --- 502,515 ---- $smarty->assign('graphs',$graphs); ! if(get_request_var('view','int')) { ! if(saved_graph_exists($db,$view)) { ! $graphdetails=get_graph_details($db,$view); ! $smarty->assign('graphurl', $graphdetails['url']); ! $smarty->assign('graphtitle', $graphdetails['title']); ! } else { ! //Graph does not exist ! $view=NULL; ! $smarty->assign_by_ref('view',$view); ! } } |