Subversion Repositories eFlore/Applications.cel

Compare Revisions

No changes between revisions

Ignore whitespace Rev 629 → Rev 688

/branches/v1.4-broyeur/widget/modules/carto/config.defaut.ini
New file
0,0 → 1,5
[carto]
; Chemin vers le dossier contenant les fichiers kmz des limites communales
communesKmzChemin = "/home/telabotap/www/commun/google/map/3/kmz/communes/,/home/telabotap/www/commun/google/map/3/kmz/communes_incompletes/"
; Template de l'url où charger les fichiers kml des limites communales.
limitesCommunaleUrlTpl = "http://www.tela-botanica.org/eflore/cel2/widget/modules/carto/squelettes/kml/%s"
/branches/v1.4-broyeur/widget/modules/carto/Carto.php
New file
0,0 → 1,308
<?php
// declare(encoding='UTF-8');
/**
* Service fournissant une carte dynamique des obsertions publiques du CEL.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* Cas d'utilisation et documentation :
* @link http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCELWidgetCarto
*
* Paramètres :
* ===> utilisateur = identifiant
* Affiche seulement les observations d'un utilisateur donné. L'identifiant correspond au courriel de
* l'utilisateur avec lequel il s'est inscrit sur Tela Botanica.
* ===> dept = code_du_département
* Affiche seulement les observations pour le département français métropolitain indiqué. Les codes de département utilisables
* sont : 01 à 19, 2A, 2B et 21 à 95.
* ===> projet = mot-clé
* Affiche seulement les observations pour le projet d'observations indiqué. Dans l'interface du CEL, vous pouvez taguer vos
* observations avec un mot-clé de projet. Si vous voulez regrouper des observations de plusieurs utilisateurs, communiquez un
* mot-clé de projet à vos amis et visualisez les informations ainsi regroupées.
* ===> num_taxon = num_taxon
* Affiche seulement les observations pour la plante indiquée. Le num_taxon correspond au numéro taxonomique de la plante.
* Ce numéro est disponible dans les fiches d'eFlore. Par exemple, pour "Poa bulbosa L." le numéro taxonomique vaut 7080.
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
*/
class Carto extends WidgetCommun {
const DS = DIRECTORY_SEPARATOR;
const SERVICE_DEFAUT = 'carte-defaut';
/**
* Méthode appelée par défaut pour charger ce widget.
*/
public function executer() {
$retour = null;
extract($this->parametres);
 
if (!isset($carte)) {
$carte = self::SERVICE_DEFAUT;
}
$methode = $this->traiterNomMethodeExecuter($carte);
if (method_exists($this, $methode)) {
$retour = $this->$methode();
} else {
$this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
}
 
if (is_null($retour)) {
$info = 'Un problème est survenu : '.print_r($this->messages, true);
$this->envoyer($info);
} else {
$squelette = dirname(__FILE__).self::DS.'squelettes'.self::DS.$retour['squelette'].'.tpl.html';
$html = $this->traiterSquelettePhp($squelette, $retour['donnees']);
$this->envoyer($html);
}
}
 
/**
* Carte par défaut
*/
public function executerCarteDefaut() {
$widget = null;
extract($this->parametres);
$utilisateur = (isset($utilisateur) ? $utilisateur : '*');
$projet = (isset($projet) ? $projet : '*');
$dept = (isset($dept) ? $dept : '*');
$num_taxon = (isset($num_taxon) ? $num_taxon : '*');
// Création url données json
$url_cel_carto = sprintf($this->config['chemins']['baseURLServicesCelTpl'], 'CelWidgetMap');
$url_json = "$url_cel_carto/carte-defaut-json/$utilisateur/$projet/$dept/$num_taxon";
$url_base = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
 
// Création des infos du widget
$widget['donnees']['url_cel_carto'] = $url_cel_carto;
$widget['donnees']['url_json'] = $url_json;
$widget['donnees']['url_base'] = $url_base;
$widget['donnees']['jquery_version'] = '1.4.4';
$widget['donnees']['utilisateur'] = $utilisateur;
$widget['donnees']['projet'] = $projet;
$widget['donnees']['dept'] = $dept;
$widget['donnees']['num_taxon'] = $num_taxon;
$widget['donnees']['taxons'] = $this->chargerTaxons();
if ($num_taxon != '*') {
$taxon_courrant = current($widget['donnees']['taxons']);
$widget['donnees']['taxon_nom'] = $taxon_courrant['nom'];
}
$widget['squelette'] = 'carte_defaut';
if (isset($dept)) {
// si on veut afficher les limites départemmentales on va compter et chercher les noms de fichiers
$fichiersKml = $this->chercherFichierKml($dept);
foreach ($fichiersKml as $kml => $dossier){
$url_limites_communales = sprintf($this->config['carto']['limitesCommunaleUrlTpl'], $dossier, $kml);
$widget['donnees']['url_limites_communales'][] = $url_limites_communales;
}
}
return $widget;
}
private function chargerTaxons() {
extract($this->parametres);
$utilisateur = (isset($utilisateur) ? $utilisateur : '*');
$projet = (isset($projet) ? $projet : '*');
$dept = (isset($dept) ? $dept : '*');
$num_taxon = (isset($num_taxon) ? $num_taxon : '*');
// Récupération des données au format Json
$service = "CelWidgetMap/taxons/$utilisateur/$projet/$dept/$num_taxon";
$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
$json = $this->getDao()->envoyerRequeteConsultation($url);
$donnees = json_decode($json);
// Post-traitement des données
$taxons = $this->traiterTaxons($donnees);
return $taxons;
}
private function traiterTaxons($donnees) {
$taxons = array();
if (is_array($donnees) && count($donnees) > 0) {
foreach ($donnees as $donnee) {
if (!isset($taxons[$donnee->num_taxon]) && ! $this->etreVide($donnee->nom_ret)) {
$taxon = array();
$taxon['nn'] = $donnee->num_nom_ret;
$taxon['nt'] = $donnee->num_taxon;
$taxon['nom'] = $this->nettoyerTexte($donnee->nom_ret);
$taxon['famille'] = $this->nettoyerTexte($donnee->famille);
$taxons[$donnee->num_taxon] = $taxon;
}
}
}
return $taxons;
}
private function chercherFichierKml($dept){
$chemins = explode(',', $this->config['carto']['communesKmzChemin']);
$departements = explode(',', $dept);// plrs code de départements peuvent être demandés séparés par des virgules
$departements_trouves = array();
$fichiers = array();
foreach ($chemins as $dossier_chemin) {
if ($dossier_ressource = opendir($dossier_chemin)) {
while ($element = readdir($dossier_ressource)) {
if ($element != '.' && $element != '..') {
foreach ($departements as $departement) {
$nom_dossier = basename($dossier_chemin);
if (!isset($departements_trouves[$departement]) || $departements_trouves[$departement] == $nom_dossier) {
$dept_protege = preg_quote($departement);
if (!is_dir($dossier_chemin.'/'.$element) && preg_match("/^$dept_protege(?:_[0-9]+|)\.km[lz]$/", $element)) {
$fichiers[$element] = $nom_dossier;
$departements_trouves[$departement] = $nom_dossier;
}
}
}
}
}
closedir($dossier_ressource);
}
}
return $fichiers;
}
/**
* Tableau des observations d'une station
*/
public function executerObservations() {
$widget = null;
extract($this->parametres);
$observations = $this->chargerObservation($station);
// Création des infos du widget
if (isset($observations['commune'])) {
$commune = $observations['commune'];
unset($observations['commune']);
$widget['donnees']['commune'] = $commune;
}
$obs_ids = null;
if (isset($observations['ids'])) {
$obs_ids = $observations['ids'];
unset($observations['ids']);
}
$widget['squelette'] = $this->choisirFormatSortie(count($observations));
if ($widget['squelette'] == 'obs_liste' && $obs_ids != null && count($obs_ids) > 0) {
$widget['donnees']['images'] = $this->chargerImages($obs_ids);
}
$widget['donnees']['observations'] = $observations;
$widget['donnees']['station_id'] = $station;
return $widget;
}
private function chargerObservation($station) {
extract($this->parametres);
$utilisateur = (isset($utilisateur) ? $utilisateur : '*');
$projet = (isset($projet) ? $projet : '*');
$dept = (isset($dept) ? $dept : '*');
$num_taxon = (isset($num_taxon) ? $num_taxon : '*');
// Récupération des données au format Json
$service = "CelWidgetMap/observations/$station/$utilisateur/$projet/$dept/$num_taxon";
$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
$json = $this->getDao()->envoyerRequeteConsultation($url);
$donnees = json_decode($json);
// Post-traitement des données
$observations = $this->traiterObservations($donnees);
return $observations;
}
private function traiterObservations($donnees) {
$observations = array();
if (is_array($donnees) && count($donnees) > 0) {
foreach ($donnees as $donnee) {
$observation = array();
$observation['id'] = $donnee->id;
$observation['nn'] = $this->etreVide($donnee->num_nom_sel) ? null : $donnee->num_nom_sel;
$observation['nom'] = $this->nettoyerTexte($donnee->nom_sel);
$observation['date'] = $this->formaterDate($donnee->date_observation, '%d/%m/%Y');
$observation['lieu'] = $this->traiterLieu($donnee);
$observation['observateur'] = $this->tronquerCourriel($donnee->identifiant);
$observations[] = $observation;
$observations['commune'] = $this->nettoyerTexte($donnee->location);
$observations['ids'][] = $donnee->id;
}
}
return $observations;
}
private function traiterLieu($donnee) {
$lieu = array();
if (isset($donnee->lieudit) && ! empty($donnee->lieudit)) {
$lieu[] = $donnee->lieudit;
}
if (isset($donnee->milieu) && ! empty($donnee->milieu)) {
$lieu[] = $donnee->milieu;
}
return implode(', ', $lieu);
}
private function choisirFormatSortie($observations_nbre) {
extract($this->parametres);
$sortie = 'obs_tableau';
if (isset($format) && $format != '*') {
$sortie = ($format == 'tableau' ) ? 'obs_tableau' : 'obs_liste';
} else {
$sortie = ($observations_nbre > 4) ? 'obs_tableau' : 'obs_liste';
}
return $sortie;
}
private function chargerImages($obs_ids) {
// Récupération des données au format Json
$service = 'CelImage/liste-ids?obsId='.implode(',', $obs_ids);
$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
$json = $this->getDao()->envoyerRequeteConsultation($url);
$donnees = json_decode($json);
// Post-traitement des données
$images = $this->traiterImages($donnees);
return $images;
}
private function traiterImages($donnees) {
$images = array();
//echo '<br/><pre>'.print_r($donnees,true).'</pre>';
if (count($donnees) > 0) {
foreach ($donnees as $id_obs => $id_images) {
foreach ($id_images as $id_img) {
$urls['id'] = $id_img;
$urls['miniature'] = $this->getUrlImage($id_img, 'CXS');
$urls['normale'] = $this->getUrlImage($id_img, 'XL');
$images[$id_obs][] = $urls;
}
}
}
return $images;
}
/**
* Afficher message d'avertissement.
*/
public function executerAvertissement() {
$widget = null;
 
// Création des infos du widget
$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
$widget['squelette'] = 'avertissement';
return $widget;
}
}
/branches/v1.4-broyeur/widget/modules/carto/squelettes/avertissement.tpl.html
New file
0,0 → 1,107
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Avertissements - CEL widget cartographie</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-style-type" content="text/css" />
<meta http-equiv="Content-script-type" content="text/javascript" />
<meta http-equiv="Content-language" content="fr" />
<meta name="revisit-after" content="15 days" />
<meta name="robots" content="index,follow" />
<meta name="author" content="Delphine CAUQUIL, Jean-Pascal MILCENT" />
<meta name="keywords" content="Avertissement, Tela Botanica, cartographie, CEL" />
<meta name="description" content="Avertissement du widget de cartographie des observations publiques de plantes saisies dans le Carnet en Ligne (CEL)" />
 
