Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2181 → Rev 2182

/trunk/widget/modules/stats/squelettes/navigation.tpl.html
3,4 → 3,5
<li><a href="/widget:cel:stats?page=nombres">Nombres</a> (<a href="/widget:cel:stats?page=nombres&mode=<?=Stats::MODE_UTILISATEUR?>">les miens</a>)</li>
<li><a href="/widget:cel:stats?page=liste-utilisateurs-nbre-photos">Liste des utilisateurs ayant le plus de photographies publiques</a></li>
<li><a href="/widget:cel:stats?page=liste-taxons-nbre-photos">Liste des taxons ayant le plus de photographies publiques</a></li>
<li><a href="/widget:cel:stats?page=grandscontributeurs">Liste des contributeurs ayant publié le plus de données récemment</a></li>
</ul>
/trunk/widget/modules/stats/squelettes/stats_grands_contributeurs.tpl.html
New file
0,0 → 1,74
<!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" xml:lang="fr" lang="fr">
<head>
<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="Jean-Pascal MILCENT" />
<meta name="keywords" content="Statistiques, CEL, Tela Botanica, graphiques" />
<meta name="description" content="Graphiques et statistiques sur les observations et images du Carnet en Ligne (CEL)" />
 
<title>Statistiques du Carnet En Ligne</title>
<style>
img{display:block;margin:0.5em;border:1px solid black;}
hr.nettoyeur {clear:both;width:0;}
.flottant-gauche img{float:left;}
</style>
 
<link rel="stylesheet" type="text/css" href="http://www.tela-botanica.org/commun/bootstrap/3.1.0/css/bootstrap.min.css" />
<!-- 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>
<h1>Statistiques du CEL</h1>
<h2>Les <?= $donnees['entete']->nombre ?> plus importants contributeurs depuis <?= $donnees['entete']->jours ?> jours</h2>
<table class="table">
<tr>
<td>Contributeur(trice)</td>
<?php if($donnees['entete']->critere != "img"): ?>
<td>Nombre d'observations</td>
<?php endif; ?>
<?php if($donnees['entete']->critere != "obs"): ?>
<td>Nombre d'images</td>
<?php endif; ?>
<?php if($donnees['entete']->critere == null): ?>
<td>Somme des données publiées</td>
<?php endif; ?>
</tr>
<?php foreach($donnees['resultats'] as $util): ?>
<tr>
<td><?= $util->intitule_utilisateur ?></td>
<?php if($donnees['entete']->critere != "img"): ?>
<td><?= $util->nombreObs ?></td>
<?php endif; ?>
<?php if($donnees['entete']->critere != "obs"): ?>
<td><?= $util->nombreImg ?></td>
<?php endif; ?>
<?php if($donnees['entete']->critere == null): ?>
<td><?= $util->somme ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</table>
 
<?php include('navigation.tpl.html') ?>
</body>
</html>
/trunk/widget/modules/stats/Stats.php
31,7 → 31,7
if (method_exists($this, $methode)) {
$retour = $this->$methode();
} else {
$this->messages[] = "Ce type de carte '$methode' n'est pas disponible.";
$this->messages[] = "Le type de statistiques '$methode' n'est pas disponible.";
}
 
if (is_null($retour)) {
216,5 → 216,42
$json = $this->getDao()->consulter($url);
return (array) json_decode($json);
}
 
/**
* Aligne les contributeurs contre un mur et... euh... hum;
* Appelle le service pour obtenir les n principaux contributeurs depuis x jours,
* en termes d'observations ajoutées, d'images ajoutées, ou les deux
* Paramètres : "jours" (int), "nombre" (int), "critere" ("obs" ou "img" ou "")
* @return array
*/
public function executerGrandsContributeurs() {
$widget = null;
$widget['donnees'] = (array) $this->recupererStatsTxtGrandsContributeurs();
if (!is_null($widget)) {
$widget['squelette'] = 'stats_grands_contributeurs';
$widget['donnees']['url_service'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], 'CelStatistique');
}
return $widget;
}
 
private function recupererStatsTxtGrandsContributeurs() {
// Récupération des données au format Json
$service = "CelStatistiqueTxt/GrandsContributeurs";
 
if (isset($this->parametres['nombre'])) {
$this->getDao()->ajouterParametre('nombre', $this->parametres['nombre']);
}
if (isset($this->parametres['jours'])) {
$this->getDao()->ajouterParametre('jours', $this->parametres['jours']);
}
if (isset($this->parametres['critere'])) {
$this->getDao()->ajouterParametre('critere', $this->parametres['critere']);
}
$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], $service);
$json = $this->getDao()->consulter($url);
 
return (array) json_decode($json);
}
}
?>