Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 389 → Rev 388

/trunk/presentation/tela_ergo.php
1,5 → 1,5
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
65,7 → 65,7
 
if (isset($_GET[PROJET_VARIABLE_TRI]) && $_GET[PROJET_VARIABLE_TRI] != '' && in_array($_GET[PROJET_VARIABLE_TRI], $valeur_acceptable_tri)) {
$tri = $_GET[PROJET_VARIABLE_TRI];
 
} else {
$tri = 'p_titre';
}
72,10 → 72,10
 
$valeur_acceptable_ordre_tri = array ('asc', 'desc'); // securite
 
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != ''
if (isset($_GET[PROJET_VARIABLE_ORDRE_TRI]) && $_GET[PROJET_VARIABLE_ORDRE_TRI] != ''
&& in_array ($_GET[PROJET_VARIABLE_ORDRE_TRI], $valeur_acceptable_ordre_tri)) {
$ordre_tri = $_GET[PROJET_VARIABLE_ORDRE_TRI];
 
} else {
$ordre_tri = '';
}
82,7 → 82,7
 
// variable de session pour se rappeler des choix du visiteur
if (!isset ($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && isset($_SESSION['_PROJET_']['projet_affichage']) && ($_SESSION['_PROJET_']['projet_affichage'] == 'simple' || $_SESSION['_PROJET_']['projet_affichage'] == 'expert')) {
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage'];
$_GET[PROJET_VARIABLE_MODE_AFFICHAGE] = $_SESSION['_PROJET_']['projet_affichage'];
}
 
if (isset($_GET[PROJET_VARIABLE_MODE_AFFICHAGE]) && $_GET[PROJET_VARIABLE_MODE_AFFICHAGE] != '') {
161,12 → 161,12
if (!isset($GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'])) $GLOBALS['_MOTEUR_RECHERCHE_']['bd']['papyrus'] = $this->_db;
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche.class.php';
include_once 'papyrus/applettes/moteur_recherche/bibliotheque/more_recherche_projet.class.php';
 
$moteur = new More_Recherche($_SESSION['_PROJET_']['motif_recherche']);
$recherche_projet = new More_Recherche_Projet($_SESSION['_PROJET_']['motif_recherche']);
$moteur->ajouterRecherche($recherche_projet);
$resultats = $moteur->rechercherMotif();
 
// $chaine_id_projet contient une liste d identifiant separer par une virgule
if (!empty($resultats)) {
$chaine_id_projet = '';
175,7 → 175,7
}
$chaine_id_projet = substr($chaine_id_projet, 0, -1);
$where_recherche = ' where p_id in ('.$chaine_id_projet.')';
 
$valeur_projet_recherche = $_GET['projet_recherche'];
}
} else {
194,7 → 194,7
 
if ($this->_auth->getAuth()) {
/** on recherche egalement le statut si l utilisateur est loggue */
 
$from_recherche .= ' left join projet_statut_utilisateurs on psu_id_projet=p_id and psu_id_utilisateur='.$this->_auth->getAuthData(PROJET_CHAMPS_ID).
' left join projet_statut on psu_id_statut=ps_id_statut';
$select = 'psu_id_statut, ps_statut_nom,';
210,7 → 210,7
' group by p_id order by '.$tri.' '.$ordre_tri ;
 
if ($ordre_tri == '') $ordre_tri = 'desc';
 
$resultat = $this->_db->query($requete) ;
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
232,15 → 232,15
include_once PROJET_CHEMIN_BIBLIOTHEQUE_API.'pear/Pager/Pager.php';
 
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
 
// Si le projet est en dormance, on ne l affiche pas dans le mode normal
// Sauf si le theme choisit est "en dormance"
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) {
 
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) {
} else {
$donnees[] = $ligne;
}
 
}
 
if ($_SESSION['_PROJET_']['projet_affichage'] == 'expert') $perpage = $nombre_resultat; else $perpage = 20;
256,7 → 256,7
'separator' => '',
'prevImg' => '&lt;&lt; Page pr&eacute;c&eacute;dente',
'nextImg' => 'Page suivante &gt;&gt;',
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'],
'extraVars' => array ('projet_recherche' => $_SESSION['_PROJET_']['motif_recherche'],
PROJET_VARIABLE_MODE_AFFICHAGE => $_SESSION['_PROJET_']['projet_affichage']),
'itemData' => $donnees
);
264,7 → 264,7
$links = $pager->getLinks();
$data = $pager->getPageData();
$nombre_projets = $pager->numItems();
$range = $pager->getOffsetByPageId();
$range = $pager->getOffsetByPageId();
 
 
// On inclue un fichier local
292,13 → 292,13
if ($_SESSION['_PROJET_']['projet_affichage'] == 'simple') {
if ($ligne->ps_pourcent <33) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Peu actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_faible';
}
else if ($ligne->ps_pourcent < 66) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Assez actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_moyenne';
}
else if ($ligne->ps_pourcent <= 100) {
else if ($ligne->ps_pourcent <= 100) {
$tableau_donnees[$ligne->p_id]['activite'] = 'Tr&egrave;s actif';
$tableau_donnees[$ligne->p_id]['classe_projet_activite'] = 'projet_activite_elevee';
}
308,7 → 308,7
$res .= $ligne->p_resume ;
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$res .= '(<a href="'.$this->_url->getURL().'">Rejoindre ce projet</a>)'."\n";
 
// Recherche du forum
if ($ligne->pl_id_liste != null && $ligne->plle_id_liste == null) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
315,14 → 315,14
 
$forum = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/favicones/tela_botanica.png" alt="Tela Botanica" /></a>'."\n";
$res .= $forum;
 
} else {
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
if ($ligne->plle_id_liste != null) {
$info_liste = $listes_ext->getInfoListe($ligne->plle_id_liste) ;
 
$forum = '<a href="'.$info_liste->AGO_A_URLGRP.
'"><img src="sites/commun/generique/images/favicones/yahoo.png" alt="Yahoo"/></a>';
$tableau_donnees[$ligne->p_id]['nombre_participants'] = $ligne->ps_nombre_membre_yahoo;
331,7 → 331,7
}
}
if ($ligne->ps_msg_derniere_semaine != 0) {
 
$tableau_donnees[$ligne->p_id]['nombre_message'] = $ligne->ps_msg_derniere_semaine;
} else {
$tableau_donnees[$ligne->p_id]['nombre_message'] = 0;
350,7 → 350,7
}
$tableau_donnees[$ligne->p_id]['wikini'] = $wiki_res;
$titre= '<a href="'.$this->_url->getURL().'">'.$ligne->p_titre.'</a>';
 