<!-- Spécial mobile -->
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<!-- Favicones -->
<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" />
<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.ico" />
<!-- CSS -->
<link href="<?=$url_base?>modules/carto/squelettes/css/carto.css" rel="stylesheet" type="text/css" media="screen" />
<style type="">
html {
overflow:auto;
}
body {
overflow:auto;
}
</style>
<!-- Stats : Google Analytics -->
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20092557-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//]]>
</script>
</head>
<body>
<div id="zone-avertissement">
<h1>Avertissements &amp; informations</h1>
<h2>C'est quoi ces chiffres sur la carte ?</h2>
<p>
Afin de ne pas divulguer la localisation des stations d'espèces rares ou protégées, l'ensemble des observations
a été regroupé par commune.<br />
Ainsi les nombres apparaissant sur la carte représentent le nombre de communes où des observations ont été
réalisées.<br />
Ce nombre varie en fonction du niveau de zoom auquel vous vous trouvez, jusqu'à faire apparaître l'icône
<img src="http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png" alt="Icône de regroupement des observations" />.
Il indique le centre d'une commune et permet en cliquant dessus d'afficher l'ensemble des observations que l'on
peut y trouver.
</p>
<h2>Avertissements</h2>
<p>
Les observations affichées sur cette carte proviennent des saisies des membres du réseau Tela Botanica réalisées à l'aide
de l'application <a href="http://www.tela-botanica.org/appli:cel" onclick="window.open(this.href); return false;">Carnet en Ligne (CEL)</a>.<br />
Bien que la plupart des botanistes cherchent à déterminer avec un maximum de rigueur les espèces qu'ils observent, il arrive que des erreurs soient faites.<br />
Il est donc important de garder un esprit critique vis à vis des observations diffusées sur cette carte.<br />
Nous souhaitons prochainement ajouter à cette application cartographique un moyen de contacter les auteurs des observations.
Cette fonctionnalité permettra de faciliter la correction d'eventuelles erreurs.<br />
Pour l'instant, si vous constatez des problèmes, veuillez contacter : <a href="mailto:eflore_remarques@tela-botanica.org">eflore_remarques@tela-botanica.org</a>.
</p>
<h2>Le <a href="http://www.tela-botanica.org/appli:cel" onclick="window.open(this.href); return false;">Carnet en Ligne (CEL)</a>, c'est quoi ?</h2>
<h3>Un outil pour gérer mes relevés de terrain</h3>
<p>
Le Carnet en ligne est <a href="http://www.tela-botanica.org/appli:cel" onclick="window.open(this.href); return false;">accessible en ligne sur le site de Tela Botanica</a>.
Vous pouvez y déposer vos observations de plantes de manière simple et efficace
(aide à la saisie, visualisation de la chorologie d’une plante, utilisation de Google Map),
les trier et les rechercher.
</p>
<h3>Des fonctionnalités à la demande</h3>
<ul>
<li>Un module cartographique vous permet de géolocaliser vos observations grâce aux coordonnées ou bien par pointage sur une carte (en France métropolitaine).</li>
<li>Un module image vous permet d’ajouter des images et des les associer à vos observations.</li>
<li>Un module projet vous permet de créer des projets et d’y associer des observations.</li>
<li>Un module import/export au format tableur pour traiter ses données.</li>
</ul>
<h3>Partage des données</h3>
<p>
Partager vos observations permet d’alimenter la base de données eFlore, de compléter automatiquement la carte
de répartition des espèces du site de Tela Botanica, de servir de source de données pour des projets externes...<br />
Les données sont publiées sous licence libre <a href="http://www.tela-botanica.org/page:licence" onclick="window.open(this.href); return false;">Creative commons</a>
afin d'en faciliter la divulgation.
</p>
<h3>Vous souhaitez participer ?</h3>
<p>Consulter le mode d'emploi ci-dessous pour facilement prendre en main cet outil.</p>
<div>
<object style="width: 600px; height: 282px;">
<param value="http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf?mode=embed&amp;viewMode=presentation&amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml&amp;showFlipBtn=true&amp;autoFlip=true&amp;autoFlipTime=6000&amp;documentId=100624090135-b3beeea0f20641bf8f277c49ebc5bbee&amp;docName=cel&amp;username=marietela&amp;loadingInfoText=Carnet%20en%20ligne&amp;et=1277375679622&amp;er=55" name="movie">
<param value="true" name="allowfullscreen">
<param value="false" name="menu"><embed flashvars="mode=embed&amp;viewMode=presentation&amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml&amp;showFlipBtn=true&amp;autoFlip=true&amp;autoFlipTime=6000&amp;documentId=100624090135-b3beeea0f20641bf8f277c49ebc5bbee&amp;docName=cel&amp;username=marietela&amp;loadingInfoText=Carnet%20en%20ligne&amp;et=1277375679622&amp;er=55" style="width: 600px; height: 282px;" menu="false" allowfullscreen="true" type="application/x-shockwave-flash" src="http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf">
</object>
<p style="width: 600px; text-align: left;"><a target="_blank" href="http://issuu.com/marietela/docs/cel?mode=embed&amp;viewMode=presentation&amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml&amp;showFlipBtn=true&amp;autoFlip=true&amp;autoFlipTime=6000">Open publication</a> - Free <a target="_blank" href="http://issuu.com">publishing</a> - <a target="_blank" href="http://issuu.com/search?q=terrain">More terrain</a></p>
</div>
</div>
</body>
</html>
/branches/v1.4-broyeur/widget/modules/carto/squelettes/obs_tableau.tpl.html
New file
0,0 → 1,35
<div class="info-bulle-contenu">
<div class="onglets">
<ul>
<li class="actif"><span class="onglet">Tableau</span></li>
<li class="inactif"><a class="onglet" onclick="chargerFormatObs('<?=$station_id?>', 'liste');return false;" href="#">Liste</a></li>
</ul>
</div>
<div id="observations">
<table>
<caption><h2><?=count($observations)?> observations pour <?=(isset($commune) ? $commune : '?')?></h2></caption>
<thead>
<tr>
<th>Nom</th><th>Date</th><th>Lieu</th><th>Observateur</th>
</tr>
</thead>
<tbody>
<? foreach ($observations as $obs) : ?>
<tr>
<td>&nbsp;
<? if (isset($obs['nn'])) : ?>
<a href="http://www.tela-botanica.org/nn<?=$obs['nn']?>" onclick="window.open(this.href); arreter(event); return false; "><?=$obs['nom']?></a>
<? else : ?>
<?=$obs['nom']?>
<? endif; ?>
</td>
<td>&nbsp;<?=$obs['date']?></td>
<td>&nbsp;<?=$obs['lieu']?></td>
<td>&nbsp;<?=$obs['observateur']?></td>
</tr>
<? endforeach; ?>
</tbody>
</table>
<? include(dirname(__FILE__).'/obs_msg_info.tpl.html') ?>
</div>
</div>
/branches/v1.4-broyeur/widget/modules/carto/squelettes/obs_liste.tpl.html
New file
0,0 → 1,43
<div class="info-bulle-contenu">
<div class="onglets">
<ul>
<li class="inactif"><a class="onglet" onclick="chargerFormatObs('<?=$station_id?>', 'tableau');return false;" href="#">Tableau</a></li>
<li class="actif"><span class="onglet">Liste</span></li>
</ul>
</div>
<div id="observations">
<h2><?=count($observations)?> observations pour <?=(isset($commune) ? $commune : '?')?></h2>
<ol>
<? foreach ($observations as $obs) : ?>
<li>
<div>
<? if (isset($images[$obs['id']])) : ?>
<? foreach ($images[$obs['id']] as $num => $urls) : ?>
<div<?=($num == 0) ? ' class="cel-img-principale"': ' class="cel-img-secondaire"'?>>
<a class="cel-img" href="<?=$urls['normale']?>" rel="cel-obs-<?=$obs['id']?>">
<img src="<?=$urls['miniature']?>" alt="Image #<?=$urls['id']?> de l'osbervation #<?=$obs['id']?>" />
</a>
</div>
<? endforeach ?>
<? endif ?>
<dl>
<dt class="champ_nom_latin">Nom</dt>
<dd>&nbsp;
<? if (isset($obs['nn'])) : ?>
<a href="http://www.tela-botanica.org/nn<?=$obs['nn']?>" onclick="window.open(this.href); arreter(event); return false; "><?=$obs['nom']?></a>
<? else : ?>
<?=$obs['nom']?>
<? endif; ?>
</dd>
<dt>Lieu</dt><dd>&nbsp;<?=$obs['lieu']?></dd>
<dt>Publié par</dt><dd>&nbsp;<?=$obs['observateur']?></dd>
<dt>Le</dt><dd>&nbsp;<?=$obs['date']?></dd>
</dl>
<hr class="nettoyage"/>
</div>
</li>
<? endforeach; ?>
</ol>
<? include(dirname(__FILE__).'/obs_msg_info.tpl.html') ?>
</div>
</div>
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/information.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/information.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/trie_croissant.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/trie_croissant.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/chargement.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/chargement.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/fermeture.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/fermeture.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/ouverture.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/ouverture.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/trie_decroissant.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/trie_decroissant.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/trie.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/branches/v1.4-broyeur/widget/modules/carto/squelettes/images/trie.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/branches/v1.4-broyeur/widget/modules/carto/squelettes/obs_msg_info.tpl.html
New file
0,0 → 1,3
<p id="obs-msg-info">
Les observations de cette carte sont regroupées par commune.
</p>
/branches/v1.4-broyeur/widget/modules/carto/squelettes/carte_defaut.tpl.html
New file
0,0 → 1,339
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Observations publiques du CEL - Tela Botanica</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-style-type" content="text/css" />
<meta http-equiv="Content-script-type" content="text/javascript" />
<meta http-equiv="Content-language" content="fr" />
<meta name="revisit-after" content="15 days" />
<meta name="robots" content="index,follow" />
<meta name="author" content="Delphine CAUQUIL, Jean-Pascal MILCENT" />
<meta name="keywords" content="Tela Botanica, cartographie, CEL" />
<meta name="description" content="Widget de cartographie des observations publiques de plantes saisies dans le Carnet en Ligne (CEL)" />
 
