diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml
index 296c6cb9b6f..1a18710b0d1 100644
--- a/dev/setup/codesniffer/ruleset.xml
+++ b/dev/setup/codesniffer/ruleset.xml
@@ -201,7 +201,7 @@
0
-
+
diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php
index 4da15890045..789bd8173c4 100644
--- a/dev/translation/autotranslator.class.php
+++ b/dev/translation/autotranslator.class.php
@@ -50,7 +50,7 @@ class autoTranslator
* @param string $_apikey Api key
* @return void
*/
- function __construct($_destlang, $_refLang, $_langDir, $_limittofile, $_apikey)
+ public function __construct($_destlang, $_refLang, $_langDir, $_limittofile, $_apikey)
{
// Set enviorment variables
@@ -346,5 +346,5 @@ class autoTranslator
//print "OK ".join('',$src_texts).' => '.$rep."\n";
return $rep;
- }
+ }
}
diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php
index 010f452755d..73cccdfd721 100644
--- a/htdocs/accountancy/class/accountancycategory.class.php
+++ b/htdocs/accountancy/class/accountancycategory.class.php
@@ -129,7 +129,7 @@ class AccountancyCategory // extends CommonObject
*
* @param DoliDb $db Database handler
*/
- function __construct($db)
+ public function __construct($db)
{
$this->db = $db;
}
@@ -142,7 +142,7 @@ class AccountancyCategory // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, Id of created object if OK
*/
- function create($user, $notrigger = 0)
+ public function create($user, $notrigger = 0)
{
global $conf, $langs;
$error=0;
@@ -239,7 +239,7 @@ class AccountancyCategory // extends CommonObject
* @param string $label Label
* @return int <0 if KO, >0 if OK
*/
- function fetch($id, $code = '', $label = '')
+ public function fetch($id, $code = '', $label = '')
{
$sql = "SELECT";
$sql.= " t.rowid,";
@@ -299,7 +299,7 @@ class AccountancyCategory // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function update($user = null, $notrigger = 0)
+ public function update($user = null, $notrigger = 0)
{
global $conf, $langs;
$error=0;
@@ -379,7 +379,7 @@ class AccountancyCategory // extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function delete($user, $notrigger = 0)
+ public function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error=0;
@@ -460,7 +460,7 @@ class AccountancyCategory // extends CommonObject
return - 1;
}
- }
+ }
/**
* Function to select accounting category of an accounting account present in chart of accounts
@@ -509,7 +509,7 @@ class AccountancyCategory // extends CommonObject
return - 1;
}
- }
+ }
/**
* Function to select accounting category of an accounting account present in chart of accounts
@@ -552,7 +552,7 @@ class AccountancyCategory // extends CommonObject
return - 1;
}
- }
+ }
/**
* Function to add an accounting account in an accounting category
@@ -617,7 +617,7 @@ class AccountancyCategory // extends CommonObject
return 1;
}
- }
+ }
/**
* Function to delete an accounting account from an accounting category
@@ -643,7 +643,7 @@ class AccountancyCategory // extends CommonObject
}
// Commit or rollback
- if ($error) {
+ if ($error) {
foreach ($this->errors as $errmsg) {
dol_syslog(__METHOD__ . " " . $errmsg, LOG_ERR);
$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
@@ -651,12 +651,12 @@ class AccountancyCategory // extends CommonObject
$this->db->rollback();
return - 1 * $error;
- } else {
+ } else {
$this->db->commit();
- return 1;
- }
- }
+ return 1;
+ }
+ }
/**
* Function to know all category from accounting account
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index 775974edb6c..01f02a8a80a 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -8,7 +8,7 @@
* Copyright (C) 2016-2018 Alexandre Spangaro
* Copyright (C) 2013-2017 Olivier Geffroy
* Copyright (C) 2017 Elarifr. Ari Elbaz
- * Copyright (C) 2017 Frédéric France
+ * Copyright (C) 2017-2019 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
@@ -98,18 +98,18 @@ class AccountancyExport
global $langs;
return array (
- //self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
- self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
- self::$EXPORT_TYPE_CEGID => $langs->trans('Modelcsv_CEGID'),
- self::$EXPORT_TYPE_COALA => $langs->trans('Modelcsv_COALA'),
- self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'),
- self::$EXPORT_TYPE_CIEL => $langs->trans('Modelcsv_ciel'),
- self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'),
- self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
- self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
- self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
- self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
- );
+ //self::$EXPORT_TYPE_NORMAL => $langs->trans('Modelcsv_normal'),
+ self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
+ self::$EXPORT_TYPE_CEGID => $langs->trans('Modelcsv_CEGID'),
+ self::$EXPORT_TYPE_COALA => $langs->trans('Modelcsv_COALA'),
+ self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'),
+ self::$EXPORT_TYPE_CIEL => $langs->trans('Modelcsv_ciel'),
+ self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'),
+ self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
+ self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
+ self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
+ self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
+ );
}
/**
diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php
index 65852258867..53e824219c5 100644
--- a/htdocs/accountancy/class/accountancysystem.class.php
+++ b/htdocs/accountancy/class/accountancysystem.class.php
@@ -64,10 +64,10 @@ class AccountancySystem
*
* @param DoliDB $db handler
*/
- function __construct($db)
+ public function __construct($db)
{
$this->db = $db;
- }
+ }
/**
@@ -77,7 +77,7 @@ class AccountancySystem
* @param string $ref ref
* @return int <0 if KO, Id of record if OK and found
*/
- function fetch($rowid = 0, $ref = '')
+ public function fetch($rowid = 0, $ref = '')
{
global $conf;
@@ -124,7 +124,7 @@ class AccountancySystem
* @param User $user making insert
* @return int if KO, Id of line if OK
*/
- function create($user)
+ public function create($user)
{
$now = dol_now();
@@ -151,6 +151,6 @@ class AccountancySystem
dol_syslog($this->error, LOG_ERR);
}
- return $result;
- }
+ return $result;
+ }
}
diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php
index d889ef37195..f184d30699f 100644
--- a/htdocs/accountancy/class/accountingaccount.class.php
+++ b/htdocs/accountancy/class/accountingaccount.class.php
@@ -138,13 +138,13 @@ class AccountingAccount extends CommonObject
*
* @param DoliDB $db Database handle
*/
- function __construct($db)
+ public function __construct($db)
{
global $conf;
$this->db = $db;
$this->next_prev_filter='fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')'; // Used to add a filter in Form::showrefnav method
- }
+ }
/**
* Load record in memory
@@ -154,7 +154,7 @@ class AccountingAccount extends CommonObject
* @param int $limittocurrentchart 1=Do not load record if it is into another accounting system
* @return int <0 if KO, 0 if not found, Id of record if OK and found
*/
- function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0)
+ public function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0)
{
global $conf;
@@ -216,7 +216,7 @@ class AccountingAccount extends CommonObject
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
- function create($user, $notrigger = 0)
+ public function create($user, $notrigger = 0)
{
global $conf;
$error = 0;
@@ -317,7 +317,7 @@ class AccountingAccount extends CommonObject
$this->db->commit();
return $this->id;
}
- }
+ }
/**
* Update record
@@ -325,7 +325,7 @@ class AccountingAccount extends CommonObject
* @param User $user Use making update
* @return int <0 if KO, >0 if OK
*/
- function update($user)
+ public function update($user)
{
// Check parameters
if (empty($this->pcg_type) || $this->pcg_type == '-1')
@@ -368,7 +368,7 @@ class AccountingAccount extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
- function checkUsage()
+ public function checkUsage()
{
global $langs;
@@ -402,7 +402,7 @@ class AccountingAccount extends CommonObject
* @param int $notrigger 0=triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function delete($user, $notrigger = 0)
+ public function delete($user, $notrigger = 0)
{
$error = 0;
@@ -453,9 +453,9 @@ class AccountingAccount extends CommonObject
} else {
return - 1;
}
- }
+ }
- /**
+ /**
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
@@ -466,8 +466,8 @@ class AccountingAccount extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
- function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
- {
+ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
+ {
global $langs, $conf, $user;
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@@ -522,7 +522,7 @@ class AccountingAccount extends CommonObject
if ($withpicto && $withpicto != 2) $result .= ' ';
if ($withpicto != 2) $result.=$linkstart . $label_link . $linkend;
return $result;
- }
+ }
/**
* Information on record
@@ -530,7 +530,7 @@ class AccountingAccount extends CommonObject
* @param int $id of record
* @return void
*/
- function info($id)
+ public function info($id)
{
$sql = 'SELECT a.rowid, a.datec, a.fk_user_author, a.fk_user_modif, a.tms';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as a';
@@ -562,14 +562,14 @@ class AccountingAccount extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Account deactivated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
- function account_desactivate($id)
+ public function account_desactivate($id)
{
// phpcs:enable
$result = $this->checkUsage();
@@ -597,14 +597,14 @@ class AccountingAccount extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Account activated
*
* @param int $id Id
* @return int <0 if KO, >0 if OK
*/
- function account_activate($id)
+ public function account_activate($id)
{
// phpcs:enable
$this->db->begin();
@@ -615,15 +615,15 @@ class AccountingAccount extends CommonObject
dol_syslog(get_class($this) . "::activate sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql);
- if ($result) {
+ if ($result) {
$this->db->commit();
return 1;
- } else {
+ } else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return - 1;
- }
- }
+ }
+ }
/**
@@ -632,12 +632,12 @@ class AccountingAccount 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
* @return string Label of status
*/
- function getLibStatut($mode = 0)
+ public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->status, $mode);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@@ -645,7 +645,7 @@ class AccountingAccount 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
* @return string Label of status
*/
- function LibStatut($statut, $mode = 0)
+ public function LibStatut($statut, $mode = 0)
{
// phpcs:enable
global $langs;
@@ -655,32 +655,32 @@ class AccountingAccount extends CommonObject
{
$prefix='';
if ($statut == 1) return $langs->trans('Enabled');
- if ($statut == 0) return $langs->trans('Disabled');
+ elseif ($statut == 0) return $langs->trans('Disabled');
}
elseif ($mode == 1)
{
if ($statut == 1) return $langs->trans('Enabled');
- if ($statut == 0) return $langs->trans('Disabled');
+ elseif ($statut == 0) return $langs->trans('Disabled');
}
elseif ($mode == 2)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
- if ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
+ elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
}
elseif ($mode == 3)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4');
- if ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5');
+ elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5');
}
elseif ($mode == 4)
{
if ($statut == 1) return img_picto($langs->trans('Enabled'), 'statut4').' '.$langs->trans('Enabled');
- if ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
+ elseif ($statut == 0) return img_picto($langs->trans('Disabled'), 'statut5').' '.$langs->trans('Disabled');
}
elseif ($mode == 5)
{
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'), 'statut4');
- if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
+ elseif ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5');
}
}
}
diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php
index b4ef9781aa2..eb99badd5f3 100644
--- a/htdocs/accountancy/class/accountingjournal.class.php
+++ b/htdocs/accountancy/class/accountingjournal.class.php
@@ -74,10 +74,10 @@ class AccountingJournal extends CommonObject
*
* @param DoliDB $db Database handle
*/
- function __construct($db)
+ public function __construct($db)
{
- $this->db = $db;
- }
+ $this->db = $db;
+ }
/**
* Load an object from database
@@ -86,7 +86,7 @@ class AccountingJournal extends CommonObject
* @param string $journal_code Journal code
* @return int <0 if KO, Id of record if OK and found
*/
- function fetch($rowid = null, $journal_code = null)
+ public function fetch($rowid = null, $journal_code = null)
{
global $conf;
@@ -146,7 +146,7 @@ class AccountingJournal extends CommonObject
*
* @return int <0 if KO, >0 if OK
*/
- function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
+ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
$sql = "SELECT rowid, code, label, nature, active";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
@@ -213,7 +213,7 @@ class AccountingJournal extends CommonObject
* @param int $notooltip 1=Disable tooltip
* @return string String with URL
*/
- function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0)
+ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0)
{
global $langs, $conf, $user;
@@ -270,12 +270,12 @@ class AccountingJournal extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court
* @return string Label of type
*/
- function getLibType($mode = 0)
+ public function getLibType($mode = 0)
{
return $this->LibType($this->nature, $mode);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return type of an accounting journal
*
@@ -283,7 +283,7 @@ class AccountingJournal extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court
* @return string Label of type
*/
- function LibType($nature, $mode = 0)
+ public function LibType($nature, $mode = 0)
{
// phpcs:enable
global $langs;
@@ -294,20 +294,20 @@ class AccountingJournal extends CommonObject
{
$prefix='';
if ($nature == 9) return $langs->trans('AccountingJournalType9');
- if ($nature == 5) return $langs->trans('AccountingJournalType5');
- if ($nature == 4) return $langs->trans('AccountingJournalType4');
- if ($nature == 3) return $langs->trans('AccountingJournalType3');
- if ($nature == 2) return $langs->trans('AccountingJournalType2');
- if ($nature == 1) return $langs->trans('AccountingJournalType1');
+ elseif ($nature == 5) return $langs->trans('AccountingJournalType5');
+ elseif ($nature == 4) return $langs->trans('AccountingJournalType4');
+ elseif ($nature == 3) return $langs->trans('AccountingJournalType3');
+ elseif ($nature == 2) return $langs->trans('AccountingJournalType2');
+ elseif ($nature == 1) return $langs->trans('AccountingJournalType1');
}
- if ($mode == 1)
+ elseif ($mode == 1)
{
if ($nature == 9) return $langs->trans('AccountingJournalType9');
- if ($nature == 5) return $langs->trans('AccountingJournalType5');
- if ($nature == 4) return $langs->trans('AccountingJournalType4');
- if ($nature == 3) return $langs->trans('AccountingJournalType3');
- if ($nature == 2) return $langs->trans('AccountingJournalType2');
- if ($nature == 1) return $langs->trans('AccountingJournalType1');
+ elseif ($nature == 5) return $langs->trans('AccountingJournalType5');
+ elseif ($nature == 4) return $langs->trans('AccountingJournalType4');
+ elseif ($nature == 3) return $langs->trans('AccountingJournalType3');
+ elseif ($nature == 2) return $langs->trans('AccountingJournalType2');
+ elseif ($nature == 1) return $langs->trans('AccountingJournalType1');
}
}
}
diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php
index bf3594e967d..5856c9a418e 100644
--- a/htdocs/accountancy/class/bookkeeping.class.php
+++ b/htdocs/accountancy/class/bookkeeping.class.php
@@ -411,7 +411,7 @@ class BookKeeping extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
- function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
+ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -1308,7 +1308,7 @@ class BookKeeping extends CommonObject
* @param string $importkey Import key
* @return int Result
*/
- function deleteByImportkey($importkey)
+ public function deleteByImportkey($importkey)
{
$this->db->begin();
@@ -1338,7 +1338,7 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
- function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
+ public function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
{
global $conf;
@@ -1378,7 +1378,7 @@ class BookKeeping extends CommonObject
* @param int $piecenum Piecenum to delete
* @return int Result
*/
- function deleteMvtNum($piecenum)
+ public function deleteMvtNum($piecenum)
{
global $conf;
@@ -1565,7 +1565,7 @@ class BookKeeping extends CommonObject
* @param string $mode Mode
* @return int <0 if KO, >0 if OK
*/
- function fetchAllPerMvt($piecenum, $mode = '')
+ public function fetchAllPerMvt($piecenum, $mode = '')
{
global $conf;
@@ -1618,14 +1618,14 @@ class BookKeeping extends CommonObject
return 1;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Export bookkeping
*
* @param string $model Model
* @return int Result
*/
- function export_bookkeping($model = 'ebp')
+ public function export_bookkeping($model = 'ebp')
{
// phpcs:enable
global $conf;
@@ -1771,7 +1771,7 @@ class BookKeeping extends CommonObject
*/
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of accounts with label by chart of accounts
*
@@ -1784,7 +1784,7 @@ class BookKeeping extends CommonObject
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
* @return string String with HTML select
*/
- function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
+ public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
{
// phpcs:enable
global $conf;
@@ -1843,14 +1843,14 @@ class BookKeeping extends CommonObject
return $out;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Description of a root accounting account
*
* @param string $account Accounting account
* @return string Root account
*/
- function get_compte_racine($account = null)
+ public function get_compte_racine($account = null)
{
// phpcs:enable
global $conf;
@@ -1884,15 +1884,15 @@ class BookKeeping extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Description of accounting account
*
* @param string $account Accounting account
* @return string Account desc
*/
- function get_compte_desc($account = null)
- {
+ public function get_compte_desc($account = null)
+ {
// phpcs:enable
global $conf;
diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php
index d646a7cfb9b..31f957fcf21 100644
--- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php
+++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php
@@ -32,15 +32,15 @@ abstract class ActionsAdherentCardCommon
*/
public $db;
- var $dirmodule;
- var $targetmodule;
- var $canvas;
- var $card;
+ public $dirmodule;
+ public $targetmodule;
+ public $canvas;
+ public $card;
//! Template container
- var $tpl = array();
+ public $tpl = array();
//! Object container
- var $object;
+ public $object;
/**
* @var string Error code (or message)
@@ -59,7 +59,7 @@ abstract class ActionsAdherentCardCommon
* @param int $id Object id
* @return object Object loaded
*/
- function getObject($id)
+ public function getObject($id)
{
//$ret = $this->getInstanceDao();
@@ -75,7 +75,7 @@ abstract class ActionsAdherentCardCommon
//}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Set content of ->tpl array, to use into template
*
@@ -83,7 +83,7 @@ abstract class ActionsAdherentCardCommon
* @param int $id Id
* @return string HTML output
*/
- function assign_values(&$action, $id)
+ public function assign_values(&$action, $id)
{
// phpcs:enable
global $conf, $langs, $user, $canvas;
@@ -245,23 +245,23 @@ abstract class ActionsAdherentCardCommon
// phpcs:enable
global $langs, $mysoc;
- $this->object->old_name = $_POST["old_name"];
- $this->object->old_firstname = $_POST["old_firstname"];
+ $this->object->old_name = $_POST["old_name"];
+ $this->object->old_firstname = $_POST["old_firstname"];
- $this->object->fk_soc = $_POST["fk_soc"];
- $this->object->lastname = $_POST["lastname"];
- $this->object->firstname = $_POST["firstname"];
- $this->object->civility_id = $_POST["civility_id"];
- $this->object->address = $_POST["address"];
- $this->object->zip = $_POST["zipcode"];
- $this->object->town = $_POST["town"];
- $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
- $this->object->state_id = $_POST["state_id"];
- $this->object->phone_perso = $_POST["phone_perso"];
- $this->object->phone_mobile = $_POST["phone_mobile"];
- $this->object->email = $_POST["email"];
- $this->object->note = $_POST["note"];
- $this->object->canvas = $_POST["canvas"];
+ $this->object->fk_soc = $_POST["fk_soc"];
+ $this->object->lastname = $_POST["lastname"];
+ $this->object->firstname = $_POST["firstname"];
+ $this->object->civility_id = $_POST["civility_id"];
+ $this->object->address = $_POST["address"];
+ $this->object->zip = $_POST["zipcode"];
+ $this->object->town = $_POST["town"];
+ $this->object->country_id = $_POST["country_id"]?$_POST["country_id"]:$mysoc->country_id;
+ $this->object->state_id = $_POST["state_id"];
+ $this->object->phone_perso = $_POST["phone_perso"];
+ $this->object->phone_mobile = $_POST["phone_mobile"];
+ $this->object->email = $_POST["email"];
+ $this->object->note = $_POST["note"];
+ $this->object->canvas = $_POST["canvas"];
// We set country_id, and country_code label of the chosen country
if ($this->object->country_id)
@@ -272,8 +272,8 @@ abstract class ActionsAdherentCardCommon
{
$obj = $this->db->fetch_object($resql);
- $this->object->country_code = $obj->code;
- $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
+ $this->object->country_code = $obj->code;
+ $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
}
else
{
diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
index 67c1e33dbec..40424540312 100644
--- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
+++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
@@ -39,7 +39,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/
- function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
+ public function __construct($db, $dirmodule, $targetmodule, $canvas, $card)
{
$this->db = $db;
$this->dirmodule = $dirmodule;
@@ -67,7 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
return $out;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Assign custom values for canvas
*
@@ -75,7 +75,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param int $id Id
* @return void
*/
- function assign_values(&$action, $id)
+ public function assign_values(&$action, $id)
{
// phpcs:enable
global $limit, $offset, $sortfield, $sortorder;
@@ -122,7 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Fetch datas list and save into ->list_datas
*
@@ -132,7 +132,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
* @param string $sortorder Sort order ('ASC' or 'DESC')
* @return void
*/
- function LoadListDatas($limit, $offset, $sortfield, $sortorder)
+ public function LoadListDatas($limit, $offset, $sortfield, $sortorder)
{
// phpcs:enable
global $conf, $langs;
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 66ee5ee16f2..1d7fb503ea2 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -223,7 +223,7 @@ class Adherent extends CommonObject
*
* @param DoliDB $db Database handler
*/
- function __construct($db)
+ public function __construct($db)
{
$this->db = $db;
$this->statut = -1;
@@ -234,7 +234,7 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function sending an email to the current member with the text supplied in parameter.
*
@@ -251,7 +251,7 @@ class Adherent extends CommonObject
* @param string $moreinheader Add more html headers
* @return int <0 if KO, >0 if OK
*/
- function send_an_email($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '')
+ public function send_an_email($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '')
{
// phpcs:enable
global $conf,$langs;
@@ -296,7 +296,7 @@ class Adherent extends CommonObject
* @param string $text Text to make substitution to
* @return string Value of input text string with substitutions done
*/
- function makeSubstitution($text)
+ public function makeSubstitution($text)
{
global $conf,$langs;
@@ -363,7 +363,7 @@ class Adherent extends CommonObject
* @param string $morphy Nature of the adherent (physical or moral)
* @return string Label
*/
- function getmorphylib($morphy = '')
+ public function getmorphylib($morphy = '')
{
global $langs;
if (! $morphy) { $morphy=$this->morphy; }
@@ -379,7 +379,7 @@ class Adherent extends CommonObject
* @param int $notrigger 1 ne declenche pas les triggers, 0 sinon
* @return int <0 if KO, >0 if OK
*/
- function create($user, $notrigger = 0)
+ public function create($user, $notrigger = 0)
{
global $conf,$langs;
@@ -505,7 +505,7 @@ class Adherent extends CommonObject
* @param string $action Current action for hookmanager
* @return int <0 if KO, >0 if OK
*/
- function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update')
+ public function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update')
{
global $conf, $langs, $hookmanager;
@@ -760,7 +760,7 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Update denormalized last subscription date.
* This function is called when we delete a subscription for example.
@@ -768,7 +768,7 @@ class Adherent extends CommonObject
* @param User $user User making change
* @return int <0 if KO, >0 if OK
*/
- function update_end_date($user)
+ public function update_end_date($user)
{
// phpcs:enable
$this->db->begin();
@@ -825,7 +825,7 @@ class Adherent extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, 0=nothing to do, >0 if OK
*/
- function delete($rowid, $user, $notrigger = 0)
+ public function delete($rowid, $user, $notrigger = 0)
{
global $conf, $langs;
@@ -935,7 +935,7 @@ class Adherent extends CommonObject
* @param int $nosyncuser Do not synchronize linked user
* @return string If OK return clear password, 0 if no change, < 0 if error
*/
- function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0)
+ public function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0)
{
global $conf, $langs;
@@ -1046,7 +1046,7 @@ class Adherent extends CommonObject
* @param int $userid Id of user to link to
* @return int 1=OK, -1=KO
*/
- function setUserId($userid)
+ public function setUserId($userid)
{
global $conf, $langs;
@@ -1080,7 +1080,7 @@ class Adherent extends CommonObject
* @param int $thirdpartyid Id of user to link to
* @return int 1=OK, -1=KO
*/
- function setThirdPartyId($thirdpartyid)
+ public function setThirdPartyId($thirdpartyid)
{
global $conf, $langs;
@@ -1116,14 +1116,14 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Method to load member from its login
*
* @param string $login login of member
* @return void
*/
- function fetch_login($login)
+ public function fetch_login($login)
{
// phpcs:enable
global $conf;
@@ -1147,7 +1147,7 @@ class Adherent extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Method to load member from its name
*
@@ -1155,7 +1155,7 @@ class Adherent extends CommonObject
* @param string $lastname Lastname
* @return void
*/
- function fetch_name($firstname, $lastname)
+ public function fetch_name($firstname, $lastname)
{
// phpcs:enable
global $conf;
@@ -1191,7 +1191,7 @@ class Adherent extends CommonObject
* @param bool $fetch_subscriptions To load member subscriptions
* @return int >0 if OK, 0 if not found, <0 if KO
*/
- function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
+ public function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
{
global $langs;
@@ -1325,7 +1325,7 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to get member subscriptions data
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
@@ -1333,7 +1333,7 @@ class Adherent extends CommonObject
*
* @return int <0 si KO, >0 si OK
*/
- function fetch_subscriptions()
+ public function fetch_subscriptions()
{
// phpcs:enable
global $langs;
@@ -1409,7 +1409,7 @@ class Adherent extends CommonObject
* @param int $datesubend Date end subscription
* @return int rowid of record added, <0 if KO
*/
- function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0)
+ public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0)
{
global $conf,$langs,$user;
@@ -1495,7 +1495,7 @@ class Adherent extends CommonObject
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
* @return int <0 if KO, >0 if OK
*/
- function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0)
+ public function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0)
{
global $conf, $langs, $user, $mysoc;
@@ -1788,7 +1788,7 @@ class Adherent extends CommonObject
* @param User $user user adherent qui valide
* @return int <0 if KO, 0 if nothing done, >0 if OK
*/
- function validate($user)
+ public function validate($user)
{
global $langs,$conf;
@@ -1841,7 +1841,7 @@ class Adherent extends CommonObject
* @param User $user User making change
* @return int <0 if KO, >0 if OK
*/
- function resiliate($user)
+ public function resiliate($user)
{
global $langs,$conf;
@@ -1883,13 +1883,13 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to add member into external tools mailing-list, spip, etc.
*
* @return int <0 if KO, >0 if OK
*/
- function add_to_abo()
+ public function add_to_abo()
{
// phpcs:enable
global $conf,$langs;
@@ -1942,13 +1942,13 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to delete a member from external tools like mailing-list, spip, etc.
*
* @return int <0 if KO, >0 if OK
*/
- function del_to_abo()
+ public function del_to_abo()
{
// phpcs:enable
global $conf,$langs;
@@ -2006,7 +2006,7 @@ class Adherent extends CommonObject
*
* @return string Translated name of civility (translated with transnoentitiesnoconv)
*/
- function getCivilityLabel()
+ public function getCivilityLabel()
{
global $langs;
$langs->load("dict");
@@ -2027,7 +2027,7 @@ class Adherent extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL
*/
- function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1)
+ public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1)
{
global $conf, $langs;
@@ -2118,12 +2118,12 @@ class Adherent 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
* @return string Label
*/
- function getLibStatut($mode = 0)
+ public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->statut, $this->need_subscription, $this->datefin, $mode);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@@ -2133,7 +2133,7 @@ class Adherent 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
* @return string Label
*/
- function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
+ public function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
{
// phpcs:enable
global $langs;
@@ -2211,13 +2211,13 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Charge indicateurs this->nb de tableau de bord
*
* @return int <0 if KO, >0 if OK
*/
- function load_state_board()
+ public function load_state_board()
{
// phpcs:enable
global $conf;
@@ -2247,14 +2247,14 @@ class Adherent extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
- function load_board($user)
+ public function load_board($user)
{
// phpcs:enable
global $conf, $langs;
@@ -2346,7 +2346,7 @@ class Adherent extends CommonObject
*
* @return void
*/
- function initAsSpecimen()
+ public function initAsSpecimen()
{
global $user,$langs;
@@ -2400,7 +2400,7 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@@ -2410,7 +2410,7 @@ class Adherent extends CommonObject
* 2=Return key only (uid=qqq)
* @return string DN
*/
- function _load_ldap_dn($info, $mode = 0)
+ private function _load_ldap_dn($info, $mode = 0)
{
// phpcs:enable
global $conf;
@@ -2422,13 +2422,13 @@ class Adherent extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Initialise tableau info (tableau des attributs LDAP)
*
* @return array Tableau info des attributs
*/
- function _load_ldap_info()
+ private function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
@@ -2536,7 +2536,7 @@ class Adherent extends CommonObject
* @param int $id Id of member to load
* @return void
*/
- function info($id)
+ public function info($id)
{
$sql = 'SELECT a.rowid, a.datec as datec,';
$sql.= ' a.datevalid as datev,';
@@ -2592,7 +2592,7 @@ class Adherent extends CommonObject
*
* @return int Number of EMailings
*/
- function getNbOfEMailings()
+ public function getNbOfEMailings()
{
$sql = "SELECT count(mc.email) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 9fd7a9b9d38..65085caf42a 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -89,7 +89,7 @@ class AdherentType extends CommonObject
*
* @param DoliDB $db Database handler
*/
- function __construct($db)
+ public function __construct($db)
{
$this->db = $db;
$this->statut = 1;
@@ -103,7 +103,7 @@ class AdherentType extends CommonObject
* @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO
*/
- function create($user, $notrigger = 0)
+ public function create($user, $notrigger = 0)
{
global $conf;
@@ -170,7 +170,7 @@ class AdherentType extends CommonObject
* @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO
*/
- function update($user, $notrigger = 0)
+ public function update($user, $notrigger = 0)
{
global $conf, $hookmanager;
@@ -238,7 +238,7 @@ class AdherentType extends CommonObject
*
* @return int > 0 if OK, 0 if not found, < 0 if KO
*/
- function delete()
+ public function delete()
{
global $user;
@@ -272,7 +272,7 @@ class AdherentType extends CommonObject
* @param int $rowid Id of member type to load
* @return int <0 if KO, >0 if OK
*/
- function fetch($rowid)
+ public function fetch($rowid)
{
$sql = "SELECT d.rowid, d.libelle as label, d.statut, d.subscription, d.mail_valid, d.note, d.vote";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
@@ -306,13 +306,13 @@ class AdherentType extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of members' type
*
* @return array List of types of members
*/
- function liste_array()
+ public function liste_array()
{
// phpcs:enable
global $conf,$langs;
@@ -356,7 +356,7 @@ class AdherentType extends CommonObject
* 2=Return array of members id only
* @return mixed Array of members or -1 on error
*/
- function listMembersForMemberType($excludefilter = '', $mode = 0)
+ public function listMembersForMemberType($excludefilter = '', $mode = 0)
{
global $conf, $user;
@@ -404,14 +404,14 @@ class AdherentType extends CommonObject
}
/**
- * Return clicable name (with picto eventually)
+ * Return clicable name (with picto eventually)
*
- * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
- * @param int $maxlen length max label
- * @param int $notooltip 1=Disable tooltip
- * @return string String with URL
+ * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ * @param int $maxlen length max label
+ * @param int $notooltip 1=Disable tooltip
+ * @return string String with URL
*/
- function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
+ public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
{
global $langs;
@@ -434,12 +434,12 @@ class AdherentType extends CommonObject
*
* @return string Return status of a type of member
*/
- function getLibStatut()
- {
- return '';
- }
+ public function getLibStatut()
+ {
+ return '';
+ }
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@@ -449,7 +449,7 @@ class AdherentType extends CommonObject
* 2=Return key only (uid=qqq)
* @return string DN
*/
- function _load_ldap_dn($info, $mode = 0)
+ private function _load_ldap_dn($info, $mode = 0)
{
// phpcs:enable
global $conf;
@@ -461,13 +461,13 @@ class AdherentType extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
*
* @return array Tableau info des attributs
*/
- function _load_ldap_info()
+ private function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
@@ -502,7 +502,7 @@ class AdherentType extends CommonObject
*
* @return void
*/
- function initAsSpecimen()
+ public function initAsSpecimen()
{
global $conf, $user, $langs;
@@ -530,7 +530,7 @@ class AdherentType extends CommonObject
*
* @return string Return mail content of type or empty
*/
- function getMailOnValid()
+ public function getMailOnValid()
{
global $conf;
@@ -547,7 +547,7 @@ class AdherentType extends CommonObject
*
* @return string Return mail content of type or empty
*/
- function getMailOnSubscription()
+ public function getMailOnSubscription()
{
global $conf;
@@ -565,16 +565,16 @@ class AdherentType extends CommonObject
*
* @return string Return mail model content of type or empty
*/
- function getMailOnResiliate()
- {
- global $conf;
+ public function getMailOnResiliate()
+ {
+ global $conf;
- // NOTE mail_resiliate not defined so never used
- if (! empty($this->mail_resiliate) && trim(dol_htmlentitiesbr_decode($this->mail_resiliate))) // Property not yet defined
- {
- return $this->mail_resiliate;
- }
+ // NOTE mail_resiliate not defined so never used
+ if (! empty($this->mail_resiliate) && trim(dol_htmlentitiesbr_decode($this->mail_resiliate))) // Property not yet defined
+ {
+ return $this->mail_resiliate;
+ }
- return '';
- }
+ return '';
+ }
}
diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php
index 7468ddb92a9..b9085b1f6b4 100644
--- a/htdocs/adherents/class/adherentstats.class.php
+++ b/htdocs/adherents/class/adherentstats.class.php
@@ -37,12 +37,12 @@ class AdherentStats extends Stats
*/
public $table_element;
- var $socid;
- var $userid;
+ public $socid;
+ public $userid;
- var $from;
- var $field;
- var $where;
+ public $from;
+ public $field;
+ public $where;
/**
@@ -52,7 +52,7 @@ class AdherentStats extends Stats
* @param int $socid Id third party
* @param int $userid Id user for filter
*/
- function __construct($db, $socid = 0, $userid = 0)
+ public function __construct($db, $socid = 0, $userid = 0)
{
global $user, $conf;
@@ -85,7 +85,7 @@ class AdherentStats extends Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of nb each month
*/
- function getNbByMonth($year, $format = 0)
+ public function getNbByMonth($year, $format = 0)
{
global $user;
@@ -105,7 +105,7 @@ class AdherentStats extends Stats
*
* @return array Array of nb each year
*/
- function getNbByYear()
+ public function getNbByYear()
{
global $user;
@@ -126,7 +126,7 @@ class AdherentStats extends Stats
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
* @return array Array of amount each month
*/
- function getAmountByMonth($year, $format = 0)
+ public function getAmountByMonth($year, $format = 0)
{
global $user;
@@ -147,7 +147,7 @@ class AdherentStats extends Stats
* @param int $year Year
* @return array Array of average each month
*/
- function getAverageByMonth($year)
+ public function getAverageByMonth($year)
{
global $user;
@@ -168,7 +168,7 @@ class AdherentStats extends Stats
*
* @return array Array with nb, total amount, average for each year
*/
- function getAllByYear()
+ public function getAllByYear()
{
global $user;
diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php
index 7e43e17fd6f..6025f2a2985 100644
--- a/htdocs/adherents/class/api_members.class.php
+++ b/htdocs/adherents/class/api_members.class.php
@@ -41,7 +41,7 @@ class Members extends DolibarrApi
/**
* Constructor
*/
- function __construct()
+ public function __construct()
{
global $db, $conf;
$this->db = $db;
@@ -57,7 +57,7 @@ class Members extends DolibarrApi
*
* @throws RestException
*/
- function get($id)
+ public function get($id)
{
if(! DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401);
@@ -91,7 +91,7 @@ class Members extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
+ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $typeid = '', $sqlfilters = '')
{
global $db, $conf;
@@ -162,7 +162,7 @@ class Members extends DolibarrApi
* @param array $request_data Request data
* @return int ID of member
*/
- function post($request_data = null)
+ public function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
throw new RestException(401);
@@ -187,7 +187,7 @@ class Members extends DolibarrApi
* @param array $request_data Datas
* @return int
*/
- function put($id, $request_data = null)
+ public function put($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
throw new RestException(401);
@@ -242,7 +242,7 @@ class Members extends DolibarrApi
* @param int $id member ID
* @return array
*/
- function delete($id)
+ public function delete($id)
{
if(! DolibarrApiAccess::$user->rights->adherent->supprimer) {
throw new RestException(401);
@@ -277,7 +277,7 @@ class Members extends DolibarrApi
*
* @throws RestException
*/
- function _validate($data)
+ private function _validate($data)
{
$member = array();
foreach (Members::$FIELDS as $field) {
@@ -294,7 +294,7 @@ class Members extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object)
+ private function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@@ -328,7 +328,7 @@ class Members extends DolibarrApi
*
* @url GET {id}/subscriptions
*/
- function getSubscriptions($id)
+ public function getSubscriptions($id)
{
$obj_ret = array();
@@ -361,7 +361,7 @@ class Members extends DolibarrApi
*
* @url POST {id}/subscriptions
*/
- function createSubscription($id, $start_date, $end_date, $amount, $label = '')
+ public function createSubscription($id, $start_date, $end_date, $amount, $label = '')
{
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
throw new RestException(401);
@@ -389,7 +389,7 @@ class Members extends DolibarrApi
*
* @url GET {id}/categories
*/
- function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
+ public function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
{
if (! DolibarrApiAccess::$user->rights->categorie->lire) {
throw new RestException(401);
diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php
index e6ce4ace151..43fd2635fb4 100644
--- a/htdocs/adherents/class/api_memberstypes.class.php
+++ b/htdocs/adherents/class/api_memberstypes.class.php
@@ -37,7 +37,7 @@ class MembersTypes extends DolibarrApi
/**
* Constructor
*/
- function __construct()
+ public function __construct()
{
global $db, $conf;
$this->db = $db;
@@ -53,7 +53,7 @@ class MembersTypes extends DolibarrApi
*
* @throws RestException
*/
- function get($id)
+ public function get($id)
{
if(! DolibarrApiAccess::$user->rights->adherent->lire) {
throw new RestException(401);
@@ -86,7 +86,7 @@ class MembersTypes extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
+ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
{
global $db, $conf;
@@ -154,7 +154,7 @@ class MembersTypes extends DolibarrApi
* @param array $request_data Request data
* @return int ID of member type
*/
- function post($request_data = null)
+ public function post($request_data = null)
{
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
throw new RestException(401);
@@ -179,7 +179,7 @@ class MembersTypes extends DolibarrApi
* @param array $request_data Datas
* @return int
*/
- function put($id, $request_data = null)
+ public function put($id, $request_data = null)
{
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
throw new RestException(401);
@@ -220,7 +220,7 @@ class MembersTypes extends DolibarrApi
* @param int $id member type ID
* @return array
*/
- function delete($id)
+ public function delete($id)
{
if (! DolibarrApiAccess::$user->rights->adherent->configurer) {
throw new RestException(401);
@@ -255,7 +255,7 @@ class MembersTypes extends DolibarrApi
*
* @throws RestException
*/
- function _validate($data)
+ private function _validate($data)
{
$membertype = array();
foreach (MembersTypes::$FIELDS as $field) {
@@ -272,7 +272,7 @@ class MembersTypes extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object)
+ private function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/adherents/class/api_subscriptions.class.php b/htdocs/adherents/class/api_subscriptions.class.php
index 3089f2cfd98..e5173005460 100644
--- a/htdocs/adherents/class/api_subscriptions.class.php
+++ b/htdocs/adherents/class/api_subscriptions.class.php
@@ -40,7 +40,7 @@ class Subscriptions extends DolibarrApi
/**
* Constructor
*/
- function __construct()
+ public function __construct()
{
global $db, $conf;
$this->db = $db;
@@ -56,7 +56,7 @@ class Subscriptions extends DolibarrApi
*
* @throws RestException
*/
- function get($id)
+ public function get($id)
{
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->lire) {
throw new RestException(401);
@@ -85,7 +85,7 @@ class Subscriptions extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
+ public function index($sortfield = "dateadh", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
{
global $db, $conf;
@@ -151,7 +151,7 @@ class Subscriptions extends DolibarrApi
* @param array $request_data Request data
* @return int ID of subscription
*/
- function post($request_data = null)
+ public function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
throw new RestException(401);
@@ -176,7 +176,7 @@ class Subscriptions extends DolibarrApi
* @param array $request_data Datas
* @return int
*/
- function put($id, $request_data = null)
+ public function put($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->adherent->creer) {
throw new RestException(401);
@@ -209,7 +209,7 @@ class Subscriptions extends DolibarrApi
* @param int $id ID of subscription to delete
* @return array
*/
- function delete($id)
+ public function delete($id)
{
// The right to delete a subscription comes with the right to create one.
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
@@ -241,7 +241,7 @@ class Subscriptions extends DolibarrApi
*
* @throws RestException
*/
- function _validate($data)
+ private function _validate($data)
{
$subscription = array();
foreach (Subscriptions::$FIELDS as $field) {
diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index 0d43b9d3f09..52cb8e05bbd 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -32,78 +32,78 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
*/
class Subscription extends CommonObject
{
- /**
- * @var string ID to identify managed object
- */
- public $element='subscription';
-
- /**
- * @var string Name of table without prefix where object is stored
- */
- public $table_element='subscription';
+ /**
+ * @var string ID to identify managed object
+ */
+ public $element='subscription';
/**
- * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
- */
- public $picto='payment';
+ * @var string Name of table without prefix where object is stored
+ */
+ public $table_element='subscription';
- public $datec; // Date creation
- public $datem; // Date modification
- public $dateh; // Subscription start date (date subscription)
- public $datef; // Subscription end date
+ /**
+ * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
+ */
+ public $picto='payment';
- /**
+ public $datec; // Date creation
+ public $datem; // Date modification
+ public $dateh; // Subscription start date (date subscription)
+ public $datef; // Subscription end date
+
+ /**
* @var int ID
*/
- public $fk_type;
- public $fk_adherent;
+ public $fk_type;
+ public $fk_adherent;
- public $amount;
+ public $amount;
- /**
+ /**
* @var int ID
*/
- public $fk_bank;
+ public $fk_bank;
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db)
- {
- $this->db = $db;
- }
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
+ public function __construct($db)
+ {
+ $this->db = $db;
+ }
- /**
- * Function who permitted cretaion of the subscription
- *
- * @param User $user User that create
- * @param bool $notrigger false=launch triggers after, true=disable triggers
- * @return int <0 if KO, Id subscription created if OK
- */
- function create($user, $notrigger = false)
- {
- global $langs;
+ /**
+ * Function who permitted cretaion of the subscription
+ *
+ * @param User $user User that create
+ * @param bool $notrigger false=launch triggers after, true=disable triggers
+ * @return int <0 if KO, Id subscription created if OK
+ */
+ public function create($user, $notrigger = false)
+ {
+ global $langs;
- $error = 0;
+ $error = 0;
- $now=dol_now();
+ $now=dol_now();
- // Check parameters
- if ($this->datef <= $this->dateh)
- {
- $this->error=$langs->trans("ErrorBadValueForDate");
- return -1;
- }
- if (empty($this->datec)) $this->datec = $now;
+ // Check parameters
+ if ($this->datef <= $this->dateh)
+ {
+ $this->error=$langs->trans("ErrorBadValueForDate");
+ return -1;
+ }
+ if (empty($this->datec)) $this->datec = $now;
- $this->db->begin();
+ $this->db->begin();
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
if ($this->fk_type == null) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
@@ -113,338 +113,338 @@ class Subscription extends CommonObject
} else {
$type=$this->fk_type;
}
- $sql.= " VALUES (".$this->fk_adherent.", '".$type."', '".$this->db->idate($now)."',";
- $sql.= " '".$this->db->idate($this->dateh)."',";
- $sql.= " '".$this->db->idate($this->datef)."',";
- $sql.= " ".$this->amount.",";
- $sql.= " '".$this->db->escape($this->note_public?$this->note_public:$this->note)."')";
+ $sql.= " VALUES (".$this->fk_adherent.", '".$type."', '".$this->db->idate($now)."',";
+ $sql.= " '".$this->db->idate($this->dateh)."',";
+ $sql.= " '".$this->db->idate($this->datef)."',";
+ $sql.= " ".$this->amount.",";
+ $sql.= " '".$this->db->escape($this->note_public?$this->note_public:$this->note)."')";
- $resql = $this->db->query($sql);
- if (! $resql) {
- $error++;
- $this->errors[] = $this->db->lasterror();
- }
+ $resql = $this->db->query($sql);
+ if (! $resql) {
+ $error++;
+ $this->errors[] = $this->db->lasterror();
+ }
- if (! $error)
- {
- $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
- }
+ if (! $error)
+ {
+ $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
+ }
- if (! $error && ! $notrigger)
- {
- // Call triggers
- $result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE', $user);
- if ($result < 0) { $error++; }
- // End call triggers
- }
+ if (! $error && ! $notrigger)
+ {
+ // Call triggers
+ $result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE', $user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
- // Commit or rollback
- if ($error) {
- $this->db->rollback();
- return -1;
- } else {
- $this->db->commit();
- return $this->id;
- }
- }
+ // Commit or rollback
+ if ($error) {
+ $this->db->rollback();
+ return -1;
+ } else {
+ $this->db->commit();
+ return $this->id;
+ }
+ }
- /**
- * Method to load a subscription
- *
- * @param int $rowid Id subscription
- * @return int <0 if KO, =0 if not found, >0 if OK
- */
- function fetch($rowid)
- {
+ /**
+ * Method to load a subscription
+ *
+ * @param int $rowid Id subscription
+ * @return int <0 if KO, =0 if not found, >0 if OK
+ */
+ public function fetch($rowid)
+ {
$sql ="SELECT rowid, fk_type, fk_adherent, datec,";
- $sql.=" tms,";
- $sql.=" dateadh as dateh,";
- $sql.=" datef,";
- $sql.=" subscription, note, fk_bank";
- $sql.=" FROM ".MAIN_DB_PREFIX."subscription";
- $sql.=" WHERE rowid=".$rowid;
+ $sql.=" tms,";
+ $sql.=" dateadh as dateh,";
+ $sql.=" datef,";
+ $sql.=" subscription, note, fk_bank";
+ $sql.=" FROM ".MAIN_DB_PREFIX."subscription";
+ $sql.=" WHERE rowid=".$rowid;
- dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
- $resql=$this->db->query($sql);
- if ($resql)
- {
- if ($this->db->num_rows($resql))
- {
- $obj = $this->db->fetch_object($resql);
+ dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ if ($this->db->num_rows($resql))
+ {
+ $obj = $this->db->fetch_object($resql);
- $this->id = $obj->rowid;
- $this->ref = $obj->rowid;
+ $this->id = $obj->rowid;
+ $this->ref = $obj->rowid;
- $this->fk_type = $obj->fk_type;
- $this->fk_adherent = $obj->fk_adherent;
- $this->datec = $this->db->jdate($obj->datec);
- $this->datem = $this->db->jdate($obj->tms);
- $this->dateh = $this->db->jdate($obj->dateh);
- $this->datef = $this->db->jdate($obj->datef);
- $this->amount = $obj->subscription;
- $this->note = $obj->note;
- $this->fk_bank = $obj->fk_bank;
- return 1;
- }
- else
- {
- return 0;
- }
- }
- else
- {
- $this->error=$this->db->lasterror();
- return -1;
- }
- }
+ $this->fk_type = $obj->fk_type;
+ $this->fk_adherent = $obj->fk_adherent;
+ $this->datec = $this->db->jdate($obj->datec);
+ $this->datem = $this->db->jdate($obj->tms);
+ $this->dateh = $this->db->jdate($obj->dateh);
+ $this->datef = $this->db->jdate($obj->datef);
+ $this->amount = $obj->subscription;
+ $this->note = $obj->note;
+ $this->fk_bank = $obj->fk_bank;
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ else
+ {
+ $this->error=$this->db->lasterror();
+ return -1;
+ }
+ }
- /**
- * Update subscription
- *
- * @param User $user User who updated
- * @param int $notrigger 0=Disable triggers
- * @return int <0 if KO, >0 if OK
- */
- function update($user, $notrigger = 0)
- {
- $error = 0;
+ /**
+ * Update subscription
+ *
+ * @param User $user User who updated
+ * @param int $notrigger 0=Disable triggers
+ * @return int <0 if KO, >0 if OK
+ */
+ public function update($user, $notrigger = 0)
+ {
+ $error = 0;
- $this->db->begin();
+ $this->db->begin();
- $sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
- $sql .= " fk_type = ".$this->fk_type.",";
- $sql .= " fk_adherent = ".$this->fk_adherent.",";
- $sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
- $sql .= " subscription = '".price2num($this->amount)."',";
- $sql .= " dateadh='".$this->db->idate($this->dateh)."',";
- $sql .= " datef='".$this->db->idate($this->datef)."',";
- $sql .= " datec='".$this->db->idate($this->datec)."',";
- $sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
- $sql .= " WHERE rowid = ".$this->id;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
+ $sql .= " fk_type = ".$this->fk_type.",";
+ $sql .= " fk_adherent = ".$this->fk_adherent.",";
+ $sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
+ $sql .= " subscription = '".price2num($this->amount)."',";
+ $sql .= " dateadh='".$this->db->idate($this->dateh)."',";
+ $sql .= " datef='".$this->db->idate($this->datef)."',";
+ $sql .= " datec='".$this->db->idate($this->datec)."',";
+ $sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
+ $sql .= " WHERE rowid = ".$this->id;
- dol_syslog(get_class($this)."::update", LOG_DEBUG);
- $resql = $this->db->query($sql);
- if ($resql)
- {
- require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
- $member=new Adherent($this->db);
- $result=$member->fetch($this->fk_adherent);
- $result=$member->update_end_date($user);
+ dol_syslog(get_class($this)."::update", LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if ($resql)
+ {
+ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
+ $member=new Adherent($this->db);
+ $result=$member->fetch($this->fk_adherent);
+ $result=$member->update_end_date($user);
- if (! $error && ! $notrigger) {
- // Call triggers
- $result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user);
- if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
- // End call triggers
- }
- }
- else
- {
- $error++;
- $this->error=$this->db->lasterror();
- }
+ if (! $error && ! $notrigger) {
+ // Call triggers
+ $result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user);
+ if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
+ // End call triggers
+ }
+ }
+ else
+ {
+ $error++;
+ $this->error=$this->db->lasterror();
+ }
- // Commit or rollback
- if ($error) {
- $this->db->rollback();
- return -1;
- } else {
- $this->db->commit();
- return $this->id;
- }
- }
+ // Commit or rollback
+ if ($error) {
+ $this->db->rollback();
+ return -1;
+ } else {
+ $this->db->commit();
+ return $this->id;
+ }
+ }
- /**
- * Delete a subscription
- *
- * @param User $user User that delete
- * @param bool $notrigger false=launch triggers after, true=disable triggers
- * @return int <0 if KO, 0 if not found, >0 if OK
- */
- function delete($user, $notrigger = false)
- {
- $error = 0;
+ /**
+ * Delete a subscription
+ *
+ * @param User $user User that delete
+ * @param bool $notrigger false=launch triggers after, true=disable triggers
+ * @return int <0 if KO, 0 if not found, >0 if OK
+ */
+ public function delete($user, $notrigger = false)
+ {
+ $error = 0;
- // It subscription is linked to a bank transaction, we get it
- if ($this->fk_bank > 0)
- {
- require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
- $accountline=new AccountLine($this->db);
- $result=$accountline->fetch($this->fk_bank);
- }
+ // It subscription is linked to a bank transaction, we get it
+ if ($this->fk_bank > 0)
+ {
+ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
+ $accountline=new AccountLine($this->db);
+ $result=$accountline->fetch($this->fk_bank);
+ }
- $this->db->begin();
+ $this->db->begin();
- if (! $error) {
- if (! $notrigger) {
- // Call triggers
- $result=$this->call_trigger('MEMBER_SUBSCRIPTION_DELETE', $user);
- if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
- // End call triggers
- }
- }
+ if (! $error) {
+ if (! $notrigger) {
+ // Call triggers
+ $result=$this->call_trigger('MEMBER_SUBSCRIPTION_DELETE', $user);
+ if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
+ // End call triggers
+ }
+ }
- if (! $error)
- {
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
- dol_syslog(get_class($this)."::delete", LOG_DEBUG);
- $resql=$this->db->query($sql);
- if ($resql)
- {
- $num=$this->db->affected_rows($resql);
- if ($num)
- {
- require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
- $member=new Adherent($this->db);
- $result=$member->fetch($this->fk_adherent);
- $result=$member->update_end_date($user);
+ if (! $error)
+ {
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
+ dol_syslog(get_class($this)."::delete", LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ $num=$this->db->affected_rows($resql);
+ if ($num)
+ {
+ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
+ $member=new Adherent($this->db);
+ $result=$member->fetch($this->fk_adherent);
+ $result=$member->update_end_date($user);
- if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
- {
- $result=$accountline->delete($user); // Return false if refused because line is conciliated
- if ($result > 0)
- {
- $this->db->commit();
- return 1;
- }
- else
- {
- $this->error=$accountline->error;
- $this->db->rollback();
- return -1;
- }
- }
- else
- {
- $this->db->commit();
- return 1;
- }
- }
- else
- {
- $this->db->commit();
- return 0;
- }
- }
- else
- {
- $error++;
- $this->error=$this->db->lasterror();
- }
- }
+ if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
+ {
+ $result=$accountline->delete($user); // Return false if refused because line is conciliated
+ if ($result > 0)
+ {
+ $this->db->commit();
+ return 1;
+ }
+ else
+ {
+ $this->error=$accountline->error;
+ $this->db->rollback();
+ return -1;
+ }
+ }
+ else
+ {
+ $this->db->commit();
+ return 1;
+ }
+ }
+ else
+ {
+ $this->db->commit();
+ return 0;
+ }
+ }
+ else
+ {
+ $error++;
+ $this->error=$this->db->lasterror();
+ }
+ }
- // Commit or rollback
- if ($error) {
- $this->db->rollback();
- return -1;
- } else {
- $this->db->commit();
- return 1;
- }
- }
+ // Commit or rollback
+ if ($error) {
+ $this->db->rollback();
+ return -1;
+ } else {
+ $this->db->commit();
+ return 1;
+ }
+ }
- /**
- * Return clicable name (with picto eventually)
- *
- * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ /**
+ * Return clicable name (with picto eventually)
+ *
+ * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $notooltip 1=Disable tooltip
- * @param string $option Page for link ('', 'nolink', ...)
- * @param string $morecss Add more css on link
- * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
- * @return string Chaine avec URL
- */
- function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
- {
- global $langs;
+ * @param string $option Page for link ('', 'nolink', ...)
+ * @param string $morecss Add more css on link
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string Chaine avec URL
+ */
+ public function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
+ {
+ global $langs;
- $result='';
+ $result='';
- $langs->load("members");
+ $langs->load("members");
$label=$langs->trans("ShowSubscription").': '.$this->ref;
$url = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$this->id;
if ($option != 'nolink')
{
- // Add param to save lastsearch_values or not
- $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
- if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
- if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
+ if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
$linkstart = '';
- $linkend = '';
+ $linkend = '';
- $picto='payment';
+ $picto='payment';
- $result .= $linkstart;
- if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
- if ($withpicto != 2) $result.= $this->ref;
- $result .= $linkend;
+ $result .= $linkstart;
+ if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
+ if ($withpicto != 2) $result.= $this->ref;
+ $result .= $linkend;
- return $result;
- }
+ return $result;
+ }
- /**
- * Retourne le libelle du statut d'une adhesion
- *
- * @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 Label
- */
- function getLibStatut($mode = 0)
- {
- return '';
- }
+ /**
+ * Retourne le libelle du statut d'une adhesion
+ *
+ * @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 Label
+ */
+ public function getLibStatut($mode = 0)
+ {
+ return '';
+ }
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
- /**
- * Renvoi le libelle d'un statut donne
- *
- * @param int $statut Id statut
- * @return string Label
- */
- function LibStatut($statut)
- {
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
+ * Renvoi le libelle d'un statut donne
+ *
+ * @param int $statut Id statut
+ * @return string Label
+ */
+ public function LibStatut($statut)
+ {
// phpcs:enable
- global $langs;
- $langs->load("members");
- return '';
- }
+ global $langs;
+ $langs->load("members");
+ return '';
+ }
/**
* Load information of the subscription object
- *
+ *
* @param int $id Id subscription
* @return void
*/
- function info($id)
- {
- $sql = 'SELECT c.rowid, c.datec,';
- $sql.= ' c.tms as datem';
- $sql.= ' FROM '.MAIN_DB_PREFIX.'subscription as c';
- $sql.= ' WHERE c.rowid = '.$id;
+ public function info($id)
+ {
+ $sql = 'SELECT c.rowid, c.datec,';
+ $sql.= ' c.tms as datem';
+ $sql.= ' FROM '.MAIN_DB_PREFIX.'subscription as c';
+ $sql.= ' WHERE c.rowid = '.$id;
- $result=$this->db->query($sql);
- if ($result)
- {
- if ($this->db->num_rows($result))
- {
- $obj = $this->db->fetch_object($result);
- $this->id = $obj->rowid;
+ $result=$this->db->query($sql);
+ if ($result)
+ {
+ if ($this->db->num_rows($result))
+ {
+ $obj = $this->db->fetch_object($result);
+ $this->id = $obj->rowid;
- $this->date_creation = $this->db->jdate($obj->datec);
- $this->date_modification = $this->db->jdate($obj->datem);
- }
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->datem);
+ }
- $this->db->free($result);
- }
- else
- {
- dol_print_error($this->db);
- }
- }
+ $this->db->free($result);
+ }
+ else
+ {
+ dol_print_error($this->db);
+ }
+ }
}
diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
index 9c691c88e88..f4ed611ac03 100644
--- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
+++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
@@ -69,7 +69,7 @@ class PrestaShopWebservice
* @param string $key Authentification key
* @param mixed $debug Debug mode Activated (true) or deactivated (false)
*/
- function __construct($url, $key, $debug = true)
+ public function __construct($url, $key, $debug = true)
{
if (!extension_loaded('curl'))
throw new PrestaShopWebserviceException('Please activate the PHP extension \'curl\' to allow use of PrestaShop webservice library');
@@ -77,7 +77,7 @@ class PrestaShopWebservice
$this->key = $key;
$this->debug = $debug;
$this->version = 'unknown';
- }
+ }
/**
* Take the status code and throw an exception if the server didn't return 200 or 201 code
diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php
index b3a9f037e95..8a27072fad1 100644
--- a/htdocs/admin/dolistore/class/dolistore.class.php
+++ b/htdocs/admin/dolistore/class/dolistore.class.php
@@ -54,7 +54,7 @@ class Dolistore
*
* @param boolean $debug Enable debug of request on screen
*/
- function __construct($debug = false)
+ public function __construct($debug = false)
{
global $conf, $langs;
@@ -77,7 +77,7 @@ class Dolistore
* @param array $options Options
* @return void
*/
- function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
+ public function getRemoteData($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
{
global $conf, $langs;
@@ -163,14 +163,14 @@ class Dolistore
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return tree of Dolistore categories. $this->categories must have been loaded before.
*
* @param int $parent Id of parent category
* @return string
*/
- function get_categories($parent = 0)
+ public function get_categories($parent = 0)
{
// phpcs:enable
if (!isset($this->categories)) die('not possible');
@@ -212,13 +212,13 @@ class Dolistore
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of product formated for output
*
* @return string HTML output
*/
- function get_products()
+ public function get_products()
{
// phpcs:enable
global $langs, $conf;
@@ -291,44 +291,44 @@ class Dolistore
| '.$download_link.' |
';
- }
- return $html;
- }
+ }
+ return $html;
+ }
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* get previous link
*
* @param string $text symbol previous
* @return string html previous link
*/
- function get_previous_link($text = '<<')
+ public function get_previous_link($text = '<<')
{
// phpcs:enable
return ''.$text.'';
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* get next link
*
* @param string $text symbol next
* @return string html next link
*/
- function get_next_link($text = '>>')
+ public function get_next_link($text = '>>')
{
// phpcs:enable
return ''.$text.'';
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
- /**
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
* get previous url
*
* @return string previous url
*/
- function get_previous_url()
- {
+ public function get_previous_url()
+ {
// phpcs:enable
$param_array = array();
if ($this->start < $this->per_page) {
@@ -343,15 +343,15 @@ class Dolistore
}
$param = http_build_query($param_array);
return $this->url."&".$param;
- }
+ }
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* get next url
*
* @return string next url
*/
- function get_next_url()
+ public function get_next_url()
{
// phpcs:enable
$param_array = array();
@@ -369,7 +369,7 @@ class Dolistore
return $this->url."&".$param;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* version compare
*
@@ -377,7 +377,7 @@ class Dolistore
* @param string $v2 version 2
* @return int result of compare
*/
- function version_compare($v1, $v2)
+ public function version_compare($v1, $v2)
{
// phpcs:enable
$v1 = explode('.', $v1);
diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index 5bbd6746573..f532db76ce4 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -81,7 +81,7 @@ if ($action == 'addprinter' && $user->admin) {
}
if (! $error) {
- $result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
+ $result= $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
if ($result > 0) $error++;
if (! $error)
@@ -107,7 +107,7 @@ if ($action == 'deleteprinter' && $user->admin) {
}
if (! $error) {
- $result= $printer->DeletePrinter($printerid);
+ $result= $printer->deletePrinter($printerid);
if ($result > 0) $error++;
if (! $error)
@@ -133,7 +133,7 @@ if ($action == 'updateprinter' && $user->admin) {
}
if (! $error) {
- $result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
+ $result= $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
if ($result > 0) $error++;
if (! $error) {
@@ -156,7 +156,7 @@ if ($action == 'testprinter' && $user->admin) {
if (! $error) {
// test
- $ret = $printer->SendTestToPrinter($printerid);
+ $ret = $printer->sendTestToPrinter($printerid);
if ($ret == 0) {
setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
} else {
@@ -176,7 +176,7 @@ if ($action == 'updatetemplate' && $user->admin) {
}
if (! $error) {
- $result= $printer->UpdateTemplate($templatename, $template, $templateid);
+ $result= $printer->updateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++;
if (! $error) {
diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php
index 5595f94a950..6c9074226dc 100644
--- a/htdocs/api/class/api.class.php
+++ b/htdocs/api/class/api.class.php
@@ -37,7 +37,7 @@ class DolibarrApi
/**
* @var Restler $r Restler object
*/
- var $r;
+ public $r;
/**
* Constructor
@@ -46,7 +46,7 @@ class DolibarrApi
* @param string $cachedir Cache dir
* @param boolean $refreshCache Update cache
*/
- function __construct($db, $cachedir = '', $refreshCache = false)
+ public function __construct($db, $cachedir = '', $refreshCache = false)
{
global $conf, $dolibarr_main_url_root;
@@ -87,16 +87,16 @@ class DolibarrApi
);
}*/
-
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Clean sensible object datas
*
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object)
+ protected function _cleanObjectDatas($object)
{
-
+ // phpcs:enable
// Remove $db object property for object
unset($object->db);
unset($object->isextrafieldmanaged);
@@ -208,6 +208,7 @@ class DolibarrApi
return $object;
}
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Check user access to a resource
*
@@ -222,9 +223,9 @@ class DolibarrApi
* @return bool
* @throws RestException
*/
- static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
+ protected static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
{
-
+ // phpcs:enable
// Features/modules to check
$featuresarray = array($resource);
if (preg_match('/&/', $resource)) {
@@ -240,16 +241,18 @@ class DolibarrApi
}
return checkUserAccessToObject(DolibarrApiAccess::$user, $featuresarray, $resource_id, $dbtablename, $feature2, $dbt_keyfield, $dbt_select);
- }
+ }
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Return if a $sqlfilters parameter is valid
*
* @param string $sqlfilters sqlfilter string
* @return boolean True if valid, False if not valid
*/
- function _checkFilters($sqlfilters)
+ protected function _checkFilters($sqlfilters)
{
+ // phpcs:enable
//$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
$tmp=$sqlfilters;
@@ -271,14 +274,15 @@ class DolibarrApi
return true;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Function to forge a SQL criteria
*
* @param array $matches Array of found string by regex search
* @return string Forged criteria. Example: "t.field like 'abc%'"
*/
- static function _forge_criteria_callback($matches)
+ protected static function _forge_criteria_callback($matches)
{
// phpcs:enable
global $db;
diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php
index 9c748fb5f03..010bb854f25 100644
--- a/htdocs/api/class/api_access.class.php
+++ b/htdocs/api/class/api_access.class.php
@@ -173,20 +173,20 @@ class DolibarrApiAccess implements iAuthenticate
* @example Digest
* @example OAuth
*/
- public function __getWWWAuthenticateString()
+ public function __getWWWAuthenticateString()
{
// phpcs:enable
return '';
}
- /**
- * Verify access
- *
- * @param array $m Properties of method
- *
- * @access private
- * @return bool
- */
+ /**
+ * Verify access
+ *
+ * @param array $m Properties of method
+ *
+ * @access private
+ * @return bool
+ */
public static function verifyAccess(array $m)
{
$requires = isset($m['class']['DolibarrApiAccess']['properties']['requires'])
diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php
index 7473bc5db5e..19bd61c641b 100644
--- a/htdocs/api/class/api_documents.class.php
+++ b/htdocs/api/class/api_documents.class.php
@@ -43,7 +43,7 @@ class Documents extends DolibarrApi
/**
* Constructor
*/
- function __construct()
+ public function __construct()
{
global $db;
$this->db = $db;
@@ -67,7 +67,7 @@ class Documents extends DolibarrApi
*
* @url GET /download
*/
- public function index($module_part, $original_file='')
+ public function index($module_part, $original_file = '')
{
global $conf, $langs;
@@ -82,12 +82,11 @@ class Documents extends DolibarrApi
$entity=$conf->entity;
$check_access = dol_check_secure_access_document($module_part, $original_file, $entity, DolibarrApiAccess::$user, '', 'read');
- $accessallowed = $check_access['accessallowed'];
+ $accessallowed = $check_access['accessallowed'];
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
- $original_file = $check_access['original_file'];
+ $original_file = $check_access['original_file'];
- if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file))
- {
+ if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) {
throw new RestException(401);
}
if (!$accessallowed) {
@@ -127,7 +126,7 @@ class Documents extends DolibarrApi
*
* @url PUT /builddoc
*/
- public function builddoc($module_part, $original_file='', $doctemplate='', $langcode='')
+ public function builddoc($module_part, $original_file = '', $doctemplate = '', $langcode = '')
{
global $conf, $langs;
@@ -153,7 +152,7 @@ class Documents extends DolibarrApi
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
$original_file = $check_access['original_file'];
- if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file)) {
+ if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) {
throw new RestException(401);
}
if (!$accessallowed) {
@@ -245,7 +244,7 @@ class Documents extends DolibarrApi
*
* @url GET /
*/
- function getDocumentsListByElement($modulepart, $id=0, $ref='', $sortfield='', $sortorder='')
+ public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sortfield = '', $sortorder = '')
{
global $conf;
@@ -392,7 +391,7 @@ class Documents extends DolibarrApi
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
}
- $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
+ $filearray=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC), 1);
if (empty($filearray)) {
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(! empty($object->Ref)?' or Ref '.$object->ref:'').' does not return any document.');
}
@@ -428,6 +427,7 @@ class Documents extends DolibarrApi
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)
* @param string $fileencoding File encoding (''=no encoding, 'base64'=Base 64) {@example '' or 'base64'}
* @param int $overwriteifexists Overwrite file if exists (1 by default)
+ * @return string
*
* @throws 200
* @throws 400
@@ -437,7 +437,7 @@ class Documents extends DolibarrApi
*
* @url POST /upload
*/
- public function post($filename, $modulepart, $ref='', $subdir='', $filecontent='', $fileencoding='', $overwriteifexists=0)
+ public function post($filename, $modulepart, $ref = '', $subdir = '', $filecontent = '', $fileencoding = '', $overwriteifexists = 0)
{
global $db, $conf;
@@ -517,7 +517,7 @@ class Documents extends DolibarrApi
if($result == 0)
{
throw new RestException(404, "Object with ref '".$ref."' was not found.");
- }
+ }
elseif ($result < 0)
{
throw new RestException(500, 'Error while fetching object.');
@@ -592,6 +592,7 @@ class Documents extends DolibarrApi
return dol_basename($destfile);
}
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName
/**
* Validate fields before create or update object
*
@@ -599,7 +600,8 @@ class Documents extends DolibarrApi
* @return array
* @throws RestException
*/
- function _validate_file($data) {
+ private function _validate_file($data) {
+ // phpcs:enable
$result = array();
foreach (Documents::$DOCUMENT_FIELDS as $field) {
if (!isset($data[$field]))
diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php
index 43a0aeb9bbb..2bf464f7296 100644
--- a/htdocs/api/class/api_login.class.php
+++ b/htdocs/api/class/api_login.class.php
@@ -29,11 +29,11 @@ class Login
/**
* Constructor of the class
*/
- function __construct()
+ public function __construct()
{
- global $db;
- $this->db = $db;
- }
+ global $db;
+ $this->db = $db;
+ }
/**
* Login
@@ -136,5 +136,5 @@ class Login
'message' => 'Welcome ' . $login.($reset?' - Token is new':' - This is your token (generated by a previous call). You can use it to make any REST API call, or enter it into the DOLAPIKEY field to use the Dolibarr API explorer.')
)
);
- }
+ }
}
diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php
index 00a84a00555..766cf79f7be 100644
--- a/htdocs/api/class/api_setup.class.php
+++ b/htdocs/api/class/api_setup.class.php
@@ -38,7 +38,7 @@ class Setup extends DolibarrApi
/**
* Constructor
*/
- function __construct()
+ public function __construct()
{
global $db;
$this->db = $db;
@@ -61,7 +61,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException
* @throws 200 OK
*/
- function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -76,7 +76,7 @@ class Setup extends DolibarrApi
{
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
- $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
+ $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
@@ -128,7 +128,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getListOfCountries($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '')
+ public function getListOfCountries($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '')
{
$list = array();
@@ -195,7 +195,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getCountryByID($id, $lang = '')
+ public function getCountryByID($id, $lang = '')
{
$country = new Ccountry($this->db);
@@ -228,7 +228,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException
* @throws 200 OK
*/
- function getAvailability($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getAvailability($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -279,7 +279,7 @@ class Setup extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object)
+ private function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@@ -334,7 +334,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getListOfEventTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
+ public function getListOfEventTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
{
$list = array();
@@ -397,7 +397,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
+ public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
{
$list = array();
@@ -442,7 +442,7 @@ class Setup extends DolibarrApi
return $list;
}
-
+
/**
* Get the list of currencies.
*
@@ -458,10 +458,10 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getListOfCurrencies($sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getListOfCurrencies($sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
- //TODO link with multicurrency module
+ //TODO link with multicurrency module
$sql = "SELECT t.code_iso, t.label, t.unicode";
$sql.= " FROM ".MAIN_DB_PREFIX."c_currencies as t";
$sql.= " WHERE t.active = ".$active;
@@ -516,7 +516,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '')
+ public function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '')
{
$list = array();
@@ -595,7 +595,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getListOfTowns($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $active = 1, $sqlfilters = '')
+ public function getListOfTowns($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $active = 1, $sqlfilters = '')
{
$list = array();
@@ -659,7 +659,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException
* @throws 200 OK
*/
- function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -720,7 +720,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -780,13 +780,13 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
$sql = "SELECT rowid, code, pos, label, use_default, color, description";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as t";
- $sql.= " WHERE t.active = ".$active;
+ $sql.= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
@@ -840,13 +840,13 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
+ public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
$sql = "SELECT rowid, code, pos, label, use_default, description";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t";
- $sql.= " WHERE t.active = ".$active;
+ $sql.= " WHERE t.active = ".$active;
if ($type) $sql.=" AND t.type LIKE '%" . $this->db->escape($type) . "%'";
if ($module) $sql.=" AND t.module LIKE '%" . $this->db->escape($module) . "%'";
// Add sql filters
@@ -898,7 +898,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
- function getCheckIntegrity($target)
+ public function getCheckIntegrity($target)
{
global $langs, $conf;
diff --git a/htdocs/api/class/api_status.class.php b/htdocs/api/class/api_status.class.php
index 3ade4ea51b8..3e61b2e6d0a 100644
--- a/htdocs/api/class/api_status.class.php
+++ b/htdocs/api/class/api_status.class.php
@@ -31,7 +31,7 @@ class Status
*
* @return array
*/
- function index()
+ public function index()
{
global $conf;
diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php
index aca175b59d2..8e9e31e68b2 100644
--- a/htdocs/asset/class/asset.class.php
+++ b/htdocs/asset/class/asset.class.php
@@ -23,8 +23,6 @@
*/
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/**
* Class for Asset
@@ -312,7 +310,7 @@ class Asset extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
- function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
+ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -369,12 +367,12 @@ class Asset 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
* @return string Label of status
*/
- function getLibStatut($mode = 0)
+ public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->status, $mode);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return the status
*
@@ -382,7 +380,7 @@ class Asset extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
*/
- static function LibStatut($status, $mode = 0)
+ public static function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
@@ -425,7 +423,7 @@ class Asset extends CommonObject
* @param int $id Id of order
* @return void
*/
- function info($id)
+ public function info($id)
{
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql.= ' fk_user_creat, fk_user_modif';
diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php
index 58baf280036..9cc96ae6c44 100644
--- a/htdocs/asset/class/asset_type.class.php
+++ b/htdocs/asset/class/asset_type.class.php
@@ -76,7 +76,7 @@ class AssetType extends CommonObject
*
* @param DoliDB $db Database handler
*/
- function __construct($db)
+ public function __construct($db)
{
$this->db = $db;
}
@@ -89,8 +89,8 @@ class AssetType extends CommonObject
* @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO
*/
- function create($user, $notrigger = 0)
- {
+ public function create($user, $notrigger = 0)
+ {
global $conf;
$error=0;
@@ -157,7 +157,7 @@ class AssetType extends CommonObject
$this->db->rollback();
return -1;
}
- }
+ }
/**
* Met a jour en base donnees du type
@@ -166,7 +166,7 @@ class AssetType extends CommonObject
* @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO
*/
- function update($user, $notrigger = 0)
+ public function update($user, $notrigger = 0)
{
global $conf, $hookmanager;
@@ -233,7 +233,7 @@ class AssetType extends CommonObject
*
* @return int >0 if OK, 0 if not found, < 0 if KO
*/
- function delete()
+ public function delete()
{
global $user;
@@ -267,7 +267,7 @@ class AssetType extends CommonObject
* @param int $rowid Id of member type to load
* @return int <0 if KO, >0 if OK
*/
- function fetch($rowid)
+ public function fetch($rowid)
{
$sql = "SELECT d.rowid, d.label as label, d.accountancy_code_asset, d.accountancy_code_depreciation_asset, d.accountancy_code_depreciation_expense, d.note";
$sql .= " FROM ".MAIN_DB_PREFIX."asset_type as d";
@@ -282,13 +282,13 @@ class AssetType extends CommonObject
{
$obj = $this->db->fetch_object($resql);
- $this->id = $obj->rowid;
- $this->ref = $obj->rowid;
- $this->label = $obj->label;
- $this->accountancy_code_asset = $obj->accountancy_code_asset;
- $this->accountancy_code_depreciation_asset = $obj->accountancy_code_depreciation_asset;
- $this->accountancy_code_depreciation_expense = $obj->accountancy_code_depreciation_expense;
- $this->note = $obj->note;
+ $this->id = $obj->rowid;
+ $this->ref = $obj->rowid;
+ $this->label = $obj->label;
+ $this->accountancy_code_asset = $obj->accountancy_code_asset;
+ $this->accountancy_code_depreciation_asset = $obj->accountancy_code_depreciation_asset;
+ $this->accountancy_code_depreciation_expense = $obj->accountancy_code_depreciation_expense;
+ $this->note = $obj->note;
}
return 1;
@@ -300,13 +300,13 @@ class AssetType extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of asset's type
*
* @return array List of types of members
*/
- function liste_array()
+ public function liste_array()
{
// phpcs:enable
global $conf,$langs;
@@ -350,7 +350,7 @@ class AssetType extends CommonObject
* 2=Return array of asset id only
* @return mixed Array of asset or -1 on error
*/
- function listAssetForAssetType($excludefilter = '', $mode = 0)
+ public function listAssetForAssetType($excludefilter = '', $mode = 0)
{
global $conf, $user;
@@ -405,7 +405,7 @@ class AssetType extends CommonObject
* @param int $notooltip 1=Disable tooltip
* @return string String with URL
*/
- function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
+ public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
{
global $langs;
@@ -430,8 +430,8 @@ class AssetType extends CommonObject
*
* @return void
*/
- function initAsSpecimen()
- {
+ public function initAsSpecimen()
+ {
global $conf, $user, $langs;
// Initialize parameters
@@ -446,15 +446,15 @@ class AssetType extends CommonObject
$this->asset=array(
$user->id => $user
);
- }
+ }
- /**
- * getLibStatut
- *
- * @return string Return status of a type of asset
- */
- function getLibStatut()
- {
- return '';
- }
+ /**
+ * getLibStatut
+ *
+ * @return string Return status of a type of asset
+ */
+ public function getLibStatut()
+ {
+ return '';
+ }
}
diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php
index 6db5edf4646..376a1d3986a 100644
--- a/htdocs/blockedlog/class/authority.class.php
+++ b/htdocs/blockedlog/class/authority.class.php
@@ -53,7 +53,7 @@ class BlockedLogAuthority
public function __construct($db)
{
$this->db = $db;
- }
+ }
/**
* Get the blockchain
@@ -76,7 +76,7 @@ class BlockedLogAuthority
}
return $this->blockchain;
- }
+ }
/**
* Get hash of the block chain to check
@@ -87,7 +87,7 @@ class BlockedLogAuthority
{
return md5($this->signature.$this->blockchain);
- }
+ }
/**
* Get hash of the block chain to check
@@ -99,7 +99,7 @@ class BlockedLogAuthority
{
return ($hash === $this->getBlockchainHash() );
- }
+ }
/**
* Add a new block to the chain
@@ -111,7 +111,7 @@ class BlockedLogAuthority
{
$this->blockchain.=$block;
- }
+ }
/**
* hash already exist into chain ?
@@ -132,7 +132,7 @@ class BlockedLogAuthority
else{
return false;
}
- }
+ }
/**
@@ -191,7 +191,7 @@ class BlockedLogAuthority
$this->error=$this->db->error();
return -1;
}
- }
+ }
/**
* Create authority in database.
@@ -245,7 +245,7 @@ class BlockedLogAuthority
$this->db->rollback();
return -1;
}
- }
+ }
/**
* Create authority in database.
@@ -283,7 +283,7 @@ class BlockedLogAuthority
$this->db->rollback();
return -1;
}
- }
+ }
/**
* For cron to sync to authority.
@@ -326,6 +326,6 @@ class BlockedLogAuthority
}
}
- return 1;
- }
+ return 1;
+ }
}
diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php
index 9c7baa0634a..ae64665bbfd 100644
--- a/htdocs/blockedlog/class/blockedlog.class.php
+++ b/htdocs/blockedlog/class/blockedlog.class.php
@@ -291,8 +291,7 @@ class BlockedLog
}
elseif ($this->action == 'MODULE_RESET')
{
- if ($this->signature == '0000000000')
- {
+ if ($this->signature == '0000000000') {
return 'System to track events into unalterable logs were disabled after some recording were done. We saved a special Fingerprint to track the chain as broken.';
}
else
@@ -387,14 +386,15 @@ class BlockedLog
$arrayoffieldstoexclude = array(
'table_element','fields','ref_previous','ref_next','origin','origin_id','oldcopy','picto','error','errors','modelpdf','last_main_doc','civility_id','contact','contact_id',
'table_element_line','ismultientitymanaged','isextrafieldmanaged',
- 'linkedObjectsIds','linkedObjects','fk_delivery_address',
+ 'linkedObjectsIds',
+ 'linkedObjects',
+ 'fk_delivery_address',
'context',
'projet' // There is already ->fk_project
);
// Add more fields to exclude depending on object type
- if ($this->element == 'cashcontrol')
- {
- $arrayoffieldstoexclude = array_merge($arrayoffieldstoexclude, array(
+ if ($this->element == 'cashcontrol') {
+ $arrayoffieldstoexclude = array_merge($arrayoffieldstoexclude, array(
'name','lastname','firstname','region','region_id','region_code','state','state_id','state_code','country','country_id','country_code',
'total_ht','total_tva','total_ttc','total_localtax1','total_localtax2',
'barcode_type','barcode_type_code','barcode_type_label','barcode_type_coder','mode_reglement_id','cond_reglement_id','mode_reglement','cond_reglement','shipping_method_id',
@@ -727,15 +727,12 @@ class BlockedLog
*/
public function dolDecodeBlockedData($data, $mode = 0)
{
- try
- {
+ try {
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$aaa = unserialize($data);
//$aaa = unserialize($data);
- }
- catch(Exception $e)
- {
+ } catch(Exception $e) {
//print $e->getErrs);
}
return $aaa;
@@ -1064,14 +1061,14 @@ class BlockedLog
}
- /**
- * Check if module was already used or not for at least one recording.
- *
- * @param int $ignoresystem Ignore system events for the test
- * @return bool
- */
- function alreadyUsed($ignoresystem = 0)
- {
+ /**
+ * Check if module was already used or not for at least one recording.
+ *
+ * @param int $ignoresystem Ignore system events for the test
+ * @return bool
+ */
+ public function alreadyUsed($ignoresystem = 0)
+ {
global $conf;
$result = false;
@@ -1092,5 +1089,5 @@ class BlockedLog
dol_syslog("Module Blockedlog alreadyUsed with ignoresystem=".$ignoresystem." is ".$result);
return $result;
- }
+ }
}
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index ea5ba91c715..9d45b8e86f8 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -88,7 +88,7 @@ $search_all=trim(GETPOST("search_all", 'alpha'));
$search=array();
foreach($object->fields as $key => $val)
{
- if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
+ if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha');
}
if (empty($action) && empty($id) && empty($ref)) $action='view';
@@ -115,15 +115,15 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook))
{
- $error=0;
+ $error=0;
- $permissiontoadd = $user->rights->bom->write;
- $permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
+ $permissiontoadd = $user->rights->bom->write;
+ $permissiontodelete = $user->rights->bom->delete || ($permissiontoadd && $object->status == 0);
$backurlforlist = dol_buildpath('/bom/bom_list.php', 1);
- if (empty($backtopage)) {
- if (empty($id)) $backtopage = $backurlforlist;
- else $backtopage = dol_buildpath('/bom/bom_card.php', 1).($id > 0 ? $id : '__ID__');
- }
+ if (empty($backtopage)) {
+ if (empty($id)) $backtopage = $backurlforlist;
+ else $backtopage = dol_buildpath('/bom/bom_card.php', 1).($id > 0 ? $id : '__ID__');
+ }
$triggermodname = 'BILLOFMATERIALS_BILLOFMATERIALS_MODIFY'; // Name of trigger action code to execute when we modify record
// Actions cancel, add, update, delete or clone
diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php
index 4785d0c4598..3ec9695a7e0 100644
--- a/htdocs/bom/bom_list.php
+++ b/htdocs/bom/bom_list.php
@@ -478,19 +478,19 @@ while ($i < min($num, $limit))
if (isset($obj->$key)) $object->$key = $obj->$key;
}
- // Show here line of result
- print '';
- foreach($object->fields as $key => $val)
- {
+ // Show here line of result
+ print '
';
+ foreach($object->fields as $key => $val)
+ {
$cssforfield='';
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
- if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
- elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
+ if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
+ elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
- if (! empty($arrayfields['t.'.$key]['checked']))
- {
+ if (! empty($arrayfields['t.'.$key]['checked']))
+ {
print '