Subversion Repositories Applications.projet

Rev

Rev 208 | Rev 294 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 208 Rev 249
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU General Public                                                  |
9
// | modify it under the terms of the GNU General Public                                                  |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | General Public License for more details.                                                             |
16
// | General Public License for more details.                                                             |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
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                                  |
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                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: forums.php,v 1.11 2007-04-19 15:34:35 neiluj Exp $
22
// CVS : $Id: forums.php,v 1.12 2007-06-25 12:15:06 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Action forums
26
* Action forums
27
*
27
*
28
*@package projet
28
*@package projet
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2005
33
*@copyright     Tela-Botanica 2000-2005
34
*@version       $Revision: 1.11 $
34
*@version       $Revision: 1.12 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
42
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
43
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
43
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
44
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php') ;
44
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php') ;
45
include_once (PROJET_CHEMIN_CLASSES.'inscription_liste.class.php') ;
45
include_once (PROJET_CHEMIN_CLASSES.'inscription_liste.class.php') ;
46
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
46
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
47
// RAPPEL IMPORTANT
47
// RAPPEL IMPORTANT
48
// On se situe dans la méthode run() de la classe projetControleur
48
// On se situe dans la méthode run() de la classe projetControleur
49
//
49
//
50
 
50
 
51
 
51
 
52
// création de l'objet projet courant
52
// création de l'objet projet courant
53
$projet = new projet ($this->_db, $this->_id_projet) ;
53
$projet = new projet ($this->_db, $this->_id_projet) ;
54
 
54
 
55
$liste_ext_res = '' ;
55
$liste_ext_res = '' ;
56
$sortie_liste = '' ;
56
$sortie_liste = '' ;
57
$inscription_laius ='' ;
57
$inscription_laius ='' ;
58
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
58
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
59
if ($projet->avoirListe()) {
59
if ($projet->avoirListe()) {
60
    foreach ($projet->_listes_associes as $info_liste) {
60
    foreach ($projet->_listes_associes as $info_liste) {
61
        ob_start() ;
61
        ob_start() ;
62
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
62
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
63
        if ($this->_auth->getAuth()) {
63
        if ($this->_auth->getAuth()) {
64
            $participant = new participe($this->_db) ;
64
            $participant = new participe($this->_db) ;
65
            
65
            
66
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
66
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
67
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
67
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
68
            $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
68
            $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
69
            if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
69
            if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
70
            if ($isAdm) $isCoord = true ;
70
            if ($isAdm) $isCoord = true ;
71
        } else {
71
        } else {
72
            $droits = PROJET_DROIT_AUCUN;
72
            $droits = PROJET_DROIT_AUCUN;
73
        }
73
        }
74
        
74
        
75
        // gestion de l'inscription désinscription à la liste
75
        // gestion de l'inscription désinscription à la liste
76
        // TODO : la gestion de linscription au résumé
76
        // TODO : la gestion de linscription au résumé
77
        $inscription_liste = new inscription_liste($this->_db) ;
77
        $inscription_liste = new inscription_liste($this->_db) ;
78
        $statut = $inscription_liste->getStatutInscrit( $info_liste->getId(),  $this->_auth ) ;
78
        $statut = $inscription_liste->getStatutInscrit( $info_liste->getId(),  $this->_auth ) ;
79
        if ($this->_auth->getAuth() && isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
79
        if ($this->_auth->getAuth() && isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) {
80
	        if ($statut == 2) {
80
	        if ($statut == 2) {
81
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
81
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
82
	        	$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
82
	        	$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
83
	        	$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE_LISTE.'</a>'."\n" ;
83
	        	$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_SE_DESINSCRIRE_LISTE.'</a>'."\n" ;
84
	        } else {
84
	        } else {
85
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
85
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
86
	        	$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
86
	        	$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
87
	        	$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>'."\n" ;
87
	        	$inscription_laius .= '<a href="'.$this->_url->getURL().'">'.PROJET_S_INSCRIRE.'</a>'."\n" ;
88
	        }
88
	        }
89
        }
89
        }
90
        
90
        
91
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
91
        if ($info_liste->isPublic() || $droits <= PROJET_DROIT_CONTRIBUTEUR) {
92
            include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
92
            include_once PROJET_CHEMIN_CLASSES_LISTES.'ezmlm.php' ;
93
            $liste = new ezmlm_php() ;
93
            $liste = new ezmlm_php() ;
94
            // Paramétrage de la liste
94
            // Paramétrage de la liste
95
            
95
            
96
            $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
96
            $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
97
            $liste->listname = $info_liste->getNom() ;
97
            $liste->listname = $info_liste->getNom() ;
98
            $liste->listdomain = $info_liste->getDomaine();
98
            $liste->listdomain = $info_liste->getDomaine();
99
        
99
        
100
            if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
100
            if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
101
                $liste->set_action($GLOBALS['action']) ;
101
                $liste->set_action($GLOBALS['action']) ;
102
                $liste->set_actionargs($GLOBALS['actionargs']) ;
102
                $liste->set_actionargs($GLOBALS['actionargs']) ;
103
            } else {
103
            } else {
104
                $liste->set_action('list_info') ;
104
                $liste->set_action('list_info') ;
105
            }
105
            }
106
            $liste->sendheaders	= false;
106
            $liste->sendheaders	= false;
107
            $liste->sendbody        = false;
107
            $liste->sendbody        = false;
108
            $liste->sendfooters    = false;
108
            $liste->sendfooters    = false;
109
            $liste->forcehref = $this->_url->getURL() ;
109
            $liste->forcehref = $this->_url->getURL() ;
110
            
110
            
111
            
111
            
112
            print '<a href="mailto:'.$info_liste->getAdresseEnvoi().'">' . $info_liste->getAdresseEnvoi() ;
112
            print '<a href="mailto:'.$info_liste->getAdresseEnvoi().'">' . $info_liste->getAdresseEnvoi() ;
113
            print "</a><br />\n";
113
            print "</a><br />\n";
114
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL);
114
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL);
115
            if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) 