if ($ligne->p_avoir_document != 0) {
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_DOCUMENT) ;
$document = '<a href="'.$this->_url->getURL().'">voir</a>' ;
361,35 → 361,34
$document = '-' ;
}
$tableau_donnees[$ligne->p_id]['document'] = $document;
 
if ($ligne->p_wikini) {
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link=$this->_url->getURL();
$url_rss = PROJET_URL_WIKINI.$ligne->p_wikini.'/wakka.php?wiki=DerniersChangementsRss/xml';
//$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
$wiki_rss = '<a href="'.$url_rss.'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
//$this->_url->removeQueryString ('act');
//$this->_url->removeQueryString ('wiki');
$this->_url->addQueryString('wiki', 'DerniersChangementsRSS/xml');
$wiki_rss = '<a href="'.$this->_url->getURL().'"><img src="sites/commun/generique/images/rss.gif" alt="rss"/></a>' ;
$this->_url->removeQueryString ('act');
$this->_url->removeQueryString ('wiki');
} else {
$wiki_rss = '-' ;
}
$tableau_donnees[$ligne->p_id]['wikini_rss'] = $wiki_rss;
 
$this->_url->addQueryString ('act', PROJET_ACTION_VOIR_PARTICIPANT);
$participant = '<a href="'.$this->_url->getURL().'">voir</a>' ;
$tableau_donnees[$ligne->p_id]['lien_participants'] = $this->_url->getURL();
if ($ligne->ps_nombre_inscrit_derniere_semaine != 0) {
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '<span title="Nouveaux inscrits cette semaine">( + '.$ligne->ps_nombre_inscrit_derniere_semaine.' )</span>';
} else {
$tableau_donnees[$ligne->p_id]['ps_nombre_inscrit_derniere_semaine'] = '';
}
 
$ligne_projet = array ( '', $titre, $forum, // le nom du projet
$wiki_res, $wiki_rss,$document, $participant) ;
 
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
array_push ($liste_projet, $ligne_projet) ;
 
if ($loggue) {
switch ($ligne->psu_id_statut) {
case 1 : $icone_statut = 'etoile_rouge';
406,7 → 405,7
$icone_statut = false;
}
if ($icone_statut) $tableau_donnees[$ligne->p_id]['statut_icone'] = '<img src="'.PROJET_CHEMIN_ICONES.$icone_statut.'.png" alt="'.$ligne->ps_statut_nom.'" title="'.$ligne->ps_statut_nom.'" />';
 
}
$res .= '</li>'."\n";
}
445,7 → 444,7
$enteteTri[$var_tri] = new enteteColonneTriable($var_tri);
$enteteTri[$var_tri]->setColonneCliquee($tri, PROJET_VARIABLE_TRI);
$enteteTri[$var_tri]->setOrdre($ordre_tri, PROJET_VARIABLE_ORDRE_TRI);
 
}
 
$lien_tri_titre = $enteteTri['p_titre']->getLien($this->_url);
/trunk/presentation/mes_projets.php
243,11 → 243,11
// Si le projet est en dormance, on ne l affiche pas dans le mode normal
// Sauf si le theme choisit est "en dormance"
/*if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) {
if ($_SESSION['_PROJET_']['projet_affichage'] != 'expert' && $ligne->p_en_dormance == 1 && $theme_selectionne != 9) {
} else {*/
} else {
$donnees[] = $ligne;
//}
}
}
 
/trunk/jrest/services/DocumentsRss.php
File deleted
\ No newline at end of file
/trunk/jrest/services/Documents.php
File deleted
\ No newline at end of file
/trunk/jrest/services/Inscription.php
File deleted
\ No newline at end of file
/trunk/jrest/services/ProjetService.php
86,28 → 86,6
return $listes_projets;
}
protected function obtenirListesExternesAssocieesAuProjet($id_projet) {
 
$requete_liste_projets = 'SELECT * FROM agora '.
'WHERE plle_id_liste IN '.
'(SELECT plle_id_liste from projet_lien_liste_externe '.
'WHERE plle_id_projet='.$id_projet.')' ;
 
try {
$listes_projets = $this->bdd->query($requete_liste_projets)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
Log::getInstance()->ajouterEntree('projet','Fichier: '.$e->getFile().' Ligne: '.$e->getLine().' '.$e->getMessage());
return array();
}
 
 
if(!$listes_projets || count($listes_projets) <= 0) {
return array();
}
 
return $listes_projets;
}
protected function supprimerInscriptionAListeProjet($id_utilisateur, $id_liste) {
$requete_suppression_liste = 'DELETE FROM projet_inscription_liste '.
/trunk/jrest/jrest.ini.php
11,8 → 11,6
database = papyrus_bp
url_service_liste = vpopmail.tela-botanica.org/
domaine_service_liste = tela-botanica.org
adresse_appli_projet = http://www.tela-botanica.org/page:liste_projets
addresse_telechargement_docs = http://www.tela-botanica.org/projets/%s/telechargement/%s
 
; Identification
[database_ident]
/trunk/projet.desinscription.inc.php
1,5 → 1,5
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
56,7 → 56,7
$annuaire = new annuaire($GLOBALS['ins_db'], array('identifiant' => INS_CHAMPS_ID, 'mail' => INS_CHAMPS_MAIL, 'table' => INS_ANNUAIRE, 'nom' => INS_CHAMPS_NOM,
'prenom' => INS_CHAMPS_PRENOM)) ;
$annuaire->setId($id_utilisateur) ;
 
// On boucle sur chaque projet et on desinscrit l'utilisateur
foreach ($tableau_projet as $projet) {
// On verifie si l utilisateur est le dernier coordinateur
69,16 → 69,15
$controleur->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD, $annuaire);
}
}
 
// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
$projet->getListesAssociees() ;
 
if ($projet->avoirListe()) {
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($GLOBALS['ins_db']) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
 
}
}
 
/trunk/classes/gestion_wikini05.class.php
File deleted
/trunk/classes/document.class.php
1,5 → 1,5
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
81,7 → 81,7
* @access private
*/
var $_db;
 
