Subversion Repositories Applications.projet

Rev

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

Rev 112 Rev 208
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.10 2006-06-16 14:17:16 alexandre_tb Exp $
22
// CVS : $Id: forums.php,v 1.11 2007-04-19 15:34:35 neiluj 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.10 $
34
*@version       $Revision: 1.11 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
-
 
41
 
-
 
42
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
41
 
43
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
42
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php') ;
44
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php') ;
43
include_once (PROJET_CHEMIN_CLASSES.'inscription_liste.class.php') ;
45
include_once (PROJET_CHEMIN_CLASSES.'inscription_liste.class.php') ;
44
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
46
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
45
// RAPPEL IMPORTANT
47
// RAPPEL IMPORTANT
46
// 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
47
//
49
//
48
 
50
 
49
 
51
 
50
// création de l'objet projet courant
52
// création de l'objet projet courant
51
$projet = new projet ($this->_db, $this->_id_projet) ;
53
$projet = new projet ($this->_db, $this->_id_projet) ;
52
 
54
 
53
$liste_ext_res = '' ;
55
$liste_ext_res = '' ;
54
$sortie_liste = '' ;
56
$sortie_liste = '' ;
55
$inscription_laius ='' ;
57
$inscription_laius ='' ;
56
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
58
$this->_url->addQueryString (PROJET_VARIABLE_ID_PROJET, $this->_id_projet);
57
if ($projet->avoirListe()) {
59
if ($projet->avoirListe()) {
58
    foreach ($projet->_listes_associes as $info_liste) {
60
    foreach ($projet->_listes_associes as $info_liste) {
59
        ob_start() ;
61
        ob_start() ;
60
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
62
        $id_u = $this->_auth->getAuthData(PROJET_CHAMPS_ID) ;
61
        if ($this->_auth->getAuth()) {
63
        if ($this->_auth->getAuth()) {
62
            $participant = new participe($this->_db) ;
64
            $participant = new participe($this->_db) ;
63
            
65
            
64
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
66
            $isCoord = $participant->isCoordinateur($id_u, $this->_id_projet, $this->_db) ;
65
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
67
            if ($isCoord) $droits = PROJET_DROIT_COORDINATEUR ;
66
            $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
68
            $isAdm = participe::isAdministrateur($this->_auth->getAuthData(PROJET_CHAMPS_ID), $this->_db) ;
67
            if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
69
            if ($isAdm) $droits = PROJET_DROIT_ADMINISTRATEUR ;
68
            if ($isAdm) $isCoord = true ;
70
            if ($isAdm) $isCoord = true ;
69
        } else {
71
        } else {
70
            $droits = PROJET_DROIT_AUCUN;
72
            $droits = PROJET_DROIT_AUCUN;
71
        }
73
        }
72
        
74
        
73
        // gestion de l'inscription désinscription à la liste
75
        // gestion de l'inscription désinscription à la liste
74
        // TODO : la gestion de linscription au résumé
76
        // TODO : la gestion de linscription au résumé
75
        $inscription_liste = new inscription_liste($this->_db) ;
77
        $inscription_liste = new inscription_liste($this->_db) ;
76
        $statut = $inscription_liste->getStatutInscrit( $info_liste->getId(),  $this->_auth ) ;
78
        $statut = $inscription_liste->getStatutInscrit( $info_liste->getId(),  $this->_auth ) ;
77
        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)) {
78
	        if ($statut == 2) {
80
	        if ($statut == 2) {
79
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
81
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_DESINSCRIPTION_LISTE);
80
	        	$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
82
	        	$inscription_laius ='<h2>'.PROJET_VOUS_ETES_INSCRIT.'</h2>'."\n" ;
81
	        	$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" ;
82
	        } else {
84
	        } else {
83
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
85
	        	$this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_INSCRIPTION_LISTE);
84
	        	$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
86
	        	$inscription_laius ='<h2>'.PROJET_VOUS_N_ETES_PAS_INSCRIT.'</h2>'."\n" ;
85
	        	$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" ;
86
	        }
88
	        }
87
        }
89
        }
88
        
90
        
89
        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' ;
90
            $liste = new ezmlm_php() ;
93
            $liste = new ezmlm_php() ;
91
            // Paramétrage de la liste
94
            // Paramétrage de la liste
92
            
95
            
93
            $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
96
            $liste->listdir = PROJET_CHEMIN_LISTES.$info_liste->getDomaine().'/'.$info_liste->getNom();
