Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 430 → Rev 431

/trunk/actions/wikini.php
1,131 → 1,131
<?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.17 2007-06-25 12:15:06 alexandre_tb 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.17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$droits = PROJET_DROIT_AUCUN ;
$res = '' ;
$loggue = $this->_auth->getAuth();
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$lien_inscription = PROJET_LIEN_INSCRIPTION_CMS;
 
$wiki_res = '' ;
$script_wiki = '$(document).ready(function() {
$(\'#projet_lien_inscription\').bind(\'click\', function() {
$(\'#projet_bloc_inscription\').toggle();
return false;
});
});';
GEN_stockerCodeScript($script_wiki);
// Les wikinis associes au projet
 
if ($loggue) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$droits = $participant->getStatut($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet);
switch ($droits) {
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = "S'inscrire &agrave; ce projet";
break;
}
}
if ($wiki = $projet->getWikini()) {
// Si le wiki, ne peut pas être intégré
if (strpos($wiki, "http://www.tela-botanica.org/wikini/") === 0) {
$wiki_res .= '<div style="line-height: 2em;">'.sprintf(PROJET_WIKINI_PAS_REDIR, $wiki).'</div>'."\n" ;
} else {
if ($projet->isModere()) {
if ($this->_auth->getAuth()) {
if ($participant->getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $projet->getId(), $this->_db) < 3) {
$wiki_res .= '<a href="http://'.$GLOBALS['_GEN_commun']['url']->host.'/'.
PROJET_CHEMIN_WIKINI.$projet->getWikini().'">'.PROJET_WIKINI_ALLER.'</a>';
$GLOBALS['_GEN_commun']['info_application']->wikini = $wiki;
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ACTION,'wikini');
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ID_PROJET,$this->_id_projet);
require_once 'client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php';
$wiki_res.= afficherPageWikini();
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_MENU'] =afficherPageMenuWikini();
 
} else {
$wiki_res .= PROJET_VOUS_N_ETES_PAS_INSCRIT;
}
} else {
$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> '.
'<div id="projet_lien_inscription">'.
'<a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>'.
'</div>';
$loggue = false;
$wiki_res .= PROJET_TEXTE_NON_IDENTIFIE;
}
} else {
$wiki_res .= '<a href="http://'.$GLOBALS['_GEN_commun']['url']->host.'/'.
PROJET_CHEMIN_WIKINI.$projet->getWikini().'" target="_blank" id="aller_sur_wikini">'.
PROJET_WIKINI_ALLER.'</a>';
$GLOBALS['_GEN_commun']['info_application']->wikini = $wiki;
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ACTION,'wikini');
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ID_PROJET,$this->_id_projet);
require_once 'client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php';
$wiki_res.= afficherPageWikini();
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_MENU'] = afficherPageMenuWikini();
}
}
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n";
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_WIKINI;
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/wikini.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
<?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.17 2007-06-25 12:15:06 alexandre_tb 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.17 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$droits = PROJET_DROIT_AUCUN ;
$res = '' ;
$loggue = $this->_auth->getAuth();
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$lien_inscription = PROJET_LIEN_INSCRIPTION_CMS;
 
$wiki_res = '' ;
$script_wiki = '$(document).ready(function() {
$(\'#projet_lien_inscription\').bind(\'click\', function() {
$(\'#projet_bloc_inscription\').toggle();
return false;
});
});';
GEN_stockerCodeScript($script_wiki);
// Les wikinis associes au projet
 
if ($loggue) {
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$droits = $participant->getStatut($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_id_projet);
switch ($droits) {
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = "S'inscrire &agrave; ce projet";
break;
}
}
if ($wiki = $projet->getWikini()) {
// Si le wiki, ne peut pas �tre int�gr�
if (strpos($wiki, "http://www.tela-botanica.org/wikini/") === 0) {
$wiki_res .= '<div style="line-height: 2em;">'.sprintf(PROJET_WIKINI_PAS_REDIR, $wiki).'</div>'."\n" ;
} else {
if ($projet->isModere()) {
if ($this->_auth->getAuth()) {
if ($participant->getStatutSurProjetCourant($this->_auth->getAuthData(PROJET_CHAMPS_ID), $projet->getId(), $this->_db) < 3) {
$wiki_res .= '<a href="http://'.$GLOBALS['_GEN_commun']['url']->host.'/'.
PROJET_CHEMIN_WIKINI.$projet->getWikini().'">'.PROJET_WIKINI_ALLER.'</a>';
$GLOBALS['_GEN_commun']['info_application']->wikini = $wiki;
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ACTION,'wikini');
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ID_PROJET,$this->_id_projet);
require_once 'client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php';
$wiki_res.= afficherPageWikini();
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_MENU'] =afficherPageMenuWikini();
 
} else {
$wiki_res .= PROJET_VOUS_N_ETES_PAS_INSCRIT;
}
} else {
$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> '.
'<div id="projet_lien_inscription">'.
'<a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>'.
'</div>';
$loggue = false;
$wiki_res .= PROJET_TEXTE_NON_IDENTIFIE;
}
} else {
$wiki_res .= '<a href="http://'.$GLOBALS['_GEN_commun']['url']->host.'/'.
PROJET_CHEMIN_WIKINI.$projet->getWikini().'" target="_blank" id="aller_sur_wikini">'.
PROJET_WIKINI_ALLER.'</a>';
$GLOBALS['_GEN_commun']['info_application']->wikini = $wiki;
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ACTION,'wikini');
$GLOBALS['_GEN_commun']['url']->addQueryString(PROJET_VARIABLE_ID_PROJET,$this->_id_projet);
require_once 'client/integrateur_wikini/bibliotheque/iw_integrateur.fonct.php';
$wiki_res.= afficherPageWikini();
$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_MENU'] = afficherPageMenuWikini();
}
}
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n";
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_WIKINI;
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/wikini.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
?>
/trunk/actions/forums.php
1,406 → 1,407
<?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.14 2008-09-16 14:12:43 alexandre_tb 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.14 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php' ;
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
 
