Subversion Repositories Applications.projet

Rev

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

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