Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 235 → Rev 311

/trunk/client/annuaire/mail_tous.php
1,61 → 1,73
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: mail_tous.php,v 1.2 2005-03-24 08:24:39 alex Exp $
/**
* Permet d'envoie un mail à une sélection dans l'annuaire
*
*
*@package annuaire
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +--------------------------------------------------------------------+
// | mail_tous.php |
// +--------------------------------------------------------------------+
// | Copyright (c) 2002 Tela Botanica |
// +--------------------------------------------------------------------+
// | Application permetant d'envoyer un mail à tous |
// +--------------------------------------------------------------------+
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> |
// +--------------------------------------------------------------------+
//
// $Id: mail_tous.php,v 1.1.1.1 2005-01-03 17:27:49 alex Exp $
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
include_once "php/lib/pack.lib.gen.php" ;
include_once "php/auth_object_login.php" ;
 
function putFrame() {
// configuration
global $GS_GLOBAL ;
global $objet, $corps, $annuaire_LABEL_STATUT, $SERVER_ADMIN ;
global $action ;
$url = "document.php?project=".$GS_GLOBAL['project']."&locale=".$GS_GLOBAL['locale']."&doc=".$GS_GLOBAL['document_row']->D_NAME ;
$url .= "&page=".$GS_GLOBAL['current_page_ndx'] ;
$url = $GLOBALS['ann_url']->getURL() ;
$link = $GS_GLOBAL['link'] ;
$annu_table = "annuaire_tela" ;
$champs_mail = "U_MAIL" ;
 
// Entete
// Identification
$loginObj = new authLoginClass() ;
if (!gs_manageAuthWithObject ($GS_GLOBAL['mysql_db'], $GS_GLOBAL['link'], $loginObj, &$outputText)) {
$res = $outputText ;
} else {
$corps_debut = "RESEAU TELA BOTANICA - Le ".date("j/m/Y").
"\n\nBonjour,\n"."\n\nCordialement,\n-------------------\nTela Botanica le réseau des botanistes francophones\naccueil@tela-botanica.org\nhttp://www.tela-botanica.org\n";
 
$res = "<h1>Envoi d'un mail &agrave; tous les membres</h1>\n" ;
// Entete
confirmation() ;
$corps_debut = "RESEAU TELA BOTANICA - Le ".date("j/m/Y").
"\n\nBonjour,\n"."\n\nCordialement,\n-------------------\nTela Botanica le réseau des botanistes francophones\naccueil@tela-botanica.org\nhttp://www.tela-botanica.org\n";
if ($_GET['action'] == ANN_MAIL_TOUS_ENVOIE) $res .= envoie_mail_selection() ;
$res = "<tr class=\"titlePage\"><td>Envoi d'un mail &agrave; tous les membres</td></tr>\n" ;
$res .= "<tr><td>&nbsp;</td></tr>\n" ;
if ($action == "go") $res .= envoie_mail() ;
// formulaire
$res .= "<tr><td><form action=\"$url&action=go\" method=\"post\"><table width=\"100%\">\n" ;
$res .= "<tr><td class=\"insLabel\">" ;
$res .= "Objet&nbsp;:&nbsp;</td><td><input size=\"91\" name=\"objet\" type=\"text\" class=\"insInputForm\"></td></tr>\n" ;
$res .= "<tr><td class=\"insLabel\">Corps&nbsp;:&nbsp;</td><td><textarea name=\"corps\" cols=\"90\" rows=\"30\" class=\"insInputForm\">$corps_debut</textarea></td></tr>\n" ;
$res .= "<tr><td></td><td><input type=\"submit\" class=\"texte_tb\" value=\"envoyer\"" ;
$res .= " onclick=\"javascript:return confirmLink(this, 'Etes-vous sur de vouloir envoyer ce message !!');\"" ;
$res .= "></td></tr>\n" ;
$res .= "</table></form></td></tr>\n" ;
}
// formulaire
$res .= "<div><form action=\"$url&action=".ANN_MAIL_TOUS_ENVOIE."\" method=\"post\"><table>\n" ;
$res .= "<tr><td class=\"insLabel\">" ;
$res .= "Objet&nbsp;:&nbsp;</td><td><input size=\"91\" name=\"objet\" type=\"text\" class=\"insInputForm\"></td></tr>\n" ;
$res .= "<tr><td class=\"insLabel\">Corps&nbsp;:&nbsp;</td><td><textarea name=\"corps\" cols=\"90\" rows=\"30\" class=\"insInputForm\">$corps_debut</textarea></td></tr>\n" ;
$res .= "<tr><td></td><td><input type=\"submit\" class=\"texte_tb\" value=\"envoyer\"" ;
$res .= " onclick=\"javascript:return confirm('Etes-vous sur de vouloir envoyer ce message !!');\"" ;
$res .= "></td></tr>\n" ;
$res .= "</table></form></div>\n" ;
 
return $res ;
}
 
64,7 → 76,7
// envoie le mail à tous
 
 
function envoie_mail()
function envoie_mail_selection()
{
global $objet, $corps, $annuaire_LABEL_STATUT, $SERVER_ADMIN, $GS_GLOBAL ;
76,8 → 88,8
 
$corps = stripslashes($corps) ;
$requete = cxt_getVariable($GS_GLOBAL['mysql_db'], $GS_GLOBAL['link'], "requete_mail_tous") ;
cxt_clear($GS_GLOBAL['mysql_db'], $GS_GLOBAL['link']) ;
$requete = $_SESSION['requete_mail_tous'] ;
unset ($_SESSION['requete_mail_tous']) ;
 
$resultat = mysql_query($requete) or die ("echec") ;
87,8 → 99,7
}
}
return "<tr><td class=\"titlePage\">Le mail est parti !</td></tr>\n";
return "<div>Le mail est parti !</div>\n";
 
}
?>