// creation de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
/* contiendra le lien vers la liste yahoo */
$liste_ext_res = '' ;
 
$url_page_en_cours = $this->_url->getURL();
 
$inscription_laius ='' ;
$bouton_poster = '';
$bouton_desinscription_liste = '';
 
$loggue = $this->_auth->getAuth();
 
// Un appel a papyrus pour modifier le titre de la page
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_FORUM;
 
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" ;
}
$avoir_liste_externe = true;
$adresse_envoie = $info_liste->AGO_A_MAILSEND;
$adresse_inscription = $info_liste->AGO_A_MAILABO;
} else {
$avoir_liste_externe = false;
}
 
 
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
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) ;
$droits = $participant->getStatut($id_u, $this->_id_projet);
} else {
$droits = PROJET_DROIT_AUCUN;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
}
switch ($droits) {
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
break;
}
// gestion de l'inscription desinscription a la liste
// TODO : la gestion de linscription au resume
$inscription_liste = new inscription_liste($this->_db) ;
$statut = $inscription_liste->getStatutInscrit( $info_liste->getId(), $this->_auth ) ;
if ($this->_auth->getAuth() && isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
if ($statut == 2) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE_LISTE.'</a>'."\n" ;
} else {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>'."\n" ;
}
}
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = 'S\'inscrire &agrave; la liste' ;
} else {
// L'action envoyer un mail
$action_inscription = PROJET_ENVOYER_UN_MAIL ;
$label_inscription = PROJET_ECRIRE_LISTE ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
$bouton_desinscription_liste = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire de la liste','cross');
}
if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
$liste = new ezmlm_php() ;
// Parametrage 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 (!$avoir_liste_externe) {
$adresse_envoie = $info_liste->getAdresseEnvoi();
}
print '<a href="mailto:'.$adresse_envoie.'">' . $adresse_envoie ;
print "</a><br />\n";
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum))
print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
if ($liste->action != 'show_message') {
$xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
$info_liste->getNom(), $GLOBALS['lang'],
$this->_url->getURL()) ;
$xml_parser->load();
ob_start();
$resultat = $xml_parser->parse() ;
$calendrier = ob_get_contents();
ob_end_clean();
$xml_parser->reset();
}
//$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
// On teste si l'on vient d'une reponse a un email, si oui
// on modifie $liste->action pour renvoyer le message auquelon vient de repondre
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);
}
// actionargs[0] contient le nom du repertoire et actionargs[1] le nom du fichier
// On appelle la fonction qui affiche un fichier
$xml_parser->setAction ('message');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$mail = ob_get_contents() ;
ob_end_clean();
$mimeDecode = new Mail_mimeDecode($mail) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true',
'include_bodies' => 'true')) ;
$message = new ezmlm_msgdisplay() ;
$message->listname = $info_liste->getNom();
$numero_message = $xml_parser->getNumeroMessage();
$total_message = $xml_parser->getNombreTotalMessage();
$this->_url->addQueryString ('action', 'show_msg');
ob_start();
if ($xml_parser->getNumeroFichierPrecedent() != 0) {
$lien_precedent = $this->_url->getURL(). '&amp;actionargs[]='.
$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
$xml_parser->getNumeroFichierPrecedent();
$bouton_precedent = bouton::toHTML($lien_precedent, PROJET_PRECEDENT, 'gauche', 'projet_bouton_inline');
$navigation = $bouton_precedent;
}
if ($xml_parser->getNumeroFichierSuivant() != '' && (int) $numero_message < (int) $total_message) {
$lien_suivant = $this->_url->getURL(). '&amp;actionargs[]='.
$xml_parser->getNumeroRepertoireSuivant().'&amp;actionargs[]='.
$xml_parser->getNumeroFichierSuivant();
$bouton_suivant = bouton::toHTML($lien_suivant ,PROJET_SUIVANT, 'droite', 'projet_bouton_inline');
$navigation .= $bouton_suivant;
}
$this->_url->addQueryString ('action', 'repondre');
$bouton_repondre = bouton::toHTML($this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
'&amp;actionargs[]='.$liste->actionargs[1], PROJET_REPONDRE, 'repondre', 'projet_bouton_inline');
$this->_url->removeQueryString('action');
/*
Un bouton pour revenir a la liste des messages
*/
$navigation .= bouton::toHTML($this->_url->getURL() ,'retour', 'haut', 'projet_bouton_inline');
if (!$avoir_liste_externe && $droits <= PROJET_DROIT_CONTRIBUTEUR) $navigation .= $bouton_repondre;
if ($droits == PROJET_DROIT_COORDINATEUR || $droits == PROJET_DROIT_ADMINISTRATEUR) {
$this->_url->addQueryString ('action', 'supprimer');
 
$bouton_suppression_message = bouton::toHTML($this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
'&amp;actionargs[]='.$liste->actionargs[1], 'Supprimer', 'cross', 'projet_bouton_inline');
$navigation .= $bouton_suppression_message;
}
$this->_url->removeQueryString ('action');
print '<div class="message">' ;
print $message->parse_entete_mail($mailDecode) ;
$message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
print $message->message_rendu;
print '</div>' ;
$message = ob_get_contents();
ob_end_clean();
break;
case "list_info":
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$derniers_messages = ob_get_contents() ;
ob_end_clean();
 