94
            $liste->listname = $info_liste->getNom() ;
97
            $liste->listname = $info_liste->getNom() ;
95
            $liste->listdomain = $info_liste->getDomaine();
98
            $liste->listdomain = $info_liste->getDomaine();
96
        
99
        
97
            if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
100
            if (isset ($GLOBALS['action']) && $GLOBALS['action'] != '') {
98
                $liste->set_action($GLOBALS['action']) ;
101
                $liste->set_action($GLOBALS['action']) ;
99
                $liste->set_actionargs($GLOBALS['actionargs']) ;
102
                $liste->set_actionargs($GLOBALS['actionargs']) ;
100
            } else {
103
            } else {
101
                $liste->set_action('list_info') ;
104
                $liste->set_action('list_info') ;
102
            }
105
            }
103
            $liste->sendheaders	= false;
106
            $liste->sendheaders	= false;
104
            $liste->sendbody        = false;
107
            $liste->sendbody        = false;
105
            $liste->sendfooters    = false;
108
            $liste->sendfooters    = false;
106
            $liste->forcehref = $this->_url->getURL() ;
109
            $liste->forcehref = $this->_url->getURL() ;
107
            
110
            
108
            
111
            
109
            print '<a href="mailto:'.$info_liste->getAdresseEnvoi().'">' . $info_liste->getAdresseEnvoi() ;
112
            print '<a href="mailto:'.$info_liste->getAdresseEnvoi().'">' . $info_liste->getAdresseEnvoi() ;
110
            print "</a><br />\n";
113
            print "</a><br />\n";
111
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL);
114
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL);
112
            if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) 
115
            if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) 
113
            		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
116
            		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
114
            
117
            
115
            print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
118
            print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
116
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
119
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
117
            
120
            
118
            $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
121
            $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
119
            									$info_liste->getNom(), $GLOBALS['lang'], 
122
            									$info_liste->getNom(), $GLOBALS['lang'], 
120
            									$this->_url->getURL()) ;
123
            									$this->_url->getURL()) ;
121
			$xml_parser->load();
124
			$xml_parser->load();
122
			$resultat = $xml_parser->parse() ;
125
			$resultat = $xml_parser->parse() ;
123
			$xml_parser->reset();
126
			$xml_parser->reset();
124
          
127
          
125
            //$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
128
            //$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
126
            
129
            
127
            // 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
128
            // 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
129
            if (isset($_POST['messageid'])) {
132
            if (isset($_POST['messageid'])) {
130
                $liste->action = 'show_msg' ;
133
                $liste->action = 'show_msg' ;
131
            }
134
            }
132
            switch ($liste->action) {
135
            switch ($liste->action) {
133
                case "show_msg":
136
                case "show_msg":
134
                    if (count($liste->actionargs) < 2) {
137
                    if (count($liste->actionargs) < 2) {
135
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
138
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
136
                    }
139
                    }
137
                    
140
                    
138
                    // 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
139
                    // On appelle la fonction qui affiche un fichier
142
                    // On appelle la fonction qui affiche un fichier
140
					$xml_parser->setAction ('message');
143
					$xml_parser->setAction ('message');
141
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
144
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
142
                    $xml_parser->load();
145
                    $xml_parser->load();
143
                    ob_start ();
146
                    ob_start ();
144
                    $xml_parser->parse() ;
147
                    $xml_parser->parse() ;
145
                    $mail = ob_get_contents() ;
148
                    $mail = ob_get_contents() ;
146
                    ob_end_clean();
149
                    ob_end_clean();
147
                    
150
                    
148
                    $mimeDecode = new Mail_mimeDecode($mail) ;
151
                    $mimeDecode = new Mail_mimeDecode($mail) ;
149
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 
152
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 
150
												'include_bodies' => 'true')) ;
153
												'include_bodies' => 'true')) ;
151
					$message = new ezmlm_msgdisplay() ;
154
					$message = new ezmlm_msgdisplay() ;
152
					$message->listname = $info_liste->getNom();
155
					$message->listname = $info_liste->getNom();
-
 
156
					$this->_url->addQueryString ('action', 'show_msg');
