svg ninestat

This commit is contained in:
root 2020-06-24 15:22:39 +02:00
parent b214ebe981
commit 994972606a
21 changed files with 2162 additions and 45 deletions

View File

@ -10,9 +10,10 @@ use Doctrine\DBAL\Connection as DBALConnection;
use Doctrine\ORM\EntityManager;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Id\AssignedGenerator;
use Cadoles\CoreBundle\Entity\Group;
use Cadoles\CoreBundle\Entity\UserGroup;
use Cadoles\CoreBundle\Entity\Etab;
class InitDataCommand extends ContainerAwareCommand
{
@ -50,6 +51,23 @@ class InitDataCommand extends ContainerAwareCommand
$stmt->execute();
}
$stmt->closeCursor();
// afin de forcer les ID sur certaines entités
$metadata = $em->getClassMetaData('CadolesCoreBundle:Etab');
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new AssignedGenerator());
// Etab inconnu
$entity = $em->getRepository('CadolesCoreBundle:Etab')->find(-100);
if(!$entity) {
$entity = new Etab;
$entity->setId(-100);
}
$entity->setLatitude(50);
$entity->setLongitude(-30);
$em->persist($entity);
$em->flush();
}
protected static function determineKernelRootDir(Event $event) {

View File

@ -0,0 +1,169 @@
<?php
namespace Cadoles\CoreBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface;
use Doctrine\DBAL\Connection as DBALConnection;
use Doctrine\ORM\EntityManager;
use Cadoles\CoreBundle\Entity\Etab;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
global $bdd01;
global $config;
class SynchroEtabCommand extends Command
{
private $container;
private $em;
private $em2;
private $output;
private $filesystem;
private $rootlog;
private $ldap;
private $ldap_basedn;
protected function configure()
{
$this
->setName('Core:SynchroEtab')
->setDescription('Synchronisation Etablissement Scolaire')
->setHelp('This command Synchro Etab for Core')
->addArgument('simulate', InputArgument::OPTIONAL, 'true to simulate / false to run')
->addArgument('cronid', InputArgument::OPTIONAL, 'ID Cron Job')
->addArgument('lastchance', InputArgument::OPTIONAL, 'Lastchance to run the cron')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->container = $this->getApplication()->getKernel()->getContainer();
$this->em = $this->container->get('doctrine')->getEntityManager();
$this->output = $output;
$this->filesystem = new Filesystem();
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
$this->writelnred('');
$this->writelnred('== Core:SynchroEtab');
$this->writelnred('==========================================================================================================');
$simulate = $input->getArgument('simulate');
if($simulate=="") $simulate="true";
if($simulate!="true"&&$simulate!="false") {
$this->writeln('Paramétre incorrect');
return;
}
$simulate=($simulate=="true");
$this->writeln('');
if($simulate) $this->writeln('** SIMULATION');
else $this->writeln('** REEL');
$this->writeln('');
$this->writeln('=====================================================');
$this->writeln('== SYNCHONISATION ETAB ==============================');
$this->writeln('=====================================================');
$headers = ['Accept' => 'application/json'];
$query = [];
$url="https://data.education.gouv.fr/api/records/1.0/search/?dataset=fr-en-adresse-et-geolocalisation-etablissements-premier-et-second-degre&q=numero_uai%3D##RNE##&facet=numero_uai&facet=appellation_officielle&facet=secteur_public_prive_libe&facet=code_postal_uai&facet=localite_acheminement_uai&facet=libelle_commune&facet=appariement&facet=localisation&facet=nature_uai&facet=nature_uai_libe&facet=etat_etablissement&facet=etat_etablissement_libe&facet=code_departement&facet=code_region&facet=code_academie&facet=code_commune&facet=libelle_departement&facet=libelle_region&facet=libelle_academie&facet=secteur_prive_code_type_contrat&facet=secteur_prive_libelle_type_contrat";
if($this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYactivate")->getValue()) {
$PROXYserver = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYserver")->getValue();
$PROXYport = $this->em->getRepository("CadolesCoreBundle:Config")->find("PROXYport")->getValue();
\Unirest\Request::proxy($PROXYserver, $PROXYport, CURLPROXY_HTTP, true);
}
// Etablissement non localisé
$noloc=$this->em->getRepository("CadolesCoreBundle:Etab")->find(-100);
// Pour l'ensemble des serveurs
$servers=$this->em->getRepository("CadolesCoreBundle:Server")->findAll();
foreach($servers as $server) {
$urlrne=str_replace("##RNE##",$server->getIdLocal(),$url);
$response = \Unirest\Request::get($urlrne,$headers,$query);
if($response->body->records) {
$this->writeln($server->getIdlocal()." Localisé");
$fields = $response->body->records[0]->fields;
$etab=$this->em->getRepository("CadolesCoreBundle:Etab")->findOneBy(["numero_uai"=>$fields->numero_uai]);
if(!$etab) {
$etab=new Etab();
}
if(isset($fields->localite_acheminement_uai)) $etab->setLocaliteAcheminementUai($fields->localite_acheminement_uai);
if(isset($fields->numero_uai)) $etab->setNumeroUai($fields->numero_uai);
if(isset($fields->secteur_public_prive_libe)) $etab->setSecteurPublicPriveLibe($fields->secteur_public_prive_libe);
if(isset($fields->etat_etablissement)) $etab->setEtatEtablissement($fields->etat_etablissement);
if(isset($fields->libelle_region)) $etab->setLibelleRegion($fields->libelle_region);
if(isset($fields->secteur_prive_code_type_contrat)) $etab->setSecteurPriveCodeTypeContrat($fields->secteur_prive_code_type_contrat);
if(isset($fields->code_postal_uai)) $etab->setCodePostalUai($fields->code_postal_uai);
if(isset($fields->code_region)) $etab->setCodeRegion($fields->code_region);
if(isset($fields->epsg)) $etab->setEpsg($fields->epsg);
if(isset($fields->nature_uai_libe)) $etab->setNatureUaiLibe($fields->nature_uai_libe);
if(isset($fields->appellation_officielle)) $etab->setAppellationOfficielle($fields->appellation_officielle);
if(isset($fields->latitude)) $etab->setLatitude($fields->latitude);
if(isset($fields->secteur_prive_libelle_type_contrat)) $etab->setSecteurPriveLibelleTypeContrat($fields->secteur_prive_libelle_type_contrat);
if(isset($fields->coordonnee_y)) $etab->setCoordonneeY($fields->coordonnee_y);
if(isset($fields->coordonnee_x)) $etab->setCoordonneeX($fields->coordonnee_x);
if(isset($fields->adresse_uai)) $etab->setAdresseUai($fields->adresse_uai);
if(isset($fields->code_commune)) $etab->setCodeCommune($fields->code_commune);
if(isset($fields->localisation)) $etab->setLocalisation($fields->localisation);
if(isset($fields->libelle_commune)) $etab->setLibelleCommune($fields->libelle_commune);
if(isset($fields->code_departement)) $etab->setCodeDepartement($fields->code_departement);
if(isset($fields->etat_etablissement_libe)) $etab->setEtatEtablissementLibe($fields->etat_etablissement_libe);
if(isset($fields->nature_uai)) $etab->setNatureUai($fields->nature_uai);
if(isset($fields->libelle_departement)) $etab->setLibelleDepartement($fields->libelle_departement);
if(isset($fields->code_academie)) $etab->setCodeAcademie($fields->code_academie);
if(isset($fields->appariement)) $etab->setAppariement($fields->appariement);
if(isset($fields->longitude)) $etab->setLongitude($fields->longitude);
if(isset($fields->denomination_principale)) $etab->setDenominationPrincipale($fields->denomination_principale);
if(isset($fields->libelle_academie)) $etab->setLibelleAcademie($fields->libelle_academie);
//$etab->setPosition($fields->position);
if(!$etab->getLongitude()&&$etab->getLibelleCommune()) {
$localisation = \Unirest\Request::get("https://nominatim.openstreetmap.org/search?q=".urlencode($fields->libelle_commune)."&format=json",$headers);
if($localisation->body[0]) {
$etab->setLongitude($localisation->body[0]->lon);
$etab->setLatitude($localisation->body[0]->lat);
}
}
// Sauvegarde
$this->em->persist($etab);
$this->em->flush();
$etab=$this->em->getRepository("CadolesCoreBundle:Etab")->findOneBy(["numero_uai"=>$fields->numero_uai]);
$server->setEtab($etab);
$this->em->flush();
}
else {
$this->writeln($server->getIdlocal()." Non Localisé");
// Ratacher le serveur à l'etab inconnu
$server->setEtab($noloc);
$this->em->flush();
}
}
$this->writeln('');
return 1;
}
private function writelnred($string) {
$this->output->writeln('<fg=red>'.$string.'</>');
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
}
private function writeln($string) {
$this->output->writeln($string);
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
}
}

View File

@ -23,7 +23,8 @@ class ApiController extends Controller
echo "NAME = ".$request->request->get("name")."<br>";
echo "MODULE = ".$request->request->get("module")."<br>";
echo "VERSION = ".$request->request->get("version")."<br>";
echo "APPS = ".$request->request->get("apps")."<br><br>";
echo "URL = ".$request->request->get("url")."<br><br>";
echo "APPS = ".$request->request->get("apps")."<br><br>";
}
$idserver = $request->request->get("idserver");
@ -31,6 +32,7 @@ class ApiController extends Controller
$name = $request->request->get("name");
$module = $request->request->get("module");
$version = $request->request->get("version");
$url = "https://".$request->request->get("url");
$apps = explode(";",$request->request->get("apps"));
$now = new \DateTime();
@ -46,27 +48,40 @@ class ApiController extends Controller
$server->setName($name);
$server->setModule($module);
$server->setVersion($version);
$server->setUrl($url);
$server->setUpdatedate($now);
// Sauvegarde
$em->persist($server);
$em->flush();
// On supprime tt les apps du serveur pour remettre à jour les apps associées au serveur
$entityapps=$em->getRepository('CadolesCoreBundle:ServerApplication')->findBy(["server"=>$server]);
foreach($entityapps as $entity) {
$em->remove($entity);
$em->flush();
}
// Décryptage des paquets envole entrant
$tbapps=[];
if($this->fgdebug) echo "APPLICATIONS<br>";
foreach($apps as $app) {
$tmp=explode("-",$app);
$tmpname="";
for($i=0;$i<count($tmp)-2;$i++) {
$tmpname.=$tmp[$i];
if(($i+1)<(count($tmp)-2)) $tmpname.="-";
}
if($tmp[1]=="sacoche")
$tbapps["eole-sacoche"]=$app;
else {
$tmpname="";
for($i=0;$i<count($tmp)-2;$i++) {
$tmpname.=$tmp[$i];
if(($i+1)<(count($tmp)-2)) $tmpname.="-";
}
if($this->fgdebug) echo $tmpname."<br>";
$tbapps["$tmpname"]=$app;
if($this->fgdebug) echo $tmpname."<br>";
$tbapps["$tmpname"]=$app;
}
}
// Pour chaque apps
foreach($tbapps as $package => $version) {
$application=$em->getRepository('CadolesCoreBundle:Application')->findOneBy(["package"=>$package]);

View File

@ -76,17 +76,51 @@ class CoreController extends Controller
$totalmodules = $em->createQueryBuilder()
->select('COUNT(s.module) total','s.module label')
->from('CadolesCoreBundle:Server','s')
->groupBy('s.module');
->groupBy('s.module')
->orderBy('total','DESC')
->addOrderBy('label','ASC');
// Total by version
$totalversions = $em->createQueryBuilder()
->select('COUNT(s.version) total','s.version label')
->from('CadolesCoreBundle:Server','s')
->groupBy('s.version');
->groupBy('s.version')
->orderBy('total','DESC')
->addOrderBy('label','ASC');
// Total by Académie
$totalbyacademies = $em->createQueryBuilder()
->select('COUNT(e.libelle_academie) total','e.libelle_academie label')
->from('CadolesCoreBundle:Etab','e')
->from('CadolesCoreBundle:Server','s')
->where('s.etab=e')
->groupBy('e.libelle_academie')
->orderBy('total','DESC')
->addOrderBy('label','ASC');
// Total by Secteur
$totalbysecteurs = $em->createQueryBuilder()
->select('COUNT(e.secteur_public_prive_libe) total','e.secteur_public_prive_libe label')
->from('CadolesCoreBundle:Etab','e')
->from('CadolesCoreBundle:Server','s')
->where('s.etab=e')
->groupBy('e.secteur_public_prive_libe')
->orderBy('total','DESC')
->addOrderBy('label','ASC');
// Total by Nature
$totalbynatures = $em->createQueryBuilder()
->select('COUNT(e.nature_uai_libe) total','e.nature_uai_libe label')
->from('CadolesCoreBundle:Etab','e')
->from('CadolesCoreBundle:Server','s')
->where('s.etab=e')
->groupBy('e.nature_uai_libe')
->orderBy('total','DESC')
->addOrderBy('label','ASC');
// Total applications
$applications = $em->getRepository("CadolesCoreBundle:ServerApplication")->findAll();
// Total by apps
$totalapplications = $em->createQueryBuilder()
->select('COUNT(a.package) total','a.name label')
@ -94,17 +128,38 @@ class CoreController extends Controller
->from('CadolesCoreBundle:Application','a')
->where('sa.application=a.id')
->groupBy('a.package')
->orderBy('total','DESC');
->orderBy('total','DESC')
->addOrderBy('label','ASC');
// Servers
$etabs = $em->getRepository("CadolesCoreBundle:Etab")->findAll();
return $this->render('CadolesCoreBundle:Core:home.html.twig',[
'useheader' => true,
'usemenu' => false,
'usesidebar' => false,
'totalserveurs' => count($servers),
'etabs' => $etabs,
'totalservers' => count($servers),
'totalbymodules' => $totalmodules->getQuery()->getResult(),
'totalbyversions' => $totalversions->getQuery()->getResult(),
'totalapplications' => count($applications),
'totalbyapplications' => $totalapplications->getQuery()->getResult()
'totalbyapplications' => $totalapplications->getQuery()->getResult(),
'totalbyacademies' => $totalbyacademies->getQuery()->getResult(),
'totalbysecteurs' => $totalbysecteurs->getQuery()->getResult(),
'totalbynatures' => $totalbynatures->getQuery()->getResult(),
]);
}
public function serverAction($id,Request $request)
{
$em = $this->getDoctrine()->getManager();
$server=$em->getRepository("CadolesCoreBundle:Server")->find($id);
return $this->render('CadolesCoreBundle:Core:server.html.twig',[
'useheader' => false,
'usemenu' => false,
'usesidebar' => false,
'server' => $server
]);
}
}