break;
case "show_threads":
$xml_parser->reset() ;
$xml_parser->setAction ('messages_thread');
$xml_parser->setMois($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_thread = ob_get_contents() ;
ob_end_clean();
$message = $messages_thread ;
break;
case "show_author_msgs" :
$xml_parser->reset() ;
$xml_parser->setAction ('messages_auteur');
$xml_parser->setHashAuteur($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_auteur = ob_get_contents() ;
ob_end_clean();
$message = $messages_auteur ;
break;
case 'show_month' :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, 'forums');
$this->_url->addQueryString('action', 'show_threads');
$this->_url->addQueryString('actionargs[]', $liste->actionargs[0]);
$message = '[<a href="'.$this->_url->getURL().'">par fil de discussion</a>]';
$xml_parser->reset() ;
$xml_parser->setAction ('messages_mois');
$xml_parser->setMois($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_mois = ob_get_contents() ;
ob_end_clean();
$message .= $messages_mois ;
break;
case 'repondre' :
if (count($liste->actionargs) < 2) {
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
}
$xml_parser->setAction ('message');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$message = ob_get_contents() ;
ob_end_clean();
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
if (isset($_SESSION['formulaire_mail'])) {
unset ($_SESSION['formulaire_mail']) ;
}
$formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post',
str_replace('&amp;', '&', $this->_url->getURL()).
'&action='.PROJET_ENVOYER_UN_MAIL_V.
'&actionargs[]='.$liste->actionargs[0].
'&actionargs[]='.$liste->actionargs[1].
'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
$formulaireReponse->construitFormulaire() ;
$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
$message = '<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
$repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
$repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
$formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
// Ajout de > au début de chaque ligne du message
$tableau = explode ("\n", $repondre->message_rendu) ;
$repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
$formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
$message .= $formulaireReponse->toHTML() ;
 
break;
case 'supprimer' :
$xml_parser->reset() ;
$xml_parser->setAction ('supprimer');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
$message = '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$message .= ob_get_contents() ;
ob_end_clean();
break;
}
} else {
$message = PROJET_MESSAGE_LISTE_PRIVEE ;
}
ob_end_clean() ;
}
}
 
 
if ($liste->action == 'show_msg') $squelette = 'message'; else $squelette = 'forum';
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/'.$squelette.'.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
 
 
$this->_url->removeQueryString ('actionargs');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.13 2008-08-25 15:02:49 alexandre_tb
* mise en place des squelettes
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
<?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.13 2008-08-25 15:02:49 alexandre_tb 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.13 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php' ;
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
 
// creation de l'objet projet courant
$projet = new projet ($this->_db, $this->_id_projet) ;
 
/* contiendra le lien vers la liste yahoo */
$liste_ext_res = '' ;
 
$url_page_en_cours = $this->_url->getURL();
 
$inscription_laius ='' ;
$bouton_poster = '';
$bouton_desinscription_liste = '';
 
$loggue = $this->_auth->getAuth();
 
// Un appel a papyrus pour modifier le titre de la page
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_FORUM;
 
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" ;
}
$avoir_liste_externe = true;
$adresse_envoie = $info_liste->AGO_A_MAILSEND;
$adresse_inscription = $info_liste->AGO_A_MAILABO;
} else {
$avoir_liste_externe = false;
}
 
 
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
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) ;
$droits = $participant->getStatut($id_u, $this->_id_projet);
} else {
$droits = PROJET_DROIT_AUCUN;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
}
switch ($droits) {
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
break;
}
// gestion de l'inscription desinscription a la liste
// TODO : la gestion de linscription au resume
$inscription_liste = new inscription_liste($this->_db) ;
$statut = $inscription_liste->getStatutInscrit( $info_liste->getId(), $this->_auth ) ;
if ($this->_auth->getAuth() && isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
if ($statut == 2) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE_LISTE.'</a>'."\n" ;
} else {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>'."\n" ;
}
}
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = 'S\'inscrire &agrave; la liste' ;
} else {
// L'action envoyer un mail
$action_inscription = PROJET_ENVOYER_UN_MAIL ;
$label_inscription = PROJET_ECRIRE_LISTE ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
$bouton_desinscription_liste = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire de la liste','cross');
}
if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
$liste = new ezmlm_php() ;
// Parametrage 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 (!$avoir_liste_externe) {
$adresse_envoie = $info_liste->getAdresseEnvoi();
}
print '<a href="mailto:'.$adresse_envoie.'">' . $adresse_envoie ;
print "</a><br />\n";
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum))
print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
if ($liste->action != 'show_message') {
$xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
$info_liste->getNom(), $GLOBALS['lang'],
$this->_url->getURL()) ;
$xml_parser->load();
ob_start();
$resultat = $xml_parser->parse() ;
$calendrier = ob_get_contents();
ob_end_clean();
$xml_parser->reset();
 
}
//$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
// On teste si l'on vient d'une reponse a un email, si oui
// on modifie $liste->action pour renvoyer le message auquelon vient de repondre
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);
}
// actionargs[0] contient le nom du repertoire et actionargs[1] le nom du fichier
// On appelle la fonction qui affiche un fichier
$xml_parser->setAction ('message');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$mail = ob_get_contents() ;
ob_end_clean();
$mimeDecode = new Mail_mimeDecode($mail) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true',
'include_bodies' => 'true')) ;
$message = new ezmlm_msgdisplay() ;
$message->listname = $info_liste->getNom();
$numero_message = $xml_parser->getNumeroMessage();
$total_message = $xml_parser->getNombreTotalMessage();
$this->_url->addQueryString ('action', 'show_msg');
ob_start();
if ($xml_parser->getNumeroFichierPrecedent() != 0) {
$lien_precedent = $this->_url->getURL(). '&amp;actionargs[]='.
$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
$xml_parser->getNumeroFichierPrecedent();
$bouton_precedent = bouton::toHTML($lien_precedent, PROJET_PRECEDENT, 'gauche', 'projet_bouton_inline');
$navigation = $bouton_precedent;
}
if ($xml_parser->getNumeroFichierSuivant() != '' && (int) $numero_message < (int) $total_message) {
$lien_suivant = $this->_url->getURL(). '&amp;actionargs[]='.
$xml_parser->getNumeroRepertoireSuivant().'&amp;actionargs[]='.
$xml_parser->getNumeroFichierSuivant();
$bouton_suivant = bouton::toHTML($lien_suivant ,PROJET_SUIVANT, 'droite', 'projet_bouton_inline');
$navigation .= $bouton_suivant;
}
$this->_url->addQueryString ('action', 'repondre');
$bouton_repondre = bouton::toHTML($this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
'&amp;actionargs[]='.$liste->actionargs[1], PROJET_REPONDRE, 'repondre', 'projet_bouton_inline');
$this->_url->removeQueryString('action');
/*
Un bouton pour revenir a la liste des messages
*/
$navigation .= bouton::toHTML($this->_url->getURL() ,'retour', 'haut', 'projet_bouton_inline');
if (!$avoir_liste_externe && $droits <= PROJET_DROIT_CONTRIBUTEUR) $navigation .= $bouton_repondre;
if ($droits == PROJET_DROIT_COORDINATEUR || $droits == PROJET_DROIT_ADMINISTRATEUR) {
$this->_url->addQueryString ('action', 'supprimer');
 
$bouton_suppression_message = bouton::toHTML($this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
'&amp;actionargs[]='.$liste->actionargs[1], 'Supprimer', 'cross', 'projet_bouton_inline');
$navigation .= $bouton_suppression_message;
}
$this->_url->removeQueryString ('action');
print '<div class="message">' ;
print $message->parse_entete_mail($mailDecode) ;
$message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
print $message->message_rendu;
print '</div>' ;
$message = ob_get_contents();
ob_end_clean();
break;
case "list_info":
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$derniers_messages = ob_get_contents() ;
ob_end_clean();
 
