<?php $action = verifierAction(array('ausculter', 'calculer')); $smarty->assign('action', $action); require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Personnes_Physiques.php'; require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Planete_Billet.php'; require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Oeuvres.php'; $oeuvres = new AFUP_Oeuvres($bdd); $persone_physique = new AFUP_Personnes_Physiques($bdd); if ($action == 'calculer') { if ($oeuvres->calculer()) { AFUP_Logs::log('Calculer les oeuvres de l\'AFUP'); afficherMessage('Les oeuvres ont été calculées', 'index.php?page=membre_oeuvres'); } else { afficherMessage('Une erreur est survenue lors du calcul des oeuvres', 'index.php?page=membre_oeuvres', true); } } $id_personne_physique = isset($_GET['id_personne_physique']) ? (int) $_GET['id_personne_physique'] : $droits->obtenirIdentifiant(); $mes_sparklines = $oeuvres->obtenirSparklinePersonnelleSur12Mois($id_personne_physique); $smarty->assign('mes_sparklines', $mes_sparklines); $categories = $oeuvres->obtenirCategories(); $les_personnes_physiques = array(); foreach ($categories as $categorie) { $id_personnes_physiques = $oeuvres->obtenirPersonnesPhysiquesLesPlusActives($categorie); $les_sparklines = $oeuvres->obtenirSparklinesParCategorieDes12DerniersMois($id_personnes_physiques, $categorie); $smarty->assign('les_sparklines_actives_' . $categorie, $les_sparklines); $les_personnes_physiques += $persone_physique->obtenirListe('*', 'nom, prenom', false, false, true, $id_personnes_physiques); } $smarty->assign('les_personnes_physiques', $les_personnes_physiques);
<?php // Impossible to access the file itself if (!defined('PAGE_LOADED_USING_INDEX')) { trigger_error("Direct access forbidden.", E_USER_ERROR); exit; } require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Oeuvres.php'; $logsSVN = new AFUP_Oeuvres($bdd); $refresh = false; if (isset($_GET["refresh"]) && $_GET["refresh"] == "true") { $refresh = true; } $smarty->assign('logsvn', $logsSVN->extraireLogSVNBrut($refresh));
<?php // Impossible to access the file itself if (!defined('PAGE_LOADED_USING_INDEX')) { trigger_error("Direct access forbidden.", E_USER_ERROR); exit; } require_once dirname(__FILE__) . '/../../../sources/Afup/AFUP_Oeuvres.php'; $logsSVN = new AFUP_Oeuvres($bdd); $refresh = false; if (isset($_GET["refresh"]) && $_GET["refresh"] == "true") { $refresh = true; } $smarty->assign('loggit', $logsSVN->extraireLogGitBrut($refresh));
function test_extraireOeuvresDepuisPlanete() { $oeuvres = new AFUP_Oeuvres($this->bdd); $this->assertTrue($oeuvres->extraireOeuvresDepuisPlanete()); $flux = new AFUP_Planete_Flux($this->bdd); $flux->ajouter("Nom", "http://example.com", "http://example.com/atom", 1, 1); $premier_du_mois = mktime(0, 0, 0, date("m"), 1, date("Y")); $this->assertTrue($oeuvres->extraireOeuvresDepuisPlanete()); $this->assertFalse(isset($oeuvres->details['planete'][1][$premier_du_mois])); $billet = new AFUP_Planete_Billet($this->bdd); $billet->ajouter(1, "key", "Titre", "http://example.com/billet", time(), "Auteur", "R�sum�", "Contenu", AFUP_PLANETE_BILLET_CREUX); $this->assertTrue($oeuvres->extraireOeuvresDepuisPlanete()); $this->assertFalse(isset($oeuvres->details['planete'][1][$premier_du_mois])); $billet = new AFUP_Planete_Billet($this->bdd); $billet->ajouter(1, "key", "Titre bis", "http://example.com/billet", time(), "Auteur", "R�sum�", "Contenu", AFUP_PLANETE_BILLET_PERTINENT); $this->assertTrue($oeuvres->extraireOeuvresDepuisPlanete()); $this->assertTrue(isset($oeuvres->details['planete'][1][$premier_du_mois])); $this->assertTrue($oeuvres->details['planete'][1][$premier_du_mois], 1); }