<!-- Spécial mobile -->
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<!-- Favicones -->
<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" />
<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.ico" />
<!-- Javascript : bibliothèques -->
<!-- Google Map v3 -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.3&amp;sensor=true"></script>
<script type="text/javascript" src="http://www.tela-botanica.org/commun/google/map/3/markerclusterer/1.0/markerclusterer-1.0.pack.js"></script>
<!-- Jquery -->
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/<?=$jquery_version?>/jquery-<?=$jquery_version?>.min.js"></script>
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/tablesorter/2.0.5/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js"></script>
<!-- Javascript : données -->
<script src="<?=$url_json?>" type="text/javascript"></script>
<!-- Javascript : appli carto -->
<script type="text/javascript">
//<![CDATA[
var pointImageUrl = 'http://chart.apis.google.com/chart?cht=mm&chs=24x32&chco=FFFFFF,008CFF,000000&ext=.png';
var pointsOrigine = null;
var boundsOrigine = null;
var markerClusterer = null;
var map = null;
var nt = '<?=$num_taxon?>';
var infoBulle = new google.maps.InfoWindow();
google.maps.event.addListener(infoBulle, 'domready', function() {
// Onglet Tableau : Jquery => TableSorter
if ($("#observations table").get() != '') {
// add parser through the tablesorter addParser method
$.tablesorter.addParser({
// Définition d'un id unique pour ce parsseur
id: 'date_cel',
is: function(s) {
// retourne false si le parsseur n'est pas autodétecté
return false;
},
format: function(s) {
// Transformation date jj/mm/aaaa en aaaa/mm/jj
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1");
// Remplace la date par un nombre de millisecondes pour trier numériquement
return $.tablesorter.formatFloat(new Date(s).getTime());
},
// set type, either numeric or text
type: 'numeric'
});
$("#observations table").tablesorter({
headers: {
1: {
sorter:'date_cel'
}
}
});
}
// Onglet Liste : Jquery => FancyBox
if ($("#observations ol").get() != '') {
$("a.cel-img").fancybox({
transitionIn : 'elastic',
transitionOut : 'elastic',
speedIn : 600,
speedOut : 200,
overlayShow : true
}).bind('click', function(e) {
if (e.stopPropagation) {
e.stopPropagation();
}
return false;
});
}
});
google.maps.event.addListener(infoBulle, 'closeclick', function() {
map.panTo(pointClique.position);
});
var pointClique = null;
var carteCentre = new google.maps.LatLng(46.4, 3.10);
var carteOptions = {
zoom: 6,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}
};
var ctaLayer = null;
function refreshMap() {
var points = [];
var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < obs.nombre; ++i) {
var maLatLng = new google.maps.LatLng(obs.points[i].coord_x, obs.points[i].coord_y);
var pointImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(24, 32));
var point = new google.maps.Marker({
position: maLatLng,
map: map,
icon: pointImage,
stationId: obs.points[i].id
});
 