/**
* L'identifiant du document dans la table projet_document.
* @access private
89,17 → 89,17
var $_id;
 
/**
*
*
* @access private
*/
var $_chemin_icone;
 
/**
* L'identifiant du père, peut être à NULL
* @access private
*/
var $_id_pere;
 
/**
* L'identifiant du propriétaire. Provient d'un annuaire. Peut être à NULL.
* @access private
116,11 → 116,11
*
*/
var $_pd_lien ;
 
var $nom_fichier ;
/**
*
*
*
* @param int id_document L'identifiant du document dans la base.
* @param int objetDB un objet PEAR:DB
* @return void
130,9 → 130,9
{
if (is_object($objetDB)) {
$GLOBALS['projet_db'] = $objetDB;
}
}
$this->_chemin_icone = $chemin_icones ;
 
if ($id_document != "") {
$requete = "select * from projet_documents where pd_id=".$id_document ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
145,7 → 145,7
$this->_id_projet = $ligne->pd_ce_projet;
$this->_id = $ligne->pd_id ;
fichier::fichier($chemin.$this->getChemin(), $GLOBALS['projet_db']) ;
 
if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
$this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
$this->_nom_long = $ligne->pd_nom ;
153,7 → 153,7
$this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
$this->_description = $ligne->pd_description ;
$this->_pd_lien = $ligne->pd_lien;
 
if ($this->_isRacine($ligne->pd_pere)) {
$this->_id_pere = 0 ;
} else {
161,12 → 161,12
}
}
}
 
} // end of member function document
 
/**
*
*
*
* @param int id_document L'identifiant du document dans la base.
* @param int objetDB Un objet PEAR:DB
* @return document
174,9 → 174,9
*/
function __construct( $id_document = "", &$objetDB, $chemin = '', $chemin_icones = '' )
{
 
$this->document($id_document, $objetDB, $chemin, $chemin_icones);
 
} // end of member function __construct
 
 
311,14 → 311,14
include_once PROJET_CHEMIN_CLASSES.'projet.class.php';
$projet = new projet ($GLOBALS['projet_db'], $this->_id_projet);
// l arborescence des repertoires
 
$tableau_navigation = $this->getPath($this->_id) ;
if (is_array ($tableau_navigation))$tableau_navigation = array_reverse($tableau_navigation);
for ($i = 0; $i < count ($tableau_navigation); $i++) {
$chemin_repertoire_entre_racine_et_fichier.= $tableau_navigation[$i]."/";
$chemin_repertoire_entre_racine_et_fichier.= $tableau_navigation[$i]."/";
}
return $projet->getNomRepertoire().'/'.$chemin_repertoire_entre_racine_et_fichier.$this->nom_fichier ;
}
}
 
 
/**
331,7 → 331,7
* @return Array
* @access public
*/
 
function getCheminIdRepertoire( $id_doc, &$objetDB )
{
if ($id_doc == "") $id_doc = 0;
353,7 → 353,6
}
return ($chemin_rep_id_nom);
}
 
function getPath( $id_doc)
{
if ($id_doc == "") $id_doc = 0;
360,24 → 359,20
// on commence par rechercher le répertoire père, dans la base de donnée
$requete = 'select pd_pere, pd_nom, pd_id, pd_ce_type from projet_documents where pd_id='.$id_doc ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
 
if (DB::isError($resultat)) {
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
return ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
 
$chemin_rep_id_nom = array() ;
if ($resultat->numRows()>0 && $ligne->pd_pere != 0 && $ligne->pd_pere != $ligne->pd_id) {
 
array_push ($chemin_rep_id_nom, $ligne->pd_pere) ;
 
// Récursion sur le répertoires ou fichiers fils
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, document::getPath($ligne->pd_pere) );
if ($resultat->numRows()>0) {
if ($ligne->pd_pere == 0) {
return array();
}
array_push ($chemin_rep_id_nom, $ligne->pd_pere) ;
$chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, document::getPath($ligne->pd_pere) );
}
 
return $chemin_rep_id_nom;
}
 
/**
* Calcule le chemin vers le fichier ou le répertoire uploadé
* renvoie un chaine de la forme dir1/dir2/fichier.ext
389,7 → 384,7
 
if (isset($_FILES['fichier']['name'])) {
$extension = preg_replace("/^([^\.]+)\.(\w+$)/", "\\2", $_FILES['fichier']['name']) ;
}
}
 
if ($this->_id_pere != '') {
// On appelle la méthode getCheminIdRepertoire qui renvoie un tableau avec la liste
399,7 → 394,7
$doc_pere = new document ($this->_id_pere, $GLOBALS['projet_db']);
return $doc_pere->getChemin();
$tableau_navigation = $this->getPath($this->_id_pere) ;
 
for ($i = 0; $i < count ($tableau_navigation); $i++) $chemin_repertoire_entre_racine_et_repertoire_a_cree.= $tableau_navigation[$i]."/";
$chemin = $chemin_repertoire_entre_racine_et_repertoire_a_cree ;
} else {
419,13 → 414,13
*/
 