break;
case "show_threads":
$xml_parser->reset() ;
$xml_parser->setAction ('messages_thread');
$xml_parser->setMois($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_thread = ob_get_contents() ;
ob_end_clean();
$message = $messages_thread ;
break;
case "show_author_msgs" :
$xml_parser->reset() ;
$xml_parser->setAction ('messages_auteur');
$xml_parser->setHashAuteur($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_auteur = ob_get_contents() ;
ob_end_clean();
$message = $messages_auteur ;
break;
case 'show_month' :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, 'forums');
$this->_url->addQueryString('action', 'show_threads');
$this->_url->addQueryString('actionargs[]', $liste->actionargs[0]);
$message = '[<a href="'.$this->_url->getURL().'">par fil de discussion</a>]';
$xml_parser->reset() ;
$xml_parser->setAction ('messages_mois');
$xml_parser->setMois($liste->actionargs[0]);
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$messages_mois = ob_get_contents() ;
ob_end_clean();
$message .= $messages_mois ;
break;
case 'repondre' :
if (count($liste->actionargs) < 2) {
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
}
$xml_parser->setAction ('message');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$message = ob_get_contents() ;
ob_end_clean();
$mimeDecode = new Mail_mimeDecode($message) ;
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
if (isset($_SESSION['formulaire_mail'])) {
unset ($_SESSION['formulaire_mail']) ;
}
$formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post',
str_replace('&amp;', '&', $this->_url->getURL()).
'&action='.PROJET_ENVOYER_UN_MAIL_V.
'&actionargs[]='.$liste->actionargs[0].
'&actionargs[]='.$liste->actionargs[1].
'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
$formulaireReponse->construitFormulaire() ;
$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
$message = '<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
$repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
$repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
$formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
// Ajout de > au d�but de chaque ligne du message
$tableau = explode ("\n", $repondre->message_rendu) ;
$repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
$formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
$message .= $formulaireReponse->toHTML() ;
 
break;
case 'supprimer' :
$xml_parser->reset() ;
$xml_parser->setAction ('supprimer');
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
$xml_parser->load();
$message = '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$message .= ob_get_contents() ;
ob_end_clean();
break;
}
} else {
$message = PROJET_MESSAGE_LISTE_PRIVEE ;
}
ob_end_clean() ;
}
}
 
 
if ($liste->action == 'show_msg') $squelette = 'message'; else $squelette = 'forum';
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/'.$squelette.'.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
 
 
$this->_url->removeQueryString ('actionargs');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: forums.php,v $
* Revision 1.13 2008-08-25 15:02:49 alexandre_tb
* mise en place des squelettes
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/actions/resume.php
1,324 → 1,324
<?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.13 2007-08-28 10:33:50 alexandre_tb 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.13 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$retour = '';
$loggue = false;
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
 
/** Bloc resume avec lien resume */
$resume = $projet->getResume();
$bouton_resume = '';
$bouton_s_inscrire_au_projet = '';
 
 
$lien_inscription = '';
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet) ;
 
// creation 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' ;
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
$bouton_deposer_doc = '';
// reglage de parametres 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) ;
 
$bouton_poster = '';
$bouton_desinscription_projet = '';
 
// verification 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()) {
$loggue = true;
$droits = PROJET_DROIT_AUCUN;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
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 ;
 
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
$projet->getListesAssociees();
foreach ($projet->_listes_associes as $info_liste) {
$inscription_liste = new inscription_liste($this->_db) ;
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = 'S\'inscrire &agrave; la liste' ;
} else {
// L'action envoyer un mail
$action_inscription = PROJET_ENVOYER_UN_MAIL ;
$label_inscription = PROJET_ECRIRE_LISTE ;
}
}
 
switch ($participant->getStatut($id_u, $this->_id_projet))
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
 
break;
case PROJET_DROIT_CONTRIBUTEUR :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
 
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
$bouton_desinscription_projet .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_COORDINATEUR || PROJET_DROIT_ADMINISTRATEUR :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
$bouton_resume .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
 
if ($projet->avoirListe()) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
 
}
 
