Changeset 346 for trunk/client


Ignore:
Timestamp:
Mar 30, 2021, 11:16:34 PM (4 years ago)
Author:
roby
Message:

ulteriori modifiche per adeguamento a php7
Client: aggiornamento jpgraph

Location:
trunk/client
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/modules/Elezioni/consiglieri.php

    r320 r346  
    4747while (isset($param['num_lista'.$x])) {
    4848        if ($param['num_lista'.$x]==$gruppo) array_push($collegate,$_SESSION['num_lista'.$x]);
    49         elseif ($param['num_lista'.$x]!=0) array_push($collperd,$_SESSION['num_lista'.$x]);
     49#       elseif ($param['num_lista'.$x]!=0) array_push($collperd,$_SESSION['num_lista'.$x]);
    5050        $x++;
    5151}
  • trunk/client/modules/Elezioni/grafici/gd_image.inc.php

    r340 r346  
    109109        }
    110110        else {
    111         //    JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.')
     111            JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.')
    112112        }
    113113    }
     
    221221    }
    222222
    223     static function GetWidth($aImg=null) {
    224         if( $aImg === null ) {
    225             $aImg = $this->img;
    226         }
     223    static function GetWidth($aImg) {
    227224        return imagesx($aImg);
    228225    }
    229226
    230     static function GetHeight($aImg=null) {
    231         if( $aImg === null ) {
    232             $aImg = $this->img;
    233         }
     227    static function GetHeight($aImg) {
    234228        return imagesy($aImg);
    235229    }
     
    22712265    function GetAndStream($aImage,$aCacheFileName) {
    22722266        if( $this->Isvalid($aCacheFileName) ) {
    2273             $this->StreamImgFile($aImage,$aCacheFileName);
     2267            return $this->StreamImgFile($aImage,$aCacheFileName);
    22742268        }
    22752269        else {
  • trunk/client/modules/Elezioni/grafici/jpgraph.php

    r284 r346  
    2020
    2121// Version info
    22 define('JPG_VERSION','4.2.6');
     22define('JPG_VERSION','4.3.4');
    2323
    2424// Minimum required PHP version
     
    36433643            // to many gridlines
    36443644            $i=0;
    3645             $x=$aTicksPos[$i];
    36463645            while( $i<count($aTicksPos) && ($x=$aTicksPos[$i]) <= $limit ) {
    36473646                if    ( $aType == 'solid' )      $this->img->Line($x,$yl,$x,$yu);
     
    55715570    function Clear() {
    55725571        $this->isRunningClear = true;
    5573         $this->__construct($this->inputValues['aDatay'], $this->inputValues['aDatax']);
     5572        Plot::__construct($this->inputValues['aDatay'], $this->inputValues['aDatax']);
    55745573        $this->isRunningClear = false;
    55755574    }
  • trunk/client/modules/Elezioni/grafici/jpgraph_bar.php

    r284 r346  
    310310    }
    311311
     312
     313    /**
     314     * @override
     315     * Without overriding this method, $this->numpoints does not updated correctly.
     316     */
     317    function Clear() {
     318        $this->isRunningClear = true;
     319        $this->__construct($this->inputValues['aDatay'], $this->inputValues['aDatax']);
     320        $this->isRunningClear = false;
     321    }
     322
    312323    function Stroke($img,$xscale,$yscale) {
    313324
     
    717728        for($i=0; $i < $n; ++$i) {
    718729            list($xm,$ym) = $this->plots[$i]->Min();
    719             $xmin = max($xmin,$xm);
     730            $xmin = min($xmin,$xm);
    720731            $ymin = min($ymin,$ym);
    721732        }
  • trunk/client/modules/Elezioni/grafici/jpgraph_date.php

    r284 r346  
    407407        if( $aStartTime == $aEndTime ) {
    408408            // Special case when we only have one data point.
    409             // Create a small artifical intervall to do the autoscaling
     409            // Create a small artificial interval to do the autoscaling
    410410            $aStartTime -= 10;
    411411            $aEndTime += 10;
     412        }
     413        if( abs($aEndTime - $aStartTime) <= 1 ) {
     414            // Special case when we only have one second.
     415            // Create a small artificial interval to do the autoscaling
     416            $aStartTime -= 1;
     417            $aEndTime += 1;
    412418        }
    413419        $done=false;
  • trunk/client/modules/Elezioni/grafici/jpgraph_errhandler.inc.php

    r284 r346  
    1717if( !defined('USE_IMAGE_ERROR_HANDLER') ) {
    1818    define('USE_IMAGE_ERROR_HANDLER',true);
     19}
     20
     21if( !defined('IMG_PNG') ) {
     22    define('IMG_PNG',true);
    1923}
    2024
     
    156160        $errobj->Raise($this->getMessage());
    157161    }
    158     static public function defaultHandler(Exception $exception) {
     162    static public function defaultHandler(Throwable $exception) {
    159163        global $__jpg_OldHandler;
    160164        if( $exception instanceof JpGraphException ) {
  • trunk/client/modules/Elezioni/grafici/jpgraph_pie.php

    r284 r346  
    335335
    336336            if( $this->setslicecolors==null ) {
    337                 $graph->legend->Add($l,$colors[$ta[$i%$numcolors]],"",0,$this->csimtargets[$i],$alt,$wintarg);
     337                $csimtarget = isset($this->csimtargets[$i]) ? $this->csimtargets[$i] : null;
     338                $graph->legend->Add($l,$colors[$ta[$i%$numcolors]],"",0,$csimtarget,$alt,$wintarg);
    338339            }
    339340            else {
    340                 $graph->legend->Add($l,$this->setslicecolors[$i%$numcolors],"",0,$this->csimtargets[$i],$alt,$wintarg);
     341                $csimtarget = isset($this->csimtargets[$i]) ? $this->csimtargets[$i] : null;
     342                $graph->legend->Add($l,$this->setslicecolors[$i%$numcolors],"",0,$csimtarget,$alt,$wintarg);
    341343            }
    342344        }
  • trunk/client/modules/Elezioni/grafici/votanti_graf.php

    r105 r346  
    99include ("jpgraph.php");
    1010include ("jpgraph_pie.php");
    11 
     11require_once ('jpgraph_pie3d.php');
    1212$e=$_GET['e'];$f=$_GET['f'];$e1=$_GET['e1'];$f1=$_GET['f1'];
    1313$titolo=$_GET['titolo'];
    1414if (isset($_GET['cop'])) $cop=$_GET['cop'];else $cop='';
    15 if (isset($_GET['x'])) $dim_x=$_GET['x']; else $dim_x='350';
    16 if (isset($_GET['y'])) $dim_y=$_GET['y']; else $dim_y='200';
     15if (isset($_GET['x'])) $dim_x=$_GET['x']; else $dim_x='450';
     16if (isset($_GET['y'])) $dim_y=$_GET['y']; else $dim_y='300';
    1717if (isset($_GET['logo'])) $logo=$_GET['logo'];else $logo='';
    1818$data = array($e,$f);
     
    2020$graph = new PieGraph($dim_x,$dim_y,"auto");
    2121$graph->SetShadow();
    22 
     22$theme_class= new VividTheme;
     23$graph->SetTheme($theme_class);
    2324$graph->title->Set($titolo);
    2425$graph->title->SetFont(FF_FONT1,FS_BOLD);
    25 $graph ->legend->Pos( 0.55,0.75,"left" ,"center");
    26 
     26$graph->legend->Pos( 0,0.41,"left" ,"center");
     27$graph->legend->SetColumns(1);
    2728$graph->SetBackgroundImage("../images/$logo",BGIMG_COPY);
    2829
    2930$graph->SetBackgroundGradient('red','yellow',GRAD_HOR,BGRAD_MARGIN);
    3031
    31 $p1 = new PiePlot($data);
     32$p1 = new PiePlot3D($data);
    3233$p1->value->SetFormat('');
    3334$p1->value->Show();
    3435$p1->SetLegends($legend);
    35 $p1->SetCenter(0.45,0.5);
     36$p1->SetCenter(0.65,0.35);
    3637
    3738$graph->Add($p1);
     39$p1->ExplodeSlice(1);
    3840$graph->Stroke();
    3941
  • trunk/client/modules/Elezioni/grafici/voti_graf.php

    r105 r346  
    99include ("jpgraph.php");
    1010include ("jpgraph_pie.php");
    11 
     11require_once ('jpgraph_pie3d.php');
    1212$a=$_GET['a'];$b=$_GET['b'];$c=$_GET['c'];$d=$_GET['d'];
    1313$a1=$_GET['a1'];$b1=$_GET['b1'];$c1=$_GET['c1'];$d1=$_GET['d1'];
     
    1717$data = array($a,$b,$c,$d);
    1818$legend = array("$a $a1","$b $b1", "$c $c1", "$d $d1");
    19 $graph = new PieGraph(350,250,"auto");
     19$graph = new PieGraph(450,300,"auto");
    2020$graph->SetShadow();
    21 
    22 
    23 
     21$theme_class= new VividTheme;
     22$graph->SetTheme($theme_class);
    2423$graph->title->Set($titolo);
    2524$graph->title->SetFont(FF_FONT1,FS_BOLD);
    26 $graph ->legend->Pos( 0.52,0.70,"left" ,"center");
     25$graph->legend->Pos( 0.0,0.41,"left" ,"center");
     26$graph->legend->SetColumns(1);
    2727$graph->SetBackgroundGradient('white','yellow',GRAD_HOR,BGRAD_MARGIN);
    2828
     
    3434//$graph->AdjBackgroundImage(0.4,0.3,-1);
    3535
    36 $p1 = new PiePlot($data);
     36$p1 = new PiePlot3D($data);
    3737$p1->value->SetFormat('');
    3838$p1->value->Show();
    3939$p1->SetLegends($legend);
    40 $p1->SetCenter(0.25,0.65);
     40$p1->SetCenter(0.65,0.35);
    4141$graph->Add($p1);
     42$p1->ExplodeSlice(1);
    4243$graph->Stroke();
    43 
    44 
    45 
    46 
    47 
    48 
    49 $graph->Add($p1);
    50 $graph->Stroke();
    51 
    52 
    53 
    54 
    5544
    5645?>
  • trunk/client/modules/Elezioni/gruppo.php

    r344 r346  
    297297
    298298                        if ($circo) $condcirc="and t5.id_circ=$id_circ";                       
    299                         if ($tab=="gruppo" or $genere==4)
     299                        if ($tab=="gruppo" or $genere==4 or ($genere==5 and $votog))
    300300                                        $votigl=" sum(t3.validi),sum(t3.nulli),sum(t3.bianchi),sum(t3.contestati),sum(t3.voti_nulli)";
    301301                        else
  • trunk/client/versione.php

    r345 r346  
    11<?php
    22
    3 $versione = "3.0 rev 345";
     3$versione = "3.0 rev 346";
    44$version_number = $versione;
    5 $datarel = "28 gennaio 2021";
     5$datarel = "30 marzo 2021";
    66$version = "Eleonline $version_number (<i>Data Release: $datarel</i>)";
    77
Note: See TracChangeset for help on using the changeset viewer.