bounds.extend(maLatLng);
google.maps.event.addListener(point, 'click', function() {
pointClique = this;
infoBulle.open(map, this);
var limites = map.getBounds();
var centre = limites.getCenter();
var nordEst = limites.getNorthEast();
var centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng());
map.panTo(centreSudLatLng);
afficherMsgChargement();
chargerFormatObs(this.stationId, '*');
});
points.push(point);
}
 
if (pointsOrigine == null && boundsOrigine == null) {
pointsOrigine = points;
boundsOrigine = bounds;
}
executerMarkerClusterer(points, bounds);
}
 
function executerMarkerClusterer(points, bounds) {
if (markerClusterer) {
markerClusterer.clearMarkers();
}
markerClusterer = new MarkerClusterer(map, points);
map.fitBounds(bounds);
}
 
function afficherMsgChargement() {
var chargement = document.getElementById('chargement').cloneNode(true);
chargement.setAttribute('id', 'chargement-copie');
infoBulle.setContent(chargement);
}
 
function chargerFormatObs(stationId, format) {
var url = '<?=$url_base?>carto?carte=observations'+
'&utilisateur=<?=$utilisateur?>'+
'&projet=<?=$projet?>'+
'&num_taxon='+nt+
'&dept=<?=$dept?>'+
'&format='+format+'&station='+stationId;
$.get(url, function(observations){
infoBulle.setContent(observations);
});
}
 
