This commit is contained in:
Frédéric FRANCE 2019-02-24 23:47:00 +01:00
parent 27218b7087
commit 041310c4ee
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 33 additions and 32 deletions

View File

@ -580,7 +580,7 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Link an object to the category * Link an object to the category
* *
@ -907,7 +907,7 @@ class Categorie extends CommonObject
return $categories; return $categories;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return childs of a category * Return childs of a category
* *
@ -1076,10 +1076,10 @@ class Categorie extends CommonObject
* @param int $protection Deep counter to avoid infinite loop * @param int $protection Deep counter to avoid infinite loop
* @return void * @return void
*/ */
public function build_path_from_id_categ($id_categ, $protection = 1000) public function build_path_from_id_categ($id_categ, $protection = 1000)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG); dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
if (! empty($this->cats[$id_categ]['fullpath'])) if (! empty($this->cats[$id_categ]['fullpath']))
{ {
@ -1109,8 +1109,8 @@ class Categorie extends CommonObject
// We count number of _ to have level // We count number of _ to have level
$this->cats[$id_categ]['level']=dol_strlen(preg_replace('/[^_]/i', '', $this->cats[$id_categ]['fullpath'])); $this->cats[$id_categ]['level']=dol_strlen(preg_replace('/[^_]/i', '', $this->cats[$id_categ]['fullpath']));
return; return;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
@ -1548,7 +1548,7 @@ class Categorie extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Deplace fichier uploade sous le nom $files dans le repertoire sdir * Deplace fichier uploade sous le nom $files dans le repertoire sdir
* *
@ -1599,7 +1599,7 @@ class Categorie extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return tableau de toutes les photos de la categorie * Return tableau de toutes les photos de la categorie
* *

View File

@ -6,6 +6,7 @@
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net> * Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -103,7 +104,7 @@ class Don extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -115,12 +116,12 @@ class Don extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Libelle * @return string Libelle
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return $this->LibStatut($this->statut, $mode); return $this->LibStatut($this->statut, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@ -128,7 +129,7 @@ class Don extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut * @return string Libelle du statut
*/ */
function LibStatut($statut, $mode = 0) public function LibStatut($statut, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
if (empty($this->labelstatut) || empty($this->labelstatutshort)) if (empty($this->labelstatut) || empty($this->labelstatutshort))
@ -198,7 +199,7 @@ class Don extends CommonObject
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
global $conf, $user,$langs; global $conf, $user,$langs;
@ -257,7 +258,7 @@ class Don extends CommonObject
* @param int $minimum Minimum * @param int $minimum Minimum
* @return int 0 if KO, >0 if OK * @return int 0 if KO, >0 if OK
*/ */
function check($minimum = 0) public function check($minimum = 0)
{ {
global $langs; global $langs;
$langs->load('main'); $langs->load('main');
@ -350,7 +351,7 @@ class Don extends CommonObject
* @return int <0 if KO, id of created donation if OK * @return int <0 if KO, id of created donation if OK
* TODO add numbering module for Ref * TODO add numbering module for Ref
*/ */
function create($user, $notrigger = 0) public function create($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
@ -429,7 +430,7 @@ class Don extends CommonObject
// End call triggers // End call triggers
} }
} }
else else
{ {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
$this->errno = $this->db->lasterrno(); $this->errno = $this->db->lasterrno();
@ -473,7 +474,7 @@ class Don extends CommonObject
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $langs, $conf; global $langs, $conf;
@ -564,7 +565,7 @@ class Don extends CommonObject
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
* @return int <0 if KO, 0 if not possible, >0 if OK * @return int <0 if KO, 0 if not possible, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
global $user, $conf, $langs; global $user, $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
@ -639,7 +640,7 @@ class Don extends CommonObject
* @param string $ref Ref of donation to load * @param string $ref Ref of donation to load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $ref = '') public function fetch($id, $ref = '')
{ {
global $conf; global $conf;
@ -727,12 +728,12 @@ class Don extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function setValid($user, $notrigger = 0) public function setValid($user, $notrigger = 0)
{ {
return $this->valid_promesse($this->id, $user->id, $notrigger); return $this->valid_promesse($this->id, $user->id, $notrigger);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Validate a promise of donation * Validate a promise of donation
* *
@ -741,7 +742,7 @@ class Don extends CommonObject
* @param int $notrigger Disable triggers * @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function valid_promesse($id, $userid, $notrigger = 0) public function valid_promesse($id, $userid, $notrigger = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs, $user; global $langs, $user;
@ -784,7 +785,7 @@ class Don extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Classify the donation as paid, the donation was received * Classify the donation as paid, the donation was received
* *
@ -792,7 +793,7 @@ class Don extends CommonObject
* @param int $modepayment mode of payment * @param int $modepayment mode of payment
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function set_paid($id, $modepayment = 0) public function set_paid($id, $modepayment = 0)
{ {
// phpcs:enable // phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2"; $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2";
@ -821,14 +822,14 @@ class Don extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Set donation to status cancelled * Set donation to status cancelled
* *
* @param int $id id of donation * @param int $id id of donation
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function set_cancel($id) public function set_cancel($id)
{ {
// phpcs:enable // phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$id; $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$id;
@ -852,14 +853,14 @@ class Don extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Sum of donations * Sum of donations
* *
* @param string $param 1=promesses de dons validees , 2=xxx, 3=encaisses * @param string $param 1=promesses de dons validees , 2=xxx, 3=encaisses
* @return int Summ of donations * @return int Summ of donations
*/ */
function sum_donations($param) public function sum_donations($param)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -881,13 +882,13 @@ class Don extends CommonObject
return $result; return $result;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Charge indicateurs this->nb pour le tableau de bord * Charge indicateurs this->nb pour le tableau de bord
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function load_state_board() public function load_state_board()
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@ -924,7 +925,7 @@ class Don extends CommonObject
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto = 0, $notooltip = 0) public function getNomUrl($withpicto = 0, $notooltip = 0)
{ {
global $langs; global $langs;
@ -948,7 +949,7 @@ class Don extends CommonObject
* @param int $id Id of record * @param int $id Id of record
* @return void * @return void
*/ */
function info($id) public function info($id)
{ {
$sql = 'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,'; $sql = 'SELECT d.rowid, d.datec, d.fk_user_author, d.fk_user_valid,';
$sql.= ' d.tms'; $sql.= ' d.tms';