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.9 2006-04-19 13:49:31 alexandre_tb Exp $
|
22 |
// CVS : $Id: forums.php,v 1.10 2006-06-16 14:17:16 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.9 $
|
34 |
*@version $Revision: 1.10 $
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
*/
|
36 |
*/
|
Line 37... |
Line 37... |
37 |
|
37 |
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
Line 166... |
Line 166... |
166 |
print '['.PROJET_SUIVANT.']' ;
|
166 |
print '['.PROJET_SUIVANT.']' ;
|
167 |
}
|
167 |
}
|
168 |
$this->_url->addQueryString ('action', 'repondre');
|
168 |
$this->_url->addQueryString ('action', 'repondre');
|
169 |
print '[<a href="'.$this->_url->getURL().'&actionargs[]='.$liste->actionargs[0].
|
169 |
print '[<a href="'.$this->_url->getURL().'&actionargs[]='.$liste->actionargs[0].
|
170 |
'&actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
|
170 |
'&actionargs[]='.$liste->actionargs[1].'">'.PROJET_REPONDRE.'</a>]';
|
- |
|
171 |
if ($isCoord) {
|
- |
|
172 |
$this->_url->addQueryString ('action', 'supprimer');
|
- |
|
173 |
print '[<a href="'.$this->_url->getURL().'&actionargs[]='.$liste->actionargs[0].
|
- |
|
174 |
'&actionargs[]='.$liste->actionargs[1].'">'.PROJET_SUPPRIMER.'</a>]';
|
171 |
|
175 |
}
|
172 |
print '<div class="message">' ;
|
176 |
print '<div class="message">' ;
|
173 |
print $message->parse_entete_mail($mailDecode) ;
|
177 |
print $message->parse_entete_mail($mailDecode) ;
|
174 |
$message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
|
178 |
$message->parse_template($mailDecode, $liste->actionargs[1], $liste->actionargs[0]);
|
175 |
print $message->message_rendu;
|
179 |
print $message->message_rendu;
|
176 |
print '</div>' ;
|
180 |
print '</div>' ;
|
Line 177... |
Line 181... |
177 |
|
181 |
|
Line 178... |
Line 182... |
178 |
break;
|
182 |
break;
|
179 |
|
- |
|
180 |
case "list_info":
|
183 |
|
181 |
$info = new ezmlm_listinfo();
|
- |
|
182 |
|
- |
|
183 |
if (!$info) print 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
|
- |
|
184 |
$info->forcehref = $this->_url->getURL();
|
- |
|
185 |
$info->listdir = $liste->listdir ;
|
- |
|
186 |
$info->listname = $info_liste->getNom();
|
184 |
case "list_info":
|
187 |
$info->listdomain = $info_liste->getDomaine() ;
|
185 |
|
- |
|
186 |
print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
|
- |
|
187 |
$xml_parser->reset() ;
|
- |
|
188 |
$xml_parser->setAction ('derniers_messages');
|
- |
|
189 |
$xml_parser->load();
|
188 |
print'<h2>'.PROJET_DERNIERS_MESSAGES.'</h2>'."\n" ;
|
190 |
ob_start ();
|
189 |
if (!$info->show_recentmsgs()) {
|
191 |
$xml_parser->parse() ;
|
- |
|
192 |
$derniers_messages = ob_get_contents() ;
|
- |
|
193 |
ob_end_clean();
|
190 |
echo 'Pas de message dans cette liste' ;
|
194 |
echo $derniers_messages ;
|
191 |
}
|
195 |
|
192 |
break;
|
196 |
break;
|
193 |
case "show_threads":
|
197 |
case "show_threads":
|
- |
|
198 |
$xml_parser->reset() ;
|
194 |
$threads = new ezmlm_threads();
|
199 |
$xml_parser->setAction ('messages_thread');
|
195 |
$this->_url->addQueryString(PROJET_VARIABLE_ACTION, $this->_action) ;
|
200 |
$xml_parser->setMois($liste->actionargs[0]);
|
196 |
$threads->forcehref = $this->_url->getURL() ;
|
201 |
$xml_parser->load();
|
197 |
$threads->listdir = $liste->listdir ;
|
202 |
ob_start ();
|
198 |
$threads->listname = $info_liste->getNom() ;
|
203 |
$xml_parser->parse() ;
|
199 |
$threads->listdomain = $info_liste->getDomaine() ;
|
204 |
$messages_thread = ob_get_contents() ;
|
200 |
$threads->tempdir = PROJET_CHEMIN_APPLI.'/tmp' ;
|
205 |
ob_end_clean();
|
201 |
$threads->load($liste->actionargs[0]);
|
206 |
echo $messages_thread ;
|
202 |
break;
|
207 |
break;
|
- |
|
208 |
case "show_author_msgs" :
|
- |
|
209 |
$xml_parser->reset() ;
|
203 |
case "show_author_msgs" :
|
210 |
$xml_parser->setAction ('messages_auteur');
|
- |
|
211 |
$xml_parser->setHashAuteur($liste->actionargs[0]);
|
204 |
$author = new ezmlm_author();
|
212 |
$xml_parser->load();
|
205 |
$author->listdir = $liste->listdir ;
|
213 |
ob_start ();
|
206 |
$author->listname = $info_liste->getNom() ;
|
214 |
$xml_parser->parse() ;
|
207 |
$author->listdomain = $info_liste->getDomaine() ;
|
215 |
$messages_auteur = ob_get_contents() ;
|
208 |
$author->forcehref = $this->_url->getURL() ;
|
216 |
ob_end_clean();
|
209 |
$author->display($liste->actionargs[0]);
|
217 |
echo $messages_auteur ;
|
210 |
break;
|
218 |
break;
|
211 |
case 'show_month' :
|
219 |
case 'show_month' :
|
212 |
$info = new ezmlm_listinfo();
|
220 |
echo '[ '.$liste->makelink(PROJET_VARIABLE_ACTION.'=forums&action=show_threads&actionargs[]='.
|
213 |
if (!$info) return 'Les fichiers de la liste ne sont pas visible sur le serveur' ;
|
221 |
$liste->actionargs[0], 'par fil de discussion').' ]' ;
|
214 |
$info->forcehref = $this->_url->getURL();
|
222 |
$xml_parser->reset() ;
|
215 |
$info->listdir = $liste->listdir ;
|
223 |
$xml_parser->setAction ('messages_mois');
|
216 |
$info->listname = $info_liste->getNom();
|
- |
|
217 |
$info->listdomain = $info_liste->getDomaine() ;
|
224 |
$xml_parser->setMois($liste->actionargs[0]);
|
218 |
echo '[ '.$info->makelink('action=show_threads&actionargs[]='.$liste->actionargs[0], 'par fil de discussion').' ]' ;
|
225 |
$xml_parser->load();
|
219 |
// print'<h2>'.PROJET_MESSAGE_DU_MOIS.$GLOBALS['mois'][((int)substr($liste->actionargs[0],4,2) / 1)-1] .', ' .
|
226 |
ob_start ();
|
220 |
substr($liste->actionargs[0],0,4). '</h2>'."\n" ;
|
227 |
$xml_parser->parse() ;
|
221 |
if (!$info->show_month($liste->actionargs[0])) {
|
228 |
$messages_mois = ob_get_contents() ;
|
222 |
echo 'Pas de message dans cette liste' ;
|
229 |
ob_end_clean();
|
223 |
}
|
230 |
echo $messages_mois ;
|
224 |
break;
|
231 |
break;
|
225 |
case 'repondre' :
|
232 |
case 'repondre' :
|
226 |
if (count($liste->actionargs) < 2) {
|
233 |
if (count($liste->actionargs) < 2) {
|
- |
|
234 |
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
|
- |
|
235 |
}
|
- |
|
236 |
$xml_parser->setAction ('message');
|
- |
|
237 |
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
|
- |
|
238 |
$xml_parser->load();
|
227 |
$liste->error(EZMLM_INVALID_SYNTAX,TRUE);
|
239 |
ob_start ();
|
- |
|
240 |
$xml_parser->parse() ;
|
- |
|
241 |
$message = ob_get_contents() ;
|
- |
|
242 |
ob_end_clean();
|
- |
|
243 |
$mimeDecode = new Mail_mimeDecode($message) ;
|
- |
|
244 |
$mailDecode = $mimeDecode->decode(array('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
|
- |
|
245 |
|
- |
|
246 |
if (isset($_SESSION['formulaire_mail'])) {
|
- |
|
247 |
unset ($_SESSION['formulaire_mail']) ;
|
- |
|
248 |
}
|
- |
|
249 |
|
- |
|
250 |
$formulaireReponse = new HTML_formulaireMail('formulaire_reponse', 'post',
|
- |
|
251 |
str_replace('&', '&', $this->_url->getURL()).
|
- |
|
252 |
'&action='.PROJET_ENVOYER_UN_MAIL_V.
|
- |
|
253 |
'&actionargs[]='.$liste->actionargs[0].
|
- |
|
254 |
'&actionargs[]='.$liste->actionargs[1].
|
- |
|
255 |
'&'.PROJET_VARIABLE_ACTION.'='.PROJET_ENVOYER_UN_MAIL_V) ;
|
- |
|
256 |
$formulaireReponse->construitFormulaire() ;
|
228 |
}
|
257 |
|
229 |
$repondre = new ezmlm_repondre();
|
258 |
$repondre = new ezmlm_repondre();
|
230 |
$repondre->listdir = $liste->listdir ;
|
259 |
$repondre->listdir = $liste->listdir ;
|
231 |
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
|
260 |
$this->_url->removeQueryString (PROJET_VARIABLE_ACTION) ;
|
232 |
$repondre->forcehref = $this->_url->getURL();
|
261 |
$repondre->forcehref = $this->_url->getURL();
|
233 |
$repondre->listname = $info_liste->getNom() ;
|
262 |
$repondre->listname = $info_liste->getNom() ;
|
234 |
// actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
|
263 |
// actionargs[0] contient le nom du répertoire et actionargs[1] le nom du fichier
|
235 |
// On appelle la fonction qui affiche un fichier
|
264 |
// On appelle la fonction qui affiche un fichier
|
- |
|
265 |
print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
|
- |
|
266 |
$repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
|
- |
|
267 |
|
- |
|
268 |
$repondre->parse_template($mailDecode, $liste->actionargs[0], $liste->actionargs[1]);
|
- |
|
269 |
$formulaireReponse->addElement ('hidden', 'messageid', $mailDecode->headers['message-id']) ;
|
- |
|
270 |
// Ajout de > au début de chaque ligne du message
|
- |
|
271 |
$tableau = explode ("\n", $repondre->message_rendu) ;
|
- |
|
272 |
$repondre->message_rendu = "> ".implode ("\n> ", $tableau) ;
|
- |
|
273 |
|
- |
|
274 |
$formulaireReponse->setDefaults(array('mail_corps' => $repondre->message_rendu,
|
- |
|
275 |
'mail_titre' => 'Re : '.$repondre->decode_iso ($mailDecode->headers['subject']))) ;
|
- |
|
276 |
|
236 |
print'<h2>'.PROJET_REDIGER_REPONSE.'</h2>'."\n" ;
|
277 |
print $formulaireReponse->toHTML() ;
|
- |
|
278 |
|
- |
|
279 |
break;
|
- |
|
280 |
case 'supprimer' :
|
- |
|
281 |
$xml_parser->reset() ;
|
- |
|
282 |
$xml_parser->setAction ('supprimer');
|
- |
|
283 |
$xml_parser->setIdMessage($liste->actionargs[0], $liste->actionargs[1]) ;
|
237 |
$repondre->repondre($liste->actionargs[0] . "/" . $liste->actionargs[1]);
|
284 |
$xml_parser->load();
|
Line 238... |
Line 285... |
238 |
break;
|
285 |
break;
|
239 |
}
|
286 |
}
|
240 |
|
287 |
|