Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 413 → Rev 414

/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) ;
106,7 → 104,7
* Constantes pour definir les droits
*
*/
define ('PROJET_DROIT_ADMINISTRATEUR', 0) ;
define ('PROJET_DROIT_ADMINISTRATEUR', 1) ;
define ('PROJET_DROIT_COORDINATEUR', 2) ;
define ('PROJET_DROIT_PROPRIETAIRE', 4) ;
define ('PROJET_DROIT_CONTRIBUTEUR', 8) ;
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() ;
768,7 → 756,10
$formulaire_document->addElement ('hidden', 'id_document', $this->_id_document) ;
$formulaire_document->setDefaults($valeurs_par_defaut) ;
} else {
$formulaire_document->setDefaults (array ('document_visibilite'=> 'public')) ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$visibilite = $projet->isModere() ? "prive" : "public";
$formulaire_document->setDefaults (array ('document_visibilite'=> $visibilite)) ;
}
return $res.$formulaire_document->toHTML() ;
 
818,11 → 809,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 → 872,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 → 882,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)) ;
1051,7 → 1042,7
function envoyerUnMailFormulaire( )
{
if (!$this->_auth->getAuth()) {
return PROJET_LISTE_PROJET;
return PROJET_LISTE_PROJET;
}
if (isset($_SESSION['formulaire_mail'])) {
unset ($_SESSION['formulaire_mail']) ;
1076,7 → 1067,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())) ;
1127,31 → 1118,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.
*
1202,21 → 1170,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
*
1276,7 → 1229,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);
1294,7 → 1247,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>';
1305,14 → 1258,11
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() ;
1321,10 → 1271,14
$projet->_listes_associes[0],
$_POST['radio_inscription_liste']) ;
}
if (!$projet->isModere()) {
$participant->setStatut(2, $this->_auth->getAuthData (PROJET_CHAMPS_ID), $this->_id_projet) ;
$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);
}
}
1406,11 → 1360,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' ;
1425,7 → 1379,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)) {
1434,11 → 1388,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]);
1462,13 → 1416,10
* @access public
*/
function formulaireWiki( )
{
 
{
$GLOBALS['url']->addQueryString ('act', PROJET_ACTION_CREER_WIKI) ;
$GLOBALS['url']->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
require_once 'client/integrateur_wikini/bibliotheque/iw_admin_wikini.fonct.php';
 
$url = &$GLOBALS['_GEN_commun']['url'] ;
$url->addQueryString ('act', PROJET_ACTION_CREER_WIKI) ;
$url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet) ;
$res =admin_afficherContenuCorps();
$res .= '<br /><a href="'.$this->_url->getURL().'">'.PROJET_RETOUR_RESUME.'</a>';
return $res;
1633,7 → 1584,7
 
/**
* retourne une variable locale si la variable $_GET existe
*
*
*/
function traiterVariableGet($var, $valeur_par_defaut ='') {
if (isset($_GET[$var]) && $_GET[$var] != '') {
1660,19 → 1611,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, $lien = false) {
 
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;
1692,24 → 1643,24
$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);
1719,26 → 1670,26
else {
$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
1746,12 → 1697,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));
}
1762,10 → 1713,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 = '';