Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/actions/wikini.php
New file
0,0 → 1,64
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: wikini.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
/**
* Application projet
*
* Action participants
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la méthode run() de la classe projetControleur
//
 
 
$res = '' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
$titre = '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>'."\n" ;
 
$wiki_res = '' ;
// Les wikinis associés au projet
if ($projet->getWikini()) {
$wiki_res .= '<div><a href="'.PROJET_URL_WIKINI.'wakka.php?wiki=PagePrincipale&wikini='.$projet->getWikini().'" target="_blank">'.PROJET_WIKINI_ALLER.'</a>' ;
$wiki_res .= '</div>' ;
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
}
 
$retour .= $titre.$wiki_res ;
 
 
?>
/trunk/actions/forums.php
New file
0,0 → 1,215
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: forums.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
/**
* Application projet
*
* Action forums
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.php') ;
 
// RAPPEL IMPORTANT
// On se situe dans la méthode run() de la classe projetControleur
//
 
 
// création de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$liste_ext_res = '' ;
$sortie_liste = '' ;
if ($projet->avoirListe()) {
foreach ($projet->_listes_associes as $info_liste) {
ob_start() ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
if ($this->_auth->getAuth()) {
$participant = new participe($this->_db) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($isAdm) $isCoord = true ;
} else {
$droits = PROJET_DROIT_AUCUN;
}
if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
$liste = new ezmlm_php() ;
// Paramétrage de la liste
$liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
$liste->listname = $info_liste->getNom() ;
$liste->listdomain = $info_liste->getDomaine();
if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
$liste->set_action($GLOBALS['action']) ;
$liste->set_actionargs($GLOBALS['actionargs']) ;
} else {
$liste->set_action('list_info') ;
}
$liste->sendheaders = false;
$liste->sendbody = false;
$liste->sendfooters = false;
$liste->forcehref = $this->_url->getURL() ;
print '<a href="mailto:'.$info_liste->getAdresseEnvoi().'">' . $info_liste->getAdresseEnvoi() ;
print "</a><br />\n";
print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
$info = new ezmlm_threads();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
$info->forcehref = $this->_url->getURL();
$info->listdir = $liste->listdir ;
$info->listname = $info_liste->getNom();
$info->listdomain = $info_liste->getDomaine() ;
if (!$info->listmessages()) {
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
}
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
// On teste si l'on vient d'une réponse à un email, si oui
// on modifie $liste->action pour renvoyer le message auquelon vient de répondre
if (isset($_POST['messageid'])) {
$liste->action = 'show_msg' ;
}
switch ($liste->action) {
case "show_msg":
if (count($liste->actionargs) < 2) {
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
}
$show_msg = new ezmlm_msgdisplay();
$show_msg->listdir = $liste->listdir ;
$show_msg->forcehref = $this->_url->getURL();
$show_msg->listname = $info_liste->getNom() ;
$show_msg->_auth = & $this->_auth ;
// actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
// On appelle la fonction qui affiche un fichier
print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
$show_msg->display($liste->actionargs[0] . "/" . $liste->actionargs[1]);
break;
case "list_info":
$info = new ezmlm_listinfo();
if (!$info) print 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $this->_url->getURL();
$info->listdir = $liste->listdir ;
$info->listname = $info_liste->getNom();
$info->listdomain = $info_liste->getDomaine() ;
print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
if (!$info->show_recentmsgs()) {
echo 'Pas de message dans cette liste' ;
}
break;
case "show_threads":
$threads = new ezmlm_threads();
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
$threads->forcehref = $this->_url->getURL() ;
$threads->listdir = $liste->listdir ;
$threads->listname = $info_liste->getNom() ;
$threads->listdomain = $info_liste->getDomaine() ;
$threads->tempdir = PROJET_CHEMIN_APPLI.'/tmp' ;
$threads->load($liste->actionargs[0]);
break;
case "show_author_msgs" :
$author = new ezmlm_author();
$author->listdir = $liste->listdir ;
$author->listname = $info_liste->getNom() ;
$author->listdomain = $info_liste->getDomaine() ;
$author->forcehref = $this->_url->getURL() ;
$author->display($liste->actionargs[0]);
break;
break ;
case 'show_month' :
$info = new ezmlm_listinfo();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$info->forcehref = $this->_url->getURL();
$info->listdir = $liste->listdir ;
$info->listname = $info_liste->getNom();
$info->listdomain = $info_liste->getDomaine() ;
echo '[ '.$info->makelink('action=show_threads&amp;actionargs[]='.$liste->actionargs[0], 'par fil de discussion').' ]' ;
print'<h2>'.PROJET_MESSAGE_DU_MOIS.$GLOBALS['mois'][((int)substr($liste->actionargs[0],4,2) / 1)-1] .', ' .
substr($liste->actionargs[0],0,4). '</h2>'."\n" ;
if (!$info->show_month($liste->actionargs[0])) {
echo 'Pas de message dans cette liste' ;
}
break;
case 'repondre' :
if (count($liste->actionargs) < 2) {
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
}
$repondre = new ezmlm_repondre();
$repondre->listdir = $liste->listdir ;
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
$repondre->forcehref = $this->_url->getURL();
$repondre->listname = $info_liste->getNom() ;
// actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
// On appelle la fonction qui affiche un fichier
print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
$repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
break;
}
} else {
print PROJET_MESSAGE_LISTE_PRIVEE ;
}
$sortie_liste = ob_get_contents() ;
ob_end_clean() ;
}
}
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
 
if (count ($tableau_liste) != 0) {
//$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
for ($i = 0; $i < count ($tableau_liste); $i++) {
$info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
$liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
$liste_ext_res .= '<br />'."\n" ;
}
}
 
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
$retour .= '<h2>'.PROJET_ADRESSE_ECRIRE.'</h2>'."\n" ;
$retour .= $sortie_liste ;
$retour .= $liste_ext_res ;
?>
/trunk/actions/resume.php
New file
0,0 → 1,201
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: resume.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
/**
* Application projet
*
* Action resume
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la méthode run() de la classe projetControleur
//
 
 
// création de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
// récupération de la liste des documents associés
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES, $this->_id_projet) ;
 
// création de la vue liste de document, on nettoie l'url
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
 
// réglage de paramètres de la vue
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
 
 
// vérification des droits de l'utilisateur
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
 
if ($this->_auth->getAuth()) {
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($isAdm) $isCoord = true ;
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
// si participant, on ajoute le champs visibilite
if ($statut !='' || $isAdm) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
}
// si chef de projet ou si propriétaire d'au moins 1 document
$proprietaire_un_document = false ;
 
foreach ($liste_documents as $document) {
if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document->_id_proprietaire) {
$proprietaire_un_document = true ;
$droits = PROJET_DROIT_PROPRIETAIRE ;
}
}
if ($droits <= PROJET_DROIT_COORDINATEUR || $proprietaire_un_document) {
array_push ($entete_liste, PROJET_ACTION) ;
}
} else {
$droits = PROJET_DROIT_AUCUN ;
}
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, 'ignore_repertoire', $this->_db) ;
 
$wiki_res = '' ;
// Les wikinis associés au projet
if ($projet->getWikini()) {
$wiki_res .= '<div><a href="'.PROJET_URL_WIKINI.'wakka.php?wiki=PagePrincipale&wikini='.$projet->getWikini().'" target="_blank">'.PROJET_URL_WIKINI.'</a>' ;
$wiki_res .= '</div>' ;
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n" ;
}
// On charge les listes de discussion du projet
// Pour le moment seul ezmlm est supportée
 
$projet->getListesAssociees();
$sortie_liste = '' ;
 
$liste_ext_res = '' ;
if ($projet->avoirListe()) {
ob_start() ;
foreach ($projet->_listes_associes as $info_liste) {
$liste = new ezmlm_php() ;
// Paramétrage de la liste
$liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
$liste->listname = $info_liste->getNom() ;
$liste->listdomain = $info_liste->getDomaine();
if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
$liste->set_action($GLOBALS['action']) ;
$liste->set_actionargs($GLOBALS['actionargs']) ;
} else {
$liste->set_action('list_info') ;
}
$liste->sendheaders = false;
$liste->sendbody = false;
$liste->sendfooters = false;
$liste->forcehref = $this->_url->getURL() ;
 
if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
switch ($liste->action) {
case "list_info":
$info = new ezmlm_listinfo();
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM) ;
$info->forcehref = $this->_url->getURL();
$info->listdir = $liste->listdir ;
$info->listname = $info_liste->getNom();
$info->listdomain = $info_liste->getDomaine() ;
$info->show_recentmsgs() ;
break;
}
} else {
print PROJET_MESSAGE_LISTE_PRIVEE;
}
$sortie_liste = ob_get_contents() ;
ob_end_clean() ;
}
}
 
// Site internet associé
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
if ($projet->getEspaceInternet() != '') {
$sortie_web .= '<a href="'.$projet->getEspaceInternet().'" target="_blank">'.$projet->getEspaceInternet().'</a>'."\n" ;
} else {
$sortie_web .= PROJET_PAS_DE_SITE ;
}
 
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
$listes_ext = new liste_externe ($this->_db) ;
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
 
if (count ($tableau_liste) != 0) {
$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
for ($i = 0; $i < count ($tableau_liste); $i++) {
$info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
//$liste_ext_res .= '<h2>'.$info_liste->AGO_A_NOMGRPLG.'</h2>'."\n" ;
//$liste_ext_res .= '<p>'.$info_liste->AGO_A_RESUMLG.'</p>'."\n" ;
$liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'" target="_blank">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
//$liste_ext_res .= '<br />'."\n" ;
}
}
 
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
$retour .= '<h2>'.PROJET_WIKI_ASSOCIE.'</h2>' ;
$retour .= $wiki_res ;
$retour .= $sortie_web ;
$retour .= '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
$retour .= $liste_ext_res.$sortie_liste ;
$retour .= '<h2>'.PROJET_FICHIERS_RECENTS.'</h2>'."\n" ;
$retour .= $vue_liste_document->toHTML() ;
//$retour .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
//$retour .= $sortie_liste ;
 
 
?>
/trunk/actions/documents.php
New file
0,0 → 1,113
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: documents.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
/**
* Application projet
*
* Action documents
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la méthode run() de la classe projetControleur
//
 
 
// création de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
// récupération de la liste des documents associés
$liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES) ;
 
// création de la vue liste de document, on nettoie l'url
//$this->_url->removeQueryString(PROJET_VARIABLE_ACTION) ;
include_once PROJET_CHEMIN_CLASSES.'HTML_listeDocuments.class.php' ;
 
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
 
$vue_liste_document = new HTML_listeDocuments($this->_url, false, $this->_id_repertoire, $this->_auth) ;
 
// réglage de paramètres de la vue
$vue_liste_document->setAction (array ("couper" => PROJET_ACTION_COUPER, "modifier" => PROJET_ACTION_MODIFIER, "supprimer" => PROJET_SUPPRESSION_FICHIER)) ;
$vue_liste_document->setCheminIcones(PROJET_CHEMIN_ICONES) ;
 
$tableau_navigation = document::getCheminIdRepertoire($this->_id_repertoire, $this->_db) ;
 
$vue_liste_document->setCheminNavigation ($tableau_navigation) ;
 
// vérification des droits de l'utilisateur
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
 
if ($this->_auth->getAuth()) {
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
$isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
if ($isAdm) $isCoord = true ;
$statut = participe::getStatutSurProjetCourant ($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
// si participant, on ajoute le champs visibilite
if ($statut !='' || $isAdm) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
}
// si chef de projet ou si propriétaire d'au moins 1 document
$proprietaire_un_document = false ;
 
foreach ($liste_documents as $document) {
if ($this->_auth->getAuthData(PROJET_CHAMPS_ID) == $document) {
$proprietaire_un_document = true ;
$droits = PROJET_DROIT_PROPRIETAIRE ;
}
}
if ($statut > 0 || $proprietaire_un_document) {
array_push ($entete_liste, PROJET_ACTION) ;
}
} else {
$droits = PROJET_DROIT_AUCUN ;
}
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, '', $this->_db) ;
 
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
 
$retour .= '<h2>'.PROJET_DOCUMENT_DU_PROJET.'</h2>'."\n" ;
$retour .= $vue_liste_document->toHTML() ;
 
 
?>
/trunk/actions/participants.php
New file
0,0 → 1,126
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: participants.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
/**
* Application projet
*
* Action participants
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la méthode run() de la classe projetControleur
//
 
 
include_once PROJET_CHEMIN_CLASSES.'HTML_listeParticipants.class.php' ;
$res = '' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
$titre = '<h2>'.PROJET_LISTE_PARTICIPANT.'</h2>'."\n" ;
$participants = new participe($this->_db) ;
 
// On teste ici s'il y a une mise à jour de statut
if (isset($_REQUEST['statut'])) {
$participants->setStatut($_REQUEST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
$projet->getListesAssociees() ;
if ($projet->avoirListe()) {
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
$annuaire->setId($_GET['id_utilisateur']) ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($this->_db) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
 
// Ce qui suit doit être amélioré pour sortir la requête sur l'annuaire
// On teste s'il y a un ajout d'utilisateur voir HTML_listeParticipants
if (isset($_POST['mail_utilisateur'])) {
$requete = 'select '.PROJET_CHAMPS_ID.' from '.PROJET_ANNUAIRE.' where '.PROJET_CHAMPS_MAIL.'="'.$_POST['mail_utilisateur'].'"';
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
if (!$resultat->numRows()) {
$msg = PROJET_MAIL_ABSENT;
} else {
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
// Le statut 2 est le statut participant
$participants->setStatut(2, $ligne[PROJET_CHAMPS_ID], $this->_id_projet) ;
}
}
 
if ($this->_auth->getAuth()) {
$statut = participe::getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet, $this->_db) ;
if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
if ($statut == 1) $droits = PROJET_DROIT_COORDINATEUR ;
if ($statut == 4) $droits = PROJET_DROIT_AUCUN ;
if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR ;
$HTML_listeParticipants = new HTML_listeParticipants(true) ;
if ($droits <= PROJET_DROIT_COORDINATEUR) $HTML_listeParticipants->setModeModification() ;
// Mise en place de l'url
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$HTML_listeParticipants->setURL($this->_url) ;
// Construction de l'entete
$entete = array (PROJET_NOM, PROJET_PRENOM) ;
 
array_push ($entete, PROJET_MAIL) ;
 
$info_utilisateur = $participants->getInscrits($this->_id_projet, $droits) ;
array_push ($entete, PROJET_DATE_INSCRIPTION, PROJET_STATUT) ;
$HTML_listeParticipants->construitEntete($entete) ;
$HTML_listeParticipants->construitListe($info_utilisateur, statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM, $this->_db)) ;
$res = $HTML_listeParticipants->toHTML() ;
if ($droits <= PROJET_DROIT_COORDINATEUR || participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) {
$res .= PROJET_NOUVEAU_UTILISATEUR_LAIUS ;
$res .= '<form action="'.$this->_url->getURL().'" method="post">'."\n" ;
if (isset ($msg) && $msg != '') {
$res .= '<div>'.$msg.'</div>' ;
}
$res .= '<input type="text" name="mail_utilisateur" size="32" />' ;
$res .= '<input type="submit" value="'.PROJET_NOUVEAU_UTILISATEUR.'" />'."\n" ;
$res .= '</form>'."\n" ;
}
} else {
$res .= '<p>'.PROJET_TEXTE_PARTICIPANT_NON_IDENTIFIE.'</p>'."\n" ;
}
$retour .= $titre.$res ;
 
 
?>
/trunk/actions/description.php
New file
0,0 → 1,56
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: description.php,v 1.1 2005-09-22 14:02:49 ddelon Exp $
/**
* Application projet
*
* Action description
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la méthode run() de la classe projetControleur
//
 
// création de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$retour .= '<h1>'.PROJET_PROJET.' : '.$projet->getTitre()."</h1>" ;
$retour .= '<h2>'.PROJET_RESUME.'</h2>'."\n" ;
$retour .= '<div>'.$projet->getResume().'</div>'."\n" ;
$retour .= '<h2>'.PROJET_DESCRIPTION.'</h2>' ;
$retour .= '<div>'.$projet->getDescription().'</div>'."\n" ;
 
 
?>