153
					if ($xml_parser->getNumeroFichierPrecedent() != '') {
157
					if ($xml_parser->getNumeroFichierPrecedent() != '') {
154
						$this->_url->addQueryString ('action', 'show_msg');
-
 
155
			            print '[<a href="' . $this->_url->getURL(). '&amp;actionargs[]='.
158
			            print '[<a href="' . $this->_url->getURL(). '&amp;actionargs[]='.
156
			            		$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
159
			            		$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
157
			            		$xml_parser->getNumeroFichierPrecedent().
160
			            		$xml_parser->getNumeroFichierPrecedent().
158
								'">'.PROJET_PRECEDENT.'</a>]';
161
								'">'.PROJET_PRECEDENT.'</a>]';
159
			        } else {
162
			        } else {
160
			            print '['.PROJET_PRECEDENT.']' ;
163
			            print '['.PROJET_PRECEDENT.']' ;
161
			        }
164
			        }
162
			        if ($xml_parser->getNumeroFichierSuivant() != '') {
165
			        if ($xml_parser->getNumeroFichierSuivant() != '') {
163
			            print '[<a href="' .$this->_url->getURL().'&amp;actionargs[]='.$xml_parser->getNumeroRepertoireSuivant()
166
			            print '[<a href="' .$this->_url->getURL().'&amp;actionargs[]='.$xml_parser->getNumeroRepertoireSuivant()
164
			            		.'&amp;actionargs[]='.$xml_parser->getNumeroFichierSuivant().'">'.PROJET_SUIVANT. '</a>]';
167
			            		.'&amp;actionargs[]='.$xml_parser->getNumeroFichierSuivant().'">'.PROJET_SUIVANT. '</a>]';
165
			        } else {
168
			        } else {
166
			            print '['.PROJET_SUIVANT.']' ;
169
			            print '['.PROJET_SUIVANT.']' ;
167
        			}
170
        			}
168
        			$this->_url->addQueryString ('action', 'repondre');
171
        			$this->_url->addQueryString ('action', 'repondre');
169
					print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
172
					print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
170
							'&amp;actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
173
							'&amp;actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
171
					if ($isCoord) {
174
					if ($isCoord) {
172
						$this->_url->addQueryString ('action', 'supprimer');
175
						$this->_url->addQueryString ('action', 'supprimer');
173
						print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
176
						print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
174
							'&amp;actionargs[]='.$liste->actionargs[1].'">'.PROJET_SUPPRIMER.'</a>]';
177
							'&amp;actionargs[]='.$liste->actionargs[1].'" onclick="javascript:return confirm(\''.PROJET_SUPPRIMER.' ?\');">'.
-
 
178
							PROJET_SUPPRIMER.'</a>]';
175
					}
179
					}
176
					print '<div class="message">' ;
180
					print '<div class="message">' ;
177
                    print $message->parse_entete_mail($mailDecode) ;
181
                    print $message->parse_entete_mail($mailDecode) ;
178
        	        $message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
182
        	        $message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
179
       				print $message->message_rendu;
183
       				print $message->message_rendu;
180
       				print '</div>' ;
184
       				print '</div>' ;
181
       				
185
       				
182
                    break;
186
                    break;
183
                    
187
                    
184
                case "list_info":
188
                case "list_info":
185
     
189
     
186
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
190
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
187
                    $xml_parser->reset() ;
191
                    $xml_parser->reset() ;
188
					$xml_parser->setAction ('derniers_messages');
192
					$xml_parser->setAction ('derniers_messages');
189
                    $xml_parser->load();
193
                    $xml_parser->load();
190
                    ob_start ();
194
                    ob_start ();
191
                    $xml_parser->parse() ;
195
                    $xml_parser->parse() ;
192
                    $derniers_messages = ob_get_contents() ;
196
                    $derniers_messages = ob_get_contents() ;
193
                    ob_end_clean();
197
                    ob_end_clean();
194
                    echo $derniers_messages ;
198
                    echo $derniers_messages ;
195
                    
199
                    
196
                    break;
200
                    break;
197
                case "show_threads":
201
                case "show_threads":
198
                    $xml_parser->reset() ;
202
                    $xml_parser->reset() ;
199
					$xml_parser->setAction ('messages_thread');
203
					$xml_parser->setAction ('messages_thread');
200
					$xml_parser->setMois($liste->actionargs[0]);
204
					$xml_parser->setMois($liste->actionargs[0]);
201
                    $xml_parser->load();
205
                    $xml_parser->load();
202
                    ob_start ();
206
                    ob_start ();
203
                    $xml_parser->parse() ;
207
                    $xml_parser->parse() ;
204
                    $messages_thread = ob_get_contents() ;