function arreter(event) {
if (event.stopPropagation) {
event.stopPropagation();
}
return false;
}
function afficher() {
document.getElementById('panneau-lateral').style.width = '300px';
document.getElementById('pl-contenu').style.display = 'block';
document.getElementById('pl-ouverture').style.display = 'none';
document.getElementById('pl-fermeture').style.display = 'block';
document.getElementById('carte').style.left = '300px';
google.maps.event.trigger(map, 'resize');
};
function cacher() {
document.getElementById('panneau-lateral').style.width = '24px';
document.getElementById('pl-contenu').style.display = 'none';
document.getElementById('pl-ouverture').style.display = 'block';
document.getElementById('pl-fermeture').style.display = 'none';
document.getElementById('carte').style.left = '24px';
google.maps.event.trigger(map, 'resize');
};
 
function ouvrirPopUp(url, nom) {
window.open(url, nom, 'scrollbars=yes,width=650,height=600,directories=no,location=no,menubar=no,status=no,toolbar=no');
};
function filtrerParTaxon(ntAFiltrer) {
infoBulle.close();
$('#taxon-'+nt).removeClass('taxon-actif');
if (nt == ntAFiltrer) {
nt = '*';
executerMarkerClusterer(pointsOrigine, boundsOrigine);
} else {
var url = '<?=$url_cel_carto?>/carte-defaut-json/<?=$utilisateur?>/<?=$projet?>/<?=$dept?>/'+ntAFiltrer+'?formatRetour=jsonp&callback=?';
$.getJSON(url, function (observations) {
obs = observations;
nt = ntAFiltrer;
$('#taxon-'+nt).addClass('taxon-actif');
refreshMap();
});
}
};
function initialize() {
map = new google.maps.Map(document.getElementById('carte'), carteOptions);
 
// Ajout des limites communales sur la carte
<? if (isset($url_limites_communales)) : ?>
<? foreach ($url_limites_communales as $url) : ?>
ctaLayer = new google.maps.KmlLayer('<?=$url?>', {preserveViewport: true});
ctaLayer.setMap(map);
<? endforeach ?>
<? endif ?>
<? if ($num_taxon == '*') : ?>
var ouvertureDiv = document.getElementById('pl-ouverture');
google.maps.event.addDomListener(ouvertureDiv, 'click', afficher);
 
var fermetureDiv = document.getElementById('pl-fermeture');
google.maps.event.addDomListener(fermetureDiv, 'click', cacher);
<? endif ?>
refreshMap();
}
// Déclenchement d'actions pour JQuery
$(document).ready(function() {
// Ajout du nombre de communes où des observations ont eu lieu
$('#commune-nbre').append(obs.nombre);
});
//]]>
</script>
<!-- CSS -->
<link href="<?=$url_base?>modules/carto/squelettes/css/carto.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<!--[if lt IE 7]>
<style type="text/css">
#carte {
height:expression(document.body.clientHeight-35); /* 80+20+20=120 */
width:expression(document.body.clientWidth-24); /* 200+20+20+20=260 */
}
#panneau-lateral {
height:expression(document.body.clientHeight-35); /* 80+20+20=120 */
}
</style>
<![endif]-->
<? if ($num_taxon != '*') : ?>
<style type="text/css">
#carte {
left:0;
}
</style>
<? endif ?>
<!-- Stats : Google Analytics -->
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20092557-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
//]]>
</script>
</head>
 