function enregistrerSQL ($valeur, $chemin) {
 
// On teste si on a affaire à un répertoire ou un fichier
if (isset ($_FILES['fichier']['name'])) {
// On tente de déterminer le type du fichier à partir de son nom dans $valeur['$fichier']
$tableau_nom = explode (".", $_FILES['fichier']['name']) ;
 
// On prend le dernier élément du tableau, si c'est un tableau
// On prend le dernier élément du tableau, si c'est un tableau
if (is_array($tableau_nom)) {
$extension = array_pop($tableau_nom) ;
$type = type_fichier_mime::factory($extension) ;
498,7 → 493,7
*
* @return true en cas de succès
*/
 
function suppressionSQL () {
$requete = 'delete from projet_documents where pd_id='.$this->_id ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
505,7 → 500,7
if ($GLOBALS['projet_db']->affectedRows()) return true ;
return false ;
}
 
/**
* Déplace un document au sein d'un même projet
*
522,12 → 517,12
$chemin_rep_cible = $repertoire_cible->getChemin();
} else {
// Si le repertoire destination est la racine cad id =0
// on cree un document qui aura pour chemin le repertoire du projet
// on cree un document qui aura pour chemin le repertoire du projet
include_once PROJET_CHEMIN_CLASSES.'projet.class.php';
$projet = new projet ($GLOBALS['projet_db'], $this->_id_projet);
$chemin_rep_cible = $projet->getNomRepertoire().'/';
}
 
$nom_fichier = $this->_pd_lien ;
$requete = 'update projet_documents set pd_pere='.$repertoire_destination.' where pd_id='.$this->_id ;
$resultat = $GLOBALS['projet_db']->query ($requete) ;
537,7 → 532,7
}
//echo $this->_chemin.'<br>'.PROJET_CHEMIN_FICHIER.$chemin_rep_cible.$nom_fichier;
return fichier::deplace ($this->_chemin, PROJET_CHEMIN_FICHIER.$chemin_rep_cible.$nom_fichier) ;
 
} // end of member function deplace
 
 
606,7 → 601,7
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$tableau_document = array() ;
 
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau_document, new document ($ligne->pd_id, $objetDB, $chemin, $chemin_icones)) ;
}
627,7 → 622,7
if (DB::isError ($resultat)) {
return ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
 
return $resultat;
}
/**
647,7 → 642,7
}
return round ($taille / $diviseur, $precision).'&nbsp;'.$unite;
}
 
/**
* Renvoie une liste de document, enfant du document courant
* qui doit etre un repertoire bien sur
656,9 → 651,9
* @access public
*/
function getDocumentsEnfant() {
 
}
 
} // end of document
 
 
/trunk/classes/ezmlm-php-2.0/services_vpopmail/ajout_abonne.php
2,5 → 2,5
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
 
echo exec ('/usr/local/bin/ezmlm-sub '.$repertoire.' '.$mail, $output, $ret) ;
echo exec ('ezmlm-sub '.$repertoire.' '.$mail, $output, $ret) ;
?>
/trunk/classes/projetControleur.class.php
71,8 → 71,6
define ('PROJET_ACTION_MODIFIER_V', 15) ;
define ('PROJET_ACTION_NOUVELLE_LISTE', 16) ;
define ('PROJET_ACTION_NOUVELLE_LISTE_V', 17) ;
define ('PROJET_ACTION_MODIFIER_LISTE', 19) ;
define ('PROJET_ACTION_MODIFIER_LISTE_V', 20) ;
define ('PROJET_ACTION_S_INSCRIRE', 21) ;
define ('PROJET_ACTION_CREER_WIKI', 22) ;
define ('PROJET_ACTION_SUPPRIMER_WIKI', 23) ;
117,10 → 115,10
* Messages envoyes par la systeme pour prevenir
* les utilisateurs de certaines action
*/
 
define ('PROJET_NOTIFICATION_DEMANDE_INSCRIPTION', 1);
define ('PROJET_NOTIFICATION_ACCEPTATION_INSCRIPTION', 2);
define ('PROJET_NOTIFICATION_INSCRIPTION_NOUVELLE', 3); // Pour le coordinateur quand quelqu un s inscrit au projet
define ('PROJET_NOTIFICATION_INSCRIPTION_NOUVELLE', 3); // Pour le coordinateur quand quelqu un s inscrit au projet
define ('PROJET_NOTIFICATION_DESINSCRIPTION_PROJET', 4);
define ('PROJET_NOTIFICATION_NOUVEAU_DOC', 5);
define ('PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD', 6);
208,7 → 206,7
* @access private
*/
var $_service ;
 
/**
* Methode principale de la classe. Elle permet d'appeler les methodes du modules
* projet en fonction de l'action.
218,7 → 216,7
*/
 
 
 
function run( )
{
// On teste en premier la presence d un appel vers un service
227,7 → 225,7
return include_once PROJET_CHEMIN_APPLI.'services/'.$this->_service.'.php' ;
}
}
 
if ($this->_action == '') {
return $this->messageErreur(PROJETCONTROLEUR_ACTION_INVALIDE) ;
}
300,11 → 298,6
case PROJET_ACTION_NOUVELLE_LISTE_V : $retour .= $this->nouvelleListeValidation() ;
$this->_action = PROJET_ACTION_VOIR_FORUM ;
break ;
case PROJET_ACTION_MODIFIER_LISTE : $retour .= $this->formulaireModificationListe($this->_id_projet) ;
break ;
case PROJET_ACTION_MODIFIER_LISTE_V : $retour .= $this->modifierListeValidation($this->_id_projet) ;
$this->_action = PROJET_ACTION_VOIR_FORUM ;
break ;
case PROJET_ACTION_SUPPRIMER_LISTE : $retour .= $this->supprimerListe() ;
$this->_action = PROJET_ACTION_VOIR_RESUME ;
break ;
415,9 → 408,9
 
$auth = $this->_auth->getAuth() ; // Pour raccourcir le code
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ; // --------------
 
return include_once PROJET_CHEMIN_APPLI.'presentation/'.$this->_presentation.'.php' ;
 
}
 
