Subversion Repositories Applications.projet

Rev

Rev 76 | Rev 112 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 76 Rev 106
Line 17... Line 17...
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.8 2005-11-28 11:19:30 alexandre_tb Exp $
22
// CVS : $Id: forums.php,v 1.9 2006-04-19 13:49:31 alexandre_tb Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Action forums
26
* Action forums
27
*
27
*
Line 29... Line 29...
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.8 $
34
*@version       $Revision: 1.9 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
Line 40... Line 40...
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
-
 
42
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php') ;
42
include_once (PROJET_CHEMIN_CLASSES.'HTML_formulaireMail.class.php') ;
43
include_once (PROJET_CHEMIN_CLASSES.'inscription_liste.class.php') ;
43
include_once (PROJET_CHEMIN_CLASSES.'inscription_liste.class.php') ;
44
include_once (PROJET_CHEMIN_CLASSES.'ezmlmAccessObject.class.php') ;
44
// RAPPEL IMPORTANT
45
// RAPPEL IMPORTANT
Line 110... Line 111...
110
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL);
111
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ENVOYER_UN_MAIL);
111
            if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) 
112
            if (isset ($GLOBALS['_GEN_commun']['info_application']->seulement_forum)) 
112
            		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
113
            		print '<a href="'.$this->_url->getURL().'">'.PROJET_ECRIRE_LISTE.'</a><br />';
Line 113... Line 114...
113
            
114
            
114
            print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
-
 
115
            $info = new ezmlm_threads();
-
 
116
            if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
115
            print '<h2>'.PROJET_TOUS_LES_MESSAGES.'</h2>'."\n";
-
 
116
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM);
117
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
117
            
118
            $info->forcehref = $this->_url->getURL();
118
            $xml_parser = &new ezmlmAccessObject('calendrier_messages', $info_liste->getDomaine(),
119
            $info->listdir = $liste->listdir ;
119
            									$info_liste->getNom(), $GLOBALS['lang'], 
120
            $info->listname = $info_liste->getNom();
120
            									$this->_url->getURL()) ;
121
            $info->listdomain = $info_liste->getDomaine() ;
121
			$xml_parser->load();
122
            if (!$info->listmessages()) {
-
 
123
                if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
122
			$resultat = $xml_parser->parse() ;
124
            }
123
			$xml_parser->reset();
125
    
124
          
Line 126... Line 125...
126
            $this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
125
            //$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
127
            
126
            
128
            // On teste si l'on vient d'une réponse à un email, si oui
127
            // On teste si l'on vient d'une réponse à un email, si oui
129
            // on modifie $liste->action pour renvoyer le message auquelon vient de répondre
128
            // on modifie $liste->action pour renvoyer le message auquelon vient de répondre
Line 133... Line 132...
133
            switch ($liste->action) {
132
            switch ($liste->action) {
134
                case "show_msg":
133
                case "show_msg":
135
                    if (count($liste->actionargs) < 2) {
134
                    if (count($liste->actionargs) < 2) {
136
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
135
                        $liste->error(EZMLM_INVALID_SYNTAX,TRUE);
137
                    }
136
                    }
138
                    $show_msg = new ezmlm_msgdisplay();
-
 
139
                    $show_msg->listdir = $liste->listdir ;
-
 
140
                    $show_msg->forcehref = $this->_url->getURL();
-
 
141
                    $show_msg->listname = $info_liste->getNom() ;
-
 
142
                    $show_msg->_auth = & $this->_auth ;
-
 
-
 
137
                    
143
                    // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
138
                    // actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
144
                    // On appelle la fonction qui affiche un fichier
139
                    // On appelle la fonction qui affiche un fichier
-
 
140
					$xml_parser->setAction ('message');
-
 
141
                    $xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
-
 
142
                    $xml_parser->load();
-
 
143
                    ob_start ();
-
 
144
                    $xml_parser->parse() ;
-
 
145
                    $mail = ob_get_contents() ;
-
 
146
                    ob_end_clean();
-
 
147
                    
-
 
148
                    $mimeDecode = new Mail_mimeDecode($mail) ;
-
 
149
        			$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 
-
 
150
												'include_bodies' => 'true')) ;
-
 
151
					$message = new ezmlm_msgdisplay() ;
-
 
152
					$message->listname = $info_liste->getNom();
-
 
153
					if ($xml_parser->getNumeroFichierPrecedent() != '') {
-
 
154
						$this->_url->addQueryString ('action', 'show_msg');
-
 
155
			            print '[<a href="' . $this->_url->getURL(). '&amp;actionargs[]='.
-
 
156
			            		$xml_parser->getNumeroRepertoirePrecedent().'&amp;actionargs[]='.
-
 
157
			            		$xml_parser->getNumeroFichierPrecedent().
-
 
158
								'">'.PROJET_PRECEDENT.'</a>]';
-
 
159
			        } else {
145
                    print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
160
			            print '['.PROJET_PRECEDENT.']' ;
-
 
161
			        }
-
 
162
			        if ($xml_parser->getNumeroFichierSuivant() != '') {
-
 
163
			            print '[<a href="' .$this->_url->getURL().'&amp;actionargs[]='.$xml_parser->getNumeroRepertoireSuivant()
-
 
164
			            		.'&amp;actionargs[]='.$xml_parser->getNumeroFichierSuivant().'">'.PROJET_SUIVANT. '</a>]';
-
 
165
			        } else {
-
 
166
			            print '['.PROJET_SUIVANT.']' ;
-
 
167
        			}
-
 
168
        			$this->_url->addQueryString ('action', 'repondre');
-
 
169
					print '[<a href="'.$this->_url->getURL().'&amp;actionargs[]='.$liste->actionargs[0].
-
 
170
							'&amp;actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
-
 
171
					
-
 
172
					print '<div class="message">' ;
-
 
173
                    print $message->parse_entete_mail($mailDecode) ;
146
                    $show_msg->display($liste->actionargs[0] . "/" . $liste->actionargs[1]);
174
        	        $message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
-
 
175
       				print $message->message_rendu;
-
 
176
       				print '</div>' ;
-
 
177
       				
147
                    break;
178
                    break;
Line 148... Line 179...
148
                    
179
                    
149
                case "list_info":
180
                case "list_info":
Line 175... Line 206...
175
                    $author->listname = $info_liste->getNom() ;
206
                    $author->listname = $info_liste->getNom() ;
176
                    $author->listdomain = $info_liste->getDomaine() ;
207
                    $author->listdomain = $info_liste->getDomaine() ;
177
                    $author->forcehref = $this->_url->getURL() ;
208
                    $author->forcehref = $this->_url->getURL() ;
178
                    $author->display($liste->actionargs[0]);
209
                    $author->display($liste->actionargs[0]);
179
                    break;
210
                    break;
180
                break ;
-
 
181
                case 'show_month' :
211
                case 'show_month' :
182
                    $info = new ezmlm_listinfo();
212
                    $info = new ezmlm_listinfo();
183
                    if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
213
                    if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
184
                    $info->forcehref = $this->_url->getURL();
214
                    $info->forcehref = $this->_url->getURL();
185
                    $info->listdir = $liste->listdir ;
215
                    $info->listdir = $liste->listdir ;