break;
case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
'element = $(\'projet_lien_login\');'."\n".
'element.addEvent(
\'click\', function() {
fx.start({
\'height\' : \'320px\'
})
}
)});');
$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
$lien_login = '#';
break;
}
$bouton_poster .= '<br style="clear:both" />';
 
$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) ;
$visible = true ;
} else {
$visible = false ;
}
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
 
 
// si chef de projet ou si proprietaire 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 ;
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
 
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
}
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 associes au projet
if ($wiki = $projet->getWikini()) {
if (strpos($wiki, "http://www.tela-botanica.org/wikini/") === 0) {// Si le wiki, ne peut pas être intégré
$wiki_res .= '<div style="line-height: 2em;">'.sprintf(PROJET_WIKINI_PAS_REDIR, $wiki).'</div>'."\n";
} else {
$url = $GLOBALS['_GEN_commun']['url'] ;
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link = $this->_url->getURL();
$wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$wiki.')</div>';
}
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n";
}
// On charge les listes de discussion du projet
// Pour le moment seul ezmlm est supportee
 
$projet->getListesAssociees();
$sortie_liste = '' ;
 
 
$liste_ext_res = '' ;
if ($projet->avoirListe()) {
ob_start() ;
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
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":
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
$xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
$info_liste->getNom(), $GLOBALS['lang'],
$this->_url->getURL()) ;
 
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$derniers_messages = ob_get_contents() ;
ob_end_clean();
echo $derniers_messages ;
break;
}
} else {
print PROJET_MESSAGE_LISTE_PRIVEE;
}
$sortie_liste = ob_get_contents() ;
ob_end_clean() ;
}
}
 
// Site internet associe
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
if ($projet->getEspaceInternet() != '') {
$sortie_web .= '<a href="'.$projet->getEspaceInternet().'">'.$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" ;
}
$avoir_liste_externe = true;
} else {
$avoir_liste_externe = false;
}
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre();
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/resume.tpl.html';
 
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log$
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
<?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.13 2007-08-28 10:33:50 alexandre_tb 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.13 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$retour = '';
$loggue = false;
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
 
/** Bloc resume avec lien resume */
$resume = $projet->getResume();
$bouton_resume = '';
$bouton_s_inscrire_au_projet = '';
 
 
$lien_inscription = '';
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet) ;
 
// creation 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' ;
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
$vue_liste_document = new HTML_listeDocuments($this->_url, false, '', $this->_auth) ;
$bouton_deposer_doc = '';
// reglage de parametres 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) ;
 
$bouton_poster = '';
$bouton_desinscription_projet = '';
 
// verification 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()) {
$loggue = true;
$droits = PROJET_DROIT_AUCUN;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
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 ;
 
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php';
$projet->getListesAssociees();
foreach ($projet->_listes_associes as $info_liste) {
$inscription_liste = new inscription_liste($this->_db) ;
if ($inscription_liste->getStatutInscrit($info_liste->getId(), $this->_auth) == 0) {
$action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
$label_inscription = 'S\'inscrire &agrave; la liste' ;
} else {
// L'action envoyer un mail
$action_inscription = PROJET_ENVOYER_UN_MAIL ;
$label_inscription = PROJET_ECRIRE_LISTE ;
}
}
 
switch ($participant->getStatut($id_u, $this->_id_projet))
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
 
break;
case PROJET_DROIT_CONTRIBUTEUR :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
 
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
$bouton_desinscription_projet .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_COORDINATEUR || PROJET_DROIT_ADMINISTRATEUR :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
$bouton_resume .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
 
if ($projet->avoirListe()) {
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
 
}
 
break;
case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
'element = $(\'projet_lien_login\');'."\n".
'element.addEvent(
\'click\', function() {
fx.start({
\'height\' : \'320px\'
})
}
)});');
$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
$lien_login = '#';
break;
}
$bouton_poster .= '<br style="clear:both" />';
 
$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) ;
$visible = true ;
} else {
$visible = false ;
}
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
 
 
// si chef de projet ou si proprietaire 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 ;
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
 
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
}
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 associes au projet
if ($wiki = $projet->getWikini()) {
if (strpos($wiki, "http://www.tela-botanica.org/wikini/") === 0) {// Si le wiki, ne peut pas être intégré
$wiki_res .= '<div style="line-height: 2em;">'.sprintf(PROJET_WIKINI_PAS_REDIR, $wiki).'</div>'."\n";
} else {
$url = $GLOBALS['_GEN_commun']['url'] ;
$this->_url->addQueryString ('act',PROJET_ACTION_VOIR_WIKINI);
$link = $this->_url->getURL();
$wiki_res .= '<div><a href="'.$link.'">'.PROJET_ALLER_SUR_WIKINI.'</a> ('.$wiki.')</div>';
}
} else {
$wiki_res .= '<div>'.PROJET_WIKINI_PAS.'</div>'."\n";
}
// On charge les listes de discussion du projet
// Pour le moment seul ezmlm est supportee
 
$projet->getListesAssociees();
$sortie_liste = '' ;
 
 
$liste_ext_res = '' ;
if ($projet->avoirListe()) {
ob_start() ;
include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
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":
$this->_url->addQueryString('act', PROJET_ACTION_VOIR_FORUM);
$xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
$info_liste->getNom(), $GLOBALS['lang'],
$this->_url->getURL()) ;
 
$xml_parser->reset() ;
$xml_parser->setAction ('derniers_messages');
$xml_parser->load();
ob_start ();
$xml_parser->parse() ;
$derniers_messages = ob_get_contents() ;
ob_end_clean();
echo $derniers_messages ;
break;
}
} else {
print PROJET_MESSAGE_LISTE_PRIVEE;
}
$sortie_liste = ob_get_contents() ;
ob_end_clean() ;
}
}
 