/**
475,7 → 468,7
} else {
if ($this->_id_projet != '') $res .= '<h2>'.$label_statut.'</h2>'."\n" ;
}
 
if ($this->_id_projet != '') {
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
483,7 → 476,7
if (!$isEnAttente) {
$res .= '<ul id ="projet_groupe_niv1"><li class="projet_niv1">'.PROJET_CONTRIBUTEUR ;
$res .= '<ul id="projet_groupe_niv2_con">' ;
}
}
if ($isCoord || $isContri) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE."</a></li>\n" ;
498,10 → 491,10
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_GESTION_UTILISATEUR."</a></li>\n" ;
}
$res .= '</ul></li>' ;
 
//document
if ($isContri || $isCoord || $isAdm) {
 
// On ajoute l id d un repertoire s il existe
if (isset($this->_id_repertoire)) $this->_url->addQueryString ('id_repertoire', $this->_id_repertoire);
$res .= '<li class="projet_niv2">'.PROJET_DOCUMENT ;
508,25 → 501,25
// L'action "Mettre un fichier en ligne"
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER) ;
$res .= '<ul><li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_METTRE_FICHIER."</a></li>\n" ;
 
// L'action creer un repertoire
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_CREER_REP."</a></li>\n" ;
$res .= '</ul></li>' ;
 
$this->_url->removeQueryString('id_repertoire');
// Forum
// Forum
$res .= '<li class="projet_niv1">'.PROJET_FORUM ;
$res .= '<ul id="projet_groupe_niv2_for">' ;
if ($projet->avoirListe()) {
 
// On verifie si l'utilisateur est inscrit ou non a la liste et on ajoute le lien
//$projet->getListesAssociees();
 
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php';
foreach ($projet->_listes_associes as $info_liste) {
 
$listes_ext = new liste_externe ($this->_db) ;
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
if (count ($tableau_liste) == 0) {
552,7 → 545,7
$onclic = ' onclick="javascript:return confirm(\''.PROJET_SUPPRIMER_LISTE_CONFIRMATION.'\');"' ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'"'.$onclic.'>'.$texte_liste.'</a></li>'."\n" ;
}
 
} else {
if ($isAdm || $isCoord) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_NOUVELLE_LISTE) ;
564,7 → 557,7
if ($isAdm) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_REFERENCER_LISTE) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_REFERENCER_LISTE.'</a></li>'."\n" ;
 
}
$res .= '</ul></li>' ;
}
576,16 → 569,11
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_MODIFIER_PROPRIETES."</a></li>\n" ;
if ($isAdm || (PROJET_UTILISATEURS_COORD && $isCoord)) {
 
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_MODIFIER_LISTE) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'"> Modifier la visibilité de la liste </a></li>'."\n" ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 
$this->_url->removeQueryString (PROJET_VARIABLE_ID_PROJET) ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU) ;
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_NOUVEAU_PROJET.'</a></li>'."\n" ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
 
// L'action supprimer le projet
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_SUPPRESSION_PROJET) ;
$this->_url->addQueryString(PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
594,7 → 582,7
}
$res .= '</ul></li>' ;
}
 
// Wikini
if ($isAdm) {
$res .= '<li class="projet_niv1">'.PROJET_WIKINI ;
614,7 → 602,7
$res .= '<li class="projet_niv2"><a href="'.$this->_url->getURL().'">'.PROJET_NOUVEAU_PROJET.'</a></li>'."\n" ;
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
$res .= '</ul></li>' ;
}
}
}
$res .= '</ul>' ;
$res .= "</div>\n" ;
635,7 → 623,7
if (!$this->_auth->getAuth()) {
return PROJET_TEXTE_NON_IDENTIFIE;
}
 
if (fileperms(PROJET_CHEMIN_FICHIER) & 0x0002) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireProjet.class.php' ;
645,16 → 633,16
include_once PROJET_CHEMIN_CLASSES.'projet_type.class.php' ;
$tableau_type = projet_type::getTousLesTypes($this->_db) ;
}
 
/** recuperation des themes */
include_once PROJET_CHEMIN_CLASSES.'projet_theme.class.php';
$tableau_theme = projet_theme::getTousLesThemes($this->_db);
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$formulaire_projet->construitFormulaire(projet::getTousLesProjets($this->_db), $tableau_type, $tableau_theme);
if ($action == PROJET_MODIFIER_DESCRIPTION_V) {
$projet = new projet($this->_db, $this->_id_projet) ;
 
$valeurs_par_defaut = array ( 'projet_titre' => $projet->getTitre(),
'projet_description' => $projet->getDescription(),
'projet_asso' => $projet->getIdPere(),
664,7 → 652,7
'projet_type'=> $projet->getType(),
'projet_moderation' => $projet->isModere(),
) ;
 
$formulaire_projet->setDefaults($valeurs_par_defaut) ;
$themes = $projet->getThemes();
foreach ($themes as $cle => $valeur) {
673,7 → 661,7
$element->setChecked(true);
}
} else {
$formulaire_projet->setDefaults (array ('projet_moderation'=> '0')) ;
$formulaire_projet->setDefaults (array ('projet_moderation'=> '0')) ;
}
$res = PROJET_PROPOSER_PROJET ;
return $res . $formulaire_projet->toHTML() ;
818,11 → 806,11
$document = new document($this->_id_document, $this->_db, PROJET_CHEMIN_FICHIER) ;
$document->suppression() ;
$document->suppressionSQL() ;
 
// On verifie s il reste des documents associes au projet et si non on met
// On verifie s il reste des documents associes au projet et si non on met
// a jour projet.p_avoir_document
if (count ($projet->getListesDocuments(PROJET_CHEMIN_FICHIER)) == 0) $projet->setAvoirDocument(false);
 
if (count ($projet->getListesDocuments(PROJET_CHEMIN_FICHIER)) == 0) $projet->setAvoirDocument(false);
$this->_url->removeQueryString(PROJET_VARIABLE_ID_DOCUMENT);
return ;
 
881,7 → 869,7
//$GLOBALS['log'] .= 'projet->getRepertoire() : '.$projet->getNomRepertoire().'<br>';
$id_document = SQL_obtenirNouveauId($this->_db, 'projet_documents', 'pd_id') ;
$nouveau_nom = $document->genereNouveauNom($projet->getNomRepertoire(), $_FILES['fichier']['name'], $id_document);
 
if (!$document->upload (PROJET_CHEMIN_FICHIER.$chemin_upload.'/'.$nouveau_nom)) {
return 'Echec de l\'upload<br />'.
'Fichier source : '. $_FILES['fichier']['name'];
891,13 → 879,13
$document->enregistrerSQL($formulaire_document->getSubmitValues(), $nouveau_nom);
// On place a 1 la colonne p_avoir_document
if (!$projet->avoirDocument()) $projet->setAvoirDocument(true);
 
// On ajoute une information de session
$_SESSION['formulaire_document'] = 'valide';
 
// Pour notification coordinateur
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
1047,7 → 1035,7
function envoyerUnMailFormulaire( )
{
if (!$this->_auth->getAuth()) {
return PROJET_LISTE_PROJET;
return PROJET_LISTE_PROJET;
}
if (isset($_SESSION['formulaire_mail'])) {
unset ($_SESSION['formulaire_mail']) ;
1072,7 → 1060,7
if (isset($_SESSION['formulaire_mail']) && $_SESSION['formulaire_mail'] == 'valide') {
return include_once PROJET_CHEMIN_APPLI.'actions/forums.php' ;
}
 
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL_V );
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
$formulaire_mail = new HTML_formulaireMail('formulaire_mail', 'post', preg_replace ("/&amp;/", "&", $this->_url->getURL())) ;
1123,31 → 1111,8
$formulaire_liste->setDefaults(array('domaine_liste' => PROJET_DOMAINE_LISTE)) ;
$formulaire_liste->updateElementAttr('domaine_liste', array('readonly' => 'readonly')) ;
return $res.$formulaire_liste->toHTML() ;
}
}
 
