Changeset 2117


Ignore:
Timestamp:
Sep 7, 2011, 2:43:16 AM (9 years ago)
Author:
roux
Message:

adaptation ND

Location:
cpc/trunk/project
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/plot/actions/components.class.php

    r2097 r2117  
    158158      $this->type = "home";
    159159    $this->data['groupes'] = array();
    160     foreach (array_reverse(myTools::convertYamlToArray(sfConfig::get('app_groupes_actuels', ''))) as $gpe)
     160    $this->data['couleurs'] = array();
     161    $colormap = myTools::getGroupesColorMap();
     162    foreach (array_reverse(myTools::convertYamlToArray(sfConfig::get('app_groupes_actuels', ''))) as $gpe) {
    161163      $this->data['groupes'][$gpe] = array();
     164      $this->data['couleurs'][] = $colormap[$gpe];
     165    }
    162166    if ($this->type === "home")
    163167      $this->data['titres'] = array("Députés", "Interventions", "Amendements", "Propositions", "Quest. Écrites");
     
    224228    if (!isset($this->plot)) $this->plot = 'total';
    225229    $this->labels = myTools::convertYamlToArray(sfConfig::get('app_groupes_actuels', ''));
     230    $this->couleurs = array();
     231    $colormap = myTools::getGroupesColorMap();
     232    foreach ($this->labels as $gpe)
     233      $this->couleurs[] = $colormap[$gpe];
    226234    $this->interventions = array();
    227235    if ($this->plot == 'total') {
  • cpc/trunk/project/apps/frontend/modules/plot/templates/_groupes.php

    r1788 r2117  
    6262$Test->drawFilledRoundedRectangle(7,7,$xsize-7,$ysize-7,5,240,240,240);
    6363$Test->drawRoundedRectangle(5,5,$xsize-5,$ysize-5,5,230,230,230);
    64 $Test->setColorPalette(0,255,30,30);
    65 $Test->setColorPalette(1,255,50,190);
    66 $Test->setColorPalette(2,30,190,255);
    67 $Test->setColorPalette(3,30,30,200);
    68 $Test->setColorPalette(4,200,200,200);
    69 $Test->setColorPalette(5,240,240,240);
     64$ct = 0;
     65foreach ($couleurs as $col) if (preg_match('/^(\d+),(\d+),(\d+)$/', $col, $cols)) {
     66  $Test->setColorPalette($ct,$cols[1],$cols[2],$cols[3]);
     67  $ct++;
     68}
    7069$Test->xsSetFontProperties("tahoma.ttf",7);
    7170if (isset($Data)) {
     
    9392$Test->xsSetFontProperties("tahoma.ttf",9);
    9493$Test->setColorPalette(0,255,255,255);
    95 $Test->setColorPalette(1,255,30,30);
    96 $Test->setColorPalette(2,255,50,190);
    97 $Test->setColorPalette(3,30,190,255);
    98 $Test->setColorPalette(4,30,30,200);
    99 $Test->setColorPalette(5,200,200,200);
    100 $Test->setColorPalette(6,255,255,255);
     94$ct = 1;
     95foreach ($couleurs as $col) if (preg_match('/^(\d+),(\d+),(\d+)$/', $col, $cols)) {
     96  $Test->setColorPalette($ct,$cols[1],$cols[2],$cols[3]);
     97  $ct++;
     98}
    10199$Test->drawFilledRoundedRectangle(15,$ylegend-14,72,$ylegend+5,5,255,255,255);
    102100$Test->drawLegend(15,$ylegend,$DataDescrLegend,255,255,255);
  • cpc/trunk/project/apps/frontend/modules/plot/templates/generatePlotGroupesSuccess.php

    r2107 r2117  
    6363}
    6464$Test->drawGrid(4,TRUE,0,0,0,30);
    65 $Test->setColorPalette(0,30,30,200);
    66 $Test->setColorPalette(1,30,190,255);
    67 $Test->setColorPalette(2,255,50,190);
    68 $Test->setColorPalette(3,255,30,30);
    69 $Test->setColorPalette(4,130,130,130);
     65$ct = 0;
     66foreach ($data['couleurs'] as $col) if (preg_match('/^(\d+),(\d+),(\d+)$/', $col, $cols)) {
     67  $Test->setColorPalette($ct,$cols[1],$cols[2],$cols[3]);
     68  $ct++;
     69}
    7070$Test->setImageMap(TRUE,$mapId);
    7171$Test->drawStackedBarGraph($Data,$DataDescr,75,90);
  • cpc/trunk/project/bin/init

    r1287 r2117  
    33mkdir log cache
    44chmod 777 log cache
     5cp config/app.yml{.example,}
    56cp config/ProjectConfiguration.class{.example,}.php
    67cp config/databases.yml{.example,}
    7 echo "Don't forget to adapt the configuration files : config/ProjectConfiguration.class.php config/databases.yml"
     8cp bin/db.inc{.example,}
     9echo "Don't forget to adapt the configuration files : bin/db.inc config/ProjectConfiguration.class.php config/databases.yml config/app.yml"
  • cpc/trunk/project/lib/model/doctrine/myTools.class.php

    r2103 r2117  
    3131      $gpes[] = $map[$gpe];
    3232    return $gpes;
     33  }
     34
     35  public static function getGroupesColorMap() {
     36    $colormap = array();
     37    foreach (myTools::getGroupesInfos() as $gpe)
     38      $colormap[$gpe[1]] = $gpe[2];
     39    return $colormap;
    3340  }
    3441
Note: See TracChangeset for help on using the changeset viewer.