// Site internet associe
$sortie_web = '<h2>'.PROJET_ESPACE_INTERNET.'</h2>'."\n" ;
if ($projet->getEspaceInternet() != '') {
$sortie_web .= '<a href="'.$projet->getEspaceInternet().'">'.$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" ;
}
$avoir_liste_externe = true;
} else {
$avoir_liste_externe = false;
}
$this->_url->removeQueryString(PROJET_VARIABLE_ACTION);
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre();
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/resume.tpl.html';
 
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log$
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
/trunk/actions/documents.php
1,175 → 1,175
<?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.11 2008-08-25 15:02:49 alexandre_tb 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.11 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
if (!isset($retour)) $retour = '';
 
$bouton_deposer_doc = '';
$bouton_creer_repertoire = '';
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
// recuperation de la liste des documents associes
 
$liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES, $this->_id_repertoire) ;
 
//$html_document = print_r($liste_documents, true);
// creation 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) ;
if (count ($liste_documents) == 0) $pas_de_document = true;
 
// reglage de parametres 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) ;
 
// verification des droits de l'utilisateur
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
$loggue = false;
if ($this->_auth->getAuth()) {
$loggue = true;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$droits = $participant->getStatut($id_u, $this->_id_projet);
 
// si participant, on ajoute le champs visibilite
if ($droits <= PROJET_DROIT_CONTRIBUTEUR) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
}
// si chef de projet ou si proprietaire d'au moins 1 document
$proprietaire_un_document = false ;
 
if ($droit <= PROJET_DROIT_CONTRIBUTEUR ) {
array_push ($entete_liste, PROJET_ACTION) ;
}
switch ($droits)
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
break;
}
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE);
$bouton_creer_repertoire = bouton::toHTML($this->_url->getURL(), 'Cr&eacute;er un r&eacute;pertoire', 'repertoire');
$bouton_creer_repertoire .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT);
} else {
$droits = PROJET_DROIT_AUCUN ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$label_url_inscription = 'S\'inscrire &agrave; au projet';
}
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, '', $this->_db) ;
 
 
// Les liens pour l affichage classique ou arborescent (avec dojo)
$this->_url->addQueryString('affichage', 'ajax');
$url_ajax = $this->_url->getURL();
$this->_url->addQueryString('affichage', 'standart');
$url_classique = $this->_url->getURL();
$this->_url->removeQueryString('affichage');
 
$arbre = document::getArbreDocument($this->_id_projet) ;
 
if (!isset ($_SESSION['mode_affichage'])) {
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage']; else $_SESSION['mode_affichage'] = 'standart';
} else {
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage'];
}
$vue_liste_document->setModeAffichage($_SESSION['mode_affichage']);
 
$html_no_script = '';
if ($vue_liste_document->_mode_affichage == 'ajax') {
$html_no_script .= '<noscript>';
$vue_liste_document->setModeAffichage('standart');
$html_no_script .= $vue_liste_document->toHTML('', '') ;
$html_no_script .= '</noscript>';
}
 
 
$html_document .= $vue_liste_document->toHTML($projet->getId(), $droits);
$this->_url->removeQueryString(PROJET_VARIABLE_SERVICE);
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DOCUMENT;
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/document.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
<?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.10 2007-10-02 09:24:53 alexandre_tb 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.10 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
if (!isset($retour)) $retour = '';
 
$bouton_deposer_doc = '';
$bouton_creer_repertoire = '';
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
// recuperation de la liste des documents associes
 
$liste_documents = $projet->getListesDocuments(PROJET_CHEMIN_FICHIER, PROJET_CHEMIN_ICONES, $this->_id_repertoire) ;
 
//$html_document = print_r($liste_documents, true);
// creation 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) ;
if (count ($liste_documents) == 0) $pas_de_document = true;
 
// reglage de parametres 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) ;
 
// verification des droits de l'utilisateur
$entete_liste = array (PROJET_FICHIERS_NOM, PROJET_FICHIERS_TAILLE, PROJET_FICHIERS_PAR, PROJET_FICHIERS_CREE_LE) ;
$loggue = false;
if ($this->_auth->getAuth()) {
$loggue = true;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$droits = $participant->getStatut($id_u, $this->_id_projet);
 
// si participant, on ajoute le champs visibilite
if ($droits <= PROJET_DROIT_CONTRIBUTEUR) {
array_push ($entete_liste, PROJET_FICHIERS_VISIBILITE) ;
}
// si chef de projet ou si proprietaire d'au moins 1 document
$proprietaire_un_document = false ;
 
if ($droit <= PROJET_DROIT_CONTRIBUTEUR ) {
array_push ($entete_liste, PROJET_ACTION) ;
}
switch ($droits)
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
break;
}
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$bouton_deposer_doc .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_REPERTOIRE);
$bouton_creer_repertoire = bouton::toHTML($this->_url->getURL(), 'Cr&eacute;er un r&eacute;pertoire', 'repertoire');
$bouton_creer_repertoire .= '<br style="clear:both" />';
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT);
} else {
$droits = PROJET_DROIT_AUCUN ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$label_url_inscription = 'S\'inscrire &agrave; au projet';
}
if (!isset($droits)) $droits = PROJET_DROIT_AUCUN ;
 
$vue_liste_document->construitEntete($entete_liste) ;
$vue_liste_document->construitListe ($liste_documents, $droits, '', $this->_db) ;
 
 
// Les liens pour l affichage classique ou arborescent (avec dojo)
$this->_url->addQueryString('affichage', 'ajax');
$url_ajax = $this->_url->getURL();
$this->_url->addQueryString('affichage', 'standart');
$url_classique = $this->_url->getURL();
$this->_url->removeQueryString('affichage');
 
$arbre = document::getArbreDocument($this->_id_projet) ;
 
