Changeset 1476


Ignore:
Timestamp:
Sep 28, 2010, 9:19:22 PM (10 years ago)
Author:
roux
Message:

amélioration et extension a synthese du plot de home

Location:
cpc/trunk/project
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/config/routing.yml

    r1473 r1476  
    460460  param: {module: plot, action: generatePlotParlementaire}
    461461groupes_plot_graph:
    462   url: /graphes/groupes/lastyear
     462  url: /graphes/groupes/:type
    463463  param: {module: plot, action: generatePlotGroupes}
    464464preuve_presence_seance:
  • cpc/trunk/project/apps/frontend/modules/parlementaire/config/view.yml

    r1472 r1476  
    77plotSuccess:
    88   javascripts: [overlib.js, pMap.js]
     9topSuccess:
     10   javascripts: [overlib.js, pMap.js]
     11
  • cpc/trunk/project/apps/frontend/modules/parlementaire/templates/indexSuccess.php

    r1463 r1476  
    177177    </div>
    178178  </div>
     179  <div class="box_repartition">
     180  <h2><span style="margin-right: 5px;"><img alt="activite" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/ico_graph.png"></span><a href="<?php echo url_for('@top_global'); ?>">Activité parlementaire des 12 derniers mois</a></h2>
     181  <?php echo include_component('plot', 'newGroupes', array('type' => 'home')); ?>
     182  <?php // echo include_component('plot', 'groupes', array('plot' => 'total')); ?>
     183  </div>
     184  <div class="box_tags">
     185  <h2><span style="margin-right: 5px;"><img alt="tags" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/assemblee-nationale.png"></span><?php echo link_to('En ce moment à l\'Assemblée Nationale', '@parlementaires_tags'); ?></h2>
     186  <?php echo include_component('tag', 'globalActivite'); ?>
     187  </div>
    179188  <div class="box_widget">
    180189    <h2><span style="margin-right: 5px;"><img alt="comments" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/ico_comment.png"></span><a href="<?php echo url_for('@commentaires'); ?>">Les derniers commentaires</a></h2>
     
    186195    <div style="display: hidden;" id="coms_widget_update"></div>
    187196  </div>
    188   <div class="box_repartition">
    189   <h2><span style="margin-right: 5px;"><img alt="activite" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/ico_graph.png"></span><a href="<?php echo url_for('@top_global'); ?>">Activité parlementaire des 12 derniers mois</a></h2>
    190   <?php echo include_component('plot', 'newGroupes'); ?>
    191   <?php // echo include_component('plot', 'groupes', array('plot' => 'total')); ?>
    192   </div>
    193   <div class="box_tags">
    194   <h2><span style="margin-right: 5px;"><img alt="tags" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/assemblee-nationale.png"></span><?php echo link_to('En ce moment à l\'Assemblée Nationale', '@parlementaires_tags'); ?></h2>
    195   <?php echo include_component('tag', 'globalActivite'); ?>
    196   </div>
    197197</div>
  • cpc/trunk/project/apps/frontend/modules/parlementaire/templates/topSuccess.php

    r1393 r1476  
    7575</div>
    7676<div>
     77<div class="aligncenter"><?php echo include_component('plot', 'newGroupes', array('type' => 'all')); ?></div>
    7778<h3>Explications :</h3>
    7879<ul>
  • cpc/trunk/project/apps/frontend/modules/plot/actions/actions.class.php

    r1463 r1476  
    3939    $this->mapId = $request->getParameter('mapId');
    4040    $this->forward404Unless($this->mapId);
     41    $this->type = $request->getParameter('type');
    4142    $this->getResponse()->setHttpHeader('content-type', 'image/png');
    4243    $this->setLayout(false);
  • cpc/trunk/project/apps/frontend/modules/plot/actions/components.class.php

    r1472 r1476  
    156156  public function executeGetGroupesData() {
    157157    $this->data = array();
     158    if (!isset($this->type) || $this->type != "all")
     159      $this->type = "home";
    158160    $this->data['groupes'] = array('UMP' => array(),'NC' => array(),'SRC' => array(),'GDR' => array(), 'NI' => array());
    159     $this->data['titres'] = array(" Députés", "Interventions", "Amendements", "Propositions", "Quest. Orales", "Quest. Écrites");
     161    if ($this->type === "home")
     162      $this->data['titres'] = array("Députés", "Interventions", "Amendements", "Propositions", "Quest. Écrites");
     163    else $this->data['titres'] = array("", "Interventions", "Longues", "Courtes", "Déposés", "Adoptés", "de Lois", "Écrites", "Orales");
    160164    $n = count($this->data['titres']);
    161165    $stats = unserialize(Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_groupes')->value);
    162     $amdmts = Doctrine_Query::create()
     166    $query = Doctrine_Query::create()
    163167      ->select('p.groupe_acronyme, count(DISTINCT(a.id)) as ct')
    164168      ->from('Parlementaire p, p.ParlementaireAmendements pa, pa.Amendement a')
    165169      ->where('a.date > ?', date('Y-m-d', time()-60*60*24*365))
    166       ->groupBy('p.groupe_acronyme')
    167       ->fetchArray();
     170      ->groupBy('p.groupe_acronyme');
     171    $qamdmts = clone($query);
     172    $amdmts = $qamdmts->fetchArray();
     173    if ($this->type === "all") {
     174      $qamdmts2 = clone($query);
     175      $amdmts2 = $qamdmts2->andWhere('a.sort = ?', "Adopté")
     176        ->fetchArray();
     177    }
    168178    $props = Doctrine_Query::create()
    169179      ->select('p.groupe_acronyme, count(DISTINCT(t.id)) as ct')
     
    176186    foreach ($this->data['groupes'] as $groupe => $arr) if ($stats[$groupe]) {
    177187      $this->data['groupes'][$groupe][] = $stats[$groupe]['groupe']['nb'];
    178       $this->data['groupes'][$groupe][] = $stats[$groupe]['hemicycle_interventions']['somme']+$stats[$groupe]['commission_interventions']['somme'];
     188      if ($this->type === "all") {
     189        $this->data['groupes'][$groupe][] = $stats[$groupe]['commission_interventions']['somme'];
     190        $this->data['groupes'][$groupe][] = $stats[$groupe]['hemicycle_interventions']['somme'];
     191        $this->data['groupes'][$groupe][] = $stats[$groupe]['hemicycle_interventions_courtes']['somme'];
     192      } else $this->data['groupes'][$groupe][] = $stats[$groupe]['hemicycle_interventions']['somme']+$stats[$groupe]['commission_interventions']['somme'];
    179193    }
    180194    foreach ($amdmts as $amdt)
    181195      $this->data['groupes'][$amdt['groupe_acronyme']][] = $amdt['ct'];
     196    if ($this->type === "all")
     197      foreach ($amdmts2 as $amdt)
     198        $this->data['groupes'][$amdt['groupe_acronyme']][] = $amdt['ct'];
    182199    foreach ($props as $pro)
    183200      $this->data['groupes'][$pro['groupe_acronyme']][] = $pro['ct'];
    184201    foreach ($this->data['groupes'] as $groupe => $arr) if ($stats[$groupe]) {
    185202      $this->data['groupes'][$groupe][] = $stats[$groupe]['questions_ecrites']['somme'];
    186       $this->data['groupes'][$groupe][] = $stats[$groupe]['questions_orales']['somme'];
     203      if ($this->type === "all")
     204        $this->data['groupes'][$groupe][] = $stats[$groupe]['questions_orales']['somme'];
    187205    }
    188206    $this->data['totaux'] = array();
  • cpc/trunk/project/apps/frontend/modules/plot/templates/_newGroupes.php

    r1472 r1476  
    22<?php $PictureID = "Map_".rand(1,10000).".map"; ?>
    33<a href="<?php echo url_for('@top_global'); ?>">
    4 <img id="graph_groupes" alt="Répartition de l'activité parlementaire sur les 12 derniers mois" src="<?php echo url_for('@groupes_plot_graph?mapId='.$PictureID); ?>" OnMouseMove="getMousePosition(event);" OnMouseOut="nd();"/>
     4<img id="graph_groupes" alt="Répartition de l'activité parlementaire sur les 12 derniers mois" src="<?php echo url_for('@groupes_plot_graph?type='.$type.'&mapId='.$PictureID); ?>" OnMouseMove="getMousePosition(event);" OnMouseOut="nd();"/>
    55</a>
    6 <script> LoadImageMap("graph_groupes", "<?php echo url_for('@groupes_plot_graph?drawAction=map&mapId='.$PictureID); ?>"); </script>
     6<script> LoadImageMap("graph_groupes", "<?php echo url_for('@groupes_plot_graph?type='.$type.'&drawAction=map&mapId='.$PictureID); ?>"); </script>
    77<?php echo include_partial('plot/groupesLegende', array()); ?>
  • cpc/trunk/project/apps/frontend/modules/plot/templates/generatePlotGroupesSuccess.php

    r1472 r1476  
    11<?php
    22
    3 $data = unserialize(get_component('plot', 'getGroupesData'));
    4 $xsize = 433; $ysize = 300 ; $font = 8;
     3$data = unserialize(get_component('plot', 'getGroupesData', array('type' => $type)));
     4if ($type === "home")
     5  $xsize = 433;
     6else $xsize = 720;
     7$yadd = 0;
     8if ($type === "all")
     9 $yadd = 40;
     10$ydefsize = 300;
     11$ysize = $ydefsize + $yadd;
     12$font = 8;
    513
    614if ($drawAction === "map") { 
     
    3341
    3442$Test = new xsPChart($xsize,$ysize);
    35 $Test->setGraphArea(40+2*$font,15+4*$font,$xsize-20,$ysize-4*$font);
     43$Test->setGraphArea(40+2*$font,15+3*$font+$yadd,$xsize-20,$ysize-4*$font);
    3644$Test->drawFilledRectangle(7,7,$xsize-7,$ysize-7,240,240,240);
    3745$Test->drawGraphArea(190,190,190,FALSE);
     
    3947$Test->xsSetFontProperties("tahoma.ttf",$font);
    4048$Test->drawScale($Data2,$DataDescr2,SCALE_NORMAL,50,50,50,TRUE,0,0,TRUE,1,FALSE);
    41 $Test->drawScale($Data,$DataDescr,SCALE_NORMAL,50,50,50,TRUE,16,0,TRUE,1,TRUE);
     49$Test->drawScale($Data,$DataDescr,SCALE_NORMAL,50,50,50,TRUE,0,0,TRUE,1,TRUE);
    4250$Test->xsSetFontProperties("tahoma.ttf",$font+1);
    4351$Test->drawTitle(4+2*$font,$ysize-4*$font+18, "TOTAL :",50,50,50);
    44 $Test->drawGrid(4,TRUE,0,0,0,40);
     52if ($type === "all") {
     53  $Test->drawTitle(70,52,"Députés",50,50,50);
     54  $Test->drawTitle(130,52,"Commission",50,50,50);
     55  $Test->drawTitle(208,52,"Hémicycle interventions",50,50,50);
     56  $Test->drawTitle(376,52,"Amendements",50,50,50);
     57  $Test->drawTitle(490,52,"Propositions",50,50,50);
     58  $Test->drawTitle(600,52,"Questions",50,50,50);
     59  $Test->xsSetFontProperties("tahoma.ttf",$font+5);
     60  $Test->drawTitle(60,30,"Répartition de l'activité des députés sur les 12 derniers mois par groupe politique",25,25,25);
     61}
     62$Test->drawGrid(4,TRUE,0,0,0,30);
    4563$Test->setColorPalette(0,30,30,200);
    4664$Test->setColorPalette(1,30,190,255);
  • cpc/trunk/project/plugins/xsPChartPlugin/lib/pChart/pChart/pChart.class

    r1472 r1476  
    499499         if ( $Angle == 0 )
    500500          {
    501            $YPos = $YAxisPos+$YAxisOrt*18;
     501           $YPos = $YAxisPos+$YAxisOrt*(2*$YLegShift-2);
    502502           imagettftext($this->Picture,$this->FontSize,$Angle,floor($XPos)-floor($TextWidth/2),$YPos,$C_TextColor,$this->FontName,$Value);
    503503          }
  • cpc/trunk/project/web/css/xneth/style.css

    r1468 r1476  
    251251  text-align:justify;
    252252}
    253 .tableau_synthese { height: 500px; overflow: auto; }
     253.tableau_synthese {
     254  height: 500px;
     255  overflow: auto;
     256  margin-bottom: 25px;
     257}
    254258.synthese td, .synthese tr { padding: 0px; margin: 0px, border: 0px; height: 25px; }
    255259.p { width: 112px; }
Note: See TracChangeset for help on using the changeset viewer.