Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1467 → Rev 1571

/trunk/client/bottin/bibliotheque/inscription.fonct.php
19,7 → 19,7
// | 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: inscription.fonct.php,v 1.30 2007-06-25 09:59:03 alexandre_tb Exp $
// CVS : $Id: inscription.fonct.php,v 1.31 2007-09-06 08:28:32 alexandre_tb Exp $
/**
* Fonctions du module inscription
*
31,7 → 31,7
//Autres auteurs :
*@author Florian Schmitt <florian@ecole-et-nature.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.30 $ $Date: 2007-06-25 09:59:03 $
*@version $Revision: 1.31 $ $Date: 2007-09-06 08:28:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
392,9 → 392,7
* @return
*/
 
function envoie_mail() //A COMPLETER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{
//include_once PAP_CHEMIN_RACINE.'api/pear/Mail/mime.php' ;
function envoie_mail() {
include_once PAP_CHEMIN_RACINE.'api/pear/Mail.php' ;
$crlf="\n";
402,8 → 400,6
$headers ['Subject'] = html_entity_decode(INS_MAIL_COORD_SUJET) ;
$headers ['Reply-To'] = $GLOBALS['ins_config']['ic_from_mail_confirmation'] ;
//$mime = new Mail_mime($crlf);
$requete = "select *, ".INS_CHAMPS_LABEL_PAYS." from ".INS_ANNUAIRE.",".INS_TABLE_PAYS.
" where ".INS_CHAMPS_MAIL."=\"".$GLOBALS['AUTH']->getUsername()."\"".
" and ".INS_CHAMPS_ID_PAYS."=".INS_CHAMPS_PAYS;
413,24 → 409,42
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
$valeur = $ligne;
$body_entete = INS_MAIL_COORD_CORPS."\n" ;
$body = "mail : ".$ligne[INS_CHAMPS_MAIL]."\n" ;
$body .= "------------------------------------------\n";
$body .= INS_NOM.": ".html_entity_decode($ligne[INS_CHAMPS_NOM])." \n" ;
$body .= INS_PRENOM.' : '.html_entity_decode($ligne[INS_CHAMPS_PRENOM])." \n" ;
$body .= INS_PAYS." : ".html_entity_decode($ligne[INS_CHAMPS_LABEL_PAYS])." \n" ;
$body .= "-------------------------------------------\n" ;
 
// On recupere le template de l inscription
include_once GEN_CHEMIN_API.'/formulaire/formulaire.fonct.inc.php';
$tableau= formulaire_valeurs_template_champs($GLOBALS['ins_config']['ic_inscription_template']);
//$mime->setTXTBody($body);
//$mime->setHTMLBody(info()) ;
//$body = $mime->get();
//$headers = $mime->headers($headers);
for ($i=0; $i<count($tableau); $i++) {
//cas des checkbox et des listes
if ($tableau[$i]['type']=='liste') {
if (is_int($tableau[$i]['nom_bdd'])) {
$body .= $tableau[$i]['label'].' : '.$valeur[$tableau[$i]['nom_bdd']]."\n";
} else {
if(isset($valeur[$tableau[$i]['nom_bdd']])) {
list ($table, $col_id, $col_label, $col_langue, $langue) = explode (',', $tableau[$i]['table_source']);
$requete = 'select '.$col_label.' from '.$table.' where '.$col_id.'="'.$valeur[$tableau[$i]['nom_bdd']].'"';;
if (isset($col_langue)) $requete .= ' and '.$col_langue.' like "'.INS_LANGUE_DEFAUT.'%"';
$resultat = $GLOBALS['ins_db']->getOne($requete);
$body .= $tableau[$i]['label'].' : '. $resultat."\n";
}
}
} elseif ($tableau[$i]['type']=='checkbox') {
}
//cas des champs texte
elseif ($tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || $tableau[$i]['type']=='champs_mail') {
//on mets les slashes pour les saisies dans les champs texte et textearea
$body .= $tableau[$i]['label'].' : '.$valeur[$tableau[$i]['nom_bdd']]."\n";
}
}
$body = html_entity_decode($body);
$mail = & Mail::factory('mail') ;
$mail -> send ($ligne[INS_CHAMPS_MAIL], $headers, $body) ;
//mail ($ligne[INS_CHAMPS_MAIL], $headers ['Subject'], $body, 'From: '.$GLOBALS['ins_config']['ic_from_mail_confirmation']);
// Envoi du mail aux administrateur du site
$body = $body_entete.$body;
$body = html_entity_decode($body);
529,6 → 543,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.30 2007-06-25 09:59:03 alexandre_tb
* ajout de carte_google, mise en place des templates avec api/formulaire, configuration de multiples inscriptions, ajout de modele pour les mails
*
* Revision 1.29 2007-05-25 14:32:17 alexandre_tb
* en cours
*