115
            if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) 
116
            		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
116
            		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
117
            
117
            
118
            print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
118
            print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
119
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
119
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
120
            
120
            
121
            $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
121
            $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
122
            									$info_liste->getNom(), $GLOBALS['lang'], 
122
            									$info_liste->getNom(), $GLOBALS['lang'], 
123
            									$this->_url->getURL()) ;
123
            									$this->_url->getURL()) ;
124
			$xml_parser->load();
124
			$xml_parser->load();
125
			$resultat = $xml_parser->parse() ;
125
			$resultat = $xml_parser->parse() ;
126
			$xml_parser->reset();
126
			$xml_parser->reset();
127
          
127
          
128
            //$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
128
            //$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
129
            
129
            
130
            // On teste si l'on vient d'une réponse à un email, si oui
130
            // On teste si l'on vient d'une réponse à un email, si oui
131
            // on modifie $liste->action pour renvoyer le message auquelon vient de répondre
131
            // on modifie $liste->action pour renvoyer le message auquelon vient de répondre
132
            if (isset($_POST['messageid'])) {
132
            if (isset($_POST['messageid'])) {
133
                $liste->action = 'show_msg' ;
133
                $liste->action = 'show_msg' ;
134
            }
134
            }
135
            switch ($liste->action) {
135
            switch ($liste->action) {
136
                case "show_msg":
136
                case "show_msg":
137
                    if (count($liste->actionargs) < 2) {
137
                    if (count($liste->actionargs) < 2) {
138
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
138
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
139
                    }
139
                    }
140
                    
140
                    
141
                    // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
141
                    // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
142
                    // On appelle la fonction qui affiche un fichier
142
                    // On appelle la fonction qui affiche un fichier
143
					$xml_parser->setAction ('message');
143
					$xml_parser->setAction ('message');
144
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
144
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
145
                    $xml_parser->load();
145
                    $xml_parser->load();
146
                    ob_start ();
146
                    ob_start ();
147
                    $xml_parser->parse() ;
147
                    $xml_parser->parse() ;
148
                    $mail = ob_get_contents() ;
148
                    $mail = ob_get_contents() ;
149
                    ob_end_clean();
149
                    ob_end_clean();
150
                    
150
                    
151
                    $mimeDecode = new Mail_mimeDecode($mail) ;
151
                    $mimeDecode = new Mail_mimeDecode($mail) ;
152
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 
152
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 
153
												'include_bodies' => 'true')) ;
153
												'include_bodies' => 'true')) ;
154
					$message = new ezmlm_msgdisplay() ;
154
					$message = new ezmlm_msgdisplay() ;
155
					$message->listname = $info_liste->getNom();
155
					$message->listname = $info_liste->getNom();
156
					$this->_url->addQueryString ('action', 'show_msg');
156
					$this->_url->addQueryString ('action', 'show_msg');
