11,7 → 11,11 |
* @link /doc/projet_bp/ |
*/ |
|
abstract class ProjetService extends JRestService { |
class ProjetService extends JRestService { |
|
public function __construct($config, $demarrer_session= true) { |
parent::__construct($config, $demarrer_session); |
} |
|
protected function obtenirProjetsPourParticipant($id_utilisateur) { |
|
38,7 → 42,28 |
|
return $projets; |
} |
|
protected function obtenirInformationsProjet($id_projet) { |
|
$requete_informations_projet = 'SELECT DISTINCT *'. |
' FROM projet'. |
' WHERE p_id = '.$id_projet ; |
|
try { |
$projet = $this->bdd->query($requete_informations_projet)->fetchAll(PDO::FETCH_ASSOC); |
} catch (PDOException $e) { |
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage()); |
return false; |
} |
|
// pas de projets ? alors c'est fait ! |
if(!$projet) { |
return false; |
} |
|
return $projet; |
} |
|
protected function obtenirListesAssocieesAuProjet($id_projet) { |
|
$requete_liste_projets = 'SELECT * FROM projet_liste '. |
60,7 → 85,21 |
|
return $listes_projets; |
} |
|
protected function supprimerInscriptionAListeProjet($id_utilisateur, $id_liste) { |
|
$requete_suppression_liste = 'DELETE FROM projet_inscription_liste '. |
'WHERE pil_id_utilisateur='.$id_utilisateur.' and pil_id_liste='.$id_liste ; |
|
try { |
$requete_suppression_liste = $this->bdd->query($requete_suppression_liste); |
} catch (PDOException $e) { |
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage().' '.$requete_suppression_liste); |
return false; |
} |
|
} |
|
protected function supprimerParticipantAProjet($id_utilisateur, $id_projet) { |
$requete_suppression_projets = 'DELETE FROM projet_statut_utilisateurs '. |
'WHERE psu_id_utilisateur='.$id_utilisateur.' and psu_id_projet='.$id_projet ; |
71,7 → 110,7 |
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage().' '.$requete_suppression_projets); |
return false; |
} |
|
|
return true; |
} |
|
79,11 → 118,9 |
|
try { |
$est_abonne = '0' ; |
//$xml_abonne = new SimpleXMLElement(file_get_contents('http://vpopmail.tela-botanica.org/est_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail)) ; |
$est_abonne = 1;//$xml_abonne[0] ; |
$xml_abonne = new SimpleXMLElement(file_get_contents('http://vpopmail.tela-botanica.org/est_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail)) ; |
$est_abonne = $xml_abonne[0] ; |
|
Log::getInstance()->ajouterEntree('projet','appel de http://vpopmail.tela-botanica.org/est_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail); |
|
if($est_abonne == '1') { |
return true; |
} else { |
102,16 → 139,11 |
} |
|
protected function inscriptionListe($nom_liste, $mail) { |
|
Log::getInstance()->ajouterEntree('projet','appel de http://vpopmail.tela-botanica.org/ajout_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail); |
return true; |
//return $inscription_abonne = file_get_contents('http://vpopmail.tela-botanica.org/ajout_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail) ; |
return $inscription_abonne = file_get_contents('http://vpopmail.tela-botanica.org/ajout_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail) ; |
} |
|
protected function desinscriptionListe($nom_liste, $mail) { |
Log::getInstance()->ajouterEntree('projet','appel de http://vpopmail.tela-botanica.org/suppression_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail); |
return true; |
//return $suppression_abonne = file_get_contents('http://vpopmail.tela-botanica.org/suppression_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.mail) ; |
return $suppression_abonne = file_get_contents('http://vpopmail.tela-botanica.org/suppression_abonne.php?domaine=tela-botanica.org&liste='.$nom_liste.'&mail='.$mail) ; |
} |
} |
?> |