function formulaireModificationListe($id_projet) {
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$projet->getListesAssociees();
//var_dump($projet);
$liste_visible = $projet->_listes_associes[0]->getVisibilite();
 
$res = '<h1> Modification de la visibilité de la liste </h1><br />'."\n" ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_MODIFIER_LISTE_V) ;
$res .= '<form action="'.$this->_url->getURL().'" method="post">'.
'<label for="liste_visible">Visibilité de la liste </label><input type="checkbox" name="liste_visible" id="liste_visible"';
if($liste_visible == 1) {
$res .= ' checked="checked" ';
}
$res .= ' /> <br /><br />'.
'<input type="submit" value="valider" /> '.
'</form>';
 
return $res;
}
 
/**
* Transmet au serveur la demande de creation d'une nouvelle liste.
*
1198,21 → 1163,6
}
} // end of member function nouvelleListeValidation
 
function modifierListeValidation($id_projet) {
 
if(isset($_POST['liste_visible'])) {
$visibilite = true;
} else {
$visibilite = false;
}
 
$projet->getListesAssociees();
$id_liste = $projet->_listes_associes[0]->getId();
$projet->majSQLVisibilite($id_projet,$visibilite);
 
return true;
}
 
/**
* Supprime la liste de discussion associee au projet
*
1272,7 → 1222,7
if (isset ($this->_id_projet)) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
 
// On controle si la liste est externe (yahoo) auquel cas on ne presente pas l inscription
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$liste_ext = new liste_externe($this->_db);
1290,7 → 1240,7
if ($projet->isModere()) {
$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
} else {
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
$message_retour = '<p class="information">Votre inscription a bien &eacute;t&eacute; prise en compte'.$msg.'</p>';
}
$message_retour = '<p class="information">Votre inscription a bien &eacute;t&eacute; prise en compte. '.$msg.'</p>';
1301,14 → 1251,14
if (isset($_POST['valider_inscription_projet'])) {
if (isset($_POST['radio_inscription_liste'])) {
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
 
if (!$projet->isModere()) {
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 
if ($_POST['radio_inscription_liste'] == 2) {
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$projet->getListesAssociees() ;
1320,7 → 1270,7
$this->notifierCoordinateurs(PROJET_NOTIFICATION_INSCRIPTION_NOUVELLE, $utilisateur);
} else {
$participant->setStatut(3, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
 
$this->notifierCoordinateurs(PROJET_NOTIFICATION_DEMANDE_INSCRIPTION, $utilisateur);
}
}
1402,11 → 1352,11
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$participant = new participe($this->_db) ;
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
$utilisateur = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID,
'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE,
'nom'=> PROJET_CHAMPS_NOM, 'prenom' => PROJET_CHAMPS_PRENOM)) ;
$utilisateur->setId($this->_auth->getAuthData(PROJET_CHAMPS_ID)) ;
 
// Le statut 4 desinscrit l'utilisateur, dans la methode setStatut
$participant->setStatut(4, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
1421,7 → 1371,7
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
$this->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET, $utilisateur);
 
// On verifie si l utilisateur est le dernier coordinateur
// auquel cas on previent les administrateurs
if ($participant->isCoordinateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db)) {
1430,11 → 1380,11
$this->notifierCoordinateurs(PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD, $utilisateur);
}
}
//
//
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php';
$liste_ext = new liste_externe($this->_db);
$listes = $liste_ext->getListesAssociees($this->_id_projet);
 
$msg = '';
if (count ($listes) != 0) {
$info_liste = $liste_ext->getInfoListe($listes[0]);
1630,7 → 1580,7
 
/**
* retourne une variable locale si la variable $_GET existe
*
*
*/
function traiterVariableGet($var, $valeur_par_defaut ='') {
if (isset($_GET[$var]) && $_GET[$var] != '') {
1657,19 → 1607,19
) ;
return '<p class="erreur">'.$messageErreur[$valeur].'</p>' ;
} // end of member function messageErreur
 
/** Envoie de mail pour prevenir les coordinateurs d une action sur le projet
* Lorsqu un projet n a plus de coordinateur, la notification est
* envoyee aux administrateurs
*
*
*/
 
