Subversion Repositories Applications.projet

Rev

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

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