208
                    $messages_thread = ob_get_contents() ;
205
                    ob_end_clean();
209
                    ob_end_clean();
206
                    echo $messages_thread ;
210
                    echo $messages_thread ;
207
                    break;
211
                    break;
208
                case "show_author_msgs" :
212
                case "show_author_msgs" :
209
                    $xml_parser->reset() ;
213
                    $xml_parser->reset() ;
210
					$xml_parser->setAction ('messages_auteur');
214
					$xml_parser->setAction ('messages_auteur');
211
					$xml_parser->setHashAuteur($liste->actionargs[0]);
215
					$xml_parser->setHashAuteur($liste->actionargs[0]);
212
                    $xml_parser->load();
216
                    $xml_parser->load();
213
                    ob_start ();
217
                    ob_start ();
214
                    $xml_parser->parse() ;
218
                    $xml_parser->parse() ;
215
                    $messages_auteur = ob_get_contents() ;
219
                    $messages_auteur = ob_get_contents() ;
216
                    ob_end_clean();
220
                    ob_end_clean();
217
                    echo $messages_auteur ;
221
                    echo $messages_auteur ;
218
                    break;
222
                    break;
219
                case 'show_month' :
223
                case 'show_month' :
220
                	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[]='.
221
                			$liste->actionargs[0], 'par fil de discussion').' ]' ;
225
                			$liste->actionargs[0], 'par fil de discussion').' ]' ;
222
                    $xml_parser->reset() ;
226
                    $xml_parser->reset() ;
223
					$xml_parser->setAction ('messages_mois');
227
					$xml_parser->setAction ('messages_mois');
224
					$xml_parser->setMois($liste->actionargs[0]);
228
					$xml_parser->setMois($liste->actionargs[0]);
225
                    $xml_parser->load();
229
                    $xml_parser->load();
226
                    ob_start ();
230
                    ob_start ();
227
                    $xml_parser->parse() ;
231
                    $xml_parser->parse() ;
228
                    $messages_mois = ob_get_contents() ;
232
                    $messages_mois = ob_get_contents() ;
229
                    ob_end_clean();
233
                    ob_end_clean();
230
                    echo $messages_mois ;
234
                    echo $messages_mois ;
231
                break;
235
                break;
232
                case 'repondre' :
236
                case 'repondre' :
233
                    if (count($liste->actionargs) < 2) {
237
                    if (count($liste->actionargs) < 2) {
234
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
238
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
235
                    }
239
                    }
236
                    $xml_parser->setAction ('message');
240
                    $xml_parser->setAction ('message');
237
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
241
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
238
                    $xml_parser->load();
242
                    $xml_parser->load();
239
                    ob_start ();
243
                    ob_start ();
240
                    $xml_parser->parse() ;
244
                    $xml_parser->parse() ;
241
                    $message = ob_get_contents() ;
245
                    $message = ob_get_contents() ;
242
                    ob_end_clean();
246
                    ob_end_clean();
243
        			$mimeDecode = new Mail_mimeDecode($message) ;
247
        			$mimeDecode = new Mail_mimeDecode($message) ;
244
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
248
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
245
					
249
					
246
					if (isset($_SESSION['formulaire_mail'])) {
250
					if (isset($_SESSION['formulaire_mail'])) {
247
            			unset ($_SESSION['formulaire_mail']) ;
251
            			unset ($_SESSION['formulaire_mail']) ;
248
        			}
252
        			}
249
        
253
        
250
			        $formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post', 
254
			        $formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post', 
251
										str_replace('&amp;', '&', $this->_url->getURL()).
255
										str_replace('&amp;', '&', $this->_url->getURL()).
252
										'&action='.PROJET_ENVOYER_UN_MAIL_V.
256
										'&action='.PROJET_ENVOYER_UN_MAIL_V.
253
                                        '&actionargs[]='.$liste->actionargs[0].
257
                                        '&actionargs[]='.$liste->actionargs[0].
254
										'&actionargs[]='.$liste->actionargs[1].
258
										'&actionargs[]='.$liste->actionargs[1].
255
										'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
259
										'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
256
			        $formulaireReponse->construitFormulaire() ;
260
			        $formulaireReponse->construitFormulaire() ;
257
			        
261
			        
258
					$repondre = new ezmlm_repondre();
262
					$repondre = new ezmlm_repondre();
259
                    $repondre->listdir = $liste->listdir ;
