Subversion Repositories Applications.projet

Rev

Rev 450 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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