157
					if ($xml_parser->getNumeroFichierPrecedent() != '') {
157
					if ($xml_parser->getNumeroFichierPrecedent() != '') {
158
			            print '[<a href="' . $this->_url->getURL(). '&amp;actionargs[]='.
158
			            print '[<a href="' . $this->_url->getURL(). '&amp;actionargs[]='.
159
			            		$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
159
			            		$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
160
			            		$xml_parser->getNumeroFichierPrecedent().
160
			            		$xml_parser->getNumeroFichierPrecedent().
161
								'">'.PROJET_PRECEDENT.'</a>]';
161
								'">'.PROJET_PRECEDENT.'</a>]';
162
			        } else {
162
			        } else {
163
			            print '['.PROJET_PRECEDENT.']' ;
163
			            print '['.PROJET_PRECEDENT.']' ;
164
			        }
164
			        }
165
			        if ($xml_parser->getNumeroFichierSuivant() != '') {
165
			        if ($xml_parser->getNumeroFichierSuivant() != '') {
166
			            print '[<a href="' .$this->_url->getURL().'&amp;actionargs[]='.$xml_parser->getNumeroRepertoireSuivant()
166
			            print '[<a href="' .$this->_url->getURL().'&amp;actionargs[]='.$xml_parser->getNumeroRepertoireSuivant()
167
			            		.'&amp;actionargs[]='.$xml_parser->getNumeroFichierSuivant().'">'.PROJET_SUIVANT. '</a>]';
167
			            		.'&amp;actionargs[]='.$xml_parser->getNumeroFichierSuivant().'">'.PROJET_SUIVANT. '</a>]';
168
			        } else {
168
			        } else {
169
			            print '['.PROJET_SUIVANT.']' ;
169
			            print '['.PROJET_SUIVANT.']' ;
170
        			}
170
        			}
171
        			$this->_url->addQueryString ('action', 'repondre');
171
        			$this->_url->addQueryString ('action', 'repondre');
172
					print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
172
					print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
173
							'&amp;actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
173
							'&amp;actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
174
					if ($isCoord) {
174
					if ($isCoord) {
175
						$this->_url->addQueryString ('action', 'supprimer');
175
						$this->_url->addQueryString ('action', 'supprimer');
176
						print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
176
						print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
177
							'&amp;actionargs[]='.$liste->actionargs[1].'" onclick="javascript:return confirm(\''.PROJET_SUPPRIMER.' ?\');">'.
177
							'&amp;actionargs[]='.$liste->actionargs[1].'" onclick="javascript:return confirm(\''.PROJET_SUPPRIMER.' ?\');">'.
178
							PROJET_SUPPRIMER.'</a>]';
178
							PROJET_SUPPRIMER.'</a>]';
179
					}
179
					}
180
					print '<div class="message">' ;
180
					print '<div class="message">' ;
181
                    print $message->parse_entete_mail($mailDecode) ;
181
                    print $message->parse_entete_mail($mailDecode) ;
182
        	        $message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
182
        	        $message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
183
       				print $message->message_rendu;
183
       				print $message->message_rendu;
184
       				print '</div>' ;
184
       				print '</div>' ;
185
       				
185
       				
186
                    break;
186
                    break;
187
                    
187
                    
188
                case "list_info":
188
                case "list_info":
189
     
189
     
190
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
190
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
191
                    $xml_parser->reset() ;
191
                    $xml_parser->reset() ;
192
					$xml_parser->setAction ('derniers_messages');
192
					$xml_parser->setAction ('derniers_messages');
193
                    $xml_parser->load();
193
                    $xml_parser->load();
194
                    ob_start ();
194
                    ob_start ();
195
                    $xml_parser->parse() ;
195
                    $xml_parser->parse() ;
196
                    $derniers_messages = ob_get_contents() ;
196
                    $derniers_messages = ob_get_contents() ;
197
                    ob_end_clean();
197
                    ob_end_clean();
198
                    echo $derniers_messages ;
198
                    echo $derniers_messages ;
199
                    
199
                    
200
                    break;
200
                    break;
201
                case "show_threads":
201
                case "show_threads":
202
                    $xml_parser->reset() ;
202
                    $xml_parser->reset() ;
203
					$xml_parser->setAction ('messages_thread');
203
					$xml_parser->setAction ('messages_thread');
204
					$xml_parser->setMois($liste->actionargs[0]);
204
					$xml_parser->setMois($liste->actionargs[0]);
205
                    $xml_parser->load();
205
                    $xml_parser->load();
206
                    ob_start ();
206
                    ob_start ();
207
                    $xml_parser->parse() ;
207
                    $xml_parser->parse() ;
208
                    $messages_thread = ob_get_contents() ;
208
                    $messages_thread = ob_get_contents() ;
209
                    ob_end_clean();
209
                    ob_end_clean();
210
                    echo $messages_thread ;
