ajout des commentaires doxygen pour la doc
This commit is contained in:
parent
5c4e98f2f7
commit
8457b7c87e
@ -14,6 +14,23 @@ Note: this code requires version 4.1.0 or higher of PHP.
|
|||||||
Adaptation pour fonctionnner en PHP 5.0
|
Adaptation pour fonctionnner en PHP 5.0
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
* $Source$
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file XML-RPC.functions.php
|
||||||
|
\brief Fonction XLM-RPC pour dolibarr
|
||||||
|
\author Keith Devens
|
||||||
|
\author Jean-Louis Bergamo
|
||||||
|
\auhtor Laurent Destailleur
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \class XML
|
||||||
|
\brief Fonction XLM-RPC pour dolibarr
|
||||||
|
*/
|
||||||
|
|
||||||
function & XML_serialize(&$data, $level = 0, $prior_key = NULL){
|
function & XML_serialize(&$data, $level = 0, $prior_key = NULL){
|
||||||
#assumes a hash, keys are the variable names
|
#assumes a hash, keys are the variable names
|
||||||
@ -71,11 +88,11 @@ function & XML_serialize(&$data, $level = 0, $prior_key = NULL){
|
|||||||
}
|
}
|
||||||
|
|
||||||
class XML {
|
class XML {
|
||||||
var $parser; #a reference to the XML parser
|
var $parser; /**< a reference to the XML parser */
|
||||||
var $document; #the entire XML structure built up so far
|
var $document; /**< the entire XML structure built up so far */
|
||||||
var $current; #a pointer to the current item - what is this
|
var $current; /**< a pointer to the current item - what is this */
|
||||||
var $parent; #a pointer to the current parent - the parent will be an array
|
var $parent; /**< a pointer to the current parent - the parent will be an array */
|
||||||
var $parents; #an array of the most recent parent at each level
|
var $parents; /**< an array of the most recent parent at each level */
|
||||||
|
|
||||||
var $last_opened_tag;
|
var $last_opened_tag;
|
||||||
|
|
||||||
@ -496,4 +513,4 @@ function XMLRPC_show($data, $func = "print_r", $return_str = false){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -22,6 +22,19 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! \file adherent.class.php
|
||||||
|
\brief Classe permettant la gestion d'un adhérent
|
||||||
|
\author Rodolphe Qiedeville
|
||||||
|
\author Jean-Louis Bergamo
|
||||||
|
\author Laurent Destailleur
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \class adherent.class.php
|
||||||
|
\brief Classe permettant la gestion d'un adhérent
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
class Adherent
|
class Adherent
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
@ -47,11 +60,14 @@ class Adherent
|
|||||||
var $array_options;
|
var $array_options;
|
||||||
|
|
||||||
var $errorstr;
|
var $errorstr;
|
||||||
/*
|
|
||||||
*
|
/*!
|
||||||
*
|
\brief Adherent
|
||||||
*/
|
\param DB base de données
|
||||||
Function Adherent($DB, $id='')
|
\param id id de l'adhérent
|
||||||
|
*/
|
||||||
|
|
||||||
|
Function Adherent($DB, $id='')
|
||||||
{
|
{
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -61,17 +77,22 @@ class Adherent
|
|||||||
// les champs optionnels sont vides
|
// les champs optionnels sont vides
|
||||||
$this->array_options=array();
|
$this->array_options=array();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* function envoyant un email au destinataire (recipient) avec le text fourni en parametre.
|
/*!
|
||||||
* La particularite de cette fonction est de remplacer certains champs par leur valeur pour l'adherent
|
\brief function envoyant un email au destinataire (recipient) avec le text fourni en parametre.
|
||||||
* en l'occurrence :
|
\param recipients destinataires
|
||||||
* %PRENOM% : est remplace par le prenom
|
\param text contenu du message
|
||||||
* %NOM% : est remplace par nom
|
\param subject sujet du message
|
||||||
* %INFOS% : l'ensemble des attributs de cet adherent
|
\remarks La particularite de cette fonction est de remplacer certains champs
|
||||||
* %SERVEUR% : URL du serveur web
|
\remarks par leur valeur pour l'adherent en l'occurrence :
|
||||||
* ...
|
\remarks %PRENOM% : est remplace par le prenom
|
||||||
*/
|
\remarks %NOM% : est remplace par nom
|
||||||
|
\remarks %INFOS% : l'ensemble des attributs de cet adherent
|
||||||
|
\remarks %SERVEUR% : URL du serveur web
|
||||||
|
\remarks etc..
|
||||||
|
*/
|
||||||
|
|
||||||
Function send_an_email($recipients,$text,$subject="Vos coordonnees sur %SERVEUR%")
|
Function send_an_email($recipients,$text,$subject="Vos coordonnees sur %SERVEUR%")
|
||||||
{
|
{
|
||||||
$patterns = array (
|
$patterns = array (
|
||||||
@ -125,10 +146,11 @@ class Adherent
|
|||||||
return mail($recipients,$subjectosend,$texttosend);
|
return mail($recipients,$subjectosend,$texttosend);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*
|
/*!
|
||||||
*
|
\brief imprime une liste d'erreur.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function print_error_list()
|
Function print_error_list()
|
||||||
{
|
{
|
||||||
$num = sizeof($this->errorstr);
|
$num = sizeof($this->errorstr);
|
||||||
@ -140,8 +162,10 @@ class Adherent
|
|||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief fonction qui renvoi la nature physique ou morale d'un adherent
|
\brief fonction qui renvoie la nature physique ou morale d'un adherent
|
||||||
|
\param morphy nature physique ou morale de l'adhérent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function getmorphylib($morphy='')
|
Function getmorphylib($morphy='')
|
||||||
{
|
{
|
||||||
if (! $morphy) { $morphy=$this->morphy; }
|
if (! $morphy) { $morphy=$this->morphy; }
|
||||||
@ -150,11 +174,12 @@ class Adherent
|
|||||||
return $morphy;
|
return $morphy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
*
|
\brief fonction qui vérifie les données entrées
|
||||||
*
|
\param minimum
|
||||||
*/
|
*/
|
||||||
Function check($minimum=0)
|
|
||||||
|
Function check($minimum=0)
|
||||||
{
|
{
|
||||||
$err = 0;
|
$err = 0;
|
||||||
|
|
||||||
@ -249,12 +274,13 @@ class Adherent
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Création
|
/*!
|
||||||
*
|
\brief fonction qui crée l'adhérent
|
||||||
*
|
\param userid userid de l'adhérent
|
||||||
*/
|
*/
|
||||||
Function create($userid)
|
|
||||||
|
Function create($userid)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Insertion dans la base
|
* Insertion dans la base
|
||||||
@ -264,10 +290,10 @@ class Adherent
|
|||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent (datec)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent (datec)";
|
||||||
$sql .= " VALUES (now())";
|
$sql .= " VALUES (now())";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id();
|
$this->id = $this->db->last_insert_id();
|
||||||
return $this->update();
|
return $this->update();
|
||||||
@ -280,11 +306,10 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Mise à jour
|
\brief fonction qui met à jour l'adhérent
|
||||||
*
|
*/
|
||||||
*
|
|
||||||
*/
|
|
||||||
Function update()
|
Function update()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -342,10 +367,11 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Suppression de l'adhérent
|
\brief fonction qui supprime l'adhérent et les données associées
|
||||||
*
|
\param rowid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function delete($rowid)
|
Function delete($rowid)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -383,13 +409,13 @@ class Adherent
|
|||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Fetch
|
/*!
|
||||||
*
|
\brief fonction qui récupére l'adhérent en donnant son login
|
||||||
*
|
\param login login de l'adhérent
|
||||||
*/
|
*/
|
||||||
/* Fetch adherent corresponding to login passed in argument */
|
|
||||||
Function fetch_login($login)
|
Function fetch_login($login)
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent WHERE login='$login' LIMIT 1";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent WHERE login='$login' LIMIT 1";
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
@ -405,8 +431,14 @@ class Adherent
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Fetch adherent corresponding to rowid passed in argument */
|
|
||||||
Function fetch($rowid)
|
/*!
|
||||||
|
\brief fonction qui récupére l'adhérent en donnant son rowid
|
||||||
|
\param rowid
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
Function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.statut, d.public, d.adresse, d.cp, d.ville, d.pays, d.note, d.email, d.login, d.pass, d.naiss, d.photo, d.fk_adherent_type, d.morphy, t.libelle as type";
|
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.statut, d.public, d.adresse, d.cp, d.ville, d.pays, 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 .= ",".$this->db->pdate("d.datefin")." as datefin";
|
||||||
@ -450,10 +482,12 @@ class Adherent
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* fetch optional attribute
|
\brief fonction qui récupére les données optionelles de l'adhérent
|
||||||
*/
|
\param rowid
|
||||||
Function fetch_optionals($rowid)
|
*/
|
||||||
|
|
||||||
|
Function fetch_optionals($rowid)
|
||||||
{
|
{
|
||||||
$tab=array();
|
$tab=array();
|
||||||
$sql = "SELECT *";
|
$sql = "SELECT *";
|
||||||
@ -507,14 +541,16 @@ class Adherent
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*!
|
||||||
* Cotisation
|
\brief fonction qui insèe la cotisation dans la base de données
|
||||||
*
|
\param date
|
||||||
*/
|
\param montant
|
||||||
|
*/
|
||||||
|
|
||||||
Function cotisation($date, $montant)
|
Function cotisation($date, $montant)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cotisation (fk_adherent, dateadh, cotisation)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."cotisation (fk_adherent, dateadh, cotisation)";
|
||||||
$sql .= " VALUES ($this->id, ".$this->db->idate($date).", $montant)";
|
$sql .= " VALUES ($this->id, ".$this->db->idate($date).", $montant)";
|
||||||
|
|
||||||
@ -523,8 +559,8 @@ class Adherent
|
|||||||
if ( $this->db->affected_rows() )
|
if ( $this->db->affected_rows() )
|
||||||
{
|
{
|
||||||
$rowid=$this->db->last_insert_id();
|
$rowid=$this->db->last_insert_id();
|
||||||
$datefin = mktime(12, 0 , 0,
|
$datefin = mktime(12, 0 , 0,
|
||||||
strftime("%m",$date),
|
strftime("%m",$date),
|
||||||
strftime("%d",$date),
|
strftime("%d",$date),
|
||||||
strftime("%Y",$date)+1) - (24 * 3600);
|
strftime("%Y",$date)+1) - (24 * 3600);
|
||||||
|
|
||||||
@ -544,28 +580,26 @@ class Adherent
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief fonction qui vérifie que l'utilisateur est valide
|
||||||
|
\param userid userid de l'adhérent
|
||||||
|
*/
|
||||||
|
|
||||||
|
Function validate($userid)
|
||||||
/*
|
|
||||||
* Validation
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Function validate($userid)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET ";
|
||||||
$sql .= "statut=1";
|
$sql .= "statut=1";
|
||||||
$sql .= ",fk_user_valid=".$userid;
|
$sql .= ",fk_user_valid=".$userid;
|
||||||
|
|
||||||
$sql .= " WHERE rowid = $this->id";
|
$sql .= " WHERE rowid = $this->id";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -574,25 +608,26 @@ class Adherent
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
print "<h2><br>$sql<br></h2>";
|
print "<h2><br>$sql<br></h2>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Résiliation
|
/*!
|
||||||
*
|
\brief fonction qui résilie un adhérent
|
||||||
*
|
\param userid userid de de l'adhérent
|
||||||
*/
|
*/
|
||||||
Function resiliate($userid)
|
|
||||||
|
Function resiliate($userid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET ";
|
||||||
$sql .= "statut=0";
|
$sql .= "statut=0";
|
||||||
$sql .= ",fk_user_valid=".$userid;
|
$sql .= ",fk_user_valid=".$userid;
|
||||||
|
|
||||||
$sql .= " WHERE rowid = $this->id";
|
$sql .= " WHERE rowid = $this->id";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -601,15 +636,17 @@ class Adherent
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
print "<h2><br>$sql<br></h2>";
|
print "<h2><br>$sql<br></h2>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Ajoute le user aux differents abonneents automatiques
|
/*!
|
||||||
* (mailing-list, spip, glasnost etc etc ..)
|
\brief fonction qui ajoute l'adhérent au abonnements automatiques
|
||||||
*
|
\param adht
|
||||||
*/
|
\remarks mailing-list, spip, glasnost, etc...
|
||||||
Function add_to_abo($adht)
|
*/
|
||||||
|
|
||||||
|
Function add_to_abo($adht)
|
||||||
{
|
{
|
||||||
$err=0;
|
$err=0;
|
||||||
// mailman
|
// mailman
|
||||||
@ -620,8 +657,8 @@ class Adherent
|
|||||||
$err+=1;
|
$err+=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($adht->vote == 'yes' &&
|
if ($adht->vote == 'yes' &&
|
||||||
defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
||||||
defined("ADHERENT_USE_GLASNOST_AUTO") && ADHERENT_USE_GLASNOST_AUTO ==1
|
defined("ADHERENT_USE_GLASNOST_AUTO") && ADHERENT_USE_GLASNOST_AUTO ==1
|
||||||
)
|
)
|
||||||
@ -647,11 +684,12 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* supprime le user des differents abonnements automatiques
|
\brief fonction qui supprime l'adhérent des abonnements automatiques
|
||||||
* (mailing-list, spip, glasnost etc etc ..)
|
\param adht
|
||||||
*
|
\remarks mailing-list, spip, glasnost, etc...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function del_to_abo($adht)
|
Function del_to_abo($adht)
|
||||||
{
|
{
|
||||||
$err=0;
|
$err=0;
|
||||||
@ -662,7 +700,7 @@ class Adherent
|
|||||||
$err+=1;
|
$err+=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($adht->vote == 'yes' &&
|
if ($adht->vote == 'yes' &&
|
||||||
defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
||||||
defined("ADHERENT_USE_GLASNOST_AUTO") && ADHERENT_USE_GLASNOST_AUTO ==1
|
defined("ADHERENT_USE_GLASNOST_AUTO") && ADHERENT_USE_GLASNOST_AUTO ==1
|
||||||
)
|
)
|
||||||
@ -688,14 +726,13 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
*
|
\brief fonction qui donne les droits rédacteurs dans spip
|
||||||
* Ajoute cet utilisateur comme redacteur dans spip
|
*/
|
||||||
*
|
|
||||||
*/
|
Function add_to_spip()
|
||||||
Function add_to_spip()
|
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
|
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
|
||||||
defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
|
defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
|
||||||
defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
|
defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
|
||||||
defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
|
defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
|
||||||
@ -707,8 +744,8 @@ class Adherent
|
|||||||
// $mydb=new Db('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
// $mydb=new Db('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||||
$result = $mydb->query($query);
|
$result = $mydb->query($query);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$mydb->close();
|
$mydb->close();
|
||||||
return 1;
|
return 1;
|
||||||
@ -717,18 +754,17 @@ class Adherent
|
|||||||
{
|
{
|
||||||
$this->errorstr=$mydb->error();
|
$this->errorstr=$mydb->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
*
|
\brief fonction qui enlève les droits rédacteurs dans spip
|
||||||
* supprime cet utilisateur dans spip
|
*/
|
||||||
*
|
|
||||||
*/
|
Function del_to_spip()
|
||||||
Function del_to_spip()
|
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
|
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
|
||||||
defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
|
defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
|
||||||
defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
|
defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
|
||||||
defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
|
defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
|
||||||
@ -737,8 +773,8 @@ class Adherent
|
|||||||
$query = "DELETE FROM spip_auteurs WHERE login='".$this->login."'";
|
$query = "DELETE FROM spip_auteurs WHERE login='".$this->login."'";
|
||||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||||
$result = $mydb->query($query);
|
$result = $mydb->query($query);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$mydb->close();
|
$mydb->close();
|
||||||
return 1;
|
return 1;
|
||||||
@ -747,18 +783,17 @@ class Adherent
|
|||||||
{
|
{
|
||||||
$this->errorstr=$mydb->error();
|
$this->errorstr=$mydb->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
*
|
\brief fonction qui dit si cet utilisateur est rédacteur dans spip
|
||||||
* est-ce que cet utilisateur est dans spip
|
*/
|
||||||
*
|
|
||||||
*/
|
Function is_in_spip()
|
||||||
Function is_in_spip()
|
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
|
if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP ==1 &&
|
||||||
defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
|
defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' &&
|
||||||
defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
|
defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' &&
|
||||||
defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
|
defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' &&
|
||||||
@ -767,8 +802,8 @@ class Adherent
|
|||||||
$query = "SELECT login FROM spip_auteurs WHERE login='".$this->login."'";
|
$query = "SELECT login FROM spip_auteurs WHERE login='".$this->login."'";
|
||||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||||
$result = $mydb->query($query);
|
$result = $mydb->query($query);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if ($mydb->num_rows()){
|
if ($mydb->num_rows()){
|
||||||
# nous avons au moins une reponse
|
# nous avons au moins une reponse
|
||||||
@ -785,26 +820,26 @@ class Adherent
|
|||||||
# error
|
# error
|
||||||
$this->errorstr=$mydb->error();
|
$this->errorstr=$mydb->error();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Rajoute cet utilisateur au serveur glasnost
|
\brief fonction qui ajoute l'utilisateur dans glasnost
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
Function add_to_glasnost()
|
Function add_to_glasnost()
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
if (defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
||||||
defined('ADHERENT_GLASNOST_SERVEUR') && ADHERENT_GLASNOST_SERVEUR != '' &&
|
defined('ADHERENT_GLASNOST_SERVEUR') && ADHERENT_GLASNOST_SERVEUR != '' &&
|
||||||
defined('ADHERENT_GLASNOST_USER') && ADHERENT_GLASNOST_USER != '' &&
|
defined('ADHERENT_GLASNOST_USER') && ADHERENT_GLASNOST_USER != '' &&
|
||||||
defined('ADHERENT_GLASNOST_PASS') && ADHERENT_GLASNOST_PASS != ''
|
defined('ADHERENT_GLASNOST_PASS') && ADHERENT_GLASNOST_PASS != ''
|
||||||
){
|
){
|
||||||
// application token is not useful here
|
// application token is not useful here
|
||||||
$applicationtoken='';
|
$applicationtoken='';
|
||||||
list($success, $response) =
|
list($success, $response) =
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/authentication"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/authentication"),
|
||||||
XMLRPC_prepare('getUserIdAndToken'),
|
XMLRPC_prepare('getUserIdAndToken'),
|
||||||
@ -820,8 +855,8 @@ class Adherent
|
|||||||
}
|
}
|
||||||
|
|
||||||
list($success,$response)=
|
list($success,$response)=
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
||||||
XMLRPC_prepare('addObject'),
|
XMLRPC_prepare('addObject'),
|
||||||
@ -854,22 +889,22 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* efface cet utilisateur du serveur glasnost
|
\brief fonction qui enlève l'utilisateur de glasnost
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
Function del_to_glasnost()
|
Function del_to_glasnost()
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
if (defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
||||||
defined('ADHERENT_GLASNOST_SERVEUR') && ADHERENT_GLASNOST_SERVEUR != '' &&
|
defined('ADHERENT_GLASNOST_SERVEUR') && ADHERENT_GLASNOST_SERVEUR != '' &&
|
||||||
defined('ADHERENT_GLASNOST_USER') && ADHERENT_GLASNOST_USER != '' &&
|
defined('ADHERENT_GLASNOST_USER') && ADHERENT_GLASNOST_USER != '' &&
|
||||||
defined('ADHERENT_GLASNOST_PASS') && ADHERENT_GLASNOST_PASS != ''
|
defined('ADHERENT_GLASNOST_PASS') && ADHERENT_GLASNOST_PASS != ''
|
||||||
){
|
){
|
||||||
// application token is not useful here
|
// application token is not useful here
|
||||||
$applicationtoken='';
|
$applicationtoken='';
|
||||||
list($success, $response) =
|
list($success, $response) =
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/authentication"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/authentication"),
|
||||||
XMLRPC_prepare('getUserIdAndToken'),
|
XMLRPC_prepare('getUserIdAndToken'),
|
||||||
@ -884,8 +919,8 @@ class Adherent
|
|||||||
}
|
}
|
||||||
// recuperation du personID
|
// recuperation du personID
|
||||||
list($success,$response)=
|
list($success,$response)=
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
||||||
XMLRPC_prepare('getObjectByLogin'),
|
XMLRPC_prepare('getObjectByLogin'),
|
||||||
@ -907,8 +942,8 @@ class Adherent
|
|||||||
if (defined('ADHERENT_GLASNOST_DEFAULT_GROUPID') && ADHERENT_GLASNOST_DEFAULT_GROUPID != ''){
|
if (defined('ADHERENT_GLASNOST_DEFAULT_GROUPID') && ADHERENT_GLASNOST_DEFAULT_GROUPID != ''){
|
||||||
// recuperation des personne de ce groupe
|
// recuperation des personne de ce groupe
|
||||||
list($success,$response)=
|
list($success,$response)=
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/groups"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/groups"),
|
||||||
XMLRPC_prepare('getObject'),
|
XMLRPC_prepare('getObject'),
|
||||||
@ -933,8 +968,8 @@ class Adherent
|
|||||||
}
|
}
|
||||||
// suppression du personID
|
// suppression du personID
|
||||||
list($success,$response)=
|
list($success,$response)=
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
||||||
XMLRPC_prepare('deleteObject'),
|
XMLRPC_prepare('deleteObject'),
|
||||||
@ -959,22 +994,22 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* efface cet utilisateur du serveur glasnost
|
\brief fonction qui vérifie si l'utilisateur est dans glasnost
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
Function is_in_glasnost()
|
Function is_in_glasnost()
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
if (defined("ADHERENT_USE_GLASNOST") && ADHERENT_USE_GLASNOST ==1 &&
|
||||||
defined('ADHERENT_GLASNOST_SERVEUR') && ADHERENT_GLASNOST_SERVEUR != '' &&
|
defined('ADHERENT_GLASNOST_SERVEUR') && ADHERENT_GLASNOST_SERVEUR != '' &&
|
||||||
defined('ADHERENT_GLASNOST_USER') && ADHERENT_GLASNOST_USER != '' &&
|
defined('ADHERENT_GLASNOST_USER') && ADHERENT_GLASNOST_USER != '' &&
|
||||||
defined('ADHERENT_GLASNOST_PASS') && ADHERENT_GLASNOST_PASS != ''
|
defined('ADHERENT_GLASNOST_PASS') && ADHERENT_GLASNOST_PASS != ''
|
||||||
){
|
){
|
||||||
// application token is not useful here
|
// application token is not useful here
|
||||||
$applicationtoken='';
|
$applicationtoken='';
|
||||||
list($success, $response) =
|
list($success, $response) =
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/authentication"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/authentication"),
|
||||||
XMLRPC_prepare('getUserIdAndToken'),
|
XMLRPC_prepare('getUserIdAndToken'),
|
||||||
@ -989,8 +1024,8 @@ class Adherent
|
|||||||
}
|
}
|
||||||
// recuperation du personID
|
// recuperation du personID
|
||||||
list($success,$response)=
|
list($success,$response)=
|
||||||
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
XMLRPC_request(ADHERENT_GLASNOST_SERVEUR.':8001',
|
||||||
'/RPC2',
|
'/RPC2',
|
||||||
'callGateway',
|
'callGateway',
|
||||||
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
array(XMLRPC_prepare("glasnost://".ADHERENT_GLASNOST_SERVEUR."/people"),
|
||||||
XMLRPC_prepare('getObjectByLogin'),
|
XMLRPC_prepare('getObjectByLogin'),
|
||||||
@ -1015,11 +1050,12 @@ class Adherent
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*
|
/*!
|
||||||
*
|
\brief fonction qui rajoute l'utilisateur dans mailman
|
||||||
*/
|
*/
|
||||||
Function add_to_mailman($listes='')
|
|
||||||
|
Function add_to_mailman($listes='')
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_MAILMAN_URL") && ADHERENT_MAILMAN_URL != '' && defined("ADHERENT_MAILMAN_LISTS") && ADHERENT_MAILMAN_LISTS != '')
|
if (defined("ADHERENT_MAILMAN_URL") && ADHERENT_MAILMAN_URL != '' && defined("ADHERENT_MAILMAN_LISTS") && ADHERENT_MAILMAN_LISTS != '')
|
||||||
{
|
{
|
||||||
@ -1047,11 +1083,11 @@ class Adherent
|
|||||||
ADHERENT_MAILMAN_SERVER
|
ADHERENT_MAILMAN_SERVER
|
||||||
);
|
);
|
||||||
$curl_url = preg_replace ($patterns, $replace, ADHERENT_MAILMAN_URL);
|
$curl_url = preg_replace ($patterns, $replace, ADHERENT_MAILMAN_URL);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL,"$curl_url");
|
curl_setopt($ch, CURLOPT_URL,"$curl_url");
|
||||||
//curl_setopt($ch, CURLOPT_URL,"http://www.j1b.org/");
|
//curl_setopt($ch, CURLOPT_URL,"http://www.j1b.org/");
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
||||||
@ -1065,11 +1101,11 @@ class Adherent
|
|||||||
//ob_end_clean();
|
//ob_end_clean();
|
||||||
if (curl_error($ch) > 0)
|
if (curl_error($ch) > 0)
|
||||||
{
|
{
|
||||||
// error
|
// error
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
curl_close ($ch);
|
curl_close ($ch);
|
||||||
|
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1080,11 +1116,11 @@ class Adherent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief fonction qui désinscrit l'utilisateur de toutes les mailing list mailman
|
||||||
|
\ remarks utilie lors de la résiliation d'adhésion
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* desonscription de toutes les listes mailman (utile lors de
|
|
||||||
* resiliation d'adhesion)
|
|
||||||
*/
|
|
||||||
Function del_to_mailman($listes='')
|
Function del_to_mailman($listes='')
|
||||||
{
|
{
|
||||||
if (defined("ADHERENT_MAILMAN_UNSUB_URL") && ADHERENT_MAILMAN_UNSUB_URL != '' && defined("ADHERENT_MAILMAN_LISTS") && ADHERENT_MAILMAN_LISTS != '')
|
if (defined("ADHERENT_MAILMAN_UNSUB_URL") && ADHERENT_MAILMAN_UNSUB_URL != '' && defined("ADHERENT_MAILMAN_LISTS") && ADHERENT_MAILMAN_LISTS != '')
|
||||||
@ -1116,11 +1152,11 @@ class Adherent
|
|||||||
ADHERENT_MAILMAN_SERVER
|
ADHERENT_MAILMAN_SERVER
|
||||||
);
|
);
|
||||||
$curl_url = preg_replace ($patterns, $replace, ADHERENT_MAILMAN_UNSUB_URL);
|
$curl_url = preg_replace ($patterns, $replace, ADHERENT_MAILMAN_UNSUB_URL);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL,"$curl_url");
|
curl_setopt($ch, CURLOPT_URL,"$curl_url");
|
||||||
//curl_setopt($ch, CURLOPT_URL,"http://www.j1b.org/");
|
//curl_setopt($ch, CURLOPT_URL,"http://www.j1b.org/");
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
|
||||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
|
||||||
@ -1134,11 +1170,11 @@ class Adherent
|
|||||||
//ob_end_clean();
|
//ob_end_clean();
|
||||||
if (curl_error($ch) > 0)
|
if (curl_error($ch) > 0)
|
||||||
{
|
{
|
||||||
// error
|
// error
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
curl_close ($ch);
|
curl_close ($ch);
|
||||||
|
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1148,6 +1184,6 @@ class Adherent
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -21,9 +21,17 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*! \file adherent_options.class.php
|
||||||
* Classe de gestion de la table des champs optionels
|
\brief Classe de gestion de la table des champs optionels adhérents
|
||||||
*/
|
\author Rodolphe Quiedville
|
||||||
|
\author Jean-Louis Bergamo
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \class AdherentOptions
|
||||||
|
\brief Classe de gestion de la table des champs optionels adhérents
|
||||||
|
*/
|
||||||
|
|
||||||
class AdherentOptions
|
class AdherentOptions
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
@ -44,7 +52,14 @@ class AdherentOptions
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function AdherentOptions($DB, $id='')
|
|
||||||
|
/*!
|
||||||
|
\brief AdherentOptions
|
||||||
|
\param DB base de données
|
||||||
|
\param id id de l'adhérent
|
||||||
|
*/
|
||||||
|
|
||||||
|
Function AdherentOptions($DB, $id='')
|
||||||
{
|
{
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
@ -52,11 +67,11 @@ class AdherentOptions
|
|||||||
$this->attribute_name = array();
|
$this->attribute_name = array();
|
||||||
$this->attribute_label = array();
|
$this->attribute_label = array();
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Print error_list
|
/*!
|
||||||
*
|
\brief fonction qui imprime un liste d'erreurs
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
Function print_error_list()
|
Function print_error_list()
|
||||||
{
|
{
|
||||||
$num = sizeof($this->errorstr);
|
$num = sizeof($this->errorstr);
|
||||||
@ -65,11 +80,13 @@ class AdherentOptions
|
|||||||
print "<li>" . $this->errorstr[$i];
|
print "<li>" . $this->errorstr[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Check argument
|
/*!
|
||||||
*
|
\brief fonction qui vérifie les données entrées
|
||||||
*/
|
\param minimum
|
||||||
Function check($minimum=0)
|
*/
|
||||||
|
|
||||||
|
Function check($minimum=0)
|
||||||
{
|
{
|
||||||
$err = 0;
|
$err = 0;
|
||||||
|
|
||||||
@ -104,14 +121,16 @@ class AdherentOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Création d'un attribut optionnel supplementaire
|
/*!
|
||||||
* Ceci correspond a une modification de la table
|
\brief fonction qui crée un attribut optionnel
|
||||||
* et pas a un rajout d'enregistrement
|
\param attrname nom de l'atribut
|
||||||
* Prend en argument : le nom de l'attribut et eventuellemnt son
|
\param type type de l'attribut
|
||||||
* type et sa longueur
|
\param length longuer de l'attribut
|
||||||
*
|
|
||||||
*/
|
\remarks Ceci correspond a une modification de la table et pas a un rajout d'enregistrement
|
||||||
|
*/
|
||||||
|
|
||||||
Function create($attrname,$type='varchar',$length=255) {
|
Function create($attrname,$type='varchar',$length=255) {
|
||||||
/*
|
/*
|
||||||
* Insertion dans la base
|
* Insertion dans la base
|
||||||
@ -132,8 +151,8 @@ class AdherentOptions
|
|||||||
$sql .= " ADD $attrname $type";
|
$sql .= " ADD $attrname $type";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -142,12 +161,18 @@ class AdherentOptions
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
print "<h2><br>$sql<br></h2>";
|
print "<h2><br>$sql<br></h2>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief fonction qui crée un label
|
||||||
|
\param attrname nom de l'atribut
|
||||||
|
\param label nom du label
|
||||||
|
*/
|
||||||
|
|
||||||
Function create_label($attrname,$label='') {
|
Function create_label($attrname,$label='') {
|
||||||
/*
|
/*
|
||||||
* Insertion dans la base
|
* Insertion dans la base
|
||||||
@ -156,8 +181,8 @@ class AdherentOptions
|
|||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options_label SET ";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options_label SET ";
|
||||||
$escaped_label=mysql_escape_string($label);
|
$escaped_label=mysql_escape_string($label);
|
||||||
$sql .= " name='$attrname',label='$escaped_label' ";
|
$sql .= " name='$attrname',label='$escaped_label' ";
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -166,14 +191,15 @@ class AdherentOptions
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
print "<h2><br>$sql<br></h2>";
|
print "<h2><br>$sql<br></h2>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Suppression d'un attribut
|
\brief fonction qui supprime un attribut
|
||||||
*
|
\param attrname nom de l'atribut
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function delete($attrname)
|
Function delete($attrname)
|
||||||
{
|
{
|
||||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||||
@ -195,15 +221,16 @@ class AdherentOptions
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Suppression d'un label
|
\brief fonction qui supprime un label
|
||||||
*
|
\param attrname nom du label
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function delete_label($attrname)
|
Function delete_label($attrname)
|
||||||
{
|
{
|
||||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options_label WHERE name='$attrname'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_options_label WHERE name='$attrname'";
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
@ -220,10 +247,13 @@ class AdherentOptions
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Modification d'un attribut
|
\brief fonction qui modifie un attribut optionnel
|
||||||
*
|
\param attrname nom de l'atribut
|
||||||
*/
|
\param type type de l'attribut
|
||||||
|
\param length longuer de l'attribut
|
||||||
|
*/
|
||||||
|
|
||||||
Function update($attrname,$type='varchar',$length=255)
|
Function update($attrname,$type='varchar',$length=255)
|
||||||
{
|
{
|
||||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||||
@ -260,16 +290,18 @@ class AdherentOptions
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Modification d'un label
|
\brief fonction qui modifie un label
|
||||||
*
|
\param attrname nom de l'atribut
|
||||||
*/
|
\param label nom du label
|
||||||
|
*/
|
||||||
|
|
||||||
Function update_label($attrname,$label='')
|
Function update_label($attrname,$label='')
|
||||||
{
|
{
|
||||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-]*$/",$attrname)){
|
||||||
$escaped_label=mysql_escape_string($label);
|
$escaped_label=mysql_escape_string($label);
|
||||||
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."adherent_options_label SET name='$attrname',label='$escaped_label'";
|
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."adherent_options_label SET name='$attrname',label='$escaped_label'";
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
@ -285,20 +317,14 @@ class AdherentOptions
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
Function fetch_optionals()
|
||||||
* fetch optional attribute name and optional attribute label
|
|
||||||
*/
|
|
||||||
Function fetch_optionals()
|
|
||||||
{
|
{
|
||||||
$this->fetch_name_optionals();
|
$this->fetch_name_optionals();
|
||||||
$this->fetch_name_optionals_label();
|
$this->fetch_name_optionals_label();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
Function fetch_name_optionals()
|
||||||
* fetch optional attribute name
|
|
||||||
*/
|
|
||||||
Function fetch_name_optionals()
|
|
||||||
{
|
{
|
||||||
$array_name_options=array();
|
$array_name_options=array();
|
||||||
$sql = "SHOW COLUMNS FROM ".MAIN_DB_PREFIX."adherent_options";
|
$sql = "SHOW COLUMNS FROM ".MAIN_DB_PREFIX."adherent_options";
|
||||||
@ -324,13 +350,10 @@ class AdherentOptions
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
return array() ;
|
return array() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
Function fetch_name_optionals_label()
|
||||||
* fetch optional attribute name and its label
|
|
||||||
*/
|
|
||||||
Function fetch_name_optionals_label()
|
|
||||||
{
|
{
|
||||||
$array_name_label=array();
|
$array_name_label=array();
|
||||||
$sql = "SELECT name,label FROM ".MAIN_DB_PREFIX."adherent_options_label";
|
$sql = "SELECT name,label FROM ".MAIN_DB_PREFIX."adherent_options_label";
|
||||||
@ -353,7 +376,7 @@ class AdherentOptions
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
return array() ;
|
return array() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -20,31 +20,41 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! \file adherent_type.class.php
|
||||||
|
\brief Classe gérant les types d'adhérents
|
||||||
|
\author Rodolphe Quiedeville
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \class AdherentType
|
||||||
|
\brief Classe gérant les types d'adhérents
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
class AdherentType
|
class AdherentType
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
var $libelle;
|
var $libelle;
|
||||||
var $statut;
|
var $statut;
|
||||||
var $cotisation; // Soumis à la cotisation
|
var $cotisation; /**< Soumis à la cotisation */
|
||||||
var $errorstr;
|
var $errorstr;
|
||||||
var $mail_valid; // mail envoye lors de la validation
|
var $mail_valid; /**< mail envoye lors de la validation */
|
||||||
var $commentaire; // commentaire
|
var $commentaire; /**< commentaire */
|
||||||
var $vote; // droit de vote ?
|
var $vote; /** droit de vote ? */
|
||||||
/*
|
|
||||||
*
|
/*!
|
||||||
*
|
\brief AdherentType
|
||||||
*/
|
\param DB base de données
|
||||||
Function AdherentType($DB, $soc_idp="")
|
\param soc_idp
|
||||||
|
*/
|
||||||
|
|
||||||
|
Function AdherentType($DB, $soc_idp="")
|
||||||
{
|
{
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->statut = 1;
|
$this->statut = 1;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*
|
Function print_error_list()
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Function print_error_list()
|
|
||||||
{
|
{
|
||||||
$num = sizeof($this->errorstr);
|
$num = sizeof($this->errorstr);
|
||||||
for ($i = 0 ; $i < $num ; $i++)
|
for ($i = 0 ; $i < $num ; $i++)
|
||||||
@ -52,16 +62,13 @@ class AdherentType
|
|||||||
print "<li>" . $this->errorstr[$i];
|
print "<li>" . $this->errorstr[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*
|
/*!
|
||||||
*
|
\brief fonction qui permet de créer le status de l'adhérent
|
||||||
*/
|
\param userid userid de l'adhérent
|
||||||
/*
|
*/
|
||||||
* Création
|
|
||||||
*
|
Function create($userid)
|
||||||
*
|
|
||||||
*/
|
|
||||||
Function create($userid)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Insertion dans la base
|
* Insertion dans la base
|
||||||
@ -69,10 +76,10 @@ class AdherentType
|
|||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (statut)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (statut)";
|
||||||
$sql .= " VALUES ($this->statut)";
|
$sql .= " VALUES ($this->statut)";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id();
|
$this->id = $this->db->last_insert_id();
|
||||||
return $this->update();
|
return $this->update();
|
||||||
@ -82,17 +89,12 @@ class AdherentType
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
print "<h2><br>$sql<br></h2>";
|
print "<h2><br>$sql<br></h2>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
Function update()
|
||||||
* Mise à jour
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Function update()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type SET ";
|
||||||
$sql .= "libelle = '".$this->libelle ."'";
|
$sql .= "libelle = '".$this->libelle ."'";
|
||||||
$sql .= ",statut=".$this->statut;
|
$sql .= ",statut=".$this->statut;
|
||||||
@ -102,10 +104,10 @@ class AdherentType
|
|||||||
$sql .= ",mail_valid='".$this->mail_valid."'";
|
$sql .= ",mail_valid='".$this->mail_valid."'";
|
||||||
|
|
||||||
$sql .= " WHERE rowid = $this->id";
|
$sql .= " WHERE rowid = $this->id";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -114,17 +116,17 @@ class AdherentType
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
print "<h2><br>$sql<br></h2>";
|
print "<h2><br>$sql<br></h2>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Suppression
|
\brief fonction qui permet de supprimer le status de l'adhérent
|
||||||
*
|
\param rowid
|
||||||
*/
|
*/
|
||||||
Function delete($rowid)
|
|
||||||
|
|
||||||
|
Function delete($rowid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid";
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
@ -142,14 +144,15 @@ class AdherentType
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Fetch
|
/*!
|
||||||
*
|
\brief fonction qui permet de récupérer le status de l'adhérent
|
||||||
*
|
\param rowid
|
||||||
*/
|
*/
|
||||||
Function fetch($rowid)
|
|
||||||
|
Function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = "SELECT *";
|
$sql = "SELECT *";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||||
@ -175,19 +178,15 @@ class AdherentType
|
|||||||
{
|
{
|
||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Function liste_array()
|
Function liste_array()
|
||||||
{
|
{
|
||||||
$projets = array();
|
$projets = array();
|
||||||
|
|
||||||
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."adherent_type";
|
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
$nump = $this->db->num_rows();
|
$nump = $this->db->num_rows();
|
||||||
@ -198,7 +197,7 @@ class AdherentType
|
|||||||
while ($i < $nump)
|
while ($i < $nump)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($i);
|
$obj = $this->db->fetch_object($i);
|
||||||
|
|
||||||
$projets[$obj->rowid] = $obj->libelle;
|
$projets[$obj->rowid] = $obj->libelle;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -209,7 +208,7 @@ class AdherentType
|
|||||||
{
|
{
|
||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,16 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*! \file cotisation.class.php
|
||||||
|
\brief Classe permettant de gèrer les cotisations
|
||||||
|
\author Rodolphe Quiedeville
|
||||||
|
\version $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \class Cotisation
|
||||||
|
\brief Classe permettant de gèrer les cotisations
|
||||||
|
*/
|
||||||
|
|
||||||
class Cotisation
|
class Cotisation
|
||||||
{
|
{
|
||||||
var $id;
|
var $id;
|
||||||
@ -43,20 +53,25 @@ class Cotisation
|
|||||||
|
|
||||||
var $projet;
|
var $projet;
|
||||||
var $errorstr;
|
var $errorstr;
|
||||||
/*
|
|
||||||
*
|
/*!
|
||||||
*
|
\brief Cotisation
|
||||||
*/
|
\param DB base de données
|
||||||
Function Cotisation($DB, $soc_idp="")
|
\param soc_idp
|
||||||
|
*/
|
||||||
|
|
||||||
|
Function Cotisation($DB, $soc_idp="")
|
||||||
{
|
{
|
||||||
$this->db = $DB ;
|
$this->db = $DB ;
|
||||||
$this->modepaiementid = 0;
|
$this->modepaiementid = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function print_error_list()
|
Function print_error_list()
|
||||||
{
|
{
|
||||||
$num = sizeof($this->errorstr);
|
$num = sizeof($this->errorstr);
|
||||||
@ -65,11 +80,13 @@ class Cotisation
|
|||||||
print "<li>" . $this->errorstr[$i];
|
print "<li>" . $this->errorstr[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Function check($minimum=0)
|
|
||||||
|
Function check($minimum=0)
|
||||||
{
|
{
|
||||||
$err = 0;
|
$err = 0;
|
||||||
|
|
||||||
@ -153,12 +170,13 @@ class Cotisation
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Création
|
/*!
|
||||||
*
|
\brief fonction qui permet de créer le don
|
||||||
*
|
\param userid userid de l'adhérent
|
||||||
*/
|
*/
|
||||||
Function create($userid)
|
|
||||||
|
Function create($userid)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Insertion dans la base
|
* Insertion dans la base
|
||||||
@ -183,12 +201,12 @@ class Cotisation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Mise à jour
|
\brief fonction qui permet de mettre à jour le don
|
||||||
*
|
\param userid userid de l'adhérent
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
Function update($userid)
|
Function update($userid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->date = $this->db->idate($this->date);
|
$this->date = $this->db->idate($this->date);
|
||||||
@ -226,14 +244,15 @@ class Cotisation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*!
|
||||||
* Suppression du don
|
\brief fonction qui permet de supprimer le don
|
||||||
*
|
\param rowid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function delete($rowid)
|
Function delete($rowid)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
|
||||||
|
|
||||||
if ( $this->db->query( $sql) )
|
if ( $this->db->query( $sql) )
|
||||||
@ -251,13 +270,14 @@ class Cotisation
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Fetch
|
/*!
|
||||||
*
|
\brief fonction qui permet de récupèrer le don
|
||||||
*
|
\param rowid
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function fetch($rowid)
|
Function fetch($rowid)
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet";
|
$sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet";
|
||||||
@ -296,12 +316,15 @@ class Cotisation
|
|||||||
{
|
{
|
||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Suppression du don
|
/*!
|
||||||
*
|
\brief fonction qui permet de valider la promesse de don
|
||||||
*/
|
\param rowid
|
||||||
|
\param userid userid de l'adhérent
|
||||||
|
*/
|
||||||
|
|
||||||
Function valid_promesse($rowid, $userid)
|
Function valid_promesse($rowid, $userid)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -322,13 +345,16 @@ class Cotisation
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Classé comme payé, le don a été recu
|
/*!
|
||||||
*
|
\brief fonction qui permet de mettre le don comme payé
|
||||||
*/
|
\param rowid
|
||||||
Function set_paye($rowid, $modepaiement='')
|
\param modedepaiement
|
||||||
|
*/
|
||||||
|
|
||||||
|
Function set_paye($rowid, $modepaiement='')
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
|
||||||
|
|
||||||
@ -353,12 +379,15 @@ class Cotisation
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Classé comme payé, le don a été recu
|
/*!
|
||||||
*
|
\brief fonction qui permet de mettre un commentaire sur le don
|
||||||
*/
|
\param rowid
|
||||||
|
\param commentaire
|
||||||
|
*/
|
||||||
|
|
||||||
Function set_commentaire($rowid, $commentaire='')
|
Function set_commentaire($rowid, $commentaire='')
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET note = '$commentaire'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET note = '$commentaire'";
|
||||||
@ -380,13 +409,15 @@ class Cotisation
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* Classé comme encaissé
|
/*!
|
||||||
*
|
\brief fonction qui permet de mettre le don comme encaissé
|
||||||
*/
|
\param rowid
|
||||||
Function set_encaisse($rowid)
|
*/
|
||||||
|
|
||||||
|
Function set_encaisse($rowid)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 3 WHERE rowid = $rowid AND fk_statut = 2;";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 3 WHERE rowid = $rowid AND fk_statut = 2;";
|
||||||
@ -406,11 +437,13 @@ class Cotisation
|
|||||||
{
|
{
|
||||||
print "Err : ".$this->db->error();
|
print "Err : ".$this->db->error();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Somme des dons encaissés
|
* Somme des dons encaissés
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function sum_actual()
|
Function sum_actual()
|
||||||
{
|
{
|
||||||
$sql = "SELECT sum(amount)";
|
$sql = "SELECT sum(amount)";
|
||||||
@ -443,10 +476,12 @@ class Cotisation
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Somme des promesses de dons validées
|
* Somme des promesses de dons validées
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Function sum_intent()
|
Function sum_intent()
|
||||||
{
|
{
|
||||||
$sql = "SELECT sum(amount)";
|
$sql = "SELECT sum(amount)";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user