View File

@ -0,0 +1,933 @@
<?php
namespace Cadoles\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Scrum
*
* @ORM\Entity
* @ORM\Table(name="etab")
* @ORM\HasLifecycleCallbacks
*/
class Etab
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $localite_acheminement_uai;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $numero_uai;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $secteur_public_prive_libe;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $etat_etablissement;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $libelle_region;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $secteur_prive_code_type_contrat;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $code_postal_uai;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $code_region;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $epsg;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $nature_uai_libe;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $appellation_officielle;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $latitude;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $secteur_prive_libelle_type_contrat;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $coordonnee_y;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $coordonnee_x;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $adresse_uai;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $code_commune;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $localisation;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $libelle_commune;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $code_departement;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $etat_etablissement_libe;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $nature_uai;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $libelle_departement;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $code_academie;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $appariement;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $longitude;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $denomination_principale;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $libelle_academie;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $position;
/**
* @ORM\OneToMany(targetEntity="Cadoles\CoreBundle\Entity\Server", mappedBy="etab", cascade={"persist"}, orphanRemoval=true)
*/
private $servers;
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor
*/
public function __construct()
{
$this->servers = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set localiteAcheminementUai
*
* @param string $localiteAcheminementUai
*
* @return Etab
*/
public function setLocaliteAcheminementUai($localiteAcheminementUai)
{
$this->localite_acheminement_uai = $localiteAcheminementUai;
return $this;
}
/**
* Get localiteAcheminementUai
*
* @return string
*/
public function getLocaliteAcheminementUai()
{
return $this->localite_acheminement_uai;
}
/**
* Set numeroUai
*
* @param string $numeroUai
*
* @return Etab
*/
public function setNumeroUai($numeroUai)
{
$this->numero_uai = $numeroUai;
return $this;
}
/**
* Get numeroUai
*
* @return string
*/
public function getNumeroUai()
{
return $this->numero_uai;
}
/**
* Set secteurPublicPriveLibe
*
* @param string $secteurPublicPriveLibe
*
* @return Etab
*/
public function setSecteurPublicPriveLibe($secteurPublicPriveLibe)
{
$this->secteur_public_prive_libe = $secteurPublicPriveLibe;
return $this;
}
/**
* Get secteurPublicPriveLibe
*
* @return string
*/
public function getSecteurPublicPriveLibe()
{
return $this->secteur_public_prive_libe;
}
/**
* Set etatEtablissement
*
* @param string $etatEtablissement
*
* @return Etab
*/
public function setEtatEtablissement($etatEtablissement)
{
$this->etat_etablissement = $etatEtablissement;
return $this;
}
/**
* Get etatEtablissement
*
* @return string
*/
public function getEtatEtablissement()
{
return $this->etat_etablissement;
}
/**
* Set libelleRegion
*
* @param string $libelleRegion
*
* @return Etab
*/
public function setLibelleRegion($libelleRegion)
{
$this->libelle_region = $libelleRegion;
return $this;
}
/**
* Get libelleRegion
*
* @return string
*/
public function getLibelleRegion()
{
return $this->libelle_region;
}
/**
* Set secteurPriveCodeTypeContrat
*
* @param string $secteurPriveCodeTypeContrat
*
* @return Etab
*/
public function setSecteurPriveCodeTypeContrat($secteurPriveCodeTypeContrat)
{
$this->secteur_prive_code_type_contrat = $secteurPriveCodeTypeContrat;
return $this;
}
/**
* Get secteurPriveCodeTypeContrat
*
* @return string
*/
public function getSecteurPriveCodeTypeContrat()
{
return $this->secteur_prive_code_type_contrat;
}
/**
* Set codePostalUai
*
* @param string $codePostalUai
*
* @return Etab
*/
public function setCodePostalUai($codePostalUai)
{
$this->code_postal_uai = $codePostalUai;
return $this;
}
/**
* Get codePostalUai
*
* @return string
*/
public function getCodePostalUai()
{
return $this->code_postal_uai;
}
/**
* Set codeRegion
*
* @param string $codeRegion
*
* @return Etab
*/
public function setCodeRegion($codeRegion)
{
$this->code_region = $codeRegion;
return $this;
}
/**
* Get codeRegion
*
* @return string
*/
public function getCodeRegion()
{
return $this->code_region;
}
/**
* Set epsg
*
* @param string $epsg
*
* @return Etab
*/
public function setEpsg($epsg)
{
$this->epsg = $epsg;
return $this;
}
/**
* Get epsg
*
* @return string
*/
public function getEpsg()
{
return $this->epsg;
}
/**
* Set natureUaiLibe
*
* @param string $natureUaiLibe
*
* @return Etab
*/
public function setNatureUaiLibe($natureUaiLibe)
{
$this->nature_uai_libe = $natureUaiLibe;
return $this;
}
/**
* Get natureUaiLibe
*
* @return string
*/
public function getNatureUaiLibe()
{
return $this->nature_uai_libe;
}
/**
* Set appellationOfficielle
*
* @param string $appellationOfficielle
*
* @return Etab
*/
public function setAppellationOfficielle($appellationOfficielle)
{
$this->appellation_officielle = $appellationOfficielle;
return $this;
}
/**
* Get appellationOfficielle
*
* @return string
*/
public function getAppellationOfficielle()
{
return $this->appellation_officielle;
}
/**
* Set latitude
*
* @param string $latitude
*
* @return Etab
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
return $this;
}
/**
* Get latitude
*
* @return string
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* Set secteurPriveLibelleTypeContrat
*
* @param string $secteurPriveLibelleTypeContrat
*
* @return Etab
*/
public function setSecteurPriveLibelleTypeContrat($secteurPriveLibelleTypeContrat)
{
$this->secteur_prive_libelle_type_contrat = $secteurPriveLibelleTypeContrat;
return $this;
}
/**
* Get secteurPriveLibelleTypeContrat
*
* @return string
*/
public function getSecteurPriveLibelleTypeContrat()
{
return $this->secteur_prive_libelle_type_contrat;
}
/**
* Set coordonneeY
*
* @param string $coordonneeY
*
* @return Etab
*/
public function setCoordonneeY($coordonneeY)
{
$this->coordonnee_y = $coordonneeY;
return $this;
}
/**
* Get coordonneeY
*
* @return string
*/
public function getCoordonneeY()
{
return $this->coordonnee_y;
}
/**
* Set coordonneeX
*
* @param string $coordonneeX
*
* @return Etab
*/
public function setCoordonneeX($coordonneeX)
{
$this->coordonnee_x = $coordonneeX;
return $this;
}
/**
* Get coordonneeX
*
* @return string
*/
public function getCoordonneeX()
{
return $this->coordonnee_x;
}
/**
* Set adresseUai
*
* @param string $adresseUai
*
* @return Etab
*/
public function setAdresseUai($adresseUai)
{
$this->adresse_uai = $adresseUai;
return $this;
}
/**
* Get adresseUai
*
* @return string
*/
public function getAdresseUai()
{
return $this->adresse_uai;
}
/**
* Set codeCommune
*
* @param string $codeCommune
*
* @return Etab
*/
public function setCodeCommune($codeCommune)
{
$this->code_commune = $codeCommune;
return $this;
}
/**
* Get codeCommune
*
* @return string
*/
public function getCodeCommune()
{
return $this->code_commune;
}
/**
* Set localisation
*
* @param string $localisation
*
* @return Etab
*/
public function setLocalisation($localisation)
{
$this->localisation = $localisation;
return $this;
}
/**
* Get localisation
*
* @return string
*/
public function getLocalisation()
{
return $this->localisation;
}
/**
* Set libelleCommune
*
* @param string $libelleCommune
*
* @return Etab
*/
public function setLibelleCommune($libelleCommune)
{
$this->libelle_commune = $libelleCommune;
return $this;
}
/**
* Get libelleCommune
*
* @return string
*/
public function getLibelleCommune()
{
return $this->libelle_commune;
}
/**
* Set codeDepartement
*
* @param string $codeDepartement
*
* @return Etab
*/
public function setCodeDepartement($codeDepartement)
{
$this->code_departement = $codeDepartement;
return $this;
}
/**
* Get codeDepartement
*
* @return string
*/
public function getCodeDepartement()
{
return $this->code_departement;
}
/**
* Set etatEtablissementLibe
*
* @param string $etatEtablissementLibe
*
* @return Etab
*/
public function setEtatEtablissementLibe($etatEtablissementLibe)
{
$this->etat_etablissement_libe = $etatEtablissementLibe;
return $this;
}
/**
* Get etatEtablissementLibe
*
* @return string
*/
public function getEtatEtablissementLibe()
{
return $this->etat_etablissement_libe;
}
/**
* Set natureUai
*
* @param string $natureUai
*
* @return Etab
*/
public function setNatureUai($natureUai)
{
$this->nature_uai = $natureUai;
return $this;
}
/**
* Get natureUai
*
* @return string
*/
public function getNatureUai()
{
return $this->nature_uai;
}
/**
* Set libelleDepartement
*
* @param string $libelleDepartement
*
* @return Etab
*/
public function setLibelleDepartement($libelleDepartement)
{
$this->libelle_departement = $libelleDepartement;
return $this;
}
/**
* Get libelleDepartement
*
* @return string
*/
public function getLibelleDepartement()
{
return $this->libelle_departement;
}
/**
* Set codeAcademie
*
* @param string $codeAcademie
*
* @return Etab
*/
public function setCodeAcademie($codeAcademie)
{
$this->code_academie = $codeAcademie;
return $this;
}
/**
* Get codeAcademie
*
* @return string
*/
public function getCodeAcademie()
{
return $this->code_academie;
}
/**
* Set appariement
*
* @param string $appariement
*
* @return Etab
*/
public function setAppariement($appariement)
{
$this->appariement = $appariement;
return $this;
}
/**
* Get appariement
*
* @return string
*/
public function getAppariement()
{
return $this->appariement;
}
/**
* Set longitude
*
* @param string $longitude
*
* @return Etab
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
return $this;
}
/**
* Get longitude
*
* @return string
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* Set denominationPrincipale
*
* @param string $denominationPrincipale
*
* @return Etab
*/
public function setDenominationPrincipale($denominationPrincipale)
{
$this->denomination_principale = $denominationPrincipale;
return $this;
}
/**
* Get denominationPrincipale
*
* @return string
*/
public function getDenominationPrincipale()
{
return $this->denomination_principale;
}
/**
* Set libelleAcademie
*
* @param string $libelleAcademie
*
* @return Etab
*/
public function setLibelleAcademie($libelleAcademie)
{
$this->libelle_academie = $libelleAcademie;
return $this;
}
/**
* Get libelleAcademie
*
* @return string
*/
public function getLibelleAcademie()
{
return $this->libelle_academie;
}
/**
* Set position
*
* @param string $position
*
* @return Etab
*/
public function setPosition($position)
{
$this->position = $position;
return $this;
}
/**
* Get position
*
* @return string
*/
public function getPosition()
{
return $this->position;
}
/**
* Add server
*
* @param \Cadoles\CoreBundle\Entity\Server $server
*
* @return Etab
*/
public function addServer(\Cadoles\CoreBundle\Entity\Server $server)
{
$this->servers[] = $server;
return $this;
}
/**
* Remove server
*
* @param \Cadoles\CoreBundle\Entity\Server $server
*/
public function removeServer(\Cadoles\CoreBundle\Entity\Server $server)
{
$this->servers->removeElement($server);
}
/**
* Get servers
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getServers()
{
return $this->servers;
}
}

View File

@ -7,8 +7,6 @@ use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Scrum
*
* @ORM\Entity
* @ORM\Table(name="server")
* @ORM\HasLifecycleCallbacks
@ -49,6 +47,11 @@ class Server
*/
private $version;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $url;
/**
* @ORM\Column(name="updatedate", type="datetime")
*/
@ -59,6 +62,14 @@ class Server
*/
private $serverapplications;
/**
* @ORM\ManyToOne(targetEntity="Cadoles\CoreBundle\Entity\Etab", inversedBy="servers")
*/
private $etab;
/**
* Constructor
*/
@ -197,6 +208,30 @@ class Server
return $this->version;
}
/**
* Set url
*
* @param string $url
*
* @return Server
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get url
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set updatedate
*
@ -254,4 +289,28 @@ class Server
{
return $this->serverapplications;
}
/**
* Set etab
*
* @param \Cadoles\CoreBundle\Entity\Etab $etab
*
* @return Server
*/
public function setEtab(\Cadoles\CoreBundle\Entity\Etab $etab = null)
{
$this->etab = $etab;
return $this;
}
/**
* Get etab
*
* @return \Cadoles\CoreBundle\Entity\Etab
*/
public function getEtab()
{
return $this->etab;
}
}