<body onload="initialize()">
<div id="zone-titre">
<h1 id="carte-titre">
<? if ($num_taxon == '*') : ?>
<span id="commune-nbre">&nbsp;</span> communes contenant des observations du <a href="http://www.tela-botanica.org/appli:cel" title="Carnet en Ligne" onclick="window.open(this.href); arreter(event); return false;">CEL</a> de <a href="http://www.tela-botanica.org/" onclick="window.open(this.href); arreter(event); return false;">Tela Botanica</a>
<? else : ?>
<span id="commune-nbre">&nbsp;</span> communes pour <?=$taxon_nom?> - <a href="http://www.tela-botanica.org/appli:cel" title="Carnet en Ligne" onclick="window.open(this.href); arreter(event); return false;">CEL</a> de <a href="http://www.tela-botanica.org/" onclick="window.open(this.href); arreter(event); return false;">Tela Botanica</a>
<? endif ?>
</h1>
<div id="zone-info">
<a href="<?=$url_base?>carto?carte=avertissement" onClick="ouvrirPopUp('<?=$url_base?>carto?carte=avertissement', 'Avertissement'); arreter(event); return false;">
<img src="<?=$url_base?>modules/carto/squelettes/images/information.png"
alt="Avertissements" title="Avertissements &amp; informations" />
</a>
</div>
</div>
<? if ($num_taxon == '*') : ?>
<div id="panneau-lateral">
<div id="pl-ouverture" title="Ouvrir le panneau latéral"><span>Panneau >></span></div>
<div id="pl-fermeture" title="Fermer le panneau latéral"><span><< Fermer [x]</span></div>
<div id="pl-contenu">
<div id="pl-entete">
<h2>Filtre sur <?=count($taxons)?> plantes</h2>
<p>
Cliquez sur un nom de plante pour filtrer les observations sur la carte.<br />
Pour revenir à l'état initial, cliquez à nouveau sur le nom sélectionné.
</p>
</div>
<div id="pl-corps" onMouseOver="map.setOptions({'scrollwheel':false});" onMouseOut="map.setOptions({'scrollwheel':true});">
<ol id="taxons">
<? foreach ($taxons as $taxon) : ?>
<li id="taxon-<?=$taxon['nt']?>">
<a href="#" onclick="filtrerParTaxon(<?=$taxon['nt']?>);" title="<?=$taxon['famille']?>">
<?=$taxon['nom']?>
</a>
</li>
<? endforeach; ?>
</ol>
</div>
</div>
</div>
<? endif ?>
<div id="carte"></div>
<!-- Blocs chargés à la demande : par défaut avec un style display à none -->
<div id="chargement">
<img src="<?=$url_base?>modules/carto/squelettes/images/chargement.gif" alt="Chargement en cours..." />
<p>Chargement des observations en cours...</p>
</div>
</body>
</html>
/branches/v1.4-broyeur/widget/modules/carto/squelettes/css/carto.css
New file
0,0 → 1,328
@charset "UTF-8";
html {
overflow:hidden;
}
body {
overflow:hidden;
padding:0;
margin:0;
width:100%;
height:100%;
font-family:Arial;
font-size:12px;
}
h1 {
font-size:1.6em;
}
h2 {
font-size:1.4em;
}
a, a:active, a:visited {
border-bottom:1px dotted #666;
color:#CCC;
text-decoration:none;
}
a:active {
outline:none;
}
a:focus {
outline:thin dotted;
}
a:hover {
color:#56B80E;
border-bottom:1px dotted #56B80E;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Présentation des listes de définitions */
dl {
width:100%;
}
dt {
float:left;
font-weight:bold;
text-align:top left;
margin-right:0.3em;
}
dd {
width:auto;
margin:0.5em 0;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Tableau : */
table {
border:1px solid gray;
border-collapse:collapse;
}
table thead, table tfoot, table tbody {
background-color:Gainsboro;
border:1px solid gray;
}
table tbody {
background-color:#FFF;
}
table th {
font-family:monospace;
border:1px dotted gray;
padding:5px;
background-color:Gainsboro;
}
table td {
font-family:arial;
border:1px dotted gray;
padding:5px;
text-align:left;
}
table caption {
font-family:sans-serif;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Tableau : tablesorter */
th.header {
background:url(../images/trie.png) no-repeat center right;
padding-right:20px;
}
th.headerSortUp {
background:url(../images/trie_croissant.png) no-repeat center right #56B80E;
color:white;
}
th.headerSortDown {
background:url(../images/trie_decroissant.png) no-repeat center right #56B80E;
color:white;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Générique */
.nettoyage{
clear:both;
}
hr.nettoyage{
visibility:hidden;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Carte */
#carte {
padding:0;
margin:0;
position:absolute;
top:35px;
left:24px;
right:0;
bottom:0;
overflow:auto;
}
.bouton {
background-color:white;
border:2px solid black;
cursor:pointer;
text-align:center;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Message de chargement */
#chargement {
display:none;
}
#chargement-copie img{
display:block;
margin:auto;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Avertissement */
#zone-avertissement {
background-color:#4A4B4C;
color:#CCC;
padding:12px;
text-align:justify;
line-height:16px;
}
#zone-avertissement h1{
margin:0;
}
#zone-avertissement a {
border-bottom:1px dotted gainsboro;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Carte titre */
#zone-titre {
padding:0;
margin:0;
position:absolute;
top:0;
left:0;
width:100%;
height:35px;
overflow:hidden;
background:url(http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png) no-repeat 8px 8px #4A4B4C;
}
#zone-info {
position:absolute;
top:0;
right:8px;
width:48px;
text-align:right;
}
#zone-info img {
display:inline;
padding:4px;
margin:0;
border:none;
}
#carte-titre {
display:inline-block;
margin:0 0 0 24px;
padding:0.2em;
color:#CCCCCC;
}
#carte-titre {/*Hack CSS fonctionne seulement dans ie6, 7 & 8 */
display:inline !hackCssIe6Et7;/*Hack CSS pour ie6 & ie7 */
display /*\**/:inline\9;/*Hack CSS pour ie8 */
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Panneau latéral */
#panneau-lateral {
padding:0;
margin:0;
position:absolute;
top:35px;
left:0;
bottom:0;
width:24px;
overflow:hidden;
background-color:#4A4B4C;
border-right:1px solid grey;
}
#pl-contenu {
display:none;
}
#pl-entete {
height:95px;
}
#pl-corps {
position:absolute;
top:105px;
bottom:0;
overflow:auto;
padding:5px;
width:290px;
}
#pl-ouverture, #pl-fermeture {
position:absolute;
top:0;
height:24px;
width:24px;
text-align:center;
cursor:pointer;
}
#pl-ouverture {
left:0;
background:url(../images/ouverture.png) no-repeat top left #4A4B4C;
}
#pl-fermeture {
display:none;
left:276px;
background:url(../images/fermeture.png) no-repeat top right #4A4B4C;
}
#pl-ouverture span, #pl-fermeture span{
display:none;
}
/* Panneau latéral : balises */
#panneau-lateral h2, #panneau-lateral p {
color:#CCCCCC;}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Liste des taxons de la carte */
#taxons {
color:#999;
}
#taxons .taxon-actif, #taxons .taxon-actif a {
color:#56B80E;}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Pop-up observations */
.info-bulle-contenu {
margin:0;
padding:0;
}
#observations {
margin:23px 0 0 0;
padding:5px;
border:1px solid black;
border-radius:0 0 10px 10px;-moz-border-radius:0 0 10px 10px;-webkit-border-radius:0 0 10px 10px;
border-top:none !important;
overflow:none;
}
#observations ol {
padding-left:20px;
}
.champ_nom_latin {
display:none;
}
#obs-msg-info {
font-size:10px;
color:#CCC;
}
#observations a {
color:#333;
border-bottom:1px dotted gainsboro;
}
#observations a:hover {
color:#56B80E;
border-bottom:1px dotted #56B80E;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Onglets */
.onglets {
position:absolute;
top:0;
float:left;
height:22px;
padding:0;
margin:0;
border-bottom:1px solid black;
width:100%;
}
.onglets ul {
margin:0;
padding:0;
list-style:none;
}
.onglets li {
float:left;
text-transform:uppercase;
text-align:center;
}
.onglets .onglet {
display:block;
padding:5px 15px 4px 15px;
margin:0;
font-size:12px;
line-height:12px;
border:1px solid black;
border-radius:10px 10px 0 0;-moz-border-radius:10px 10px 0 0;-webkit-border-radius:10px 10px 0 0;
text-decoration:none;
}
.onglets .actif .onglet {
border-bottom:1px solid white;
color:black;
background-color:white;
font-weight:bold;
}
.onglets .inactif .onglet {
border-bottom:1px solid #000000;
color:white;
background-color:gray;/*rgba(29,30,32,0.8);*/
}
.onglets .inactif .onglet:hover {
color:black;
background-color:Gainsboro;
}
/*+-----------------------------------------------------------------------------------------------------------------+*/
/* Pop-up : liste */
.cel-img-principale img{
float:right;
height:75px;
padding:1px;
border:1px solid white;
}
#observations .cel-img:hover img{
border:1px dotted #56B80E;
}
.cel-img-secondaire{
display:none;
}
/branches/v1.4-broyeur/widget/modules/carto/.
New file
Property changes:
Added: svn:ignore
+config.ini