if (!isset ($_SESSION['mode_affichage'])) {
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage']; else $_SESSION['mode_affichage'] = 'standart';
} else {
if (isset($_GET['affichage'])) $_SESSION['mode_affichage'] = $_GET['affichage'];
}
$vue_liste_document->setModeAffichage($_SESSION['mode_affichage']);
 
$html_no_script = '';
if ($vue_liste_document->_mode_affichage == 'ajax') {
$html_no_script .= '<noscript>';
$vue_liste_document->setModeAffichage('standart');
$html_no_script .= $vue_liste_document->toHTML('', '') ;
$html_no_script .= '</noscript>';
}
 
 
$html_document .= $vue_liste_document->toHTML($projet->getId(), $droits);
$this->_url->removeQueryString(PROJET_VARIABLE_SERVICE);
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DOCUMENT;
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/document.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log$
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/actions/participants.php
1,211 → 1,211
<?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.9 2008-09-01 14:38:34 alexandre_tb 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.9 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$res = '' ;
$pair = true;
$loggue = $this->_auth->getAuth();
$url = $this->_url->getURL();
 
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$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 a jour de statut
if (isset($_REQUEST['statut'])) {
$participants->setStatut($_REQUEST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
// Si désinscription de l'utilisateur (statut 4)
if ($_REQUEST['statut'] == 4) {
$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']) ;
// on désinscrit l'utilisateur des listes associées au projet
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($this->_db) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
}
// On teste ici s'il y a une mise a jour de l inscription a la liste
if (isset($_POST['inscription_liste'])) {
$projet->getListesAssociees();
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' ;
$inscription= new inscription_liste($this->_db) ;
if ($_POST['inscription_liste'] == 1) {
$inscription->inscrireUtilisateur($annuaire, $projet->_listes_associes[0], 2) ; // 2 est le statut d inscription normale
} else {
$inscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
// Ce qui suit doit etre ameliore pour sortir la requete 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 == 1) $droits = PROJET_DROIT_COORDINATEUR ;
if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
if ($statut == 3) $droits = PROJET_DROIT_EN_ATTENTE;
if ($statut == 4) {
$droits = PROJET_DROIT_AUCUN ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
}
if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR ;
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><br />'."\n" ;
}
// Mise en place de l'url
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
// Construction de l'entete
$info_utilisateur = $participants->getInscrits($this->_id_projet, $droits);
$nombre_participants = count ($info_utilisateur);
include_once PROJET_CHEMIN_CLASSES.'statut.class.php' ;
if ($projet->avoirListe()) {
/** recuperation des abonnees a la liste */
include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php';
$ezmlm = new ezmlmAccessObject('liste_abonnes', $projet->_listes_associes[0]->getDomaine(),
$projet->_listes_associes[0]->getNom());
$ezmlm->load();
$tableau_mail = $ezmlm->parse();
 
for ($i = 0; $i < count ($info_utilisateur); $i++) {
$tableau_mail_utilisateur[$info_utilisateur[$i][3]] = $i;
$info_utilisateur[$i][6] = 0; // Initialisation du tableau avec la valeur 0
}
foreach ($tableau_mail->children() as $email) {
$email = (string) $email;
if (isset($tableau_mail_utilisateur[$email])) {
$id = (int) $tableau_mail_utilisateur[$email];
$info_utilisateur[$id][6] = 1;
}
}
}
$statuts = statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM, $this->_db);
$statuts_inscription_liste[0] = 'non inscrit';
$statuts_inscription_liste[1] = 'inscrit';
} else {
$droits = PROJET_DROIT_AUCUN ;
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_LISTE_PARTICIPANT;
//$retour .= $titre.$res.$xml; ;
 
 
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/participants.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
 
 
$this->_url->removeQueryString ('statut');
$this->_url->removeQueryString ('id_utilisateur');
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$GLOBALS['url']->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2008-08-25 15:02:49 alexandre_tb
* mise en place des squelettes
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
<?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.8 2008-08-25 15:02:49 alexandre_tb 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.8 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
$res = '' ;
$pair = true;
$loggue = $this->_auth->getAuth();
$url = $this->_url->getURL();
 
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
$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 a jour de statut
if (isset($_REQUEST['statut'])) {
$participants->setStatut($_REQUEST['statut'], $_GET['id_utilisateur'], $this->_id_projet) ;
// Si d�sinscription de l'utilisateur (statut 4)
if ($_REQUEST['statut'] == 4) {
$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']) ;
// on d�sinscrit l'utilisateur des listes associ�es au projet
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
$desinscription= new inscription_liste($this->_db) ;
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
}
// On teste ici s'il y a une mise a jour de l inscription a la liste
if (isset($_POST['inscription_liste'])) {
$projet->getListesAssociees();
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' ;
$inscription= new inscription_liste($this->_db) ;
if ($_POST['inscription_liste'] == 1) {
$inscription->inscrireUtilisateur($annuaire, $projet->_listes_associes[0], 2) ; // 2 est le statut d inscription normale
} else {
$inscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
}
}
// Ce qui suit doit etre ameliore pour sortir la requete 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 == 1) $droits = PROJET_DROIT_COORDINATEUR ;
if ($statut == 2) $droits = PROJET_DROIT_CONTRIBUTEUR ;
if ($statut == 3) $droits = PROJET_DROIT_EN_ATTENTE;
if ($statut == 4) {
$droits = PROJET_DROIT_AUCUN ;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
}
if (participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db)) $droits = PROJET_DROIT_ADMINISTRATEUR ;
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><br />'."\n" ;
}
// Mise en place de l'url
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
// Construction de l'entete
$info_utilisateur = $participants->getInscrits($this->_id_projet, $droits);
$nombre_participants = count ($info_utilisateur);
 
include_once PROJET_CHEMIN_CLASSES.'statut.class.php' ;
if ($projet->avoirListe()) {
/** recuperation des abonnees a la liste */
include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php';
$ezmlm = new ezmlmAccessObject('liste_abonnes', $projet->_listes_associes[0]->getDomaine(),
$projet->_listes_associes[0]->getNom());
$ezmlm->load();
$tableau_mail = $ezmlm->parse();
 
for ($i = 0; $i < count ($info_utilisateur); $i++) {
$tableau_mail_utilisateur[$info_utilisateur[$i][3]] = $i;
$info_utilisateur[$i][6] = 0; // Initialisation du tableau avec la valeur 0
}
foreach ($tableau_mail->children() as $email) {
$email = (string) $email;
if (isset($tableau_mail_utilisateur[$email])) {
$id = (int) $tableau_mail_utilisateur[$email];
$info_utilisateur[$id][6] = 1;
}
}
}
$statuts = statut::getTousLesStatuts(PROJET_STATUT_SAUF_ADM, $this->_db);
$statuts_inscription_liste[0] = 'non inscrit';
$statuts_inscription_liste[1] = 'inscrit';
} else {
$droits = PROJET_DROIT_AUCUN ;
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_LISTE_PARTICIPANT;
//$retour .= $titre.$res.$xml; ;
 
 
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/participants.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
 
 
$this->_url->removeQueryString ('statut');
$this->_url->removeQueryString ('id_utilisateur');
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
$GLOBALS['url']->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: participants.php,v $
* Revision 1.8 2008-08-25 15:02:49 alexandre_tb
* mise en place des squelettes
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
/trunk/actions/description.php
1,171 → 1,169
<?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.4 2008-08-25 15:02:35 alexandre_tb 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.4 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
if ($this->_auth->getAuth()) {
$loggue = true;
$droits = PROJET_DROIT_AUCUN;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
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 ;
 
switch ($participant->getStatut($id_u, $this->_id_projet))
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> <div id="projet_lien_inscription">
<a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>
</div>';
break;
case PROJET_DROIT_CONTRIBUTEUR :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_COORDINATEUR :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
'element = $(\'projet_lien_login\');'."\n".
'element.addEvent(
\'click\', function() {
fx.start({
\'height\' : \'320px\'
})
}
)});');
$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
$lien_login = '#';
break;
}
$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) ;
$visible = true ;
} else {
$visible = false ;
}
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
 