function notifierCoordinateurs ($notification, $utilisateur) {
 
include_once PROJET_CHEMIN_CLASSES.'projetTemplate.class.php';
 
switch ($notification) {
case PROJET_NOTIFICATION_DEMANDE_INSCRIPTION :
case PROJET_NOTIFICATION_DEMANDE_INSCRIPTION :
$sujet = PROJET_TEMPLATE_DEMANDE_INSCRIPTION_SUJET;
$corps = PROJET_TEMPLATE_DEMANDE_INSCRIPTION_CORPS;
break;
1689,48 → 1639,48
$sujet = PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_SUJET;
$corps = PROJET_TEMPLATE_DESINSCRIPTION_DERNIER_COORD_CORPS;
break;
 
}
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php';
$participant = new participe($this->_db) ;
$tableau_coordinateur = $participant->getCoordinateurs($this->_id_projet) ;
 
$objet_mail =& Mail::factory('smtp');
 
$modele = new projetTemplate($GLOBALS['projet_db']);
 
$sujet_mail = $modele->getTemplate($sujet, PROJET_LANGUE_DEFAUT);
$corps_mail = $modele->getTemplate($corps, PROJET_LANGUE_DEFAUT);
 
if (PEAR::isError($sujet_mail)) $sujet_mail->raiseError ($sujet_mail->getMessage().'<br />'.$sujet_mail->getDebugInfo());
 
$corps_mail = str_replace ('{nom}', $utilisateur->getInfo( 'nom'), $corps_mail);
$corps_mail = str_replace ('{prenom}', $utilisateur->getInfo( 'prenom'), $corps_mail);
$corps_mail = str_replace ('{nom_projet}', $projet->getTitre(), $corps_mail);
$corps_mail = str_replace ('{lien}', str_replace ('&amp;', '&', $this->_url->getURL()), $corps_mail);
 
$entetes['From'] = PROJET_MAIL_ADMINISTRATEUR;
$entetes['To'] = '';
$entetes['Subject'] = trim ($sujet_mail) ; // le trim est necessaire pour enlever d eventuels retour-chariot qui foutent el l air le message
$entetes['Subject'] = trim ($sujet_mail) ; // le trim est necessaire pour enlever d eventuels retour-chariot qui foutent el l air le message
$entetes['Date'] = date ('D, M j G:i:s \C\E\S\T Y') ;
$entetes['Message-ID'] = md5(time()) ;
$entetes['reply-to'] = $this->_auth->getUserName();
$entetes['Content-Type'] = 'text/plain' ;
 
// 2 cas : 1. il reste des coordinateurs ou notification pour administrateur
// 2. plus de coordinateur ou notification pour administrateur
if (count ($tableau_coordinateur) != 0 && $notification != PROJET_NOTIFICATION_DESINSCRIPTION_PROJET_DERNIER_COORD) {
foreach ($tableau_coordinateur as $coordinateur) {
$entetes['To'] .= $coordinateur[3].','; // Le champs 3 est le mail
 
}
// On enleve la virgule finale
 
$entetes['To'] = substr ($entetes['To'], 0, -1);
 
// on envoie le mail
$objet_mail->send($entetes['To'], $entetes, html_entity_decode ($corps_mail));
} else { // Pour le cas ou il n y a plus de coordinateur, on envoie un message aux administrateurs
1738,12 → 1688,12
trigger_error(print_r($tableau_administrateur, true));
foreach ($tableau_administrateur as $administrateur) {
$entetes['To'] .= $administrateur[3].','; // Le champs 3 est le mail
 
}
// On enleve la virgule finale
 
$entetes['To'] = substr ($entetes['To'], 0, -1);
 
// on envoie le mail
$objet_mail->send($entetes['To'], $entetes, html_entity_decode ($corps_mail));
}
1754,10 → 1704,10
 
class bouton {
static function toHTML($lien, $label, $id, $class='projet_bouton_action') {
 
if ($lien != '#') {
$balise_a_debut = '<a href="'.$lien.'"'.($id == 'cross'? ' onclick="javascript:return confirm(\''.$label.' ?\');"':'').'>';
$balise_a_fin = '</a>';
$balise_a_fin = '</a>';
} else {
$balise_a_debut = '';
$balise_a_fin = '';
/trunk/classes/liste_discussion.class.php
1,5 → 1,5
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
43,7 → 43,7
require_once GEN_CHEMIN_API.'sql/SQL_manipulation.fonct.php' ;
/**
* class liste_discussion
*
*
*/
class liste_discussion
{
50,7 → 50,7
 
/*** Attributes: ***/
 
 
/**
* Le nom de la liste, sans le domaine.
* @access private
57,7 → 57,7
*/
var $_nom;
/**
*
*
* @access private
*/
var $_adresse;
67,17 → 67,17
*/
var $_domaine;
/**
*
*
* @access private
*/
var $_adresse_inscription;
/**
*
*
* @access private
*/
var $_adresse_desinscription;
/**
*
*
* @access private
*/
var $_adresse_aide;
92,7 → 92,7
*/
var $_id;
/**
*
*
* @access private
*/
var $_adresse_inscription_resume;
101,7 → 101,7
* @access private
*/
var $_portee;
 
/**
* Le constructeur
*
115,7 → 115,7
$this->_db = $objetDB ;
if ($id_liste != '') {
$this->_id = $id_liste ;
 
$requete_liste = 'select * from projet_liste where pl_id_liste='.$this->_id ;
$resultat_liste = $this->_db->query ($requete_liste) ;
if (DB::isError ($resultat_liste)) {
165,11 → 165,8
return $this->_id ;
} // end of member function getNom
 
function getVisibilite( )
{
return $this->_portee ;
} // end of member function getNom
 
 
/**
* Enregistre une ligne dans la table projet_liste
* Le tableau de valeur doit contenir les éléments suivants 'nom_liste','','domaine_liste'
180,7 → 177,7
*/
 
function enregistrerSQL ($valeur) {
 
$id = SQL_obtenirNouveauId($this->_db, 'projet_liste', 'pl_id_liste') ;
 
$requete = "insert into projet_liste set pl_id_liste=".$id ;
201,15 → 198,15
}
 
/**
*
*
*
* @param string code_sql
* @param string code_sql
* @return bool
* @access public
*/
function suppressionSQL()
{
 
$requete = "delete from projet_liste where pl_id_liste=".$this->_id ;
$resultat = $this->_db->query ($requete) ;
 
262,8 → 259,8
} // end of member function getAdresseEnvoi
 
/**
*
*
*
* @return string
* @access public
*/
274,8 → 271,8
 
 
/**
*
*
*
* @return string
* @access public
*/
/trunk/classes/inscription_liste.class.php
1,5 → 1,5
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
43,7 → 43,7
 
/**
* class isncription_liste
*
*
*/
class inscription_liste
{
91,15 → 91,15
*/
function getInscritsListe( $id_liste )
{
 
} // end of member function getInscritsListe
 
/**
*
*
*
* @param annire utilisateur
* @param liste_discussion id_liste
* @param int type_inscription
* @param annire utilisateur
* @param liste_discussion id_liste
* @param int type_inscription
* @return void
* @access public
*/
106,7 → 106,7
function inscrireUtilisateur( &$utilisateur, &$liste, $type_inscription )
{
$requete = 'update projet_inscription_liste set '.
'pil_id_liste='.$liste->getId().', pil_id_statut='.$type_inscription.' where pil_id_utilisateur='.$utilisateur->getInfo('identifiant') ;
'pil_id_liste='.$liste->getId().', pil_id_statut='.$type_inscription.' where pil_id_utilisateur='.$utilisateur->getInfo('identifiant') ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
113,25 → 113,25
}
if ($this->_db->affectedRows() == 0) {
$requete = 'insert into projet_inscription_liste set pil_id_utilisateur='.$utilisateur->getInfo('identifiant').
', pil_id_liste='.$liste->getId().', pil_id_statut='.$type_inscription ;
', pil_id_liste='.$liste->getId().', pil_id_statut='.$type_inscription ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
 
// Ajout dans la liste des commandes au serveur
// On inscrit le créateur de la liste
$resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
 
} // end of member function inscrireUtilisateur
 
/**
*
*
*
* @param int id_utilisateur
* @param int id_liste
* @param int id_utilisateur
* @param int id_liste
* @return void
* @access public
*/
145,11 → 145,11
} // end of member function desinscrireUtilisateur
 
/**
*
*
*
* @param int id_liste
* @param int id_utilisateur
* @param int type_inscription
* @param int id_liste
* @param int id_utilisateur
* @param int type_inscription
* @return void
* @access public
*/
158,7 → 158,7
 
// envoie d'une demande d'inscription par email à la liste
//include_once 'Mail.php' ;
 
switch ($type_inscription) {
case 0 :
 
168,9 → 168,9
 
break ;
case 1 :
 
break ;
case 2 :
case 2 :
 
// Ajout d'un utilisateur
$resultat_ajout_utilisateur = file_get_contents (PROJET_SERVEUR_VPOPMAIL.'/ajout_abonne.php?domaine='.
182,13 → 182,13
/**
* Renvoie la liste des statuts d'un utilisateur
*
* @param int id_utilisateur
* @param int id_utilisateur
* @return Array
* @access public
*/
function getStatutsInscrit( $id_utilisateur )
{
 
$requete = 'select pil_id_liste, pil_id_statut from projet_inscription_liste where pil_id_utilisateur='.$id_utilisateur ;
$resultat = $this->_db->query ($requete) ;echo $requete;
if (DB::isError ($resultat)) {
199,21 → 199,21
$tableau_resultat[$ligne->pil_id_liste] = $ligne->pil_id_statut ;
}
return $tableau_resultat ;
 
 
} // end of member function getStatutsInscrit
 
/**
* Renvoie le statut d'un inscrit à une liste
*
* @param int id_liste
* @param int id_utilisateur
* @param int id_liste
* @param int id_utilisateur
* @return int
* @access public
*/
function getStatutInscrit( $id_liste, &$auth )
{
 
// Récupération de la liste des listes !!
$requete = 'select pl_nom_liste, pl_domaine from projet_liste where pl_id_liste='.$id_liste ;
$resultat = $this->_db->query ($requete) ;
/trunk/classes/projet.class.php
155,7 → 155,7
* @access private
*/
var $_avoirDocument;
 
/**
* tableau contenant les themes associes au projet
*/
218,7 → 218,7
$this->_est_racine = false ;
}
}
 
/** Recuperation des themes */
$requete_theme = 'select pat_id_theme, pt_label_theme from projet_avoir_theme, projet_theme'.
' where pat_id_projet='.$this->_id_projet.' and pat_id_theme=pt_id_theme';
227,11 → 227,11
return ("Echec de la requete : $requete_theme<br />".$resultat_theme->getMessage()) ;
}
if ($resultat_theme->numRows() != 0) {
 
while ($ligne_theme = $resultat_theme->fetchRow(DB_FETCHMODE_OBJECT)) {
$this->_themes[$ligne_theme->pat_id_theme] = $ligne_theme->pt_label_theme;
$this->_themes[$ligne_theme->pat_id_theme] = $ligne_theme->pt_label_theme;
}
 
}
}
} // end of member function projet
359,7 → 359,7
* Renvoie vrai si le projet a au moins un document, fichier ou repertoire
*
* Mis en place pour des raisons de performances avant la methode getListesDocuments etait utilisee
*
*
* @return bool
* @access public
*/
369,11 → 369,11
}
 
/**
* Permet de fixer la colonne p_avoir_document a 1
* Permet de fixer la colonne p_avoir_document a 1
*
* Mis en place pour des raisons de performances avant la methode getListesDocuments etait utilisee
*
* @param bool
*
* @param bool
* @return mixed true si la requete fonctionne
* @access public
*/
450,18 → 450,18
$tableau = array();
$tab = array();
 
 
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
array_push ($tableau, array ('id' => $ligne->pd_id,
'id_pere' => $ligne->pd_pere,
array_push ($tableau, array ('id' => $ligne->pd_id,
'id_pere' => $ligne->pd_pere,
'fils' => array(),
'label' => $ligne->pd_nom));
 
}
 
// la $tableau reste un tableau de valeur a plat
 
 
$i = 0;
foreach ($tableau as $noeud) {
// On teste si le noeud est racine si oui on l ajoute a l arbre sinon on ne l ajoute pas
477,13 → 477,13
function construireArbre(&$noeud, $tableau) {
$j = 0;
foreach ($tableau as $element) {
// pour chaque element on teste
// pour chaque element on teste
if ($element['id_pere'] == $noeud['id']) {
$noeud['fils'][$j]= $element ;
$noeud['fils'][$j]= $element ;
$this->construireArbre($noeud['fils'][$j],$tableau);
}
$j++;
}
$j++;
}
}
 
/**
627,7 → 627,7
', ph_id_projet_fils='.$id ;
$resultat = $this->_db->query ($requete) ;
}
 
/** enregistrement dans projet_avoir_theme */
$requete_theme = '';
foreach ($tableau_de_valeur['projet_theme'] as $cle => $valeur) {
677,12 → 677,12
', ph_id_projet_fils='.$this->_id_projet ;
$resultat = $this->_db->query ($requete) ;
}
 
/** enregistrement dans projet_avoir_theme */
 
$requete_suppression_theme = 'delete from projet_avoir_theme where pat_id_projet='.$this->_id_projet;
$resultat_suppression_theme = $GLOBALS['projet_db']->query($requete_suppression_theme);
 
$requete_theme = '';
foreach ($tableau_de_valeur['projet_theme'] as $cle => $valeur) {
$requete_theme = 'insert into projet_avoir_theme set pat_id_projet='.$this->_id_projet.', pat_id_theme='.$cle;
711,18 → 711,7
return true ;
} // end of member function majNomWikini
 
function majSQLVisibilite($id_liste, $visible) {
 
$requete = 'UPDATE projet_liste set pl_visibilite='.$visible.' '.
'WHERE pl_id_liste ='.$id_liste;
 
$resultat = $this->_db->query ($requete) ;
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
return true;
}
 
/**
*
*
/trunk/squelettes/participants.tpl.html
67,7 → 67,7
<td><?php if ($droits <= PROJET_DROIT_COORDINATEUR) : ?>
<form action="<?php echo $this->_url->getURL(); ?>" method="post">
<select name="inscription_liste" onchange="javascript:this.form.submit();">
<option value="0"<?php echo ($utilisateur[6] ? '' : ' selected="selected"');?> >Non inscrit</option>';
<option value="0">Non inscrit</option>';
<option value="1"<?php echo ($utilisateur[6] ? ' selected="selected"': '');?>>Inscrit</option>
</select></form>
<?php else : ?>