210
                    echo $messages_thread ;
211
                    break;
211
                    break;
212
                case "show_author_msgs" :
212
                case "show_author_msgs" :
213
                    $xml_parser->reset() ;
213
                    $xml_parser->reset() ;
214
					$xml_parser->setAction ('messages_auteur');
214
					$xml_parser->setAction ('messages_auteur');
215
					$xml_parser->setHashAuteur($liste->actionargs[0]);
215
					$xml_parser->setHashAuteur($liste->actionargs[0]);
216
                    $xml_parser->load();
216
                    $xml_parser->load();
217
                    ob_start ();
217
                    ob_start ();
218
                    $xml_parser->parse() ;
218
                    $xml_parser->parse() ;
219
                    $messages_auteur = ob_get_contents() ;
219
                    $messages_auteur = ob_get_contents() ;
220
                    ob_end_clean();
220
                    ob_end_clean();
221
                    echo $messages_auteur ;
221
                    echo $messages_auteur ;
222
                    break;
222
                    break;
223
                case 'show_month' :
223
                case 'show_month' :
224
                	echo '[ '.$liste->makelink(PROJET_VARIABLE_ACTION.'=forums&amp;action=show_threads&amp;actionargs[]='.
224
                	echo '[ '.$liste->makelink(PROJET_VARIABLE_ACTION.'=forums&amp;action=show_threads&amp;actionargs[]='.
225
                			$liste->actionargs[0], 'par fil de discussion').' ]' ;
225
                			$liste->actionargs[0], 'par fil de discussion').' ]' ;
226
                    $xml_parser->reset() ;
226
                    $xml_parser->reset() ;
227
					$xml_parser->setAction ('messages_mois');
227
					$xml_parser->setAction ('messages_mois');
228
					$xml_parser->setMois($liste->actionargs[0]);
228
					$xml_parser->setMois($liste->actionargs[0]);
229
                    $xml_parser->load();
229
                    $xml_parser->load();
230
                    ob_start ();
230
                    ob_start ();
231
                    $xml_parser->parse() ;
231
                    $xml_parser->parse() ;
232
                    $messages_mois = ob_get_contents() ;
232
                    $messages_mois = ob_get_contents() ;
233
                    ob_end_clean();
233
                    ob_end_clean();
234
                    echo $messages_mois ;
234
                    echo $messages_mois ;
235
                break;
235
                break;
236
                case 'repondre' :
236
                case 'repondre' :
237
                    if (count($liste->actionargs) < 2) {
237
                    if (count($liste->actionargs) < 2) {
238
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
238
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
239
                    }
239
                    }
240
                    $xml_parser->setAction ('message');
240
                    $xml_parser->setAction ('message');
241
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
241
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
242
                    $xml_parser->load();
242
                    $xml_parser->load();
243
                    ob_start ();
243
                    ob_start ();
244
                    $xml_parser->parse() ;
244
                    $xml_parser->parse() ;
245
                    $message = ob_get_contents() ;
245
                    $message = ob_get_contents() ;
246
                    ob_end_clean();
246
                    ob_end_clean();
247
        			$mimeDecode = new Mail_mimeDecode($message) ;
247
        			$mimeDecode = new Mail_mimeDecode($message) ;
248
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
248
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
249
					
249
					
250
					if (isset($_SESSION['formulaire_mail'])) {
250
					if (isset($_SESSION['formulaire_mail'])) {
251
            			unset ($_SESSION['formulaire_mail']) ;
251
            			unset ($_SESSION['formulaire_mail']) ;
252
        			}
252
        			}
253
        
253
        
254
			        $formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post', 
254
			        $formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post', 
255
										str_replace('&amp;', '&', $this->_url->getURL()).
255
										str_replace('&amp;', '&', $this->_url->getURL()).
256
										'&action='.PROJET_ENVOYER_UN_MAIL_V.
256
										'&action='.PROJET_ENVOYER_UN_MAIL_V.
257
                                        '&actionargs[]='.$liste->actionargs[0].
257
                                        '&actionargs[]='.$liste->actionargs[0].
258
										'&actionargs[]='.$liste->actionargs[1].
258
										'&actionargs[]='.$liste->actionargs[1].
259
										'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
259
										'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
260
			        $formulaireReponse->construitFormulaire() ;
260
			        $formulaireReponse->construitFormulaire() ;
261
			        
261
			        
262
					$repondre = new ezmlm_repondre();
262
					$repondre = new ezmlm_repondre();
263
                    $repondre->listdir = $liste->listdir ;
263
                    $repondre->listdir = $liste->listdir ;