// si chef de projet ou si proprietaire 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 ;
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DESCRIPTION;
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/description.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
<?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 |
// +------------------------------------------------------------------------------------------------------+
/**
* Application projet
*
* Action description
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// RAPPEL IMPORTANT
// On se situe dans la methode run() de la classe projetControleur
//
 
// creation de l'objet projet courant
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
$projet = new projet ($this->_db, $this->_id_projet) ;
 
if ($this->_auth->getAuth()) {
$loggue = true;
$droits = PROJET_DROIT_AUCUN;
$participant = new participe($this->_db) ;
$id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
$isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
$isParticipant = $participant->isContributeur($id_u, $this->_id_projet, $this->_db) ;
if ($isParticipant) $droits = PROJET_DROIT_CONTRIBUTEUR;
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 ;
 
switch ($participant->getStatut($id_u, $this->_id_projet))
{
case PROJET_DROIT_AUCUN :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$laius_inscription = PROJET_VOUS_N_ETES_PAS_INSCRIT;
$label_url_inscription = PROJET_S_INSCRIRE_AU_PROJET;
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
$lien_inscription = $this->_url->getURL();
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
$bouton_s_inscrire = '<span id="laius_inscription">'.$laius_inscription.'</span> <div id="projet_lien_inscription">
<a href="'.$lien_inscription.'">'.$label_url_inscription.'</a>
</div>';
break;
case PROJET_DROIT_CONTRIBUTEUR :
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_PROJET);
$bouton_desinscription_projet = bouton::toHTML($this->_url->getURL(), 'Se d&eacute;sinscrire du projet', 'cross');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_COORDINATEUR :
$this->_url->addQueryString (PROJET_VARIABLE_ACTION, PROJET_MODIFIER_DESCRIPTION);
$bouton_resume = bouton::toHTML($this->_url->getURL(), PROJET_MODIFIER_PROPRIETES, 'modifier');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_NOUVEAU_FICHIER);
$bouton_deposer_doc = bouton::toHTML($this->_url->getURL(), 'D&eacute;poser un document', 'document');
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
$bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
break;
case PROJET_DROIT_EN_ATTENTE : $droits = PROJET_DROIT_EN_ATTENTE;
GEN_stockerFichierScript('mootools', 'api/js/mootools/mootools-release-1.11.js');
GEN_stockerCodeScript('window.addEvent(\'domready\', function(){'."\n".
'var fx = new Fx.Styles($(\'projet_lien_login\'), {duration:500, wait:false});' ."\n".
'element = $(\'projet_lien_login\');'."\n".
'element.addEvent(
\'click\', function() {
fx.start({
\'height\' : \'320px\'
})
}
)});');
$laius_inscription_modere = str_replace ('nom_du_projet', $projet->getTitre(), PROJET_LAIUS_INSCRIPTION_MODERE);
$lien_login = '#';
break;
}
$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) ;
$visible = true ;
} else {
$visible = false ;
}
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, $visible) ;
 
// si chef de projet ou si proprietaire 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 ;
// recuperation de la liste des documents associes
$liste_documents = document::getDocumentsRecents(4, $this->_db, PROJET_CHEMIN_FICHIER,
PROJET_CHEMIN_ICONES, $this->_id_projet, false) ;
$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
$label_url_inscription = 'S\'inscrire &agrave; ce projet';
GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
'animatedcollapse.init();' ."\n");
$lien_login = '#';
}
 
$GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_DESCRIPTION;
 
ob_start();
include_once PROJET_CHEMIN_APPLI.'/squelettes/description.tpl.html';
$retour .= ob_get_contents();
ob_end_clean();
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
 
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>