263
                    $repondre->listdir = $liste->listdir ;
260
                    $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
264
                    $this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
261
                    $repondre->forcehref = $this->_url->getURL();
265
                    $repondre->forcehref = $this->_url->getURL();
262
                    $repondre->listname = $info_liste->getNom() ;
266
                    $repondre->listname = $info_liste->getNom() ;
263
                    // 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
264
                    // On appelle la fonction qui affiche un fichier
268
                    // On appelle la fonction qui affiche un fichier
265
                    print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
269
                    print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
266
                    $repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
270
                    $repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
267
                    
271
                    
268
                    $repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
272
                    $repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
269
			        $formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
273
			        $formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
270
			        // Ajout de > au début de chaque ligne du message
274
			        // Ajout de > au début de chaque ligne du message
271
			        $tableau = explode ("\n", $repondre->message_rendu) ;
275
			        $tableau = explode ("\n", $repondre->message_rendu) ;
272
			        $repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
276
			        $repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
273
			
277
			
274
			        $formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
278
			        $formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
275
			                                              'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
279
			                                              'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
276
			
280
			
277
			        print $formulaireReponse->toHTML() ;
281
			        print $formulaireReponse->toHTML() ;
278
 
282
 
279
                    break;
283
                    break;
280
                case 'supprimer' :
284
                case 'supprimer' :
281
                    $xml_parser->reset() ;
285
                    $xml_parser->reset() ;
282
					$xml_parser->setAction ('supprimer');
286
					$xml_parser->setAction ('supprimer');
283
					$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
287
					$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
284
                    $xml_parser->load();
288
                    $xml_parser->load();
-
 
289
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
-
 
290
                    $xml_parser->reset() ;
-
 
291
					$xml_parser->setAction ('derniers_messages');
-
 
292
                    $xml_parser->load();
-
 
293
                    ob_start ();
-
 
294
                    $xml_parser->parse() ;
-
 
295
                    $derniers_messages = ob_get_contents() ;
-
 
296
                    ob_end_clean();
-
 
297
                    echo $derniers_messages ;
285
                break;
298
                break;
286
            }
299
            }
287
            
300
            
288
        } else {
301
        } else {
289
            print PROJET_MESSAGE_LISTE_PRIVEE ;
302
            print PROJET_MESSAGE_LISTE_PRIVEE ;
290
        }
303
        }
291
        $sortie_liste = ob_get_contents() ;
304
        $sortie_liste = ob_get_contents() ;
292
        ob_end_clean() ;
305
        ob_end_clean() ;
293
    }
306
    }
294
}
307
}
295
 
308
 
296
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
309
include_once PROJET_CHEMIN_CLASSES.'liste_externe.class.php' ;
297
$listes_ext = new liste_externe ($this->_db) ;
310
$listes_ext = new liste_externe ($this->_db) ;
298
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
311
$tableau_liste = $listes_ext->getListesAssociees($this->_id_projet) ;
299
 
312
 
300
if (count ($tableau_liste) != 0) {
313
if (count ($tableau_liste) != 0) {
301
    //$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
314
    //$liste_ext_res .= '<h2>'.PROJET_LISTES_ASSOCIEES.'</h2>'."\n" ;
302
    for ($i = 0; $i < count ($tableau_liste); $i++) {
315
    for ($i = 0; $i < count ($tableau_liste); $i++) {
303
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
316
        $info_liste = $listes_ext->getInfoListe($tableau_liste[$i]) ;
304
        $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" ;
305
        $liste_ext_res .= '<br />'."\n" ;
318
        $liste_ext_res .= '<br />'."\n" ;
306
    }
319
    }
307
}
320
}
308
 
321
 
309
$retour .= '<h1>' ;
322
$retour .= '<h1>' ;
310
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.' : ';
311
$retour .= $projet->getTitre()."</h1>" ;
324
$retour .= $projet->getTitre()."</h1>" ;
312
$retour .= $inscription_laius ;
325
$retour .= $inscription_laius ;
313
$retour .= '<h2>'.PROJET_ADRESSE_ECRIRE.'</h2>'."\n" ;
326
$retour .= '<h2>'.PROJET_ADRESSE_ECRIRE.'</h2>'."\n" ;
314
 
327
 
315
$retour .= $sortie_liste ;
328
$retour .= $sortie_liste ;
316
$retour .= $liste_ext_res ;
329
$retour .= $liste_ext_res ;
317
?>
330
?>