Renomage dans tout le code du mot dclaratif de fonction php "Function" (avec F majuscule)

par "function" (avec f minuscule), qui est le mot correct (bien que cela ne gne pas le php,
cela gne doxygen et autres outils d'analyse syntaxique).
This commit is contained in:
Laurent Destailleur 2004-08-07 18:51:54 +00:00
parent fe940dfd46
commit de42d8cab0
24 changed files with 190 additions and 190 deletions

View File

@ -40,7 +40,7 @@ class ActionComm
* Initialisation
*
*/
Function ActionComm($db)
function ActionComm($db)
{
$this->db = $db;
$this->societe = new Societe($db);
@ -55,7 +55,7 @@ class ActionComm
*
*
*/
Function add($author)
function add($author)
{
if (! $this->contact)
{
@ -92,7 +92,7 @@ class ActionComm
*
*
*/
Function fetch($id)
function fetch($id)
{
$sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note, c.libelle, fk_soc, fk_user_author, fk_contact, fk_facture, a.percent ";
$sql .= "FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c WHERE a.id=$id AND a.fk_action=c.id;";
@ -135,7 +135,7 @@ class ActionComm
*
*
*/
Function delete($id)
function delete($id)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm WHERE id=$id;";
@ -148,7 +148,7 @@ class ActionComm
* Met à jour l'action
*
*/
Function update()
function update()
{
if ($this->percent > 100)
{

View File

@ -28,7 +28,7 @@ class Address {
var $city;
var $country;
Function Address() {
function Address() {
}

View File

@ -32,7 +32,7 @@ class BarGraph extends Graph
* Retour: 0 si ko, 1 si ok
*/
Function BarGraph($data=array()) {
function BarGraph($data=array()) {
$modules_list = get_loaded_extensions();
$isgdinstalled=0;
@ -74,7 +74,7 @@ class BarGraph extends Graph
return;
}
Function isGraphKo() {
function isGraphKo() {
return $this->errorstr;
}
@ -82,7 +82,7 @@ class BarGraph extends Graph
* Dessine le graphique
*
*/
Function draw($file, $data, $title='') {
function draw($file, $data, $title='') {
$this->prepare($file, $data, $title);
if (substr($this->MaxValue,0,1) == 1)

View File

@ -24,7 +24,7 @@ class CActioncomm {
var $id;
var $libelle;
Function CActioncomm($DB=0)
function CActioncomm($DB=0)
{
$this->db = $DB;
}
@ -33,7 +33,7 @@ class CActioncomm {
*
*/
Function fetch($db, $id)
function fetch($db, $id)
{
$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;";
@ -67,7 +67,7 @@ class CActioncomm {
*
*
*/
Function liste_array()
function liste_array()
{
$ga = array();
@ -102,7 +102,7 @@ class CActioncomm {
* Renvoie le nom d'une action a partir d'un id
*
*/
Function get_nom($id)
function get_nom($id)
{
$sql = "SELECT libelle nom FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id='$id';";

View File

@ -31,13 +31,13 @@ class PaiementCharge {
var $num_paiement;
var $note;
Function PaiementCharge($DB) {
function PaiementCharge($DB) {
$this->db = $DB;
return 1;
}
Function create($user) {
function create($user) {
$sql_err = 0;
/*
* Insertion dans la base
@ -93,7 +93,7 @@ class PaiementCharge {
* Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank générée
*
*/
Function update_fk_bank($id_bank) {
function update_fk_bank($id_bank) {
$sql = "UPDATE llx_paiementcharge set fk_bank = ".$id_bank." where rowid = ".$this->id;
$result = $this->db->query($sql);
if ($result)
@ -125,7 +125,7 @@ class ChargeSociales {
var $paye;
var $periode;
Function ChargeSociales($DB) {
function ChargeSociales($DB) {
$this->db = $DB;
return 1;
@ -135,7 +135,7 @@ class ChargeSociales {
* Retrouve et charge une charge sociale
* Retour: 1 si trouve, 0 sinon
*/
Function fetch($id) {
function fetch($id) {
$sql = "SELECT cs.rowid,".$this->db->pdate("cs.date_ech")." as date_ech,".$this->db->pdate("cs.date_pai")." as date_pai";
$sql .=", cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, ".$this->db->pdate("cs.periode")." as periode, c.libelle";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
@ -173,7 +173,7 @@ class ChargeSociales {
}
}
Function solde($year = 0) {
function solde($year = 0) {
$sql = "SELECT sum(f.amount) as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as f WHERE paye = 0";
@ -204,7 +204,7 @@ class ChargeSociales {
* Tag la charge comme payée complètement
*
*/
Function set_payed($rowid)
function set_payed($rowid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales set paye=1 WHERE rowid = $rowid ;";
$return = $this->db->query( $sql);
@ -215,7 +215,7 @@ class ChargeSociales {
* Renvoi le staut sous forme de libellé d'une charge
*
*/
Function getLibStatut() {
function getLibStatut() {
if ($this->paye == 0) { return "Non Payé"; }
else { return "Payé"; }
}

View File

@ -36,7 +36,7 @@ class Contact
var $email;
var $birthday;
Function Contact($DB, $id=0)
function Contact($DB, $id=0)
{
$this->db = $DB;
$this->id = $id;
@ -48,7 +48,7 @@ class Contact
* Création du contact
*
*/
Function create($user)
function create($user)
{
if (!$this->socid)
{
@ -75,7 +75,7 @@ class Contact
* Mise à jour des infos
*
*/
Function update($id, $user=0)
function update($id, $user=0)
{
$this->id = $id;
$this->error = array();
@ -131,7 +131,7 @@ class Contact
*
*/
Function update_ldap($user)
function update_ldap($user)
{
$this->fetch($this->id);
@ -255,7 +255,7 @@ class Contact
* Mise à jour des infos persos
*
*/
Function update_perso($id, $user=0)
function update_perso($id, $user=0)
{
# Mis a jour contact
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET idp=$id ";
@ -300,7 +300,7 @@ class Contact
*
*
*/
Function fetch($_id, $user=0)
function fetch($_id, $user=0)
{
$sql = "SELECT c.idp, c.fk_soc, c.civilite civilite_id, c.name, c.firstname, c.address, c.birthday as birthday, poste, phone, phone_perso, phone_mobile, fax, c.email, jabberid, c.note";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
@ -391,7 +391,7 @@ class Contact
*
*
*/
Function delete($id)
function delete($id)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople";
$sql .= " WHERE idp=$id";
@ -439,7 +439,7 @@ class Contact
* Information sur l'objet
*
*/
Function info($id)
function info($id)
{
$sql = "SELECT c.idp, ".$this->db->pdate("datec")." as datec, fk_user";
$sql .= ", ".$this->db->pdate("tms")." as tms, fk_user_modif";

View File

@ -28,7 +28,7 @@
class Cyberpaiement
{
Function Cyberpaiement($conf)
function Cyberpaiement($conf)
/*
* Initialisation des valeurs par défaut
*/
@ -104,7 +104,7 @@ class Cyberpaiement
/* */
/* ********************** */
Function set_client($nom,$prenom,$email,$societe='')
function set_client($nom,$prenom,$email,$societe='')
{
/* Nom */
@ -165,7 +165,7 @@ class Cyberpaiement
/* */
/* ********************** */
Function set_commande($ref, $montant)
function set_commande($ref, $montant)
{
/* Référence */
@ -180,7 +180,7 @@ class Cyberpaiement
*
*
*/
Function print_hidden()
function print_hidden()
{
print '<input type="hidden" name="CHAMP000" value="'.$this->champ000.'">';
print "\n";

View File

@ -52,7 +52,7 @@ class Don
*
*
*/
Function Don($DB, $soc_idp="")
function Don($DB, $soc_idp="")
{
$this->db = $DB ;
$this->modepaiementid = 0;
@ -62,7 +62,7 @@ class Don
*
*
*/
Function print_error_list()
function print_error_list()
{
$num = sizeof($this->errorstr);
for ($i = 0 ; $i < $num ; $i++)
@ -74,7 +74,7 @@ class Don
*
*
*/
Function check($minimum=0)
function check($minimum=0)
{
$err = 0;
@ -163,7 +163,7 @@ class Don
*
*
*/
Function create($userid)
function create($userid)
{
/*
* Insertion dans la base
@ -193,7 +193,7 @@ class Don
*
*
*/
Function update($userid)
function update($userid)
{
$this->date = $this->db->idate($this->date);
@ -235,7 +235,7 @@ class Don
* Suppression du don
*
*/
Function delete($rowid)
function delete($rowid)
{
@ -263,7 +263,7 @@ class Don
*
*
*/
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 .= " FROM ".MAIN_DB_PREFIX."don as d, ".MAIN_DB_PREFIX."don_projet as p, ".MAIN_DB_PREFIX."c_paiement as cp";
@ -306,7 +306,7 @@ class Don
* Suppression du don
*
*/
Function valid_promesse($rowid, $userid)
function valid_promesse($rowid, $userid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 1, fk_user_valid = $userid WHERE rowid = $rowid AND fk_statut = 0;";
@ -332,7 +332,7 @@ class Don
* Classé comme payé, le don a été recu
*
*/
Function set_paye($rowid, $modepaiement='')
function set_paye($rowid, $modepaiement='')
{
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
@ -363,7 +363,7 @@ class Don
*
*
*/
Function set_commentaire($rowid, $commentaire='')
function set_commentaire($rowid, $commentaire='')
{
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET note = '$commentaire'";
@ -390,7 +390,7 @@ class Don
* Classé comme encaissé
*
*/
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;";
@ -415,7 +415,7 @@ class Don
/*
* Somme des dons encaissés
*/
Function sum_actual()
function sum_actual()
{
$sql = "SELECT sum(amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."don";
@ -433,7 +433,7 @@ class Don
*
*
*/
Function sum_pending()
function sum_pending()
{
$sql = "SELECT sum(amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."don";
@ -451,7 +451,7 @@ class Don
* Somme des promesses de dons validées
*
*/
Function sum_intent()
function sum_intent()
{
$sql = "SELECT sum(amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."don";

View File

@ -46,7 +46,7 @@ class FactureFourn
* Initialisation
*
*/
Function FactureFourn($DB, $soc_idp="", $facid="")
function FactureFourn($DB, $soc_idp="", $facid="")
{
$this->db = $DB ;
$this->socidp = $soc_idp;
@ -66,7 +66,7 @@ class FactureFourn
* Création d'une facture fournisseur
*
*/
Function create($user)
function create($user)
{
/*
@ -136,7 +136,7 @@ class FactureFourn
*
*
*/
Function fetch($rowid)
function fetch($rowid)
{
$sql = "SELECT fk_soc,libelle,facnumber,amount,remise,".$this->db->pdate(datef)."as df";
$sql .= ", total_ht, total_tva, total_ttc, fk_user_author";
@ -215,7 +215,7 @@ class FactureFourn
* Suppression de la facture
*
*/
Function delete($rowid)
function delete($rowid)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn WHERE rowid = $rowid AND fk_statut = 0";
@ -248,7 +248,7 @@ class FactureFourn
* Passe une facture fournisseur a l'état validé
*
*/
Function set_valid($userid)
function set_valid($userid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn set fk_statut = 1, fk_user_valid = $userid WHERE rowid = ".$this->id;
$result = $this->db->query( $sql);
@ -261,7 +261,7 @@ class FactureFourn
* Passe une facture fournisseur a l'état payé
*
*/
Function set_payed($userid)
function set_payed($userid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn set paye = 1 WHERE rowid = ".$this->id;
$result = $this->db->query( $sql);
@ -275,7 +275,7 @@ class FactureFourn
* Ajoute une ligne dans la facture
*
*/
Function addline($desc, $pu, $tauxtva, $qty)
function addline($desc, $pu, $tauxtva, $qty)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn_det (fk_facture_fourn)";
@ -299,7 +299,7 @@ class FactureFourn
* Mise a jour ligne facture fourn
*
*/
Function updateline($id, $label, $puht, $tauxtva, $qty=1)
function updateline($id, $label, $puht, $tauxtva, $qty=1)
{
if (is_numeric($puht) && is_numeric($qty))
{
@ -331,7 +331,7 @@ class FactureFourn
* Supprime une ligne de la facture
*
*/
Function deleteline($rowid)
function deleteline($rowid)
{
// Supprime ligne
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_det ";
@ -351,7 +351,7 @@ class FactureFourn
*Mets à jour le prix total de la facture
*
*/
Function updateprice($facid)
function updateprice($facid)
{
$total_ht = 0;
$total_tva = 0;
@ -401,7 +401,7 @@ class FactureFourn
* Génération du PDF
*
*/
Function pdf()
function pdf()
{
}
@ -410,7 +410,7 @@ class FactureFourn
* Renvoi un libellé du statut
*
*/
Function LibStatut($paye,$statut)
function LibStatut($paye,$statut)
{
if (! $paye)
{

View File

@ -28,7 +28,7 @@ class Graph
* Prépare le graphique
*
*/
Function prepare($file, $data, $title='')
function prepare($file, $data, $title='')
{
//Define the object
$this->graph = new PHPlot($this->width, $this->height);
@ -115,53 +115,53 @@ class Graph
// $this->graph->DrawGraph();
}
Function SetPrecisionY($which_prec)
function SetPrecisionY($which_prec)
{
$this->precision_y = $which_prec;
return true;
}
Function SetYLabel($label)
function SetYLabel($label)
{
$this->YLabel = $label;
}
Function SetWidth($w)
function SetWidth($w)
{
$this->width = $w;
}
Function SetLegend($legend)
function SetLegend($legend)
{
$this->Legend = $legend;
}
Function SetMaxValue($max)
function SetMaxValue($max)
{
$this->MaxValue = $max;
}
Function SetHeight($h)
function SetHeight($h)
{
$this->height = $h;
}
Function ResetBgColor()
function ResetBgColor()
{
unset($this->bgcolor);
}
Function SetBgColor($bg_color = array(255,255,255))
function SetBgColor($bg_color = array(255,255,255))
{
$this->bgcolor = $bg_color;
}
Function ResetDataColor()
function ResetDataColor()
{
unset($this->datacolor);
}
Function GetMaxValue()
function GetMaxValue()
{
$k = 0;
$vals = array();
@ -181,7 +181,7 @@ class Graph
return $vals[0];
}
Function GetAmountMaxValue()
function GetAmountMaxValue()
{
$max = ceil($this->GetMaxValue());

View File

@ -27,7 +27,7 @@ class Form
var $errorstr;
Function Form($DB)
function Form($DB)
{
$this->db = $DB;
@ -40,7 +40,7 @@ class Form
* avec un affichage avec rupture sur le pays
*
*/
Function select_departement($selected='')
function select_departement($selected='')
{
// On recherche les départements/cantons/province active d'une region et pays actif
$sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, p.libelle as libelle_pays, p.code as code_pays FROM ";
@ -93,7 +93,7 @@ class Form
* Retourne la liste déroulante des pays actifs
*
*/
Function select_pays($selected='')
function select_pays($selected='')
{
$sql = "SELECT rowid, libelle, active FROM ".MAIN_DB_PREFIX."c_pays";
$sql .= " WHERE active = 1 ORDER BY libelle ASC";
@ -127,7 +127,7 @@ class Form
* Retourne la liste déroulante des sociétés
*
*/
Function select_societes($selected='',$htmlname='soc_id')
function select_societes($selected='',$htmlname='soc_id')
{
// On recherche les societes
$sql = "SELECT s.idp, s.nom FROM ";
@ -166,7 +166,7 @@ class Form
* Retourne la liste déroulante des contacts d'une société donnée
*
*/
Function select_contacts($socid,$selected='',$htmlname='contactid')
function select_contacts($socid,$selected='',$htmlname='contactid')
{
// On recherche les societes
$sql = "SELECT s.idp, s.name, s.firstname FROM ";
@ -208,7 +208,7 @@ class Form
* Retourne le nom d'un pays
*
*/
Function pays_name($id)
function pays_name($id)
{
$sql = "SELECT rowid, libelle FROM ".MAIN_DB_PREFIX."c_pays";
$sql .= " WHERE rowid=$id";
@ -237,7 +237,7 @@ class Form
*
*/
Function select_civilite($selected='')
function select_civilite($selected='')
{
$sql = "SELECT rowid, civilite, active FROM ".MAIN_DB_PREFIX."c_civilite";
$sql .= " WHERE active = 1";
@ -276,7 +276,7 @@ class Form
* avec un affichage avec rupture sur le pays
*
*/
Function select_forme_juridique($selected='')
function select_forme_juridique($selected='')
{
// On recherche les formes juridiques actives des pays actifs
$sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays FROM llx_c_forme_juridique as f, llx_c_pays as p";
@ -328,7 +328,7 @@ class Form
*
*
*/
Function form_confirm($page, $title, $question, $action)
function form_confirm($page, $title, $question, $action)
{
global $langs;
@ -350,7 +350,7 @@ class Form
*
*
*/
Function select_tva($name='', $defaulttx = '')
function select_tva($name='', $defaulttx = '')
{
if (! strlen(trim($name)))
{
@ -401,7 +401,7 @@ class Form
* - La date du jour si set_time vaut ''
* - Aucune date (champs vides) si set_time vaut -1
*/
Function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0)
function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0)
{
if (! $set_time && ! $empty)
{
@ -559,7 +559,7 @@ class Form
*
*
*/
Function select($name, $sql, $id='')
function select($name, $sql, $id='')
{
$result = $this->db->query($sql);
@ -612,7 +612,7 @@ class Form
\param 1 si il faut un valeur "-" dans la liste, 0 sinon
\param 1 pour affiche la key dans la valeur "[key] value"
*/
Function select_array($name, $array, $id='', $empty=0, $key_libelle=0)
function select_array($name, $array, $id='', $empty=0, $key_libelle=0)
{
print '<select name="'.$name.'">';
@ -668,7 +668,7 @@ class Form
*
*
*/
Function error()
function error()
{
return $this->errorstr;
}
@ -677,7 +677,7 @@ class Form
* Yes/No
*
*/
Function selectyesno($name,$value='')
function selectyesno($name,$value='')
{
global $langs;
@ -700,7 +700,7 @@ class Form
* Yes/No
*
*/
Function selectyesnonum($name,$value='')
function selectyesnonum($name,$value='')
{
global $langs;
@ -723,7 +723,7 @@ class Form
* Checkbox
*
*/
Function checkbox($name,$checked=0,$value=1)
function checkbox($name,$checked=0,$value=1)
{
if ($checked==1){
print "<input type=\"checkbox\" name=\"$name\" value=\"$value\" checked />\n";

View File

@ -131,7 +131,7 @@ else
"cryptType" => "none",
);
$aDol = new DOLIAuth("DB", $params, "loginFunction");
$aDol = new DOLIAuth("DB", $params, "loginfunction");
$aDol->start();
$result = $aDol->getAuth();
if ($result)
@ -143,7 +143,7 @@ else
{
/*
* Le début de la page est affiché par
* loginFunction
* loginfunction
*/
print "</div>\n</div>\n</body>\n</html>";
die ;
@ -552,7 +552,7 @@ function top_menu($head, $title="", $target="")
*
*
*/
Function left_menu($menu, $help_url='', $form_search='', $author='')
function left_menu($menu, $help_url='', $form_search='', $author='')
{
global $user, $conf, $langs;

View File

@ -23,16 +23,16 @@
class Menu {
var $liste;
Function Menu() {
function Menu() {
$this->liste = array();
}
Function clear() {
function clear() {
$this->liste = array();
}
Function add($url, $titre) {
function add($url, $titre) {
$i = sizeof($this->liste);
@ -41,7 +41,7 @@ class Menu {
}
Function add_submenu($url, $titre) {
function add_submenu($url, $titre) {
$i = sizeof($this->liste) - 1;
$j = sizeof($this->liste[$i]);

View File

@ -33,7 +33,7 @@ class Notify
var $note;
var $projet_id;
Function Notify($DB)
function Notify($DB)
{
$this->db = $DB ;
include_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php");
@ -44,7 +44,7 @@ class Notify
*
*
*/
Function send($action, $socid, $texte, $objet_type, $objet_id, $file="")
function send($action, $socid, $texte, $objet_type, $objet_id, $file="")
{
$sql = "SELECT s.nom, c.email, c.idp, c.name, c.firstname, a.titre,n.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c, ".MAIN_DB_PREFIX."action_def as a, ".MAIN_DB_PREFIX."notify_def as n, ".MAIN_DB_PREFIX."societe as s";

View File

@ -40,7 +40,7 @@ class Paiement
*
*
*/
Function Paiement($DB, $soc_idp="")
function Paiement($DB, $soc_idp="")
{
$this->db = $DB ;
}
@ -48,7 +48,7 @@ class Paiement
*
*
*/
Function fetch($id)
function fetch($id)
{
$sql = "SELECT p.rowid,".$this->db->pdate("p.datep")." as dp, p.amount";
$sql .=", c.libelle as paiement_type, p.num_paiement";
@ -87,7 +87,7 @@ class Paiement
*
*
*/
Function create($user)
function create($user)
{
$sql_err = 0;
/*
@ -163,7 +163,7 @@ class Paiement
*
*
*/
Function select($name, $filtre='', $id='')
function select($name, $filtre='', $id='')
{
$form = new Form($this->db);
@ -187,7 +187,7 @@ class Paiement
*
*
*/
Function delete()
function delete()
{
$sql = "DELETE FROM llx_paiement_facture WHERE fk_paiement = ".$this->id;
@ -212,7 +212,7 @@ class Paiement
* Mise a jour du lien entre le paiement et la ligne dans llx_bank générée
*
*/
Function update_fk_bank($id_bank)
function update_fk_bank($id_bank)
{
$sql = "UPDATE llx_paiement set fk_bank = ".$id_bank." where rowid = ".$this->id;
$result = $this->db->query($sql);
@ -230,7 +230,7 @@ class Paiement
* Information sur l'objet
*
*/
Function info($id)
function info($id)
{
$sql = "SELECT c.rowid, ".$this->db->pdate("datec")." as datec, fk_user_creat, fk_user_modif";
$sql .= ", ".$this->db->pdate("tms")." as tms";

View File

@ -35,7 +35,7 @@ class Product
var $duration_value;
var $duration_unit;
Function Product($DB, $id=0)
function Product($DB, $id=0)
{
$this->db = $DB;
$this->id = $id ;
@ -46,7 +46,7 @@ class Product
*
*
*/
Function check()
function check()
{
$this->ref = ereg_replace("'","",stripslashes($this->ref));
$this->ref = ereg_replace("\"","",stripslashes($this->ref));
@ -71,7 +71,7 @@ class Product
*
*
*/
Function create($user)
function create($user)
{
$this->ref = ereg_replace("'","",stripslashes($this->ref));
$this->ref = ereg_replace("\"","",stripslashes($this->ref));
@ -126,7 +126,7 @@ class Product
*
*
*/
Function update($id, $user)
function update($id, $user)
{
$this->ref = ereg_replace("\"","",stripslashes($this->ref));
$this->ref = ereg_replace("'","",stripslashes($this->ref));
@ -163,7 +163,7 @@ class Product
*
*
*/
Function _log_price($user)
function _log_price($user)
{
$sql = "REPLACE INTO ".MAIN_DB_PREFIX."product_price ";
@ -188,7 +188,7 @@ class Product
*
*
*/
Function update_price($id, $user)
function update_price($id, $user)
{
if (strlen(trim($this->price)) > 0 )
{
@ -219,7 +219,7 @@ class Product
*
*
*/
Function fetch ($id)
function fetch ($id)
{
$sql = "SELECT rowid, ref, label, description, price, tva_tx, envente, nbvente, fk_product_type, duration, seuil_stock_alerte";
$sql .= " FROM ".MAIN_DB_PREFIX."product WHERE rowid = $id";
@ -286,7 +286,7 @@ class Product
*
*
*/
Function count_propale($socid=0)
function count_propale($socid=0)
{
$sql = "SELECT pd.fk_propal";
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."propal as pr";
@ -312,7 +312,7 @@ class Product
*
*
*/
Function count_propale_client($socid=0)
function count_propale_client($socid=0)
{
$sql = "SELECT pr.fk_soc";
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."propal as pr";
@ -338,7 +338,7 @@ class Product
*
*
*/
Function count_facture($socid=0)
function count_facture($socid=0)
{
$sql = "SELECT pd.fk_facture";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as pd, ".MAIN_DB_PREFIX."product as p";
@ -366,7 +366,7 @@ class Product
*
*/
Function _get_stats($sql)
function _get_stats($sql)
{
$result = $this->db->query($sql) ;
@ -416,7 +416,7 @@ class Product
*
*
*/
Function get_nb_vente($socid=0)
function get_nb_vente($socid=0)
{
$sql = "SELECT sum(d.qty), date_format(f.datef, '%Y%m') ";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as d, ".MAIN_DB_PREFIX."facture as f";
@ -433,7 +433,7 @@ class Product
*Renvoie le nombre de facture dans lesquelles figure le produit
*
*/
Function get_num_vente($socid=0)
function get_num_vente($socid=0)
{
$sql = "SELECT count(*), date_format(f.datef, '%Y%m') ";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as d, ".MAIN_DB_PREFIX."facture as f";
@ -450,7 +450,7 @@ class Product
*Renvoie le nombre de proaple dans lesquelles figure le produit
*
*/
Function get_num_propal($socid=0)
function get_num_propal($socid=0)
{
$sql = "SELECT count(*), date_format(p.datep, '%Y%m') ";
$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as d, ".MAIN_DB_PREFIX."propal as p";
@ -467,7 +467,7 @@ class Product
*
*
*/
Function add_fournisseur($user, $id_fourn, $ref_fourn)
function add_fournisseur($user, $id_fourn, $ref_fourn)
{
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."product_fournisseur WHERE fk_product = $this->id AND fk_soc = $id_fourn";
@ -507,7 +507,7 @@ class Product
*
*
*/
Function remove_fournisseur($user, $id_fourn)
function remove_fournisseur($user, $id_fourn)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur ";
$sql .= " WHERE fk_product = $this->id AND fk_soc = $id_fourn;";
@ -526,7 +526,7 @@ class Product
*
*
*/
Function create_stock($id_entrepot, $nbpiece)
function create_stock($id_entrepot, $nbpiece)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_stock ";
@ -547,7 +547,7 @@ class Product
*
*
*/
Function correct_stock($user, $id_entrepot, $nbpiece, $mouvement)
function correct_stock($user, $id_entrepot, $nbpiece, $mouvement)
{
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."product_stock ";
@ -576,7 +576,7 @@ class Product
*
*
*/
Function ajust_stock($user, $id_entrepot, $nbpiece, $mouvement)
function ajust_stock($user, $id_entrepot, $nbpiece, $mouvement)
{
/* mouvement = 0 -> ajouter
* mouvement = 1 -> supprimer

View File

@ -28,7 +28,7 @@ class Project {
var $title;
var $socidp;
Function Project($DB) {
function Project($DB) {
$this->db = $DB;
}
/*
@ -37,7 +37,7 @@ class Project {
*
*/
Function create($creatorid) {
function create($creatorid) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet (ref, title, fk_soc, fk_user_creat) ";
$sql .= " VALUES ('$this->ref', '$this->title', $this->socidp, $creatorid) ;";
@ -55,7 +55,7 @@ class Project {
*
*/
Function fetch($rowid) {
function fetch($rowid) {
$sql = "SELECT title, ref FROM ".MAIN_DB_PREFIX."projet WHERE rowid=$rowid;";
@ -78,7 +78,7 @@ class Project {
*
*
*/
Function get_propal_list()
function get_propal_list()
{
$propales = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."propal WHERE fk_projet=$this->id;";
@ -114,7 +114,7 @@ class Project {
*
*
*/
Function liste_array($id_societe='')
function liste_array($id_societe='')
{
$projets = array();

View File

@ -28,7 +28,7 @@ class ProjetDon {
var $title;
var $socidp;
Function ProjetDon($DB) {
function ProjetDon($DB) {
$this->db = $DB;
}
/*
@ -43,7 +43,7 @@ class ProjetDon {
*
*
*/
Function liste_array($id_societe='')
function liste_array($id_societe='')
{
$projets = array();

View File

@ -59,7 +59,7 @@ class Propal
// {{{ constructor
Function Propal($DB, $soc_idp="", $propalid=0)
function Propal($DB, $soc_idp="", $propalid=0)
{
$this->db = $DB ;
$this->socidp = $soc_idp;
@ -78,7 +78,7 @@ class Propal
* @param integer $remise_percent remise effectuée sur le produit
* @return void
*/
Function add_product($idproduct, $qty, $remise_percent=0)
function add_product($idproduct, $qty, $remise_percent=0)
{
if ($idproduct > 0)
{
@ -98,7 +98,7 @@ class Propal
*
* @return integer
*/
Function insert_product($idproduct, $qty, $remise_percent=0)
function insert_product($idproduct, $qty, $remise_percent=0)
{
if ($this->statut == 0)
{
@ -138,7 +138,7 @@ class Propal
*
*
*/
Function insert_product_generic($p_desc, $p_price, $p_qty, $p_tva_tx=19.6, $remise_percent=0)
function insert_product_generic($p_desc, $p_price, $p_qty, $p_tva_tx=19.6, $remise_percent=0)
{
if ($this->statut == 0)
{
@ -186,7 +186,7 @@ class Propal
*
*
*/
Function fetch_client()
function fetch_client()
{
$client = new Societe($this->db);
$client->fetch($this->socidp);
@ -196,7 +196,7 @@ class Propal
*
*
*/
Function delete_product($idligne)
function delete_product($idligne)
{
if ($this->statut == 0)
{
@ -219,7 +219,7 @@ class Propal
*
*
*/
Function create()
function create()
{
/*
* Insertion dans la base
@ -285,7 +285,7 @@ class Propal
*
*
*/
Function update_price()
function update_price()
{
include_once DOL_DOCUMENT_ROOT . "/lib/price.lib.php";
@ -338,7 +338,7 @@ class Propal
*
*
*/
Function fetch($rowid)
function fetch($rowid)
{
$sql = "SELECT ref,total,price,remise,tva,fk_soc,fk_soc_contact,".$this->db->pdate("datep")."as dp,".$this->db->pdate("fin_validite")."as dfv, model_pdf, note, fk_projet, fk_statut, remise_percent, fk_user_author";
@ -477,7 +477,7 @@ class Propal
*
*
*/
Function valid($user)
function valid($user)
{
if ($user->rights->propale->valider)
{
@ -500,7 +500,7 @@ class Propal
*
*
*/
Function set_remise($user, $remise)
function set_remise($user, $remise)
{
if ($user->rights->propale->creer)
{
@ -526,7 +526,7 @@ class Propal
*
*
*/
Function set_pdf_model($user, $modelpdf)
function set_pdf_model($user, $modelpdf)
{
if ($user->rights->propale->creer)
{
@ -549,7 +549,7 @@ class Propal
* Cloture de la proposition commerciale
*
*/
Function cloture($user, $statut, $note)
function cloture($user, $statut, $note)
{
$this->statut = $statut;
@ -590,7 +590,7 @@ class Propal
* Créée une commande à partir de la proposition commerciale
*
*/
Function create_commande($user)
function create_commande($user)
{
if ($this->statut == 2)
{
@ -605,7 +605,7 @@ class Propal
*
*
*/
Function reopen($userid)
function reopen($userid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = 0";
@ -624,7 +624,7 @@ class Propal
*
*
*/
Function liste_array ($brouillon=0, $user='')
function liste_array ($brouillon=0, $user='')
{
$ga = array();
@ -673,7 +673,7 @@ class Propal
* Renvoie un tableau contenant les numéros de commandes associées
*
*/
Function commande_liste_array ()
function commande_liste_array ()
{
$ga = array();
@ -705,7 +705,7 @@ class Propal
*
*
*/
Function delete($user)
function delete($user)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = $this->id ;";
if ( $this->db->query($sql) )
@ -730,7 +730,7 @@ class Propal
* Mets à jour la note
*
*/
Function update_note($note)
function update_note($note)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET note = '$note'";
$sql .= " WHERE rowid = $this->id;";
@ -751,7 +751,7 @@ class Propal
* Information sur l'objet
*
*/
Function info($id)
function info($id)
{
$sql = "SELECT c.rowid, ".$this->db->pdate("datec")." as datec";
$sql .= ", fk_user_valid, fk_user_cloture, fk_user_author";
@ -802,7 +802,7 @@ class Propal
class PropaleLigne
{
Function PropaleLigne()
function PropaleLigne()
{
}
}

View File

@ -45,7 +45,7 @@ class Retourbplc
/*
* Initialisation des valeurs par défaut
*/
Function Retourbplc($db)
function Retourbplc($db)
{
$this->db = $db;
}
@ -54,7 +54,7 @@ class Retourbplc
*
*
*/
Function insertdb()
function insertdb()
{
@ -95,7 +95,7 @@ class Retourbplc
*
*
*/
Function check_key($key)
function check_key($key)
{
$A = $this->montant;
@ -149,7 +149,7 @@ class Retourbplc
* Table de correspondance de l'algorithme de Luhn
*
*/
Function corres($value)
function corres($value)
{
$map[0] = 0;
@ -172,7 +172,7 @@ class Retourbplc
*
*
*/
Function cle_luhn($cle, $map)
function cle_luhn($cle, $map)
{
$buffer = $this->array_reverse($cle);
@ -209,7 +209,7 @@ class Retourbplc
*
*
*/
Function calcul_pos($N1, $N0, $C5)
function calcul_pos($N1, $N0, $C5)
{
if ($N0 >= 0 && $N0 <= 6)
{
@ -259,7 +259,7 @@ class Retourbplc
*
*
*/
Function array_reverse($string)
function array_reverse($string)
{
$len = strlen($string);

View File

@ -34,7 +34,7 @@ class Service {
var $fin_epoch;
Function Service($DB, $id=0) {
function Service($DB, $id=0) {
$this->db = $DB;
$this->id = $id;
@ -45,7 +45,7 @@ class Service {
*
*
*/
Function create($user) {
function create($user) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."service (datec, fk_user_author) VALUES (now(), ".$user->id.")";
@ -64,7 +64,7 @@ class Service {
*
*
*/
Function update($id, $user) {
function update($id, $user) {
$sql = "UPDATE ".MAIN_DB_PREFIX."service ";
$sql .= " SET label = '" . trim($this->libelle) ."'";
@ -86,7 +86,7 @@ class Service {
*
*
*/
Function start_comm($id, $user, $datedeb=0) {
function start_comm($id, $user, $datedeb=0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."service ";
if ($datedeb) {
@ -109,7 +109,7 @@ class Service {
*
*
*/
Function stop_comm($id, $user, $datefin=0) {
function stop_comm($id, $user, $datefin=0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."service ";
if ($datefin) {
@ -132,7 +132,7 @@ class Service {
*
*
*/
Function fetch($id) {
function fetch($id) {
$sql = "SELECT s.ref,s.label,s.price,s.tms,s.debut_comm,s.fin_comm,s.description,";
$sql .= $this->db->pdate("s.debut_comm") . ' as debut_epoch,';

View File

@ -44,7 +44,7 @@ class Societe {
var $fournisseur;
Function Societe($DB, $id=0)
function Societe($DB, $id=0)
{
global $config;
@ -62,7 +62,7 @@ class Societe {
*
*
*/
Function create()
function create()
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, datec, datea, client) ";
$sql .= " VALUES ('".trim($this->nom)."', now(), now(), '$this->client');";
@ -84,7 +84,7 @@ class Societe {
*
*
*/
Function update($id)
function update($id)
{
if (strlen(trim($this->nom)) == 0)
{
@ -163,7 +163,7 @@ class Societe {
*
*
*/
Function fetch($socid)
function fetch($socid)
{
$this->id = $socid;
@ -275,7 +275,7 @@ class Societe {
* TODO: Cette fonction n'est pas utilisée..
* Attente des contraintes d'intégrité dans MySql
*/
Function delete($id)
function delete($id)
{
$sql = "DELETE from ".MAIN_DB_PREFIX."societe ";
$sql .= " WHERE idp = " . $id .";";
@ -318,7 +318,7 @@ class Societe {
*
*
*/
Function factures_impayes()
function factures_impayes()
{
$facimp = array();
/*
@ -351,7 +351,7 @@ class Societe {
*
*/
Function attribute_prefix()
function attribute_prefix()
{
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."societe WHERE idp = '$this->id'";
if ( $this->db->query( $sql) )
@ -403,7 +403,7 @@ class Societe {
*
*
*/
Function set_as_client()
function set_as_client()
{
if ($this->id)
{
@ -419,7 +419,7 @@ class Societe {
* Renvoie le nom d'une societe a partir d'un id
*
*/
Function get_nom($id)
function get_nom($id)
{
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."societe WHERE idp='$id';";
@ -445,7 +445,7 @@ class Societe {
*
*
*/
Function contact_email_array()
function contact_email_array()
{
$contact_email = array();
@ -478,7 +478,7 @@ class Societe {
*
*
*/
Function contact_array()
function contact_array()
{
$contacts = array();
@ -511,7 +511,7 @@ class Societe {
*
*
*/
Function contact_get_email($rowid)
function contact_get_email($rowid)
{
$sql = "SELECT idp, email, name, firstname FROM ".MAIN_DB_PREFIX."socpeople WHERE idp = '$rowid'";
@ -541,7 +541,7 @@ class Societe {
*
*
*/
Function effectif_array()
function effectif_array()
{
$effs = array();
/*
@ -569,7 +569,7 @@ class Societe {
*
*
*/
Function forme_juridique_array()
function forme_juridique_array()
{
$fj = array();
/*

View File

@ -24,12 +24,12 @@ class Stats
{
var $db ;
Function Stats($DB)
function Stats($DB)
{
$this->db = $DB;
}
Function getNbByMonthWithPrevYear($year)
function getNbByMonthWithPrevYear($year)
{
$data1 = $this->getNbByMonth($year - 1);
$data2 = $this->getNbByMonth($year);
@ -48,7 +48,7 @@ class Stats
* Renvoie le nombre de proposition par mois pour une année donnée
*
*/
Function _getNbByMonth($year, $sql)
function _getNbByMonth($year, $sql)
{
$result = array();
@ -86,7 +86,7 @@ class Stats
* Renvoie le nombre d'element par année
*
*/
Function _getNbByYear($sql)
function _getNbByYear($sql)
{
$result = array();
@ -109,7 +109,7 @@ class Stats
* Renvoie le nombre d'element par mois pour une année donnée
*
*/
Function _getAmountByMonth($year, $sql)
function _getAmountByMonth($year, $sql)
{
$result = array();
@ -138,7 +138,7 @@ class Stats
*
*
*/
Function _getAverageByMonth($year, $sql)
function _getAverageByMonth($year, $sql)
{
$result = array();

View File

@ -32,7 +32,7 @@ class Tva
/*
* Initialistation automatique de la classe
*/
Function Tva($DB)
function Tva($DB)
{
$this->db = $DB;
@ -43,7 +43,7 @@ class Tva
* calcluer le solde de TVA, non ?
*
*/
Function solde($year = 0)
function solde($year = 0)
{
$reglee = $this->tva_sum_reglee($year);
@ -60,7 +60,7 @@ class Tva
* Total de la TVA des factures emises par la societe.
*
*/
Function tva_sum_collectee($year = 0)
function tva_sum_collectee($year = 0)
{
$sql = "SELECT sum(f.tva) as amount";
@ -99,7 +99,7 @@ class Tva
*
*
*/
Function tva_sum_payee($year = 0)
function tva_sum_payee($year = 0)
{
$sql = "SELECT sum(f.amount) as amount";
@ -138,7 +138,7 @@ class Tva
* Total de la TVA réglee aupres de qui de droit
*
*/
Function tva_sum_reglee($year = 0)
function tva_sum_reglee($year = 0)
{
$sql = "SELECT sum(f.amount) as amount";
@ -176,7 +176,7 @@ class Tva
/*
*
*/
Function add_payement($datep, $datev, $amount)
function add_payement($datep, $datev, $amount)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount) ";
$sql .= " VALUES ('".$this->db->idate($datep)."',";