264
                    $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
264
                    $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
265
                    $repondre->forcehref = $this->_url->getURL();
265
                    $repondre->forcehref = $this->_url->getURL();
266
                    $repondre->listname = $info_liste->getNom() ;
266
                    $repondre->listname = $info_liste->getNom() ;
267
                    // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
267
                    // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
268
                    // On appelle la fonction qui affiche un fichier
268
                    // On appelle la fonction qui affiche un fichier
269
                    print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
269
                    print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
270
                    $repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
270
                    $repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
271
                    
271
                    
272
                    $repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
272
                    $repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
273
			        $formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
273
			        $formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
274
			        // Ajout de > au début de chaque ligne du message
274
			        // Ajout de > au début de chaque ligne du message
275
			        $tableau = explode ("\n", $repondre->message_rendu) ;
275
			        $tableau = explode ("\n", $repondre->message_rendu) ;
276
			        $repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
276
			        $repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
277
			
277
			
278
			        $formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
278
			        $formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
279
			                                              'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
279
			                                              'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
280
			
280
			
281
			        print $formulaireReponse->toHTML() ;
281
			        print $formulaireReponse->toHTML() ;
282
 
282
 
283
                    break;
283
                    break;
284
                case 'supprimer' :
284
                case 'supprimer' :
285
                    $xml_parser->reset() ;
285
                    $xml_parser->reset() ;
286
					$xml_parser->setAction ('supprimer');
286
					$xml_parser->setAction ('supprimer');
287
					$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
287
					$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
288
                    $xml_parser->load();
288
                    $xml_parser->load();
289
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
289
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
290
                    $xml_parser->reset() ;
290
                    $xml_parser->reset() ;
291
					$xml_parser->setAction ('derniers_messages');
291
					$xml_parser->setAction ('derniers_messages');
292
                    $xml_parser->load();
292
                    $xml_parser->load();
293
                    ob_start ();
293
                    ob_start ();
294
                    $xml_parser->parse() ;
294
                    $xml_parser->parse() ;
295
                    $derniers_messages = ob_get_contents() ;
295
                    $derniers_messages = ob_get_contents() ;
296
                    ob_end_clean();
296
                    ob_end_clean();
297
                    echo $derniers_messages ;
297
                    echo $derniers_messages ;
298
                break;
298
                break;
299
            }
299
            }
300
            
300
            
301
        } else {
301
        } else {
302
            print PROJET_MESSAGE_LISTE_PRIVEE ;
302
            print PROJET_MESSAGE_LISTE_PRIVEE ;
303
        }
303
        }
304
        $sortie_liste = ob_get_contents() ;
304
        $sortie_liste = ob_get_contents() ;
305
        ob_end_clean() ;
305
        ob_end_clean() ;
306
    }
306
    }
307
}
307
}
308
 
308
 
309
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
309
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
310
$listes_ext = new liste_externe ($this->_db) ;
310
$listes_ext = new liste_externe ($this->_db) ;
311
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
311
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
312
 
312
 
313
if (count ($tableau_liste) != 0) {
313
if (count ($tableau_liste) != 0) {
314
    //$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
314
    //$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
315
    for ($i = 0; $i < count ($tableau_liste); $i++) {
315
    for ($i = 0; $i < count ($tableau_liste); $i++) {
316
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
316
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
317
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
317
        $liste_ext_res .= '<p><a href="'.$info_liste->AGO_A_URLGRP.'">'.$info_liste->AGO_A_URLGRP.'</a></p>'."\n" ;
318
        $liste_ext_res .= '<br />'."\n" ;
318
        $liste_ext_res .= '<br />'."\n" ;
319
    }
319
    }
320
}
320
}
321
 
321
 
322
$retour .= '<h1>' ;
322
$retour .= '<h1>' ;
323
if (!isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) $retour .= PROJET_PROJET.' : ';
323
if (!isset($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) $retour .= PROJET_PROJET.' : ';
324
$retour .= $projet->getTitre()."</h1>" ;
324
$retour .= $projet->getTitre()."</h1>" ;
325
$retour .= $inscription_laius ;
325
$retour .= $inscription_laius ;
326
$retour .= '<h2>'.PROJET_ADRESSE_ECRIRE.'</h2>'."\n" ;
326
$retour .= '<h2>'.PROJET_ADRESSE_ECRIRE.'</h2>'."\n" ;
327
 
327
 
328
$retour .= $sortie_liste ;
328
$retour .= $sortie_liste ;
329
$retour .= $liste_ext_res ;
329
$retour .= $liste_ext_res ;
330
?>
330
?>