| 431 | 
           mathias | 
           1 | 
           <?php
  | 
        
        
            | 
            | 
           2 | 
           /*vim: set expandtab tabstop=4 shiftwidth=4: */
  | 
        
        
            | 
            | 
           3 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           4 | 
           // | PHP version 4.1                                                                                      |
  | 
        
        
            | 
            | 
           5 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           6 | 
           // | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
  | 
        
        
            | 
            | 
           7 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           8 | 
           // | This library is free software; you can redistribute it and/or                                        |
  | 
        
        
            | 
            | 
           9 | 
           // | modify it under the terms of the GNU General Public                                                  |
  | 
        
        
            | 
            | 
           10 | 
           // | License as published by the Free Software Foundation; either                                         |
  | 
        
        
            | 
            | 
           11 | 
           // | version 2.1 of the License, or (at your option) any later version.                                   |
  | 
        
        
            | 
            | 
           12 | 
           // |                                                                                                      |
  | 
        
        
            | 
            | 
           13 | 
           // | This library is distributed in the hope that it will be useful,                                      |
  | 
        
        
            | 
            | 
           14 | 
           // | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
  | 
        
        
            | 
            | 
           15 | 
           // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
  | 
        
        
            | 
            | 
           16 | 
           // | General Public License for more details.                                                             |
  | 
        
        
            | 
            | 
           17 | 
           // |                                                                                                      |
  | 
        
        
            | 
            | 
           18 | 
           // | You should have received a copy of the GNU General Public                                            |
  | 
        
        
            | 
            | 
           19 | 
           // | License along with this library; if not, write to the Free Software                                  |
  | 
        
        
            | 
            | 
           20 | 
           // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
  | 
        
        
            | 
            | 
           21 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           22 | 
           // CVS : $Id: forums.php,v 1.13 2008-08-25 15:02:49 alexandre_tb Exp $
  | 
        
        
            | 
            | 
           23 | 
           /**
  | 
        
        
            | 
            | 
           24 | 
           * Application projet
  | 
        
        
            | 
            | 
           25 | 
           *
  | 
        
        
            | 
            | 
           26 | 
           * Action forums
  | 
        
        
            | 
            | 
           27 | 
           *
  | 
        
        
            | 
            | 
           28 | 
           *@package projet
  | 
        
        
            | 
            | 
           29 | 
           //Auteur original :
  | 
        
        
            | 
            | 
           30 | 
           *@author        Alexandre Granier <alexandre@tela-botanica.org>
  | 
        
        
            | 
            | 
           31 | 
           //Autres auteurs :
  | 
        
        
            | 
            | 
           32 | 
           *@author        Aucun
  | 
        
        
            | 
            | 
           33 | 
           *@copyright     Tela-Botanica 2000-2005
  | 
        
        
            | 
            | 
           34 | 
           *@version       $Revision: 1.13 $
  | 
        
        
            | 
            | 
           35 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           36 | 
           */
  | 
        
        
            | 
            | 
           37 | 
              | 
        
        
            | 
            | 
           38 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           39 | 
           // |                                            ENTETE du PROGRAMME                                       |
  | 
        
        
            | 
            | 
           40 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           41 | 
              | 
        
        
            | 
            | 
           42 | 
           include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
  | 
        
        
            | 
            | 
           43 | 
           include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
  | 
        
        
            | 
            | 
           44 | 
           include_once PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php' ;
  | 
        
        
            | 
            | 
           45 | 
           include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
  | 
        
        
            | 
            | 
           46 | 
           include_once PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php' ;
  | 
        
        
            | 
            | 
           47 | 
           // RAPPEL IMPORTANT
  | 
        
        
            | 
            | 
           48 | 
           // On se situe dans la methode run() de la classe projetControleur
  | 
        
        
            | 
            | 
           49 | 
           //
  | 
        
        
            | 
            | 
           50 | 
              | 
        
        
            | 
            | 
           51 | 
              | 
        
        
            | 
            | 
           52 | 
           // creation de l'objet projet courant
  | 
        
        
            | 
            | 
           53 | 
           $projet = new projet ($this->_db, $this->_id_projet) ;
  | 
        
        
            | 
            | 
           54 | 
              | 
        
        
            | 
            | 
           55 | 
           /* contiendra le lien vers la liste yahoo */
  | 
        
        
            | 
            | 
           56 | 
           $liste_ext_res = '' ;
  | 
        
        
            | 
            | 
           57 | 
              | 
        
        
            | 
            | 
           58 | 
           $url_page_en_cours = $this->_url->getURL();
  | 
        
        
            | 
            | 
           59 | 
              | 
        
        
            | 
            | 
           60 | 
           $inscription_laius ='' ;
  | 
        
        
            | 
            | 
           61 | 
           $bouton_poster = '';
  | 
        
        
            | 
            | 
           62 | 
           $bouton_desinscription_liste = '';
  | 
        
        
            | 
            | 
           63 | 
              | 
        
        
            | 
            | 
           64 | 
           $loggue = $this->_auth->getAuth();
  | 
        
        
            | 
            | 
           65 | 
              | 
        
        
            | 
            | 
           66 | 
           // Un appel a papyrus pour modifier le titre de la page
  | 
        
        
            | 
            | 
           67 | 
           $GLOBALS['_PAPYRUS_']['rendu']['TITRE_PAGE'] = $projet->getTitre().' - '.PROJET_FORUM;
  | 
        
        
            | 
            | 
           68 | 
              | 
        
        
            | 
            | 
           69 | 
           include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
  | 
        
        
            | 
            | 
           70 | 
           $listes_ext = new liste_externe ($this->_db) ;
  | 
        
        
            | 
            | 
           71 | 
           $tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
  | 
        
        
            | 
            | 
           72 | 
              | 
        
        
            | 
            | 
           73 | 
           if (count ($tableau_liste) != 0) {
  | 
        
        
            | 
            | 
           74 | 
               //$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
  | 
        
        
            | 
            | 
           75 | 
               for ($i = 0; $i < count ($tableau_liste); $i++) {
  | 
        
        
            | 
            | 
           76 | 
                   $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
  | 
        
        
            | 
            | 
           77 | 
                   $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
  | 
        
        
            | 
            | 
           78 | 
                   $liste_ext_res .= '<br />'."\n" ;
  | 
        
        
            | 
            | 
           79 | 
               }
  | 
        
        
            | 
            | 
           80 | 
               $avoir_liste_externe = true;
  | 
        
        
            | 
            | 
           81 | 
               $adresse_envoie = $info_liste->AGO_A_MAILSEND;
  | 
        
        
            | 
            | 
           82 | 
               $adresse_inscription = $info_liste->AGO_A_MAILABO;
  | 
        
        
            | 
            | 
           83 | 
           } else {
  | 
        
        
            | 
            | 
           84 | 
           	$avoir_liste_externe = false;
  | 
        
        
            | 
            | 
           85 | 
           }
  | 
        
        
            | 
            | 
           86 | 
              | 
        
        
            | 
            | 
           87 | 
              | 
        
        
            | 
            | 
           88 | 
           $this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
  | 
        
        
            | 
            | 
           89 | 
           if ($projet->avoirListe()) {
  | 
        
        
            | 
            | 
           90 | 
               foreach ($projet->_listes_associes as $info_liste) {
  | 
        
        
            | 
            | 
           91 | 
                   ob_start() ;
  | 
        
        
            | 
            | 
           92 | 
                   $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
  | 
        
        
            | 
            | 
           93 | 
                   if ($this->_auth->getAuth()) {
  | 
        
        
            | 
            | 
           94 | 
                       $participant = new participe($this->_db) ;
  | 
        
        
            | 
            | 
           95 | 
                        $droits = $participant->getStatut($id_u, $this->_id_projet);
  | 
        
        
            | 
            | 
           96 | 
                   } else {
  | 
        
        
            | 
            | 
           97 | 
                       $droits = PROJET_DROIT_AUCUN;
  | 
        
        
            | 
            | 
           98 | 
                       $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
  | 
        
        
            | 
            | 
           99 | 
               		$lien_inscription = 'javascript:animatedcollapse.toggle(\'projet_bloc_inscription\');';
  | 
        
        
            | 
            | 
           100 | 
           			$label_url_inscription = 'S\'inscrire à ce projet';
  | 
        
        
            | 
            | 
           101 | 
           			GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
  | 
        
        
            | 
            | 
           102 | 
           			GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
  | 
        
        
            | 
            | 
           103 | 
           			GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
  | 
        
        
            | 
            | 
           104 | 
           					'animatedcollapse.init();' ."\n");
  | 
        
        
            | 
            | 
           105 | 
                   }
  | 
        
        
            | 
            | 
           106 | 
                   switch ($droits) {
  | 
        
        
            | 
            | 
           107 | 
                   	case PROJET_DROIT_AUCUN :
  | 
        
        
            | 
            | 
           108 | 
           	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_S_INSCRIRE);
  | 
        
        
            | 
            | 
           109 | 
           	    		$lien_inscription = $this->_url->getURL();
  | 
        
        
            | 
            | 
           110 | 
           	    		$label_url_inscription = 'S\'inscrire à ce projet';
  | 
        
        
            | 
            | 
           111 | 
           				GEN_stockerFichierScript('jquery', 'api/js/jquery/jquery.js');
  | 
        
        
            | 
            | 
           112 | 
           				GEN_stockerFichierScript('animatedcollapse', 'api/js/jquery/animatedcollapse.js');
  | 
        
        
            | 
            | 
           113 | 
           				GEN_stockerCodeScript('animatedcollapse.addDiv(\'projet_bloc_inscription\', \'fade=1, height="100px"\');' ."\n".
  | 
        
        
            | 
            | 
           114 | 
           						'animatedcollapse.init();' ."\n");
  | 
        
        
            | 
            | 
           115 | 
           	    	break;
  | 
        
        
            | 
            | 
           116 | 
                   }
  | 
        
        
            | 
            | 
           117 | 
                   // gestion de l'inscription desinscription a la liste
  | 
        
        
            | 
            | 
           118 | 
                   // TODO : la gestion de linscription au resume
  | 
        
        
            | 
            | 
           119 | 
                   $inscription_liste = new inscription_liste($this->_db) ;
  | 
        
        
            | 
            | 
           120 | 
                   $statut = $inscription_liste->getStatutInscrit( $info_liste->getId(),  $this->_auth ) ;
  | 
        
        
            | 
            | 
           121 | 
                   if ($this->_auth->getAuth() && isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
  | 
        
        
            | 
            | 
           122 | 
           	        if ($statut == 2) {
  | 
        
        
            | 
            | 
           123 | 
           	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
  | 
        
        
            | 
            | 
           124 | 
           	        	$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
  | 
        
        
            | 
            | 
           125 | 
           	        	$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE_LISTE.'</a>'."\n" ;
  | 
        
        
            | 
            | 
           126 | 
           	        } else {
  | 
        
        
            | 
            | 
           127 | 
           	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
  | 
        
        
            | 
            | 
           128 | 
           	        	$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
  | 
        
        
            | 
            | 
           129 | 
           	        	$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>'."\n" ;
  | 
        
        
            | 
            | 
           130 | 
           	        }
  | 
        
        
            | 
            | 
           131 | 
                   }
  | 
        
        
            | 
            | 
           132 | 
                   if ($inscription_liste->getStatutInscrit($info_liste->getId(),  $this->_auth) == 0) {
  | 
        
        
            | 
            | 
           133 | 
           	        $action_inscription = PROJET_ACTION_INSCRIPTION_LISTE ;
  | 
        
        
            | 
            | 
           134 | 
           	        $label_inscription = 'S\'inscrire à la liste' ;
  | 
        
        
            | 
            | 
           135 | 
           	    } else {
  | 
        
        
            | 
            | 
           136 | 
           	        // L'action envoyer un mail
  | 
        
        
            | 
            | 
           137 | 
           	        $action_inscription = PROJET_ENVOYER_UN_MAIL ;
  | 
        
        
            | 
            | 
           138 | 
           	        $label_inscription = PROJET_ECRIRE_LISTE ;
  | 
        
        
            | 
            | 
           139 | 
           	        $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
  | 
        
        
            | 
            | 
           140 | 
           	        $bouton_desinscription_liste = bouton::toHTML($this->_url->getURL(), 'Se désinscrire de la liste','cross');
  | 
        
        
            | 
            | 
           141 | 
           	    }
  | 
        
        
            | 
            | 
           142 | 
              | 
        
        
            | 
            | 
           143 | 
                   if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
  | 
        
        
            | 
            | 
           144 | 
                       include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
  | 
        
        
            | 
            | 
           145 | 
                       $liste = new ezmlm_php() ;
  | 
        
        
            | 
            | 
           146 | 
                       // Parametrage de la liste
  | 
        
        
            | 
            | 
           147 | 
              | 
        
        
            | 
            | 
           148 | 
                       $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
  | 
        
        
            | 
            | 
           149 | 
                       $liste->listname = $info_liste->getNom() ;
  | 
        
        
            | 
            | 
           150 | 
                       $liste->listdomain = $info_liste->getDomaine();
  | 
        
        
            | 
            | 
           151 | 
              | 
        
        
            | 
            | 
           152 | 
                       if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
  | 
        
        
            | 
            | 
           153 | 
                           $liste->set_action($GLOBALS['action']) ;
  | 
        
        
            | 
            | 
           154 | 
                           $liste->set_actionargs($GLOBALS['actionargs']) ;
  | 
        
        
            | 
            | 
           155 | 
                       } else {
  | 
        
        
            | 
            | 
           156 | 
                           $liste->set_action('list_info') ;
  | 
        
        
            | 
            | 
           157 | 
                       }
  | 
        
        
            | 
            | 
           158 | 
                       $liste->sendheaders	= false;
  | 
        
        
            | 
            | 
           159 | 
                       $liste->sendbody        = false;
  | 
        
        
            | 
            | 
           160 | 
                       $liste->sendfooters    = false;
  | 
        
        
            | 
            | 
           161 | 
                       $liste->forcehref = $this->_url->getURL() ;
  | 
        
        
            | 
            | 
           162 | 
              | 
        
        
            | 
            | 
           163 | 
                       if (!$avoir_liste_externe) {
  | 
        
        
            | 
            | 
           164 | 
                       	$adresse_envoie = $info_liste->getAdresseEnvoi();
  | 
        
        
            | 
            | 
           165 | 
                       }
  | 
        
        
            | 
            | 
           166 | 
                       print '<a href="mailto:'.$adresse_envoie.'">' . $adresse_envoie ;
  | 
        
        
            | 
            | 
           167 | 
                       print "</a><br />\n";
  | 
        
        
            | 
            | 
           168 | 
                       $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $action_inscription);
  | 
        
        
            | 
            | 
           169 | 
                       $bouton_poster = bouton::toHTML($this->_url->getURL(), $label_inscription,'ecrire');
  | 
        
        
            | 
            | 
           170 | 
                       if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum))
  | 
        
        
            | 
            | 
           171 | 
                       		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
  | 
        
        
            | 
            | 
           172 | 
              | 
        
        
            | 
            | 
           173 | 
                       print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
  | 
        
        
            | 
            | 
           174 | 
                       $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
  | 
        
        
            | 
            | 
           175 | 
              | 
        
        
            | 
            | 
           176 | 
                       if ($liste->action != 'show_message') {
  | 
        
        
            | 
            | 
           177 | 
           	            $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
  | 
        
        
            | 
            | 
           178 | 
           	            									$info_liste->getNom(), $GLOBALS['lang'],
  | 
        
        
            | 
            | 
           179 | 
           	            									$this->_url->getURL()) ;
  | 
        
        
            | 
            | 
           180 | 
           				$xml_parser->load();
  | 
        
        
            | 
            | 
           181 | 
           				ob_start();
  | 
        
        
            | 
            | 
           182 | 
           				$resultat = $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           183 | 
           				$calendrier = ob_get_contents();
  | 
        
        
            | 
            | 
           184 | 
           				ob_end_clean();
  | 
        
        
            | 
            | 
           185 | 
           				$xml_parser->reset();
  | 
        
        
            | 
            | 
           186 | 
              | 
        
        
            | 
            | 
           187 | 
                       }
  | 
        
        
            | 
            | 
           188 | 
                       //$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
  | 
        
        
            | 
            | 
           189 | 
              | 
        
        
            | 
            | 
           190 | 
                       // On teste si l'on vient d'une reponse a un email, si oui
  | 
        
        
            | 
            | 
           191 | 
                       // on modifie $liste->action pour renvoyer le message auquelon vient de repondre
  | 
        
        
            | 
            | 
           192 | 
                       if (isset($_POST['messageid'])) {
  | 
        
        
            | 
            | 
           193 | 
                           $liste->action = 'show_msg' ;
  | 
        
        
            | 
            | 
           194 | 
                       }
  | 
        
        
            | 
            | 
           195 | 
                       switch ($liste->action) {
  | 
        
        
            | 
            | 
           196 | 
                           case "show_msg":
  | 
        
        
            | 
            | 
           197 | 
                               if (count($liste->actionargs) < 2) {
  | 
        
        
            | 
            | 
           198 | 
                                   $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
  | 
        
        
            | 
            | 
           199 | 
                               }
  | 
        
        
            | 
            | 
           200 | 
              | 
        
        
            | 
            | 
           201 | 
              | 
        
        
            | 
            | 
           202 | 
                               // actionargs[0] contient le nom du repertoire et actionargs[1] le nom du fichier
  | 
        
        
            | 
            | 
           203 | 
                               // On appelle la fonction qui affiche un fichier
  | 
        
        
            | 
            | 
           204 | 
           					$xml_parser->setAction ('message');
  | 
        
        
            | 
            | 
           205 | 
                               $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
  | 
        
        
            | 
            | 
           206 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           207 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           208 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           209 | 
                               $mail = ob_get_contents() ;
  | 
        
        
            | 
            | 
           210 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           211 | 
              | 
        
        
            | 
            | 
           212 | 
                               $mimeDecode = new Mail_mimeDecode($mail) ;
  | 
        
        
            | 
            | 
           213 | 
                   			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true',
  | 
        
        
            | 
            | 
           214 | 
           												'include_bodies' => 'true')) ;
  | 
        
        
            | 
            | 
           215 | 
           					$message = new ezmlm_msgdisplay() ;
  | 
        
        
            | 
            | 
           216 | 
           					$message->listname = $info_liste->getNom();
  | 
        
        
            | 
            | 
           217 | 
              | 
        
        
            | 
            | 
           218 | 
           					$numero_message = $xml_parser->getNumeroMessage();
  | 
        
        
            | 
            | 
           219 | 
                   			$total_message = $xml_parser->getNombreTotalMessage();
  | 
        
        
            | 
            | 
           220 | 
              | 
        
        
            | 
            | 
           221 | 
           					$this->_url->addQueryString ('action', 'show_msg');
  | 
        
        
            | 
            | 
           222 | 
              | 
        
        
            | 
            | 
           223 | 
           					ob_start();
  | 
        
        
            | 
            | 
           224 | 
           					if ($xml_parser->getNumeroFichierPrecedent() != 0) {
  | 
        
        
            | 
            | 
           225 | 
           			            $lien_precedent = $this->_url->getURL(). '&actionargs[]='.
  | 
        
        
            | 
            | 
           226 | 
           			            		$xml_parser->getNumeroRepertoirePrecedent().'&actionargs[]='.
  | 
        
        
            | 
            | 
           227 | 
           			            		$xml_parser->getNumeroFichierPrecedent();
  | 
        
        
            | 
            | 
           228 | 
           			            $bouton_precedent = bouton::toHTML($lien_precedent, PROJET_PRECEDENT, 'gauche', 'projet_bouton_inline');
  | 
        
        
            | 
            | 
           229 | 
           			            $navigation = $bouton_precedent;
  | 
        
        
            | 
            | 
           230 | 
           			        }
  | 
        
        
            | 
            | 
           231 | 
              | 
        
        
            | 
            | 
           232 | 
           			        if ($xml_parser->getNumeroFichierSuivant() != '' && (int) $numero_message < (int) $total_message) {
  | 
        
        
            | 
            | 
           233 | 
           			            $lien_suivant = $this->_url->getURL(). '&actionargs[]='.
  | 
        
        
            | 
            | 
           234 | 
           			            		$xml_parser->getNumeroRepertoireSuivant().'&actionargs[]='.
  | 
        
        
            | 
            | 
           235 | 
           			            		$xml_parser->getNumeroFichierSuivant();
  | 
        
        
            | 
            | 
           236 | 
           			            $bouton_suivant = bouton::toHTML($lien_suivant ,PROJET_SUIVANT, 'droite', 'projet_bouton_inline');
  | 
        
        
            | 
            | 
           237 | 
           			            $navigation .= $bouton_suivant;
  | 
        
        
            | 
            | 
           238 | 
           			        }
  | 
        
        
            | 
            | 
           239 | 
                   			$this->_url->addQueryString ('action', 'repondre');
  | 
        
        
            | 
            | 
           240 | 
                   			$bouton_repondre = bouton::toHTML($this->_url->getURL().'&actionargs[]='.$liste->actionargs[0].
  | 
        
        
            | 
            | 
           241 | 
           							'&actionargs[]='.$liste->actionargs[1], PROJET_REPONDRE, 'repondre', 'projet_bouton_inline');
  | 
        
        
            | 
            | 
           242 | 
                   			$this->_url->removeQueryString('action');
  | 
        
        
            | 
            | 
           243 | 
                   			/*
  | 
        
        
            | 
            | 
           244 | 
           						Un bouton pour revenir a la liste des messages
  | 
        
        
            | 
            | 
           245 | 
           					*/
  | 
        
        
            | 
            | 
           246 | 
              | 
        
        
            | 
            | 
           247 | 
           					$navigation .= bouton::toHTML($this->_url->getURL() ,'retour', 'haut', 'projet_bouton_inline');
  | 
        
        
            | 
            | 
           248 | 
           					if (!$avoir_liste_externe && $droits <= PROJET_DROIT_CONTRIBUTEUR) $navigation .= $bouton_repondre;
  | 
        
        
            | 
            | 
           249 | 
           					if ($droits == PROJET_DROIT_COORDINATEUR || $droits == PROJET_DROIT_ADMINISTRATEUR) {
  | 
        
        
            | 
            | 
           250 | 
           						$this->_url->addQueryString ('action', 'supprimer');
  | 
        
        
            | 
            | 
           251 | 
              | 
        
        
            | 
            | 
           252 | 
           						$bouton_suppression_message = bouton::toHTML($this->_url->getURL().'&actionargs[]='.$liste->actionargs[0].
  | 
        
        
            | 
            | 
           253 | 
           							'&actionargs[]='.$liste->actionargs[1], 'Supprimer', 'cross', 'projet_bouton_inline');
  | 
        
        
            | 
            | 
           254 | 
           						$navigation .= $bouton_suppression_message;
  | 
        
        
            | 
            | 
           255 | 
           					}
  | 
        
        
            | 
            | 
           256 | 
           					$this->_url->removeQueryString ('action');
  | 
        
        
            | 
            | 
           257 | 
           					print '<div class="message">' ;
  | 
        
        
            | 
            | 
           258 | 
                               print $message->parse_entete_mail($mailDecode) ;
  | 
        
        
            | 
            | 
           259 | 
                   	        $message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
  | 
        
        
            | 
            | 
           260 | 
                  				print $message->message_rendu;
  | 
        
        
            | 
            | 
           261 | 
                  				print '</div>' ;
  | 
        
        
            | 
            | 
           262 | 
                  				$message = ob_get_contents();
  | 
        
        
            | 
            | 
           263 | 
                  				ob_end_clean();
  | 
        
        
            | 
            | 
           264 | 
              | 
        
        
            | 
            | 
           265 | 
                               break;
  | 
        
        
            | 
            | 
           266 | 
              | 
        
        
            | 
            | 
           267 | 
                           case "list_info":
  | 
        
        
            | 
            | 
           268 | 
                               $xml_parser->reset() ;
  | 
        
        
            | 
            | 
           269 | 
           					$xml_parser->setAction ('derniers_messages');
  | 
        
        
            | 
            | 
           270 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           271 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           272 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           273 | 
                               $derniers_messages = ob_get_contents() ;
  | 
        
        
            | 
            | 
           274 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           275 | 
              | 
        
        
            | 
            | 
           276 | 
              | 
        
        
            | 
            | 
           277 | 
                               break;
  | 
        
        
            | 
            | 
           278 | 
                           case "show_threads":
  | 
        
        
            | 
            | 
           279 | 
                               $xml_parser->reset() ;
  | 
        
        
            | 
            | 
           280 | 
           					$xml_parser->setAction ('messages_thread');
  | 
        
        
            | 
            | 
           281 | 
           					$xml_parser->setMois($liste->actionargs[0]);
  | 
        
        
            | 
            | 
           282 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           283 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           284 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           285 | 
                               $messages_thread = ob_get_contents() ;
  | 
        
        
            | 
            | 
           286 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           287 | 
                               $message = $messages_thread ;
  | 
        
        
            | 
            | 
           288 | 
                               break;
  | 
        
        
            | 
            | 
           289 | 
                           case "show_author_msgs" :
  | 
        
        
            | 
            | 
           290 | 
                               $xml_parser->reset() ;
  | 
        
        
            | 
            | 
           291 | 
           					$xml_parser->setAction ('messages_auteur');
  | 
        
        
            | 
            | 
           292 | 
           					$xml_parser->setHashAuteur($liste->actionargs[0]);
  | 
        
        
            | 
            | 
           293 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           294 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           295 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           296 | 
                               $messages_auteur = ob_get_contents() ;
  | 
        
        
            | 
            | 
           297 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           298 | 
                               $message = $messages_auteur ;
  | 
        
        
            | 
            | 
           299 | 
                               break;
  | 
        
        
            | 
            | 
           300 | 
                           case 'show_month' :
  | 
        
        
            | 
            | 
           301 | 
                           	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, 'forums');
  | 
        
        
            | 
            | 
           302 | 
                           	$this->_url->addQueryString('action', 'show_threads');
  | 
        
        
            | 
            | 
           303 | 
                           	$this->_url->addQueryString('actionargs[]', $liste->actionargs[0]);
  | 
        
        
            | 
            | 
           304 | 
                           	$message = '[<a href="'.$this->_url->getURL().'">par fil de discussion</a>]';
  | 
        
        
            | 
            | 
           305 | 
              | 
        
        
            | 
            | 
           306 | 
                               $xml_parser->reset() ;
  | 
        
        
            | 
            | 
           307 | 
           					$xml_parser->setAction ('messages_mois');
  | 
        
        
            | 
            | 
           308 | 
           					$xml_parser->setMois($liste->actionargs[0]);
  | 
        
        
            | 
            | 
           309 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           310 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           311 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           312 | 
                               $messages_mois = ob_get_contents() ;
  | 
        
        
            | 
            | 
           313 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           314 | 
                               $message .= $messages_mois ;
  | 
        
        
            | 
            | 
           315 | 
                           break;
  | 
        
        
            | 
            | 
           316 | 
                           case 'repondre' :
  | 
        
        
            | 
            | 
           317 | 
                               if (count($liste->actionargs) < 2) {
  | 
        
        
            | 
            | 
           318 | 
                                   $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
  | 
        
        
            | 
            | 
           319 | 
                               }
  | 
        
        
            | 
            | 
           320 | 
                               $xml_parser->setAction ('message');
  | 
        
        
            | 
            | 
           321 | 
                               $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
  | 
        
        
            | 
            | 
           322 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           323 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           324 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           325 | 
                               $message = ob_get_contents() ;
  | 
        
        
            | 
            | 
           326 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           327 | 
                   			$mimeDecode = new Mail_mimeDecode($message) ;
  | 
        
        
            | 
            | 
           328 | 
                   			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
  | 
        
        
            | 
            | 
           329 | 
              | 
        
        
            | 
            | 
           330 | 
           					if (isset($_SESSION['formulaire_mail'])) {
  | 
        
        
            | 
            | 
           331 | 
                       			unset ($_SESSION['formulaire_mail']) ;
  | 
        
        
            | 
            | 
           332 | 
                   			}
  | 
        
        
            | 
            | 
           333 | 
              | 
        
        
            | 
            | 
           334 | 
           			        $formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post',
  | 
        
        
            | 
            | 
           335 | 
           										str_replace('&', '&', $this->_url->getURL()).
  | 
        
        
            | 
            | 
           336 | 
           										'&action='.PROJET_ENVOYER_UN_MAIL_V.
  | 
        
        
            | 
            | 
           337 | 
                                                   '&actionargs[]='.$liste->actionargs[0].
  | 
        
        
            | 
            | 
           338 | 
           										'&actionargs[]='.$liste->actionargs[1].
  | 
        
        
            | 
            | 
           339 | 
           										'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
  | 
        
        
            | 
            | 
           340 | 
           			        $formulaireReponse->construitFormulaire() ;
  | 
        
        
            | 
            | 
           341 | 
              | 
        
        
            | 
            | 
           342 | 
           					$repondre = new ezmlm_repondre();
  | 
        
        
            | 
            | 
           343 | 
                               $repondre->listdir = $liste->listdir ;
  | 
        
        
            | 
            | 
           344 | 
                               $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
  | 
        
        
            | 
            | 
           345 | 
                               $repondre->forcehref = $this->_url->getURL();
  | 
        
        
            | 
            | 
           346 | 
                               $repondre->listname = $info_liste->getNom() ;
  | 
        
        
            | 
            | 
           347 | 
                               // actionargs[0] contient le nom du r�pertoire et actionargs[1] le nom du fichier
  | 
        
        
            | 
            | 
           348 | 
                               // On appelle la fonction qui affiche un fichier
  | 
        
        
            | 
            | 
           349 | 
                               $message = '<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
  | 
        
        
            | 
            | 
           350 | 
                               $repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
  | 
        
        
            | 
            | 
           351 | 
              | 
        
        
            | 
            | 
           352 | 
                               $repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
  | 
        
        
            | 
            | 
           353 | 
           			        $formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
  | 
        
        
            | 
            | 
           354 | 
           			        // Ajout de > au d�but de chaque ligne du message
  | 
        
        
            | 
            | 
           355 | 
           			        $tableau = explode ("\n", $repondre->message_rendu) ;
  | 
        
        
            | 
            | 
           356 | 
           			        $repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
  | 
        
        
            | 
            | 
           357 | 
              | 
        
        
            | 
            | 
           358 | 
           			        $formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
  | 
        
        
            | 
            | 
           359 | 
           			                                              'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
  | 
        
        
            | 
            | 
           360 | 
              | 
        
        
            | 
            | 
           361 | 
           			        $message .= $formulaireReponse->toHTML() ;
  | 
        
        
            | 
            | 
           362 | 
              | 
        
        
            | 
            | 
           363 | 
                               break;
  | 
        
        
            | 
            | 
           364 | 
                           case 'supprimer' :
  | 
        
        
            | 
            | 
           365 | 
                               $xml_parser->reset() ;
  | 
        
        
            | 
            | 
           366 | 
           					$xml_parser->setAction ('supprimer');
  | 
        
        
            | 
            | 
           367 | 
           					$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
  | 
        
        
            | 
            | 
           368 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           369 | 
                               $message = '<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
  | 
        
        
            | 
            | 
           370 | 
                               $xml_parser->reset() ;
  | 
        
        
            | 
            | 
           371 | 
           					$xml_parser->setAction ('derniers_messages');
  | 
        
        
            | 
            | 
           372 | 
                               $xml_parser->load();
  | 
        
        
            | 
            | 
           373 | 
                               ob_start ();
  | 
        
        
            | 
            | 
           374 | 
                               $xml_parser->parse() ;
  | 
        
        
            | 
            | 
           375 | 
                               $message .= ob_get_contents() ;
  | 
        
        
            | 
            | 
           376 | 
                               ob_end_clean();
  | 
        
        
            | 
            | 
           377 | 
              | 
        
        
            | 
            | 
           378 | 
                           break;
  | 
        
        
            | 
            | 
           379 | 
                       }
  | 
        
        
            | 
            | 
           380 | 
              | 
        
        
            | 
            | 
           381 | 
                   } else {
  | 
        
        
            | 
            | 
           382 | 
                       $message = PROJET_MESSAGE_LISTE_PRIVEE ;
  | 
        
        
            | 
            | 
           383 | 
                   }
  | 
        
        
            | 
            | 
           384 | 
                   ob_end_clean() ;
  | 
        
        
            | 
            | 
           385 | 
               }
  | 
        
        
            | 
            | 
           386 | 
           }
  | 
        
        
            | 
            | 
           387 | 
              | 
        
        
            | 
            | 
           388 | 
              | 
        
        
            | 
            | 
           389 | 
           if ($liste->action == 'show_msg') $squelette = 'message'; else $squelette = 'forum';
  | 
        
        
            | 
            | 
           390 | 
           ob_start();
  | 
        
        
            | 
            | 
           391 | 
           include_once PROJET_CHEMIN_APPLI.'/squelettes/'.$squelette.'.tpl.html';
  | 
        
        
            | 
            | 
           392 | 
           $retour .= ob_get_contents();
  | 
        
        
            | 
            | 
           393 | 
           ob_end_clean();
  | 
        
        
            | 
            | 
           394 | 
              | 
        
        
            | 
            | 
           395 | 
              | 
        
        
            | 
            | 
           396 | 
           $this->_url->removeQueryString ('actionargs');
  | 
        
        
            | 
            | 
           397 | 
           $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
  | 
        
        
            | 
            | 
           398 | 
           /* +--Fin du code ----------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           399 | 
           *
  | 
        
        
            | 
            | 
           400 | 
           * $Log: forums.php,v $
  | 
        
        
            | 
            | 
           401 | 
           * Revision 1.13  2008-08-25 15:02:49  alexandre_tb
  | 
        
        
            | 
            | 
           402 | 
           * mise en place des squelettes
  | 
        
        
            | 
            | 
           403 | 
           *
  | 
        
        
            | 
            | 
           404 | 
           *
  | 
        
        
            | 
            | 
           405 | 
           * +-- Fin du code ----------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           406 | 
           */
  | 
        
        
           | 2 | 
           ddelon | 
           407 | 
           ?>
  |