forked from Wavyzz/dolibarr
New: Amlioration du module de gestion des adhrents
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
*
|
||||
@@ -92,6 +92,7 @@ class Adherent
|
||||
\param recipients destinataires
|
||||
\param text contenu du message
|
||||
\param subject sujet du message
|
||||
\return int <0 si ko, >0 si ok
|
||||
\remarks La particularite de cette fonction est de remplacer certains champs
|
||||
\remarks par leur valeur pour l'adherent en l'occurrence :
|
||||
\remarks %PRENOM% : est remplace par le prenom
|
||||
@@ -99,11 +100,11 @@ class Adherent
|
||||
\remarks %INFOS% : l'ensemble des attributs de cet adherent
|
||||
\remarks %SERVEUR% : URL du serveur web
|
||||
\remarks etc..
|
||||
\todo Utiliser classe CMailFile
|
||||
*/
|
||||
|
||||
function send_an_email($recipients,$text,$subject="Vos coordonnees sur %SERVEUR%")
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$patterns = array (
|
||||
'/%PRENOM%/',
|
||||
'/%NOM%/',
|
||||
@@ -121,15 +122,20 @@ class Adherent
|
||||
'/%LOGIN%/',
|
||||
'/%PASS%/'
|
||||
);
|
||||
$infos = "Prenom : $this->prenom\nNom : $this->nom\nSociete : $this->societe\nAdresse : $this->adresse\nCP : $this->cp\nVille : $this->ville\nPays : $this->pays\nEmail : $this->email\nLogin : $this->login\nPassword : $this->pass\nDate de naissance : $this->naiss\nPhoto : $this->photo\n";
|
||||
if ($this->public == 1)
|
||||
{
|
||||
$infos.="Fiche Publique : Oui\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$infos.="Fiche Publique : Non\n";
|
||||
}
|
||||
$infos.= $langs->trans("Lastname").": $this->nom\n";
|
||||
$infos = $langs->trans("Firstname").": $this->prenom\n";
|
||||
$infos.= $langs->trans("Company").": $this->societe\n";
|
||||
$infos.= $langs->trans("Address").": $this->adresse\n";
|
||||
$infos.= $langs->trans("Zip").": $this->cp\n";
|
||||
$infos.= $langs->trans("Town").": $this->ville\n";
|
||||
$infos.= $langs->trans("Country").": $this->pays\n";
|
||||
$infos.= $langs->trans("EMail").": $this->email\n";
|
||||
$infos.= $langs->trans("Login").": $this->login\n";
|
||||
$infos.= $langs->trans("Password").": $this->pass\n";
|
||||
$infos.= $langs->trans("Birthday").": $this->naiss\n";
|
||||
$infos.= $langs->trans("Photo").": $this->photo\n";
|
||||
$infos.= $langs->trans("Public").": ".yn($this->public)."\n";
|
||||
|
||||
$replace = array (
|
||||
$this->prenom,
|
||||
$this->nom,
|
||||
@@ -149,13 +155,28 @@ class Adherent
|
||||
);
|
||||
$texttosend = preg_replace ($patterns, $replace, $text);
|
||||
$subjectosend = preg_replace ($patterns, $replace, $subject);
|
||||
if (defined('ADHERENT_MAIL_FROM') && ADHERENT_MAIL_FROM != ''){
|
||||
return mail($recipients,$subjectosend,$texttosend,"From: ".ADHERENT_MAIL_FROM."\nReply-To: ".ADHERENT_MAIL_FROM."\nX-Mailer: php/" . phpversion());
|
||||
}else{
|
||||
return mail($recipients,$subjectosend,$texttosend);
|
||||
|
||||
// Envoi mail confirmation
|
||||
include_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
|
||||
|
||||
$from=$conf->email_from;
|
||||
if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM;
|
||||
|
||||
$mailfile = new CMailFile($subject,$this->email,$from,$mesg,array(),array(),array());
|
||||
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFailedToSendPassword");
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief imprime une liste d'erreur.
|
||||
*/
|
||||
@@ -285,15 +306,19 @@ class Adherent
|
||||
}
|
||||
|
||||
/**
|
||||
\brief fonction qui cr<63>e l'adh<64>rent
|
||||
\brief Fonction qui cr<63>e l'adh<64>rent
|
||||
\param userid userid de l'adh<64>rent
|
||||
\return int <0 si ko, >0 si ok
|
||||
*/
|
||||
|
||||
function create($userid)
|
||||
{
|
||||
/*
|
||||
* Insertion dans la base
|
||||
*/
|
||||
global $conf,$langs;
|
||||
|
||||
// Verification parametres
|
||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email)) {
|
||||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->date = $this->db->idate($this->date);
|
||||
|
||||
@@ -310,16 +335,25 @@ class Adherent
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief fonction qui met <20> jour l'adh<64>rent
|
||||
\return int <0 si ko, >0 si ok
|
||||
*/
|
||||
function update()
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
// Verification parametres
|
||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email)) {
|
||||
$this->error = $langs->trans("ErrorBadEMail",$this->email);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql .= " prenom = '".$this->prenom ."'";
|
||||
@@ -328,32 +362,30 @@ class Adherent
|
||||
$sql .= ",adresse='".$this->adresse."'";
|
||||
$sql .= ",cp='" .$this->cp."'";
|
||||
$sql .= ",ville='" .$this->ville."'";
|
||||
$sql .= ",pays='" .$this->pays."'";
|
||||
$sql .= ",pays='" .$this->pays_code."'";
|
||||
$sql .= ",note='" .$this->commentaire."'";
|
||||
$sql .= ",email='" .$this->email."'";
|
||||
$sql .= ",login='" .$this->login."'";
|
||||
$sql .= ",pass='" .$this->pass."'";
|
||||
if ($this->naiss) $sql .= ",naiss='" .$this->naiss."'";
|
||||
else $sql .= ",naiss=null";
|
||||
$sql .= ",photo='" .$this->photo."'";
|
||||
$sql .= ",naiss=" .$this->naiss?"'".$this->naiss."'":"null";
|
||||
$sql .= ",photo=" .$this->photo?"'".$this->photo."'":"null";
|
||||
$sql .= ",public='" .$this->public."'";
|
||||
$sql .= ",statut=" .$this->statut;
|
||||
$sql .= ",fk_adherent_type=".$this->typeid;
|
||||
$sql .= ",morphy='".$this->morphy."'";
|
||||
|
||||
$sql .= " WHERE rowid = $this->id";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
if (!$result)
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sizeof($this->array_options) > 0 )
|
||||
{
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options WHERE adhid = $this->id;";
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options WHERE adhid = ".$this->id;
|
||||
$this->db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options (adhid";
|
||||
@@ -380,7 +412,7 @@ class Adherent
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($this->db);
|
||||
return 0;
|
||||
return -2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -469,9 +501,9 @@ class Adherent
|
||||
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.statut, d.public, d.adresse, d.cp, d.ville, d.note, d.email, d.login, d.pass, d.naiss, d.photo, d.fk_adherent_type, d.morphy, t.libelle as type";
|
||||
$sql .= ",".$this->db->pdate("d.datefin")." as datefin";
|
||||
$sql .= ", d.pays, p.rowid as pays_id, p.code as pays_code, p.libelle as pays_lib";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.pays = p.rowid";
|
||||
$sql .= " WHERE d.rowid = $rowid AND d.fk_adherent_type = t.rowid";
|
||||
$sql .= " WHERE d.rowid = ".$rowid." AND d.fk_adherent_type = t.rowid";
|
||||
|
||||
$result=$this->db->query( $sql);
|
||||
if ($result)
|
||||
@@ -1271,26 +1303,55 @@ class Adherent
|
||||
|
||||
/**
|
||||
* \brief Retourne le libell<6C> du statut d'un adh<64>rent (brouillon, valid<69>, r<>sili<6C>)
|
||||
* \param mode 0=libell<6C> long, 1=libell<6C> court, 2=Picto + Libell<6C> court, 3=Picto, 4=Picto + Libell<6C> long
|
||||
* \return string Libell<6C>
|
||||
*/
|
||||
function getLibStatut()
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return $this->LibStatut($this->statut);
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libell<6C> d'un statut donn<6E>
|
||||
* \param statut id statut
|
||||
* \param mode 0=libell<6C> long, 1=libell<6C> court, 2=Picto + Libell<6C> court, 3=Picto, 4=Picto + Libell<6C> long
|
||||
* \return string Libell<6C>
|
||||
*/
|
||||
function LibStatut($statut)
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("members");
|
||||
if ($mode == 0)
|
||||
{
|
||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
||||
if ($statut == 1) return $langs->trans("MemberStatusActive");
|
||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut == -1) return $langs->trans("MemberStatusDraft");
|
||||
if ($statut == 1) return $langs->trans("MemberStatusActive");
|
||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||
if ($statut == 1) return img_picto($langs->trans('MemberStatusActive'),'statut4').' '.$langs->trans("MemberStatusActive");
|
||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||
if ($statut == 1) return img_picto($langs->trans('MemberStatusActive'),'statut4');
|
||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||
if ($statut == 1) return img_picto($langs->trans('MemberStatusActive'),'statut4').' '.$langs->trans("MemberStatusActive");
|
||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,7 @@ function llxHeader($head = "") {
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=1&filter=uptodate",$langs->trans("MenuMembersUpToDate"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=0",$langs->trans("MenuMembersResiliated"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/public/adherents/","Espace adherents public");
|
||||
$menu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Exports"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -47,6 +47,11 @@ $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_POST["action"] == 'sendinfo')
|
||||
{
|
||||
$adh = new Adherent($db);
|
||||
@@ -55,7 +60,6 @@ if ($_POST["action"] == 'sendinfo')
|
||||
$adh->send_an_email($adh->email,"Voici le contenu de votre fiche\n\n%INFOS%\n\n","Contenu de votre fiche adherent");
|
||||
}
|
||||
|
||||
|
||||
if ($_POST["action"] == 'cotisation')
|
||||
{
|
||||
$reday=$_POST["reday"];
|
||||
@@ -73,9 +77,9 @@ if ($_POST["action"] == 'cotisation')
|
||||
|
||||
// Rajout du nouveau cotisant dans les listes qui vont bien
|
||||
// if (defined("ADHERENT_MAILMAN_LISTS_COTISANT") && ADHERENT_MAILMAN_LISTS_COTISANT!='' && $adh->datefin == "0000-00-00 00:00:00"){
|
||||
if (defined("ADHERENT_MAILMAN_LISTS_COTISANT") && ADHERENT_MAILMAN_LISTS_COTISANT!='' && $adh->datefin == 0)
|
||||
if ($conf->global->ADHERENT_MAILMAN_LISTS_COTISANT && $adh->datefin == 0)
|
||||
{
|
||||
$adh->add_to_mailman(ADHERENT_MAILMAN_LISTS_COTISANT);
|
||||
$adh->add_to_mailman($conf->global->ADHERENT_MAILMAN_LISTS_COTISANT);
|
||||
}
|
||||
|
||||
$crowid=$adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation);
|
||||
@@ -133,8 +137,9 @@ if ($_POST["action"] == 'cotisation')
|
||||
}
|
||||
|
||||
// Envoi mail
|
||||
if (defined("ADHERENT_MAIL_COTIS") && defined("ADHERENT_MAIL_COTIS_SUBJECT")){
|
||||
$adh->send_an_email($adh->email,ADHERENT_MAIL_COTIS,ADHERENT_MAIL_COTIS_SUBJECT);
|
||||
if ($conf->global->ADHERENT_MAIL_COTIS)
|
||||
{
|
||||
$adh->send_an_email($adh->email,$conf->global->ADHERENT_MAIL_COTIS,$conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -143,13 +148,80 @@ if ($_POST["action"] == 'cotisation')
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
}
|
||||
$mesg='<div class="error">'.$langs->trans("FieldRequired",$langs->trans("Amount")).'</div>';
|
||||
$errmsg=$langs->trans("FieldRequired",$langs->trans("Amount"));
|
||||
|
||||
$action = "edit";
|
||||
}
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
if ($_POST["bouton"] == $langs->trans("Save"))
|
||||
{
|
||||
$datenaiss=mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
|
||||
$adh = new Adherent($db);
|
||||
|
||||
$adh->id = $_POST["rowid"];
|
||||
$adh->prenom = $_POST["prenom"];
|
||||
$adh->nom = $_POST["nom"];
|
||||
$adh->societe = $_POST["societe"];
|
||||
$adh->adresse = $_POST["adresse"];
|
||||
$adh->amount = $_POST["amount"];
|
||||
$adh->cp = $_POST["cp"];
|
||||
$adh->ville = $_POST["ville"];
|
||||
$adh->email = $_POST["email"];
|
||||
$adh->login = $_POST["login"];
|
||||
$adh->pass = $_POST["pass"];
|
||||
$adh->naiss = $_POST["naiss"];
|
||||
$adh->photo = $_POST["photo"];
|
||||
$adh->date = $datenaiss;
|
||||
$adh->note = $_POST["note"];
|
||||
$adh->pays = $_POST["pays"];
|
||||
$adh->typeid = $_POST["type"];
|
||||
$adh->commentaire = $_POST["comment"];
|
||||
$adh->morphy = $_POST["morphy"];
|
||||
// recuperation du statut et public
|
||||
$adh->statut = $_POST["statut"];
|
||||
$adh->public = $_POST["public"];
|
||||
|
||||
foreach($_POST as $key => $value){
|
||||
if (ereg("^options_",$key)){
|
||||
$adh->array_options[$key]=$_POST[$key];
|
||||
}
|
||||
}
|
||||
if ($adh->update($user->id)>=0)
|
||||
{
|
||||
Header("Location: fiche.php?rowid=".$adh->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$errmsg=$adh->error;
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Header("Location: fiche.php?rowid=".$rowid);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'add')
|
||||
{
|
||||
$datenaiss='';
|
||||
if (isset($_POST["naissday"]) && $_POST["naissday"]
|
||||
&& isset($_POST["naissmonth"])
|
||||
&& isset($_POST["naissyear"]) && $_POST["naissyear"])
|
||||
{
|
||||
$datenaiss=mktime(12, 0 , 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
|
||||
}
|
||||
$datecotisation='';
|
||||
if (isset($_POST["naissday"]) && isset($_POST["naissmonth"]) && isset($_POST["naissyear"]))
|
||||
{
|
||||
$datecotisation=mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
}
|
||||
|
||||
$type=$_POST["type"];
|
||||
$nom=$_POST["nom"];
|
||||
$prenom=$_POST["prenom"];
|
||||
@@ -157,18 +229,14 @@ if ($_POST["action"] == 'add')
|
||||
$adresse=$_POST["adresse"];
|
||||
$cp=$_POST["cp"];
|
||||
$ville=$_POST["ville"];
|
||||
$pays=$_POST["pays"];
|
||||
$email=$_POST["email"];
|
||||
$login=$_POST["login"];
|
||||
$pass=$_POST["pass"];
|
||||
$naiss=$_POST["naiss"];
|
||||
$pays_code=$_POST["pays_code"];
|
||||
$email=$_POST["member_email"];
|
||||
$login=$_POST["member_login"];
|
||||
$pass=$_POST["member_pass"];
|
||||
$photo=$_POST["photo"];
|
||||
$note=$_POST["note"];
|
||||
$comment=$_POST["comment"];
|
||||
$morphy=$_POST["morphy"];
|
||||
$reday=$_POST["reday"];
|
||||
$remonth=$_POST["remonth"];
|
||||
$reyear=$_POST["reyear"];
|
||||
$cotisation=$_POST["cotisation"];
|
||||
|
||||
$adh = new Adherent($db);
|
||||
@@ -178,11 +246,11 @@ if ($_POST["action"] == 'add')
|
||||
$adh->adresse = $adresse;
|
||||
$adh->cp = $cp;
|
||||
$adh->ville = $ville;
|
||||
$adh->pays = $pays;
|
||||
$adh->pays_code = $pays_code;
|
||||
$adh->email = $email;
|
||||
$adh->login = $login;
|
||||
$adh->pass = $pass;
|
||||
$adh->naiss = $naiss;
|
||||
$adh->naiss = $datenaiss;
|
||||
$adh->photo = $photo;
|
||||
$adh->note = $note;
|
||||
$adh->typeid = $type;
|
||||
@@ -231,17 +299,8 @@ if ($_POST["action"] == 'add')
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Password"))."<br>\n";
|
||||
}
|
||||
if (isset($naiss) && $naiss !=''){
|
||||
if (!preg_match("/^\d\d\d\d-\d\d-\d\d$/",$naiss)) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("DateSubscription")." (".$langs->trans("DateFormatYYYYMMDD").")<br>\n";
|
||||
}
|
||||
}
|
||||
if (isset($public)) {
|
||||
$public=1;
|
||||
} else {
|
||||
$public=0;
|
||||
}
|
||||
if (isset($public)) $public=1;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
@@ -250,9 +309,10 @@ if ($_POST["action"] == 'add')
|
||||
{
|
||||
if ($cotisation > 0)
|
||||
{
|
||||
$crowid=$adh->cotisation(mktime(12, 0 , 0, $remonth, $reday, $reyear), $cotisation);
|
||||
$crowid=$adh->cotisation($datecotisation, $cotisation);
|
||||
|
||||
// insertion dans la gestion banquaire si configure pour
|
||||
if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE)
|
||||
if ($global->conf->ADHERENT_BANK_USE)
|
||||
{
|
||||
$dateop=strftime("%Y%m%d",time());
|
||||
$amount=$cotisation;
|
||||
@@ -265,7 +325,8 @@ if ($_POST["action"] == 'add')
|
||||
else
|
||||
{
|
||||
// met a jour la table cotisation
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."cotisation SET fk_bank=$insertid WHERE rowid=$crowid ";
|
||||
$sql ="UPDATE ".MAIN_DB_PREFIX."cotisation";
|
||||
$sql.=" SET fk_bank=$insertid WHERE rowid=$crowid ";
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@@ -279,6 +340,7 @@ if ($_POST["action"] == 'add')
|
||||
}
|
||||
}
|
||||
Header("Location: liste.php?statut=-1");
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
dolibarr_print_error($db);
|
||||
@@ -294,6 +356,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||
$adh = new Adherent($db);
|
||||
$adh->delete($rowid);
|
||||
Header("Location: liste.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -308,12 +371,13 @@ if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes')
|
||||
|
||||
if (isset($adht->mail_valid) && $adht->mail_valid != '')
|
||||
{
|
||||
$adh->send_an_email($adh->email,$adht->mail_valid,$conf->adherent->email_valid_subject);
|
||||
$result=$adh->send_an_email($adh->email,$adht->mail_valid,$conf->adherent->email_valid_subject);
|
||||
}
|
||||
else
|
||||
{
|
||||
$adh->send_an_email($adh->email,$conf->adherent->email_valid,$conf->adherent->email_valid_subject);
|
||||
$result=$adh->send_an_email($adh->email,$conf->adherent->email_valid,$conf->adherent->email_valid_subject);
|
||||
}
|
||||
|
||||
// rajoute l'utilisateur dans les divers abonnements ..
|
||||
if (!$adh->add_to_abo($adht))
|
||||
{
|
||||
@@ -392,38 +456,137 @@ if ($_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == 'yes')
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Cr<43>ation d'une fiche */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($errmsg != '')
|
||||
{
|
||||
print '<table class="border" width="100%">';
|
||||
print "<tr><td class=\"error\"><b>$errmsg</b></td></tr>\n";
|
||||
print '</table><br>';
|
||||
print '<div class="error">'.$errmsg.'</div>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
|
||||
|
||||
if ($action == 'create')
|
||||
if ($action == 'edit')
|
||||
{
|
||||
/********************************************
|
||||
*
|
||||
* Fiche en mode edition
|
||||
*
|
||||
********************************************/
|
||||
|
||||
print_titre($langs->trans("NewMember"));
|
||||
print "<form name='add' action=\"fiche.php\" method=\"post\">\n";
|
||||
$adho = new AdherentOptions($db);
|
||||
$adh = new Adherent($db);
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
// fetch optionals value
|
||||
$adh->fetch_optionals($rowid);
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$rowid;
|
||||
$head[$h][1] = $langs->trans("MemberCard");
|
||||
$hselected=$h;
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $adh->fullname);
|
||||
|
||||
|
||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
print "<input type=\"hidden\" name=\"rowid\" value=\"$rowid\">";
|
||||
print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">";
|
||||
print "<input type=\"hidden\" name=\"public\" value=\"".$adh->public."\">";
|
||||
|
||||
$htmls = new Form($db);
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>';
|
||||
$htmls->select_array("type", $adht->liste_array(), $adh->typeid);
|
||||
print "</td>";
|
||||
|
||||
print '<td valign="top" width="50%">'.$langs->trans("Comments").'</td></tr>';
|
||||
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Morale");
|
||||
|
||||
print "<tr><td>".$langs->trans("Person")."</td><td>";
|
||||
$htmls->select_array("morphy", $morphys, $adh->morphy);
|
||||
print "</td>";
|
||||
|
||||
$rowspan=13;
|
||||
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||
print '<textarea name="comment" wrap="soft" cols="40" rows="15">'.$adh->commentaire.'</textarea></td></tr>';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td width="35%"><input type="text" name="prenom" size="40" value="'.$adh->prenom.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Name").'</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$adh->societe.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="2">'.$adh->adresse.'</textarea></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Zip").'/'.$langs->trans("Town").'</td><td><input type="text" name="cp" size="6" value="'.$adh->cp.'"> <input type="text" name="ville" size="32" value="'.$adh->ville.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
||||
$htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays');
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'</td><td><input type="text" name="email" size="40" value="'.$adh->email.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Login").'</td><td><input type="text" name="login" size="40" value="'.$adh->login.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td><input type="password" name="pass" size="40" value="'.$adh->pass.'"></td></tr>';
|
||||
|
||||
// Date naissance
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
$htmls->select_date(-1,'naiss','','',1,'update');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Url photo
|
||||
print '<tr><td>URL photo</td><td><input type="text" name="photo" size="40" value="'.$adh->photo.'"></td></tr>';
|
||||
foreach($adho->attribute_label as $key=>$value)
|
||||
{
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n";
|
||||
}
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" name="bouton" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Fiche cr<63>ation */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
$htmls = new Form($db);
|
||||
$adht = new AdherentType($db);
|
||||
|
||||
print_titre($langs->trans("NewMember"));
|
||||
print "<form name='add' action=\"fiche.php\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="15%">'.$langs->trans("MemberType").'</td><td width="35%">';
|
||||
$listetype=$adht->liste_array();
|
||||
if (sizeof($listetype)) {
|
||||
@@ -442,21 +605,28 @@ if ($action == 'create')
|
||||
$htmls->select_array("morphy", $morphys);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td valign="top" rowspan="12"><textarea name="comment" wrap="soft" cols="40" rows="16"></textarea></td></tr>';
|
||||
$rowspan=12;
|
||||
print '<td valign="top" rowspan="'.$rowspan.'"><textarea name="comment" wrap="soft" cols="60" rows="12"></textarea></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Firstname").'*</td><td><input type="text" name="prenom" size="40" value="'.$adh->prenom.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Lastname").'*</td><td><input type="text" name="nom" value="'.$adh->nom.'" size="40"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$adh->societe.'"></td></tr>';
|
||||
print '<tr><td valign="top">'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="adresse" wrap="soft" cols="40" rows="2"></textarea></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" size="8"> <input type="text" name="ville" size="40" value="'.$adh->ville.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td><input type="text" name="cp" size="8"> <input type="text" name="ville" size="32" value="'.$adh->ville.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td>';
|
||||
$htmls->select_pays($adh->pays?$adh->pays:$mysoc->pays,'pays');
|
||||
$htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays_code');
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'</td><td><input type="text" name="email" size="40" value="'.$adh->email.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Login").'*</td><td><input type="text" name="login" size="40" value="'.$adh->login.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Password").'*</td><td><input type="password" name="pass" size="40" value="'.$adh->password.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Birthday").'</td><td><input type="text" name="naiss" size="10"> ('.$langs->trans("DateFormatYYYYMMDD").')</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'</td><td><input type="text" name="member_email" size="40" value="'.$adh->email.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Login").'*</td><td><input type="text" name="member_login" size="40" value="'.$adh->login.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Password").'*</td><td><input type="password" name="member_pass" size="40" value="'.$adh->password.'"></td></tr>';
|
||||
|
||||
// Date naissance
|
||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||
$htmls->select_date(-1,'naiss','','',1,'add');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Url photo
|
||||
print '<tr><td>Url photo</td><td><input type="text" name="photo" size="40"></td></tr>';
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\"></td></tr>\n";
|
||||
@@ -470,7 +640,7 @@ if ($action == 'create')
|
||||
$htmls->select_date('','','','','','add');
|
||||
print "</td></tr>\n";
|
||||
|
||||
if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE)
|
||||
if ($conf->global->ADHERENT_BANK_USE)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$htmls->select_types_paiements('','operation');
|
||||
@@ -498,13 +668,14 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Edition de la fiche */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($rowid)
|
||||
if ($rowid && $action != 'edit')
|
||||
{
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Mode affichage */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
$adh = new Adherent($db);
|
||||
$adh->id = $rowid;
|
||||
$adh->fetch($rowid);
|
||||
@@ -527,27 +698,21 @@ if ($rowid)
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, $adh->fullname);
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression de l'adh<64>rent
|
||||
*/
|
||||
// Confirmation de la suppression de l'adh<64>rent
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_delete");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la validation
|
||||
*/
|
||||
// Confirmation de la validation
|
||||
if ($action == 'valid')
|
||||
{
|
||||
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la R<>siliation
|
||||
*/
|
||||
// Confirmation de la R<>siliation
|
||||
if ($action == 'resign')
|
||||
{
|
||||
$html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign");
|
||||
@@ -622,7 +787,7 @@ if ($rowid)
|
||||
if ($adh->public==1) print $langs->trans("Yes");
|
||||
else print $langs->trans("No");
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$adh->getLibStatut($adh).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$adh->getLibStatut(4).'</td></tr>';
|
||||
|
||||
foreach($adho->attribute_label as $key=>$value){
|
||||
print "<tr><td>$value</td><td>".$adh->array_options["options_$key"]." </td></tr>\n";
|
||||
@@ -641,7 +806,7 @@ if ($rowid)
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
print "<a class=\"butAction\" href=\"edit.php?rowid=$rowid\">".$langs->trans("Edit")."</a>";
|
||||
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=edit\">".$langs->trans("Edit")."</a>";
|
||||
|
||||
// Valider
|
||||
if ($adh->statut < 1)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -162,7 +162,7 @@ if ($result)
|
||||
|
||||
// Statut
|
||||
print "<td>";
|
||||
print $adh->LibStatut($objp->statut);
|
||||
print $adh->LibStatut($objp->statut,2);
|
||||
print "</td>";
|
||||
|
||||
print "<td><a href=\"edit.php?rowid=$objp->rowid&action=edit\">".img_edit()."</a> ";
|
||||
|
||||
@@ -46,7 +46,7 @@ function llxHeader($head = "") {
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=1&filter=uptodate",$langs->trans("MenuMembersUpToDate"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/adherents/liste.php?statut=0",$langs->trans("MenuMembersResiliated"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/public/adherents/","Espace adherents public");
|
||||
$menu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/adherents/index.php",$langs->trans("Exports"));
|
||||
$menu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"));
|
||||
|
||||
@@ -38,8 +38,14 @@ $user->getrights();
|
||||
if (! $user->societe_id == 0)
|
||||
accessforbidden();
|
||||
|
||||
$entitytoicon=array('invoice'=>'bill','invoice_line'=>'bill');
|
||||
$entitytolang=array('user'=>'User','company'=>'Company','contact'=>'Contact','invoice'=>'Bill','invoice_line'=>'InvoiceLine');
|
||||
$entitytoicon=array(
|
||||
'invoice'=>'bill','invoice_line'=>'bill',
|
||||
'member'=>'user', 'member_type'=>'user');
|
||||
$entitytolang=array(
|
||||
'user'=>'User',
|
||||
'company'=>'Company','contact'=>'Contact',
|
||||
'invoice'=>'Bill','invoice_line'=>'InvoiceLine',
|
||||
'member'=>'Member','member_type'=>'MemberType');
|
||||
|
||||
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
|
||||
$datatoexport=isset($_GET["datatoexport"])?$_GET["datatoexport"]:'';
|
||||
@@ -49,7 +55,7 @@ $step=isset($_GET["step"])?$_GET["step"]:'1';
|
||||
$objexport=new Export($db);
|
||||
$objexport->load_arrays($user,$datatoexport);
|
||||
|
||||
$objmodel=new ModeleExports();
|
||||
$objmodelexport=new ModeleExports();
|
||||
|
||||
|
||||
/*
|
||||
@@ -467,11 +473,11 @@ if ($step == 4 && $datatoexport)
|
||||
print '<td>'.$langs->trans("LibraryVersion").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$liste=$objmodel->liste_modeles($db);
|
||||
$liste=$objmodelexport->liste_modeles($db);
|
||||
foreach($liste as $key)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$objmodel->getDriverLabel($key).'</td><td>'.$objmodel->getLibLabel($key).'</td><td>'.$objmodel->getLibVersion($key).'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td>'.$objmodelexport->getDriverLabel($key).'</td><td>'.$objmodelexport->getLibLabel($key).'</td><td>'.$objmodelexport->getLibVersion($key).'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
@@ -1576,12 +1576,18 @@ class Form
|
||||
* Les champs sont pr<70>s<EFBFBD>lectionn<6E>es avec:
|
||||
* - La date set_time (timestamps ou date au format YYYY-MM-DD ou YYYY-MM-DD HH:MM)
|
||||
* - La date du jour si set_time vaut ''
|
||||
* - Aucune date (champs vides) si set_time vaut -1
|
||||
* - Aucune date (champs vides) si set_time vaut -1 (dans ce cas empty doit valoir 0)
|
||||
* \param set_time Date de pr<70>-s<>lection
|
||||
* \param prefix Prefix pour nom champ
|
||||
* \param h Heure
|
||||
* \param m Minutes
|
||||
* \param empty 0=Champ obligatoire, 1=Permet une saisie vide
|
||||
* \param form_name Nom du formulaire de provenance. Utilis<69> pour les dates en popup style andre.
|
||||
*/
|
||||
function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0, $form_name="")
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
if($prefix=='') $prefix='re';
|
||||
if($h == '') $h=0;
|
||||
if($m == '') $m=0;
|
||||
@@ -1603,7 +1609,8 @@ class Form
|
||||
$strmonth[12] = $langs->trans("December");
|
||||
|
||||
// Analyse de la date de pr<70>selection
|
||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$set_time,$reg)) {
|
||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?',$set_time,$reg))
|
||||
{
|
||||
// Date au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
||||
$syear = $reg[1];
|
||||
$smonth = $reg[2];
|
||||
@@ -1611,7 +1618,8 @@ class Form
|
||||
$shour = $reg[4];
|
||||
$smin = $reg[5];
|
||||
}
|
||||
elseif ($set_time) {
|
||||
elseif ($set_time > 0)
|
||||
{
|
||||
// Date est un timestamps
|
||||
$syear = date("Y", $set_time);
|
||||
$smonth = date("n", $set_time);
|
||||
@@ -1619,8 +1627,9 @@ class Form
|
||||
$shour = date("H", $set_time);
|
||||
$smin = date("i", $set_time);
|
||||
}
|
||||
else {
|
||||
// Date est vide
|
||||
else
|
||||
{
|
||||
// Date est vide ou vaut -1
|
||||
$syear = '';
|
||||
$smonth = '';
|
||||
$sday = '';
|
||||
@@ -1632,17 +1641,16 @@ class Form
|
||||
* Affiche date en popup
|
||||
*/
|
||||
if ($conf->use_javascript && $conf->use_popup_calendar && $h==0 && $m==0)
|
||||
{
|
||||
// Calendrier popup version eldy
|
||||
if ("$conf->use_popup_calendar" == "eldy") // Laiss<73> conf->use_popup_calendar entre quote
|
||||
{
|
||||
//print "e".$set_time." t ".$conf->format_date_short;
|
||||
if ($set_time)
|
||||
if ($set_time > 0)
|
||||
{
|
||||
$timearray=getDate($set_time);
|
||||
$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
|
||||
}
|
||||
|
||||
// Calendrier popup version eldy
|
||||
if ("$conf->use_popup_calendar" == "eldy") // Laiss<73> conf->use_popup_calendar entre quote
|
||||
{
|
||||
// Zone de saisie manuelle de la date
|
||||
print '<input id="'.$prefix.'" name="'.$prefix.'" type="text" size="11" maxlength="11" value="'.$formated_date.'"';
|
||||
print ' onChange="dpChangeDay(\''.$prefix.'\',\''.$conf->format_date_short_java.'\')"';
|
||||
@@ -1662,13 +1670,11 @@ class Form
|
||||
// Calendrier popup version defaut
|
||||
if ($langs->defaultlang != "")
|
||||
{
|
||||
print '<script language="javascript">';
|
||||
print '<script language="javascript" type="text/javascript">';
|
||||
print 'selectedLanguage = "'.substr($langs->defaultlang,0,2).'"';
|
||||
print '</script>';
|
||||
}
|
||||
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_calendar.js"></script>';
|
||||
$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
|
||||
if($formated_date=="?") $formated_date="";
|
||||
print '<input id="'.$prefix.'" type="text" name="'.$prefix.'" size="10" value="'.$formated_date.'"> ';
|
||||
print '<input type="hidden" id="'.$prefix.'day" name="'.$prefix.'day" value="'.$sday.'">'."\n";
|
||||
print '<input type="hidden" id="'.$prefix.'month" name="'.$prefix.'month" value="'.$smonth.'">'."\n";
|
||||
|
||||
@@ -617,7 +617,14 @@ class MenuLeft {
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
|
||||
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export","Etiquettes d'adh<64>rents",1,$user->rights->adherent->export);
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/public/adherents/index.php","Espace adherents public");
|
||||
$newmenu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
|
||||
/*
|
||||
if ($leftmenu=="member_public") $newmenu->add(DOL_URL_ROOT."/public/adherents/","Non adherent");
|
||||
if ($leftmenu=="member_public") $newmenu->add_submenu("new.php","Inscription");
|
||||
if ($leftmenu=="member_public") $newmenu->add(DOL_URL_ROOT."/public/adherents/","Adherents");
|
||||
if ($leftmenu=="member_public") $newmenu->add_submenu("priv_edit.php",$langs->trans("EditCard"));
|
||||
if ($leftmenu=="member_public") $newmenu->add_submenu("priv_liste.php",$langs->trans("List"));
|
||||
*/
|
||||
|
||||
$newmenu->add(DOL_URL_ROOT."/adherents/index.php?leftmenu=setup&mainmenu=members",$langs->trans("Setup"),0,$user->rights->adherent->configurer);
|
||||
$newmenu->add_submenu(DOL_URL_ROOT."/adherents/type.php?leftmenu=setup&",$langs->trans("MembersTypes"),1,$user->rights->adherent->configurer);
|
||||
|
||||
@@ -71,7 +71,7 @@ class ExportExcel extends ModeleExports
|
||||
|
||||
// If driver use an external library, put its name here
|
||||
$this->label_lib='Php_WriteExcel';
|
||||
$this->version_lib='?';
|
||||
$this->version_lib='0.3.0';
|
||||
|
||||
$this->row=0;
|
||||
}
|
||||
|
||||
@@ -197,8 +197,9 @@ class modAdherent extends DolibarrModules
|
||||
$r++;
|
||||
$this->export_code[$r]=$this->id.'_'.$r;
|
||||
$this->export_label[$r]='Adh<64>rents et attributs';
|
||||
$this->export_fields_array[$r]=array('a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.email'=>"Email",'a.login'=>"Login",'a.naiss'=>"Birthday");
|
||||
$this->export_alias_array[$r]=array('a.nom'=>"lastname",'a.prenom'=>"firstname",'a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.email'=>"email",'a.login'=>"login",'a.naiss'=>"birthday");
|
||||
$this->export_fields_array[$r]=array('a.nom'=>"Lastname",'a.prenom'=>"Firstname",'a.adresse'=>"Address",'a.cp'=>"Zip",'a.ville'=>"Town",'a.pays'=>"Country",'a.email'=>"Email",'a.login'=>"Login",'a.naiss'=>"Birthday",'a.statut'=>"Satus",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.datefin'=>'DateEnd','a.tms'=>'DateLastModification','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel');
|
||||
$this->export_entities_array[$r]=array('a.nom'=>"member",'a.prenom'=>"member",'a.adresse'=>"member",'a.cp'=>"member",'a.ville'=>"member",'a.pays'=>"member",'a.email'=>"member",'a.login'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.datefin'=>'member','a.tms'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type');
|
||||
$this->export_alias_array[$r]=array('a.nom'=>"lastname",'a.prenom'=>"firstname",'a.adresse'=>"address",'a.cp'=>"zip",'a.ville'=>"town",'a.pays'=>"country",'a.email'=>"email",'a.login'=>"login",'a.naiss'=>"birthday",'a.statut'=>"status",'a.photo'=>'photo','a.note'=>'note','a.datec'=>'datec','a.datevalid'=>'datevalid','a.datefin'=>'dateend','a.tms'=>'datem','ta.rowid'=>'type_id','ta.libelle'=>'type_label');
|
||||
$this->export_sql[$r]="select ";
|
||||
$i=0;
|
||||
foreach ($this->export_alias_array[$r] as $key => $value)
|
||||
@@ -207,7 +208,7 @@ class modAdherent extends DolibarrModules
|
||||
else $i++;
|
||||
$this->export_sql[$r].=$key.' as '.$value;
|
||||
}
|
||||
$this->export_sql[$r].=' from '.MAIN_DB_PREFIX.'adherent as a';
|
||||
$this->export_sql[$r].=' from '.MAIN_DB_PREFIX.'adherent as a, '.MAIN_DB_PREFIX.'adherent_type as ta WHERE a.fk_adherent_type = ta.rowid';
|
||||
$this->export_permission[$r]=array(array("adherent","export"));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Dolibarr language file - en_US - members
|
||||
MembersArea=Members area
|
||||
PublicMembersArea=Public members area
|
||||
MemberCard=Member card
|
||||
Member=Member
|
||||
Members=Members
|
||||
@@ -19,9 +21,13 @@ MenuMembersResiliated=Resiliated members
|
||||
DateAbonment=Subscription date
|
||||
DateSubscription=Subscription date
|
||||
DateNextSubscription=Next subscription
|
||||
DateEndSubscription=Subscription end date
|
||||
EndSubscription=End subscription
|
||||
NewMember=New member
|
||||
NewType=New member type
|
||||
MemberType=Member type
|
||||
MemberTypeId=Member type id
|
||||
MemberTypeLabel=Member type label
|
||||
MembersTypes=Members types
|
||||
MembersAttributes=Members attributes
|
||||
SearchAMember=Search a member
|
||||
@@ -36,7 +42,6 @@ MembersStatusResiliated=Members resiliated
|
||||
NewCotisation=New cotisation
|
||||
EditMember=Edit member
|
||||
SubscriptionEndDate=Subscription end date
|
||||
MembersArea=Members area
|
||||
NewAttribute=New attribut
|
||||
AttributeCode=Attribute code
|
||||
OptionalFieldsSetup=Optional fields setup
|
||||
@@ -65,4 +70,8 @@ ConfirmDeleteMember=Are you sure you want to delete this member (Deleting a meme
|
||||
Filehtpasswd=htpasswd file
|
||||
ValidateMember=Validate a member
|
||||
ConfirmValidateMember=Are you sure you want to validate this member ?
|
||||
FollowingLinksArePublic=Following links ares opened pages not protected by any Dolibarr permission.
|
||||
PublicMemberList=Public member list
|
||||
BlankSubscriptionForm=Subscription form
|
||||
MemberPublicLinks=Public links/pages
|
||||
ExportDataset_member_1=Members and properties
|
||||
@@ -1,4 +1,6 @@
|
||||
# Dolibarr language file - fr_FR - members
|
||||
MembersArea=Espace adh<64>rents
|
||||
PublicMembersArea=Espace public des adh<64>rents
|
||||
MemberCard=Fiche adh<64>rent
|
||||
Member=Adh<64>rent
|
||||
Members=Adh<64>rents
|
||||
@@ -18,10 +20,14 @@ MenuMembersUpToDate=Adh
|
||||
MenuMembersResiliated=Adh<64>rents r<>sili<6C>s
|
||||
DateAbonment=Date cotisation
|
||||
DateSubscription=Date cotisation
|
||||
DateNextSubscription=Prochaine cotisation
|
||||
DateNextSubscription=Date prochaine cotisation
|
||||
DateEndSubscription=Date fin adh<64>sion
|
||||
EndSubscription=Fin adh<64>sion
|
||||
NewMember=Nouvel adh<64>rent
|
||||
NewType=Nouveau type d'adh<64>rent
|
||||
MemberType=Type d'adh<64>rent
|
||||
MemberTypeId=Id type adh<64>rent
|
||||
MemberTypeLabel=Libell<6C> du type adh<64>rent
|
||||
MembersTypes=Types d'adh<64>rents
|
||||
MembersAttributes=Attributs adh<64>rents
|
||||
SearchAMember=Rechercher un membre
|
||||
@@ -36,7 +42,6 @@ MembersStatusResiliated=Adh
|
||||
NewCotisation=Nouvelle adh<64>sion
|
||||
EditMember=<3D>dition adh<64>rent
|
||||
SubscriptionEndDate=Date de fin adh<64>sion
|
||||
MembersArea=Espace adh<64>rents
|
||||
NewAttribute=Nouvel attribut
|
||||
AttributeCode=Code de l'attribut
|
||||
OptionalFieldsSetup=Configuration des champs optionnels
|
||||
@@ -65,4 +70,8 @@ ConfirmDeleteMember=Etes-vous s
|
||||
Filehtpasswd=Fichier htpasswd
|
||||
ValidateMember=Valider un adh<64>rent
|
||||
ConfirmValidateMember=Etes-vous s<>r de vouloir valider cet adh<64>rent ?
|
||||
FollowingLinksArePublic=Les liens suivants sont des pages accessibles <20> tous et non prot<6F>g<EFBFBD>es par aucune habilitation Dolibarr.
|
||||
PublicMemberList=Liste des membres publiques
|
||||
BlankSubscriptionForm=Formulaire inscription
|
||||
MemberPublicLinks=Liens/pages publiques
|
||||
ExportDataset_member_1=Adh<64>rentes et caract<63>ristiques
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -17,25 +18,48 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/public/adherents/index.php
|
||||
\ingroup member
|
||||
\brief Fichier de la page de l'espace publique adherent
|
||||
\author Laurent Destailleur
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Afffichage page
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_titre("Gestion des adhesions a l'association");
|
||||
print_fiche_titre($langs->trans("PublicMembersArea"));
|
||||
|
||||
|
||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
|
||||
print '<tr><td valign="top" width="100%" class="notopnoleft">';
|
||||
|
||||
print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" cellspacing="0" cellpadding="3">';
|
||||
print '<tr class="liste_titre"><td colspan=2>Les menus ci-contre correspondent a:</td></tr>';
|
||||
print '<tr><td>-Inscription :</td><td> Formulaires d\'inscription pour les non-adherents</td></tr>';
|
||||
print '<tr><td>-Edition de sa fiche :</td><td> Permet d\'editer sa fiche d\'adherent</td></tr>';
|
||||
print '<tr><td>-Liste des adherents :</td><td> Permet de voir la liste des adherents (reserve aux adherents)</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/adherents/new.php'.'">'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/new.php'.'</a></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("BlankSubscriptionEditForm").'</td><td>'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/priv_edit.php?id=xxx'.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/adherents/priv_liste.php'.'">'.$dolibarr_main_url_root.DOL_URL_ROOT.'/public/adherents/priv_liste.php'.'</a></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -116,7 +117,8 @@ if ($_POST["action"] == 'add')
|
||||
}
|
||||
}
|
||||
|
||||
llxHeader();
|
||||
|
||||
llxHeaderVierge();
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
@@ -128,7 +130,8 @@ llxHeader();
|
||||
// fetch optionals attributes and labels
|
||||
$adho->fetch_optionals();
|
||||
|
||||
if (isset($action) && $action== 'added'){
|
||||
if (isset($action) && $action== 'added')
|
||||
{
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
print "<tr><td><FONT COLOR=\"blue\">Nouvel Adh<64>rent ajout<75>. En attente de validation</FONT></td></tr>\n";
|
||||
print '</table>';
|
||||
|
||||
@@ -37,6 +37,12 @@ function llxHeader($head = "")
|
||||
$menu->add_submenu("priv_liste.php","Liste des adherents");
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
|
||||
function llxHeaderVierge($head = "")
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
require(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
|
||||
require(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
|
||||
@@ -129,7 +129,7 @@ if ($action == 'update')
|
||||
}
|
||||
|
||||
|
||||
llxHeader();
|
||||
llxHeaderVierge();
|
||||
|
||||
if (isset($user->login))
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -19,11 +19,12 @@
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
llxHeader();
|
||||
|
||||
llxHeaderVierge();
|
||||
|
||||
|
||||
if ($sortorder == "") { $sortorder="ASC"; }
|
||||
|
||||
Reference in New Issue
Block a user