View File

@ -7,9 +7,7 @@ use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Scrum
*
* @ORM\Entity
* @ORM\Entity
* @ORM\Table(name="serverapplication")
* @ORM\HasLifecycleCallbacks
*/

View File

@ -3,6 +3,9 @@ cadoles_core_home:
path: /
defaults: { _controller: CadolesCoreBundle:Core:home }
cadoles_core_server:
path: /server/{id}
defaults: { _controller: CadolesCoreBundle:Core:server }
#== Theme ================================================================================================================

View File

@ -0,0 +1,640 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Prevents IE11 from highlighting tiles in blue */
.leaflet-tile::selection {
background: transparent;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer,
.leaflet-container .leaflet-tile {
max-width: none !important;
max-height: none !important;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
cursor: grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive,
svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(../bundles/cadolescore/images/map/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(../bundles/cadolescore/images/map/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(../bundles/cadolescore/images/map/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

File diff suppressed because one or more lines are too long

View File

@ -1,26 +1,14 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block beforepage %}
<div id="mapid" style="width:100%;height:500px"></div>
{% endblock %}
{% block pagewrapper %}
<div class="row" style="margin-top:20px">
<div class="col-md-6" style="padding:20px;text-align:center;">
<div class="col-md-12">
<h1 style="margin-top:0px"><i class="fa fa-server fa-fw"></i>Serveurs = {{ totalserveurs }} </h1>
</div>
<div class="col-md-6" >
<h1>Serveurs par Module</h1>
<div id='bymodule-chart'></div>
<div id="bymodule-legend"></div>
</div>
<div class="col-md-6" >
<h1>Serveurs par Version</h1>
<div id='byversion-chart'></div>
<div id="byversion-legend"></div>
</div>
</div>
<div class="col-md-6" style="padding:20px;text-align:center;margin: 0px;">
<div class="col-md-6 col-md-offset-1" style="padding:20px;text-align:center;">
<div class="col-md-12">
<h1 style="margin-top:0px; margin-bottom:25px""><i class="fa fa-cubes fa-fw"></i>Applications = {{ totalapplications }} </h1>
</div>
@ -31,13 +19,163 @@
<div id='byapplication-chart'></div>
</div>
<div id="byapplication-legend" class="col-md-4"></div>
</div>
</div>
<div class="col-md-4" style="padding:20px;text-align:center;">
<div class="col-md-12">
<h1 style="margin-top:0px"><i class="fa fa-server fa-fw"></i>Serveurs = {{ totalservers }} </h1>
</div>
<div class="row">
<div class="col-md-6" >
<h2>Serveurs par Académies</h2>
<div id='byacademie-chart' style="height:250px"></div>
<div id="byacademie-legend"></div>
</div>
<div class="col-md-6" >
<h2>Serveurs par Secteurs</h2>
<div id='bysecteur-chart' style="height:250px"></div>
<div id="bysecteur-legend"></div>
</div>
</div>
<div class="row">
<div class="col-md-6" >
<h2>Serveurs par Natures</h2>
<div id='bynature-chart' style="height:250px"></div>
<div id="bynature-legend"></div>
</div>
<div class="col-md-6" >
<h2>Serveurs par Module</h2>
<div id='bymodule-chart' style="height:250px"></div>
<div id="bymodule-legend"></div>
</div>
</div>
<div class="row">
<div class="col-md-6" >
<h2>Serveurs par Version</h2>
<div id='byversion-chart' style="height:250px"></div>
<div id="byversion-legend"></div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block localjavascript %}
// On initialise la latitude et la longitude de Paris (centre de la carte)
var lat = 48.852969;
var lon = 2.349903;
var macarte = null;
// Fonction d'initialisation de la carte
function initMap() {
// Créer l'objet "macarte" et l'insèrer dans l'élément HTML qui a l'ID "map"
macarte = L.map('mapid').setView([lat, lon], 3);
// Leaflet ne récupère pas les cartes (tiles) sur un serveur par défaut. Nous devons lui préciser où nous souhaitons les récupérer. Ici, openstreetmap.fr
L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {
// Il est toujours bien de laisser le lien vers la source des données
attribution: 'données © <a href="//osm.org/copyright">OpenStreetMap</a>/ODbL - rendu <a href="//openstreetmap.fr">OSM France</a>',
minZoom: 1,
maxZoom: 20
}).addTo(macarte);
}
$(document).ready(function() {
initMap();
marker=[];
{% for etab in etabs %}
{% if not etab.servers is empty and not etab.latitude is null%}
var marker = L.marker([{{ etab.latitude }}, {{ etab.longitude }}]).addTo(macarte);
html ="<h3>Etablissement</h3>";
{% if(etab.id!=-100) %}
html+="<b>UAI</b> = {{etab.numerouai}}<br>";
html+="<b>Nom</b> = {{etab.denominationprincipale}}<br>";
html+="<b>Adresse</b> = {{etab.adresseuai}} {{etab.codecommune}} {{etab.libellecommune}}<br>";
html+="<b>Académie</b> = {{etab.libelleacademie}}<br>";
html+="<b>Secteur</b> = {{etab.secteurpublicprivelibe}}<br>";
html+="<b>Nature</b> = {{etab.natureuailibe}}<br>";
{% else %}
html+="Non Localisé<br>";
{% endif %}
html+="<hr>";
{% for server in etab.servers %}
html+="<a style='cursor:pointer' onClick='showModal({{server.id}})'>Serveur id = {{ server.id}}</a><br>";
{% endfor %}
marker.bindPopup(html);
{% endif %}
{% endfor %}
//== byAcademie
var byacademie = Morris.Donut({
element: 'byacademie-chart',
data: [
{% for total in totalbyacademies %}
{'label':'{{ total.label }}','value':{{ total.total }}},
{% endfor %}
],
resize: true
});
byacademie.options.data.forEach(function(label, i) {
var legendItem = $('<span style="margin:auto; display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
legendItem.find('span')
.css('backgroundColor', byacademie.options.colors[i])
.css('width', '20px')
.css('display', 'inline-block')
.css('margin', '5px');
$('#byacademie-legend').append(legendItem)
});
//== byNature
var bynature = Morris.Donut({
element: 'bynature-chart',
data: [
{% for total in totalbynatures %}
{'label':'{{ total.label }}','value':{{ total.total }}},
{% endfor %}
],
resize: true
});
bynature.options.data.forEach(function(label, i) {
var legendItem = $('<span style="margin:auto; display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
legendItem.find('span')
.css('backgroundColor', bynature.options.colors[i])
.css('width', '20px')
.css('display', 'inline-block')
.css('margin', '5px');
$('#bynature-legend').append(legendItem)
});
//== bySecteur
var bysecteur = Morris.Donut({
element: 'bysecteur-chart',
data: [
{% for total in totalbysecteurs %}
{'label':'{{ total.label }}','value':{{ total.total }}},
{% endfor %}
],
resize: true
});
bysecteur.options.data.forEach(function(label, i) {
var legendItem = $('<span style="margin:auto; display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
legendItem.find('span')
.css('backgroundColor', bysecteur.options.colors[i])
.css('width', '20px')
.css('display', 'inline-block')
.css('margin', '5px');
$('#bysecteur-legend').append(legendItem)
});
//== byModule
var bymodule = Morris.Donut({
element: 'bymodule-chart',
@ -50,7 +188,7 @@
});
bymodule.options.data.forEach(function(label, i) {
var legendItem = $('<span style="margin:auto; width: 50%;display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
var legendItem = $('<span style="margin:auto; display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
legendItem.find('span')
.css('backgroundColor', bymodule.options.colors[i])
.css('width', '20px')
@ -71,7 +209,7 @@
});
byversion.options.data.forEach(function(label, i) {
var legendItem = $('<span style="margin:auto; width: 50%;display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
var legendItem = $('<span style="margin:auto; display: block;text-align: left;"></span>').text( label['label'] + " ( " +label['value'] + " )" ).prepend('<span>&nbsp;</span>');
legendItem.find('span')
.css('backgroundColor', byversion.options.colors[i])
.css('width', '20px')
@ -105,4 +243,16 @@
});
});
function showModal(id) {
var url="{{ path('cadoles_core_server',{id:'xx'})}}";
url=url.replace('xx',id);
console.log("pouet");
$("#mymodal .modal-title").html("Informations Serveur");
$("#mymodal #framemodal").attr("src",url);
$("#mymodal").modal('show');
}
{% endblock %}

View File

@ -0,0 +1,69 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block localstyle %}
b {
color: #{{color["main"]}};
}
{% endblock %}
{% block pagewrapper %}
<div class="row">
<div class="col-xs-6">
<b>ID</b> = {{ server.id }}<br>
<b>URL</b> = <a href="{{server.url}}" target="_blank">{{server.url}}</a><br>
<b>Local ID</b> = {{server.idlocal}}<br>
<b>Module</b> = {{ server.module }}<br>
<b>Version</b> = {{ server.version }}<br><br>
<b>Applications</b><br>
{% for application in server.serverapplications %}
{{ application.version }}<br>
{% endfor %}
</div>
<div class="col-xs-6">
<b>Etablissement</b><br>
{% if(server.etab.id!=-100) %}
<b>UAI</b> = {{server.etab.numerouai}}<br>
<b>Nom</b> = {{server.etab.denominationprincipale}}<br>
<b>Adresse</b> = {{server.etab.adresseuai}} {{server.etab.codecommune}} {{server.etab.libellecommune}}<br>
<b>Académie</b> = {{server.etab.libelleacademie}}<br>
<b>Secteur</b> = {{server.etab.secteurpublicprivelibe}}<br>
<b>Nature</b> = {{server.etab.natureuailibe}}<br><br>
<div id="mapid" style="width:100%;height:300px"></div>
{% else %}
Non Localisé<br>
{% endif %}
</div>
</div>
{% endblock %}
{% block localjavascript %}
{% if(server.etab.id!=-100) %}
// On initialise la latitude et la longitude de Paris (centre de la carte)
var lat = {{ server.etab.latitude }};
var lon = {{ server.etab.longitude }};
var macarte = null;
// Fonction d'initialisation de la carte
function initMap() {
// Créer l'objet "macarte" et l'insèrer dans l'élément HTML qui a l'ID "map"
macarte = L.map('mapid').setView([lat, lon], 10);
// Leaflet ne récupère pas les cartes (tiles) sur un serveur par défaut. Nous devons lui préciser où nous souhaitons les récupérer. Ici, openstreetmap.fr
L.tileLayer('https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {
// Il est toujours bien de laisser le lien vers la source des données
attribution: 'données © <a href="//osm.org/copyright">OpenStreetMap</a>/ODbL - rendu <a href="//openstreetmap.fr">OSM France</a>',
minZoom: 1,
maxZoom: 20
}).addTo(macarte);
}
$(document).ready(function() {
initMap();
var marker = L.marker([{{ server.etab.latitude }}, {{ server.etab.longitude }}]).addTo(macarte);
});
{% endif %}
{% endblock %}

View File

@ -71,6 +71,7 @@
'@CadolesCoreBundle/Resources/public/js/fullcalendar.min.js'
'@CadolesCoreBundle/Resources/public/js/fullcalendar.lang.js'
'@CadolesCoreBundle/Resources/public/js/bootstrap-tour.min.js'
'@CadolesCoreBundle/Resources/public/js/leaflet.js'
'@CadolesCoreBundle/Resources/public/js/sb-admin-2.js'
'@Tetranz\Select2EntityBundle//Resources/public/js/select2entity.js'

View File

@ -34,6 +34,7 @@
'@CadolesCoreBundle/Resources/public/css/jsRapClock.css'
'@CadolesCoreBundle/Resources/public/css/fullcalendar.css'
'@CadolesCoreBundle/Resources/public/css/bootstrap-tour.min.css'
'@CadolesCoreBundle/Resources/public/css/leaflet.css'
'@CadolesCoreBundle/Resources/public/css/font.css'
'@CadolesCoreBundle/Resources/public/css/style.css'

View File

@ -128,7 +128,8 @@
{% endif %}
{% block beforepage %}
{% endblock %}
<div id="page-wrapper" class="{% if maxwidth is defined and maxwidth %} page-maxed {% endif %}" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %}{% if not useheader %} background-color:transparent; padding: 5px 25px 10px 15px; {% endif %} ">
<div class="container-fluid">

View File

@ -72,8 +72,8 @@ class InitDataCommand extends ContainerAwareCommand
$entity = new Cron;
$nextdate=$entity->getSubmitdate();
$nextdate->setTime(3,0);
$entity->setCommand("Core:Synchro");
$entity->setDescription("Synchronisation des Comptes Utilisateurs");
$entity->setCommand("Core:SynchroEtab");
$entity->setDescription("Synchronisation des Etablissements Scolaire");
$entity->setId(100);
$entity->setStatut(2);
$entity->setRepeatcall(0);