ajout des commentaires doxygen pour la doc

This commit is contained in:
opensides 2004-07-27 22:46:33 +00:00
parent 5c4e98f2f7
commit 8457b7c87e
5 changed files with 480 additions and 370 deletions

View File

@ -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;

View File

@ -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,10 +60,13 @@ class Adherent
var $array_options; var $array_options;
var $errorstr; var $errorstr;
/*
* /*!
* \brief Adherent
*/ \param DB base de données
\param id id de l'adhérent
*/
Function Adherent($DB, $id='') Function Adherent($DB, $id='')
{ {
$this->db = $DB ; $this->db = $DB ;
@ -62,16 +78,21 @@ class Adherent
$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,10 +174,11 @@ 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,11 +274,12 @@ 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)
{ {
/* /*
@ -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,10 +541,12 @@ 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)
{ {
@ -547,13 +583,11 @@ class Adherent
} }
} }
/*!
\brief fonction qui vérifie que l'utilisateur est valide
\param userid userid de l'adhérent
*/
/*
* Validation
*
*
*/
Function validate($userid) Function validate($userid)
{ {
@ -576,11 +610,12 @@ class Adherent
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)
{ {
@ -604,12 +639,14 @@ class Adherent
} }
} }
/*
* 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
@ -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;
@ -688,12 +726,11 @@ 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 != '' &&
@ -721,12 +758,11 @@ class Adherent
} }
} }
/* /*!
* \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 != '' &&
@ -751,12 +787,11 @@ class Adherent
} }
} }
/* /*!
* \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 != '' &&
@ -789,11 +824,11 @@ class Adherent
} }
} }
/* /*!
* 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 != '' &&
@ -854,11 +889,11 @@ 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 != '' &&
@ -959,10 +994,10 @@ 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 &&
@ -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 != '')
{ {
@ -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 != '')

View File

@ -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,6 +52,13 @@ class AdherentOptions
* Constructor * Constructor
* *
*/ */
/*!
\brief AdherentOptions
\param DB base de données
\param id id de l'adhérent
*/
Function AdherentOptions($DB, $id='') Function AdherentOptions($DB, $id='')
{ {
$this->db = $DB ; $this->db = $DB ;
@ -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
@ -148,6 +167,12 @@ class AdherentOptions
} }
} }
/*!
\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
@ -170,10 +195,11 @@ class AdherentOptions
} }
} }
/* /*!
* 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,10 +221,11 @@ 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)){
@ -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,10 +290,12 @@ 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)){
@ -286,19 +318,13 @@ 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";
@ -327,10 +353,7 @@ class AdherentOptions
} }
/* 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";

View File

@ -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
\param soc_idp
*/
Function AdherentType($DB, $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
@ -85,11 +92,6 @@ class AdherentType
} }
} }
/*
* Mise à jour
*
*
*/
Function update() Function update()
{ {
@ -117,12 +119,12 @@ class AdherentType
} }
} }
/* /*!
* 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";
@ -144,12 +146,13 @@ class AdherentType
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";
@ -177,11 +180,7 @@ class AdherentType
} }
} }
/*
*
*
*
*/
Function liste_array() Function liste_array()
{ {
$projets = array(); $projets = array();

View File

@ -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,11 +201,11 @@ 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)
{ {
@ -226,10 +244,11 @@ class Cotisation
} }
} }
/* /*!
* Suppression du don \brief fonction qui permet de supprimer le don
* \param rowid
*/ */
Function delete($rowid) Function delete($rowid)
{ {
@ -253,11 +272,12 @@ class Cotisation
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";
@ -298,10 +318,13 @@ class Cotisation
} }
} }
/*
* 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)
{ {
@ -324,11 +347,14 @@ class Cotisation
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";
@ -355,10 +381,13 @@ class Cotisation
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'";
@ -382,11 +411,13 @@ class Cotisation
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;";
@ -408,9 +439,11 @@ class Cotisation
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)";