2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Frédéric FRANCE
2019-02-25 20:35:59 +01:00
parent 42a1387218
commit 1c07006015
125 changed files with 3394 additions and 3402 deletions

View File

@@ -37,7 +37,7 @@ class DolibarrApi
/** /**
* @var Restler $r Restler object * @var Restler $r Restler object
*/ */
var $r; public $r;
/** /**
* Constructor * Constructor
@@ -46,7 +46,7 @@ class DolibarrApi
* @param string $cachedir Cache dir * @param string $cachedir Cache dir
* @param boolean $refreshCache Update cache * @param boolean $refreshCache Update cache
*/ */
function __construct($db, $cachedir = '', $refreshCache = false) public function __construct($db, $cachedir = '', $refreshCache = false)
{ {
global $conf, $dolibarr_main_url_root; global $conf, $dolibarr_main_url_root;
@@ -94,7 +94,7 @@ class DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
// Remove $db object property for object // Remove $db object property for object
@@ -222,7 +222,7 @@ class DolibarrApi
* @return bool * @return bool
* @throws RestException * @throws RestException
*/ */
static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid') private static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
{ {
// Features/modules to check // Features/modules to check
@@ -248,7 +248,7 @@ class DolibarrApi
* @param string $sqlfilters sqlfilter string * @param string $sqlfilters sqlfilter string
* @return boolean True if valid, False if not valid * @return boolean True if valid, False if not valid
*/ */
function _checkFilters($sqlfilters) private function _checkFilters($sqlfilters)
{ {
//$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; //$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters); //$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
@@ -271,14 +271,14 @@ class DolibarrApi
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Function to forge a SQL criteria * Function to forge a SQL criteria
* *
* @param array $matches Array of found string by regex search * @param array $matches Array of found string by regex search
* @return string Forged criteria. Example: "t.field like 'abc%'" * @return string Forged criteria. Example: "t.field like 'abc%'"
*/ */
static function _forge_criteria_callback($matches) private static function _forge_criteria_callback($matches)
{ {
// phpcs:enable // phpcs:enable
global $db; global $db;

View File

@@ -43,7 +43,7 @@ class Documents extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db; global $db;
$this->db = $db; $this->db = $db;
@@ -67,7 +67,7 @@ class Documents extends DolibarrApi
* *
* @url GET /download * @url GET /download
*/ */
public function index($module_part, $original_file='') public function index($module_part, $original_file = '')
{ {
global $conf, $langs; global $conf, $langs;
@@ -86,8 +86,7 @@ class Documents extends DolibarrApi
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; $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); throw new RestException(401);
} }
if (!$accessallowed) { if (!$accessallowed) {
@@ -127,7 +126,7 @@ class Documents extends DolibarrApi
* *
* @url PUT /builddoc * @url PUT /builddoc
*/ */
public function builddoc($module_part, $original_file='', $doctemplate='', $langcode='') public function builddoc($module_part, $original_file = '', $doctemplate = '', $langcode = '')
{ {
global $conf, $langs; global $conf, $langs;
@@ -153,7 +152,7 @@ class Documents extends DolibarrApi
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; $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); throw new RestException(401);
} }
if (!$accessallowed) { if (!$accessallowed) {
@@ -245,7 +244,7 @@ class Documents extends DolibarrApi
* *
* @url GET / * @url GET /
*/ */
function getDocumentsListByElement($modulepart, $id=0, $ref='', $sortfield='', $sortorder='') public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sortfield = '', $sortorder = '')
{ {
global $conf; global $conf;
@@ -376,7 +375,7 @@ class Documents extends DolibarrApi
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); 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)) { 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.'); throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(! empty($object->Ref)?' or Ref '.$object->ref:'').' does not return any document.');
} }
@@ -412,6 +411,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 $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 string $fileencoding File encoding (''=no encoding, 'base64'=Base 64) {@example '' or 'base64'}
* @param int $overwriteifexists Overwrite file if exists (1 by default) * @param int $overwriteifexists Overwrite file if exists (1 by default)
* @return string
* *
* @throws 200 * @throws 200
* @throws 400 * @throws 400
@@ -421,7 +421,7 @@ class Documents extends DolibarrApi
* *
* @url POST /upload * @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; global $db, $conf;
@@ -576,6 +576,7 @@ class Documents extends DolibarrApi
return dol_basename($destfile); return dol_basename($destfile);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
/** /**
* Validate fields before create or update object * Validate fields before create or update object
* *
@@ -583,7 +584,8 @@ class Documents extends DolibarrApi
* @return array * @return array
* @throws RestException * @throws RestException
*/ */
function _validate_file($data) { private function _validate_file($data) {
// phpcs:enable
$result = array(); $result = array();
foreach (Documents::$DOCUMENT_FIELDS as $field) { foreach (Documents::$DOCUMENT_FIELDS as $field) {
if (!isset($data[$field])) if (!isset($data[$field]))

View File

@@ -29,7 +29,7 @@ class Login
/** /**
* Constructor of the class * Constructor of the class
*/ */
function __construct() public function __construct()
{ {
global $db; global $db;
$this->db = $db; $this->db = $db;

View File

@@ -38,7 +38,7 @@ class Setup extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db; global $db;
$this->db = $db; $this->db = $db;
@@ -61,7 +61,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException * @throws 400 RestException
* @throws 200 OK * @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(); $list = array();
@@ -128,7 +128,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -195,7 +195,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function getCountryByID($id, $lang = '') public function getCountryByID($id, $lang = '')
{ {
$country = new Ccountry($this->db); $country = new Ccountry($this->db);
@@ -228,7 +228,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException * @throws 400 RestException
* @throws 200 OK * @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(); $list = array();
@@ -279,7 +279,7 @@ class Setup extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
@@ -334,7 +334,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -397,7 +397,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -458,7 +458,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
//TODO link with multicurrency module //TODO link with multicurrency module
@@ -516,7 +516,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '') public function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '')
{ {
$list = array(); $list = array();
@@ -595,7 +595,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -659,7 +659,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException * @throws 400 RestException
* @throws 200 OK * @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(); $list = array();
@@ -720,7 +720,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -780,7 +780,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -840,7 +840,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @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(); $list = array();
@@ -898,7 +898,7 @@ class Setup extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function getCheckIntegrity($target) public function getCheckIntegrity($target)
{ {
global $langs, $conf; global $langs, $conf;

View File

@@ -31,7 +31,7 @@ class Status
* *
* @return array * @return array
*/ */
function index() public function index()
{ {
global $conf; global $conf;

View File

@@ -23,8 +23,6 @@
*/ */
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; 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 * 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 * @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 * @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 $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo; 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 * @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 * @return string Label of status
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return $this->LibStatut($this->status, $mode); return $this->LibStatut($this->status, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return the status * 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 * @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 * @return string Label of status
*/ */
static function LibStatut($status, $mode = 0) public static function LibStatut($status, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@@ -425,7 +423,7 @@ class Asset extends CommonObject
* @param int $id Id of order * @param int $id Id of order
* @return void * @return void
*/ */
function info($id) public function info($id)
{ {
$sql = 'SELECT rowid, date_creation as datec, tms as datem,'; $sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql.= ' fk_user_creat, fk_user_modif'; $sql.= ' fk_user_creat, fk_user_modif';

View File

@@ -76,7 +76,7 @@ class AssetType extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@@ -89,7 +89,7 @@ class AssetType extends CommonObject
* @param int $notrigger 1=do not execute triggers, 0 otherwise * @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO * @return int >0 if OK, < 0 if KO
*/ */
function create($user, $notrigger = 0) public function create($user, $notrigger = 0)
{ {
global $conf; global $conf;
@@ -166,7 +166,7 @@ class AssetType extends CommonObject
* @param int $notrigger 1=do not execute triggers, 0 otherwise * @param int $notrigger 1=do not execute triggers, 0 otherwise
* @return int >0 if OK, < 0 if KO * @return int >0 if OK, < 0 if KO
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $conf, $hookmanager; global $conf, $hookmanager;
@@ -233,7 +233,7 @@ class AssetType extends CommonObject
* *
* @return int >0 if OK, 0 if not found, < 0 if KO * @return int >0 if OK, 0 if not found, < 0 if KO
*/ */
function delete() public function delete()
{ {
global $user; global $user;
@@ -267,7 +267,7 @@ class AssetType extends CommonObject
* @param int $rowid Id of member type to load * @param int $rowid Id of member type to load
* @return int <0 if KO, >0 if OK * @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 = "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"; $sql .= " FROM ".MAIN_DB_PREFIX."asset_type as d";
@@ -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 list of asset's type
* *
* @return array List of types of members * @return array List of types of members
*/ */
function liste_array() public function liste_array()
{ {
// phpcs:enable // phpcs:enable
global $conf,$langs; global $conf,$langs;
@@ -350,7 +350,7 @@ class AssetType extends CommonObject
* 2=Return array of asset id only * 2=Return array of asset id only
* @return mixed Array of asset or -1 on error * @return mixed Array of asset or -1 on error
*/ */
function listAssetForAssetType($excludefilter = '', $mode = 0) public function listAssetForAssetType($excludefilter = '', $mode = 0)
{ {
global $conf, $user; global $conf, $user;
@@ -405,7 +405,7 @@ class AssetType extends CommonObject
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0) public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
{ {
global $langs; global $langs;
@@ -430,7 +430,7 @@ class AssetType extends CommonObject
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
global $conf, $user, $langs; global $conf, $user, $langs;
@@ -453,7 +453,7 @@ class AssetType extends CommonObject
* *
* @return string Return status of a type of asset * @return string Return status of a type of asset
*/ */
function getLibStatut() public function getLibStatut()
{ {
return ''; return '';
} }

View File

@@ -82,7 +82,7 @@ class Bookmark extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@@ -93,7 +93,7 @@ class Bookmark extends CommonObject
* @param int $id Bookmark Id Loader * @param int $id Bookmark Id Loader
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id) public function fetch($id)
{ {
global $conf; global $conf;
@@ -135,7 +135,7 @@ class Bookmark extends CommonObject
* *
* @return int <0 si ko, rowid du bookmark cree si ok * @return int <0 si ko, rowid du bookmark cree si ok
*/ */
function create() public function create()
{ {
global $conf; global $conf;
@@ -192,7 +192,7 @@ class Bookmark extends CommonObject
* *
* @return int <0 if KO, > if OK * @return int <0 if KO, > if OK
*/ */
function update() public function update()
{ {
// Clean parameters // Clean parameters
$this->url=trim($this->url); $this->url=trim($this->url);
@@ -227,7 +227,7 @@ class Bookmark extends CommonObject
* @param int $id Id removed bookmark * @param int $id Id removed bookmark
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function remove($id) public function remove($id)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark";
$sql .= " WHERE rowid = ".$id; $sql .= " WHERE rowid = ".$id;
@@ -268,7 +268,7 @@ class Bookmark extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of contact status * @return string Label of contact status
*/ */
function getLibStatut($mode) public function getLibStatut($mode)
{ {
return ''; return '';
} }

View File

@@ -48,7 +48,7 @@ class Contracts extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db, $conf; global $db, $conf;
$this->db = $db; $this->db = $db;
@@ -65,7 +65,7 @@ class Contracts extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function get($id) public function get($id)
{ {
if(! DolibarrApiAccess::$user->rights->contrat->lire) { if(! DolibarrApiAccess::$user->rights->contrat->lire) {
throw new RestException(401); throw new RestException(401);
@@ -101,7 +101,7 @@ class Contracts extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@@ -184,7 +184,7 @@ class Contracts extends DolibarrApi
* @param array $request_data Request data * @param array $request_data Request data
* @return int ID of contrat * @return int ID of contrat
*/ */
function post($request_data = null) public function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) { if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401, "Insuffisant rights"); throw new RestException(401, "Insuffisant rights");
@@ -218,7 +218,7 @@ class Contracts extends DolibarrApi
* *
* @return array * @return array
*/ */
function getLines($id) public function getLines($id)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->lire) { if (! DolibarrApiAccess::$user->rights->contrat->lire) {
throw new RestException(401); throw new RestException(401);
@@ -250,7 +250,7 @@ class Contracts extends DolibarrApi
* *
* @return int|bool * @return int|bool
*/ */
function postLine($id, $request_data = null) public function postLine($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) { if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -303,7 +303,7 @@ class Contracts extends DolibarrApi
* *
* @return array|bool * @return array|bool
*/ */
function putLine($id, $lineid, $request_data = null) public function putLine($id, $lineid, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) { if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -363,7 +363,7 @@ class Contracts extends DolibarrApi
* *
* @return array|bool * @return array|bool
*/ */
function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) public function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null)
{ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) { if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -401,7 +401,7 @@ class Contracts extends DolibarrApi
* *
* @return array|bool * @return array|bool
*/ */
function unactivateLine($id, $lineid, $datestart, $comment = null) public function unactivateLine($id, $lineid, $datestart, $comment = null)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->creer) { if (! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -442,7 +442,7 @@ class Contracts extends DolibarrApi
* @throws 401 * @throws 401
* @throws 404 * @throws 404
*/ */
function deleteLine($id, $lineid) public function deleteLine($id, $lineid)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->creer) { if (! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -477,7 +477,7 @@ class Contracts extends DolibarrApi
* *
* @return int * @return int
*/ */
function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->creer) { if (! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -513,7 +513,7 @@ class Contracts extends DolibarrApi
* *
* @return array * @return array
*/ */
function delete($id) public function delete($id)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->supprimer) { if (! DolibarrApiAccess::$user->rights->contrat->supprimer) {
throw new RestException(401); throw new RestException(401);
@@ -555,7 +555,7 @@ class Contracts extends DolibarrApi
* "notrigger": 0 * "notrigger": 0
* } * }
*/ */
function validate($id, $notrigger = 0) public function validate($id, $notrigger = 0)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->creer) { if (! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -601,7 +601,7 @@ class Contracts extends DolibarrApi
* "notrigger": 0 * "notrigger": 0
* } * }
*/ */
function close($id, $notrigger = 0) public function close($id, $notrigger = 0)
{ {
if (! DolibarrApiAccess::$user->rights->contrat->creer) { if (! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401); throw new RestException(401);
@@ -639,7 +639,7 @@ class Contracts extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
@@ -666,7 +666,7 @@ class Contracts extends DolibarrApi
* @return array * @return array
* @throws RestException * @throws RestException
*/ */
function _validate($data) private function _validate($data)
{ {
$contrat = array(); $contrat = array();
foreach (Contracts::$FIELDS as $field) { foreach (Contracts::$FIELDS as $field) {

View File

@@ -188,7 +188,7 @@ class Contrat extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@@ -199,7 +199,7 @@ class Contrat extends CommonObject
* @param Societe $soc Thirdparty object * @param Societe $soc Thirdparty object
* @return string free reference for contract * @return string free reference for contract
*/ */
function getNextNumRef($soc) public function getNextNumRef($soc)
{ {
global $db, $langs, $conf; global $db, $langs, $conf;
$langs->load("contracts"); $langs->load("contracts");
@@ -250,7 +250,7 @@ class Contrat extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Activate a contract line * Activate a contract line
* *
@@ -261,7 +261,7 @@ class Contrat extends CommonObject
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function active_line($user, $line_id, $date, $date_end = '', $comment = '') public function active_line($user, $line_id, $date, $date_end = '', $comment = '')
{ {
// phpcs:enable // phpcs:enable
$result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment);
@@ -274,7 +274,7 @@ class Contrat extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Close a contract line * Close a contract line
* *
@@ -284,7 +284,7 @@ class Contrat extends CommonObject
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function close_line($user, $line_id, $date_end, $comment = '') public function close_line($user, $line_id, $date_end, $comment = '')
{ {
// phpcs:enable // phpcs:enable
$result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); $result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment);
@@ -307,7 +307,7 @@ class Contrat extends CommonObject
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* @see closeAll * @see closeAll
*/ */
function activateAll($user, $date_start = '', $notrigger = 0, $comment = '') public function activateAll($user, $date_start = '', $notrigger = 0, $comment = '')
{ {
if (empty($date_start)) $date_start = dol_now(); if (empty($date_start)) $date_start = dol_now();
@@ -363,7 +363,7 @@ class Contrat extends CommonObject
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* @see activateAll * @see activateAll
*/ */
function closeAll(User $user, $notrigger = 0, $comment = '') public function closeAll(User $user, $notrigger = 0, $comment = '')
{ {
$this->db->begin(); $this->db->begin();
@@ -419,7 +419,7 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function validate(User $user, $force_number = '', $notrigger = 0) public function validate(User $user, $force_number = '', $notrigger = 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
global $langs, $conf; global $langs, $conf;
@@ -547,7 +547,7 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers * @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function reopen($user, $notrigger = 0) public function reopen($user, $notrigger = 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
global $langs, $conf; global $langs, $conf;
@@ -614,7 +614,7 @@ class Contrat extends CommonObject
* @param string $ref_supplier Supplier ref * @param string $ref_supplier Supplier ref
* @return int <0 if KO, 0 if not found, Id of contract if OK * @return int <0 if KO, 0 if not found, Id of contract if OK
*/ */
function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '') public function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '')
{ {
$sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,"; $sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,";
$sql.= " ref_supplier, ref_customer,"; $sql.= " ref_supplier, ref_customer,";
@@ -711,14 +711,14 @@ class Contrat extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load lines array into this->lines. * Load lines array into this->lines.
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
* *
* @return ContratLigne[] Return array of contract lines * @return ContratLigne[] Return array of contract lines
*/ */
function fetch_lines() public function fetch_lines()
{ {
// phpcs:enable // phpcs:enable
$this->nbofserviceswait=0; $this->nbofserviceswait=0;
@@ -869,7 +869,7 @@ class Contrat extends CommonObject
* @param User $user User that create * @param User $user User that create
* @return int <0 if KO, id of contract if OK * @return int <0 if KO, id of contract if OK
*/ */
function create($user) public function create($user)
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
@@ -1088,7 +1088,7 @@ class Contrat extends CommonObject
* @param User $user Utilisateur qui supprime * @param User $user Utilisateur qui supprime
* @return int < 0 si erreur, > 0 si ok * @return int < 0 si erreur, > 0 si ok
*/ */
function delete($user) public function delete($user)
{ {
global $conf, $langs; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
@@ -1242,7 +1242,7 @@ class Contrat extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@@ -1360,7 +1360,7 @@ class Contrat extends CommonObject
* @param string $rang Position * @param string $rang Position
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null, $rang = 0) public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null, $rang = 0)
{ {
global $user, $langs, $conf, $mysoc; global $user, $langs, $conf, $mysoc;
$error=0; $error=0;
@@ -1570,7 +1570,7 @@ class Contrat extends CommonObject
* @param string $fk_unit Code of the unit to use. Null to use the default one * @param string $fk_unit Code of the unit to use. Null to use the default one
* @return int < 0 si erreur, > 0 si ok * @return int < 0 si erreur, > 0 si ok
*/ */
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx = 0.0, $localtax2tx = 0.0, $date_debut_reel = '', $date_fin_reel = '', $price_base_type = 'HT', $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null) public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx = 0.0, $localtax2tx = 0.0, $date_debut_reel = '', $date_fin_reel = '', $price_base_type = 'HT', $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null)
{ {
global $user, $conf, $langs, $mysoc; global $user, $conf, $langs, $mysoc;
@@ -1647,21 +1647,21 @@ class Contrat extends CommonObject
} }
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description='".$this->db->escape($desc)."'"; $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description='".$this->db->escape($desc)."'";
$sql.= ",price_ht='" . price2num($price)."'"; $sql.= ",price_ht='".price2num($price)."'";
$sql.= ",subprice='" . price2num($subprice)."'"; $sql.= ",subprice='".price2num($subprice)."'";
$sql.= ",remise='" . price2num($remise)."'"; $sql.= ",remise='".price2num($remise)."'";
$sql.= ",remise_percent='".price2num($remise_percent)."'"; $sql.= ",remise_percent='".price2num($remise_percent)."'";
$sql.= ",qty='".$qty."'"; $sql.= ",qty='".$qty."'";
$sql.= ",tva_tx='". price2num($tvatx)."'"; $sql.= ",tva_tx='".price2num($tvatx)."'";
$sql.= ",localtax1_tx='". price2num($localtax1tx)."'"; $sql.= ",localtax1_tx='".price2num($localtax1tx)."'";
$sql.= ",localtax2_tx='". price2num($localtax2tx)."'"; $sql.= ",localtax2_tx='".price2num($localtax2tx)."'";
$sql.= ",localtax1_type='".$localtax1_type."'"; $sql.= ",localtax1_type='".$localtax1_type."'";
$sql.= ",localtax2_type='".$localtax2_type."'"; $sql.= ",localtax2_type='".$localtax2_type."'";
$sql.= ", total_ht='". price2num($total_ht)."'"; $sql.= ", total_ht='".price2num($total_ht)."'";
$sql.= ", total_tva='". price2num($total_tva)."'"; $sql.= ", total_tva='".price2num($total_tva)."'";
$sql.= ", total_localtax1='".price2num($total_localtax1)."'"; $sql.= ", total_localtax1='".price2num($total_localtax1)."'";
$sql.= ", total_localtax2='".price2num($total_localtax2)."'"; $sql.= ", total_localtax2='".price2num($total_localtax2)."'";
$sql.= ", total_ttc='". price2num($total_ttc)."'"; $sql.= ", total_ttc='".price2num($total_ttc)."'";
$sql.= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null"); $sql.= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : "null");
$sql.= ", buy_price_ht='".price2num($pa_ht)."'"; $sql.= ", buy_price_ht='".price2num($pa_ht)."'";
if ($date_start > 0) { $sql.= ",date_ouverture_prevue='".$this->db->idate($date_start)."'"; } if ($date_start > 0) { $sql.= ",date_ouverture_prevue='".$this->db->idate($date_start)."'"; }
@@ -1733,7 +1733,7 @@ class Contrat extends CommonObject
* @param User $user User that delete * @param User $user User that delete
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function deleteline($idline, User $user) public function deleteline($idline, User $user)
{ {
global $conf, $langs; global $conf, $langs;
@@ -1792,7 +1792,7 @@ class Contrat extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Update statut of contract according to services * Update statut of contract according to services
* *
@@ -1800,7 +1800,7 @@ class Contrat extends CommonObject
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
* @deprecated This function will never be used. Status of a contract is status of its lines. * @deprecated This function will never be used. Status of a contract is status of its lines.
*/ */
function update_statut($user) public function update_statut($user)
{ {
// phpcs:enable // phpcs:enable
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
@@ -1811,11 +1811,11 @@ class Contrat extends CommonObject
// Load $this->lines array // Load $this->lines array
// $this->fetch_lines(); // $this->fetch_lines();
// $newstatut=1; // $newstatut=1;
// foreach($this->lines as $key => $contractline) // foreach($this->lines as $key => $contractline)
// { // {
// // if ($contractline) // Loop on each service // // if ($contractline) // Loop on each service
// } // }
return 1; return 1;
} }
@@ -1827,7 +1827,7 @@ class Contrat extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length
* @return string Label * @return string Label
*/ */
function getLibStatut($mode) public function getLibStatut($mode)
{ {
return $this->LibStatut($this->statut, $mode); return $this->LibStatut($this->statut, $mode);
} }
@@ -1840,7 +1840,7 @@ class Contrat extends CommonObject
* @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length
* @return string Label * @return string Label
*/ */
function LibStatut($statut, $mode) public function LibStatut($statut, $mode)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@@ -1872,8 +1872,7 @@ class Contrat extends CommonObject
elseif ($mode == 4 || $mode == 6 || $mode == 7) elseif ($mode == 4 || $mode == 6 || $mode == 7)
{ {
$text=''; $text='';
if ($mode == 4) if ($mode == 4) {
{
$text ='<span class="hideonsmartphone">'; $text ='<span class="hideonsmartphone">';
$text.=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesexpired+$this->nbofservicesclosed); $text.=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesexpired+$this->nbofservicesclosed);
$text.=' '.$langs->trans("Services"); $text.=' '.$langs->trans("Services");
@@ -1909,7 +1908,7 @@ class Contrat extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @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 * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1) public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
@@ -1973,7 +1972,7 @@ class Contrat extends CommonObject
* @param int $id id du contrat a charger * @param int $id id du contrat a charger
* @return void * @return void
*/ */
function info($id) public function info($id)
{ {
$sql = "SELECT c.rowid, c.ref, c.datec, c.date_cloture,"; $sql = "SELECT c.rowid, c.ref, c.datec, c.date_cloture,";
$sql.= " c.tms as date_modification,"; $sql.= " c.tms as date_modification,";
@@ -2022,7 +2021,7 @@ class Contrat extends CommonObject
* @param int $statut Status of lines to get * @param int $statut Status of lines to get
* @return array Array of line's rowid * @return array Array of line's rowid
*/ */
function array_detail($statut = -1) public function array_detail($statut = -1)
{ {
// phpcs:enable // phpcs:enable
$tab=array(); $tab=array();
@@ -2059,7 +2058,7 @@ class Contrat extends CommonObject
* @param string $option 'all' or 'others' * @param string $option 'all' or 'others'
* @return array Array of contracts id * @return array Array of contracts id
*/ */
function getListOfContracts($option = 'all') public function getListOfContracts($option = 'all')
{ {
$tab=array(); $tab=array();
@@ -2092,7 +2091,7 @@ class Contrat extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
@@ -2100,7 +2099,7 @@ class Contrat extends CommonObject
* @param string $mode "inactive" pour services a activer, "expired" pour services expires * @param string $mode "inactive" pour services a activer, "expired" pour services expires
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/ */
function load_board($user, $mode) public function load_board($user, $mode)
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs; global $conf, $langs;
@@ -2172,13 +2171,13 @@ class Contrat extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
* *
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function load_state_board() public function load_state_board()
{ {
// phpcs:enable // phpcs:enable
global $conf, $user; global $conf, $user;
@@ -2223,7 +2222,7 @@ class Contrat extends CommonObject
* *
* @return array Liste des id contacts facturation * @return array Liste des id contacts facturation
*/ */
function getIdBillingContact() public function getIdBillingContact()
{ {
return $this->getIdContact('external', 'BILLING'); return $this->getIdContact('external', 'BILLING');
} }
@@ -2233,7 +2232,7 @@ class Contrat extends CommonObject
* *
* @return array Liste des id contacts prestation * @return array Liste des id contacts prestation
*/ */
function getIdServiceContact() public function getIdServiceContact()
{ {
return $this->getIdContact('external', 'SERVICE'); return $this->getIdContact('external', 'SERVICE');
} }
@@ -2246,7 +2245,7 @@ class Contrat extends CommonObject
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
@@ -2319,7 +2318,7 @@ class Contrat extends CommonObject
* *
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function getLinesArray() public function getLinesArray()
{ {
return $this->fetch_lines(); return $this->fetch_lines();
} }
@@ -2382,7 +2381,7 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int New id of clone * @return int New id of clone
*/ */
function createFromClone($socid = 0, $notrigger = 0) public function createFromClone($socid = 0, $notrigger = 0)
{ {
global $db, $user, $langs, $conf, $hookmanager, $extrafields; global $db, $user, $langs, $conf, $hookmanager, $extrafields;
@@ -2631,7 +2630,7 @@ class ContratLigne extends CommonObjectLine
* *
* @param DoliDb $db Database handler * @param DoliDb $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@@ -2643,12 +2642,12 @@ class ContratLigne extends CommonObjectLine
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle * @return string Libelle
*/ */
function getLibStatut($mode) public function getLibStatut($mode)
{ {
return $this->LibStatut($this->statut, $mode, ((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1)); return $this->LibStatut($this->statut, $mode, ((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1));
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return label of a contract line status * Return label of a contract line status
* *
@@ -2658,7 +2657,7 @@ class ContratLigne extends CommonObjectLine
* @param string $moreatt More attribute * @param string $moreatt More attribute
* @return string Libelle * @return string Libelle
*/ */
static function LibStatut($statut, $mode, $expired = -1, $moreatt = '') public static function LibStatut($statut, $mode, $expired = -1, $moreatt = '')
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@@ -2720,7 +2719,7 @@ class ContratLigne extends CommonObjectLine
* @param int $maxlength Max length * @param int $maxlength Max length
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto = 0, $maxlength = 0) public function getNomUrl($withpicto = 0, $maxlength = 0)
{ {
global $langs; global $langs;
@@ -2747,7 +2746,7 @@ class ContratLigne extends CommonObjectLine
* @param string $ref Ref of contract * @param string $ref Ref of contract
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id, $ref = '') public function fetch($id, $ref = '')
{ {
// Check parameters // Check parameters
@@ -2879,7 +2878,7 @@ class ContratLigne extends CommonObjectLine
* @param int $notrigger 0=no, 1=yes (no update trigger) * @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $conf, $langs, $mysoc; global $conf, $langs, $mysoc;
@@ -3070,14 +3069,14 @@ class ContratLigne extends CommonObjectLine
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Mise a jour en base des champs total_xxx de ligne * Mise a jour en base des champs total_xxx de ligne
* Used by migration process * Used by migration process
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update_total() public function update_total()
{ {
// phpcs:enable // phpcs:enable
$this->db->begin(); $this->db->begin();
@@ -3188,7 +3187,7 @@ class ContratLigne extends CommonObjectLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Activate a contract line * Activate a contract line
* *
@@ -3198,7 +3197,7 @@ class ContratLigne extends CommonObjectLine
* @param string $comment A comment typed by user * @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function active_line($user, $date, $date_end = '', $comment = '') public function active_line($user, $date, $date_end = '', $comment = '')
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
@@ -3247,7 +3246,7 @@ class ContratLigne extends CommonObjectLine
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Close a contract line * Close a contract line
* *
@@ -3257,7 +3256,7 @@ class ContratLigne extends CommonObjectLine
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function close_line($user, $date_end, $comment = '', $notrigger = 0) public function close_line($user, $date_end, $comment = '', $notrigger = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;

View File

@@ -61,7 +61,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
$this->code_null = 0; $this->code_null = 0;
$this->code_modifiable = 1; $this->code_modifiable = 1;
@@ -77,7 +77,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) public function info($langs)
{ {
global $conf, $mc; global $conf, $mc;
global $form; global $form;
@@ -119,7 +119,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Product $objproduct Object product * @param Product $objproduct Object product
* @return string Return string example * @return string Return string example
*/ */
function getExample($langs, $objproduct = 0) public function getExample($langs, $objproduct = 0)
{ {
$examplebarcode = $this->getNextValue($objproduct, ''); $examplebarcode = $this->getNextValue($objproduct, '');
if (! $examplebarcode) if (! $examplebarcode)
@@ -142,7 +142,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param string $type Type of barcode (EAN, ISBN, ...) * @param string $type Type of barcode (EAN, ISBN, ...)
* @return string Value if OK, '' if module not configured, <0 if KO * @return string Value if OK, '' if module not configured, <0 if KO
*/ */
function getNextValue($objproduct = null, $type = '') public function getNextValue($objproduct = null, $type = '')
{ {
global $db,$conf; global $db,$conf;
@@ -184,7 +184,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* -3 ErrorCustomerCodeAlreadyUsed * -3 ErrorCustomerCodeAlreadyUsed
* -4 ErrorPrefixRequired * -4 ErrorPrefixRequired
*/ */
function verif($db, &$code, $product, $thirdparty_type, $type) public function verif($db, &$code, $product, $thirdparty_type, $type)
{ {
global $conf; global $conf;
@@ -235,7 +235,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return if a code is used (by other element) * Return if a code is used (by other element)
* *
@@ -244,7 +244,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Product $product Objet product * @param Product $product Objet product
* @return int 0 if available, <0 if KO * @return int 0 if available, <0 if KO
*/ */
function verif_dispo($db, $code, $product) public function verif_dispo($db, $code, $product)
{ {
// phpcs:enable // phpcs:enable
$sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product"; $sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product";
@@ -269,7 +269,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return if a barcode value match syntax * Return if a barcode value match syntax
* *
@@ -277,7 +277,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param string $typefortest Type of barcode (ISBN, EAN, ...) * @param string $typefortest Type of barcode (ISBN, EAN, ...)
* @return int 0 if OK, <0 if KO * @return int 0 if OK, <0 if KO
*/ */
function verif_syntax($codefortest, $typefortest) public function verif_syntax($codefortest, $typefortest)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;

View File

@@ -50,7 +50,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* *
* @return string Text with description * @return string Text with description
*/ */
function info() public function info()
{ {
global $langs; global $langs;
return $langs->trans("SimpleNumRefModelDesc", $this->prefix); return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
@@ -62,7 +62,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
return $this->prefix."0501-0001"; return $this->prefix."0501-0001";
} }
@@ -74,7 +74,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@@ -109,7 +109,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* @param Object $object Object we need next value for * @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $db,$conf; global $db,$conf;
@@ -153,7 +153,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* @param string $objforref Object for number to search * @param string $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
function chequereceipt_get_num($objsoc, $objforref) public function chequereceipt_get_num($objsoc, $objforref)
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);

View File

@@ -49,7 +49,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $conf, $langs; global $conf, $langs;
@@ -89,7 +89,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
@@ -112,7 +112,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
* @param Object $object Object we need next value for * @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $db,$conf; global $db,$conf;
@@ -141,7 +141,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
* @param string $objforref Object for number to search * @param string $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
function chequereceipt_get_num($objsoc, $objforref) public function chequereceipt_get_num($objsoc, $objforref)
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);

View File

@@ -46,7 +46,7 @@ abstract class ModeleNumRefChequeReceipts
* *
* @return boolean true if module can be used * @return boolean true if module can be used
*/ */
function isEnabled() public function isEnabled()
{ {
return true; return true;
} }
@@ -56,7 +56,7 @@ abstract class ModeleNumRefChequeReceipts
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $langs; global $langs;
$langs->load("bills"); $langs->load("bills");
@@ -68,7 +68,7 @@ abstract class ModeleNumRefChequeReceipts
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $langs; global $langs;
$langs->load("bills"); $langs->load("bills");
@@ -80,7 +80,7 @@ abstract class ModeleNumRefChequeReceipts
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
return true; return true;
} }
@@ -92,7 +92,7 @@ abstract class ModeleNumRefChequeReceipts
* @param Object $object Object we need next value for * @param Object $object Object we need next value for
* @return string Valeur * @return string Valeur
*/ */
function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $langs; global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
@@ -103,7 +103,7 @@ abstract class ModeleNumRefChequeReceipts
* *
* @return string Value * @return string Value
*/ */
function getVersion() public function getVersion()
{ {
global $langs; global $langs;
$langs->load("admin"); $langs->load("admin");
@@ -127,7 +127,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
*/ */
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@@ -135,7 +135,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;

View File

@@ -60,7 +60,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* *
* @return string Text with description * @return string Text with description
*/ */
function info() public function info()
{ {
global $langs; global $langs;
return $langs->trans("SimpleNumRefModelDesc", $this->prefix); return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
@@ -72,7 +72,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
return $this->prefix."0501-0001"; return $this->prefix."0501-0001";
} }
@@ -84,7 +84,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@@ -119,7 +119,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* @param Object $object Object we need next value for * @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $db,$conf; global $db,$conf;
@@ -155,7 +155,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return next free value * Return next free value
* *
@@ -163,7 +163,7 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* @param string $objforref Object for number to search * @param string $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
function commande_get_num($objsoc, $objforref) public function commande_get_num($objsoc, $objforref)
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);

View File

@@ -62,7 +62,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $conf, $langs; global $conf, $langs;
@@ -102,7 +102,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
@@ -128,7 +128,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
* @param Object $object Object we need next value for * @param Object $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $db,$conf; global $db,$conf;
@@ -151,7 +151,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return next free value * Return next free value
* *
@@ -159,7 +159,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
* @param string $objforref Object for number to search * @param string $objforref Object for number to search
* @return string Next free value * @return string Next free value
*/ */
function commande_get_num($objsoc, $objforref) public function commande_get_num($objsoc, $objforref)
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);

View File

@@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
abstract class ModelePDFCommandes extends CommonDocGenerator abstract class ModelePDFCommandes extends CommonDocGenerator
{ {
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@@ -48,7 +48,7 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@@ -82,7 +82,7 @@ abstract class ModeleNumRefCommandes
* *
* @return boolean true if module can be used * @return boolean true if module can be used
*/ */
function isEnabled() public function isEnabled()
{ {
return true; return true;
} }
@@ -92,7 +92,7 @@ abstract class ModeleNumRefCommandes
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $langs; global $langs;
$langs->load("orders"); $langs->load("orders");
@@ -104,7 +104,7 @@ abstract class ModeleNumRefCommandes
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $langs; global $langs;
$langs->load("orders"); $langs->load("orders");
@@ -116,7 +116,7 @@ abstract class ModeleNumRefCommandes
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
return true; return true;
} }
@@ -128,7 +128,7 @@ abstract class ModeleNumRefCommandes
* @param Object $object Object we need next value for * @param Object $object Object we need next value for
* @return string Valeur * @return string Valeur
*/ */
function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $langs; global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
@@ -139,7 +139,7 @@ abstract class ModeleNumRefCommandes
* *
* @return string Valeur * @return string Valeur
*/ */
function getVersion() public function getVersion()
{ {
global $langs; global $langs;
$langs->load("admin"); $langs->load("admin");

View File

@@ -59,7 +59,7 @@ class mod_contract_magre extends ModelNumRefContracts
* *
* @return string text description * @return string text description
*/ */
function info() public function info()
{ {
global $conf,$langs; global $conf,$langs;
@@ -95,7 +95,7 @@ class mod_contract_magre extends ModelNumRefContracts
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $conf,$langs,$mysoc; global $conf,$langs,$mysoc;
@@ -118,7 +118,7 @@ class mod_contract_magre extends ModelNumRefContracts
* @param Object $contract contract object * @param Object $contract contract object
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
function getNextValue($objsoc, $contract) public function getNextValue($objsoc, $contract)
{ {
global $db,$conf; global $db,$conf;
@@ -145,7 +145,7 @@ class mod_contract_magre extends ModelNumRefContracts
* @param Object $objforref contract object * @param Object $objforref contract object
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
function contract_get_num($objsoc, $objforref) public function contract_get_num($objsoc, $objforref)
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);

View File

@@ -66,7 +66,7 @@ class mod_contract_olive extends ModelNumRefContracts
* *
* @return string Description of module * @return string Description of module
*/ */
function info() public function info()
{ {
global $langs; global $langs;
@@ -81,7 +81,7 @@ class mod_contract_olive extends ModelNumRefContracts
* @param Contrat $contract Object contract * @param Contrat $contract Object contract
* @return string Return next value * @return string Return next value
*/ */
function getNextValue($objsoc, $contract) public function getNextValue($objsoc, $contract)
{ {
global $langs; global $langs;
return ''; return '';
@@ -101,7 +101,7 @@ class mod_contract_olive extends ModelNumRefContracts
* -3 ErrorProductCodeAlreadyUsed * -3 ErrorProductCodeAlreadyUsed
* -4 ErrorPrefixRequired * -4 ErrorPrefixRequired
*/ */
function verif($db, &$code, $product, $type) public function verif($db, &$code, $product, $type)
{ {
global $conf; global $conf;

View File

@@ -61,7 +61,7 @@ class mod_contract_serpis extends ModelNumRefContracts
* *
* @return string text description * @return string text description
*/ */
function info() public function info()
{ {
global $langs; global $langs;
return $langs->trans("SimpleNumRefModelDesc", $this->prefix); return $langs->trans("SimpleNumRefModelDesc", $this->prefix);
@@ -73,7 +73,7 @@ class mod_contract_serpis extends ModelNumRefContracts
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
return $this->prefix."0501-0001"; return $this->prefix."0501-0001";
} }
@@ -84,7 +84,7 @@ class mod_contract_serpis extends ModelNumRefContracts
* *
* @return boolean false if conflit, true if ok * @return boolean false if conflit, true if ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
@@ -119,7 +119,7 @@ class mod_contract_serpis extends ModelNumRefContracts
* @param Object $contract contract object * @param Object $contract contract object
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
function getNextValue($objsoc, $contract) public function getNextValue($objsoc, $contract)
{ {
global $db,$conf; global $db,$conf;
@@ -153,7 +153,7 @@ class mod_contract_serpis extends ModelNumRefContracts
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return next value * Return next value
* *
@@ -161,7 +161,7 @@ class mod_contract_serpis extends ModelNumRefContracts
* @param Object $objforref contract object * @param Object $objforref contract object
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
function contract_get_num($objsoc, $objforref) public function contract_get_num($objsoc, $objforref)
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $objforref); return $this->getNextValue($objsoc, $objforref);

View File

@@ -43,7 +43,7 @@ abstract class ModelePDFContract extends CommonDocGenerator
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@@ -51,7 +51,7 @@ abstract class ModelePDFContract extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@@ -82,7 +82,7 @@ class ModelNumRefContracts
* *
* @return boolean true if module can be used * @return boolean true if module can be used
*/ */
function isEnabled() public function isEnabled()
{ {
return true; return true;
} }
@@ -92,7 +92,7 @@ class ModelNumRefContracts
* *
* @return string text description * @return string text description
*/ */
function info() public function info()
{ {
global $langs; global $langs;
$langs->load("contracts"); $langs->load("contracts");
@@ -104,7 +104,7 @@ class ModelNumRefContracts
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $langs; global $langs;
$langs->load("contracts"); $langs->load("contracts");
@@ -116,7 +116,7 @@ class ModelNumRefContracts
* *
* @return boolean false if conflict, true if ok * @return boolean false if conflict, true if ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
return true; return true;
} }
@@ -128,7 +128,7 @@ class ModelNumRefContracts
* @param Object $contract contract object * @param Object $contract contract object
* @return string Value * @return string Value
*/ */
function getNextValue($objsoc, $contract) public function getNextValue($objsoc, $contract)
{ {
global $langs; global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
@@ -139,7 +139,7 @@ class ModelNumRefContracts
* *
* @return string Value * @return string Value
*/ */
function getVersion() public function getVersion()
{ {
global $langs; global $langs;
$langs->load("admin"); $langs->load("admin");

View File

@@ -39,7 +39,7 @@ abstract class ModeleDon extends CommonDocGenerator
*/ */
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@@ -47,7 +47,7 @@ abstract class ModeleDon extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
static function liste_modeles($db, $maxfilenamelength = 0) public static function liste_modeles($db, $maxfilenamelength = 0)
{ {
// phpcs:enable // phpcs:enable
global $conf; global $conf;
@@ -78,7 +78,7 @@ abstract class ModeleNumRefDons
* *
* @return boolean true if module can be used * @return boolean true if module can be used
*/ */
function isEnabled() public function isEnabled()
{ {
return true; return true;
} }
@@ -88,7 +88,7 @@ abstract class ModeleNumRefDons
* *
* @return string Texte descripif * @return string Texte descripif
*/ */
function info() public function info()
{ {
global $langs; global $langs;
$langs->load("bills"); $langs->load("bills");
@@ -100,7 +100,7 @@ abstract class ModeleNumRefDons
* *
* @return string Example * @return string Example
*/ */
function getExample() public function getExample()
{ {
global $langs; global $langs;
$langs->load("bills"); $langs->load("bills");
@@ -113,7 +113,7 @@ abstract class ModeleNumRefDons
* *
* @return boolean false si conflit, true si ok * @return boolean false si conflit, true si ok
*/ */
function canBeActivated() public function canBeActivated()
{ {
return true; return true;
} }
@@ -123,7 +123,7 @@ abstract class ModeleNumRefDons
* *
* @return string Valeur * @return string Valeur
*/ */
function getNextValue() public function getNextValue()
{ {
global $langs; global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
@@ -134,7 +134,7 @@ abstract class ModeleNumRefDons
* *
* @return string Valeur * @return string Valeur
*/ */
function getVersion() public function getVersion()
{ {
global $langs; global $langs;
$langs->load("admin"); $langs->load("admin");

View File

@@ -37,7 +37,7 @@ class modAccounting extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -42,7 +42,7 @@ class modAdherent extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -43,7 +43,7 @@ class modAgenda extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -38,7 +38,7 @@ class modApi extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -320,7 +320,7 @@ class modAsset extends DolibarrModules
* @param string $options Options when enabling module ('', 'noboxes') * @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO * @return int 1 if OK, 0 if KO
*/ */
function init($options = '') public function init($options = '')
{ {
global $conf; global $conf;

View File

@@ -41,7 +41,7 @@ class modBanque extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -39,7 +39,7 @@ class modBarcode extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 55; $this->numero = 55;

View File

@@ -34,7 +34,7 @@ class modBlockedLog extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs, $conf, $mysoc; global $langs, $conf, $mysoc;

View File

@@ -38,7 +38,7 @@ class modBookmark extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 330; $this->numero = 330;

View File

@@ -35,7 +35,7 @@ class modCashDesk extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -37,7 +37,7 @@ class modCategorie extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -38,7 +38,7 @@ class modClickToDial extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 58; $this->numero = 58;

View File

@@ -36,7 +36,7 @@ class modCollab extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -43,7 +43,7 @@ class modCommande extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -40,7 +40,7 @@ class modComptabilite extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -39,7 +39,7 @@ class modContrat extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $langs; global $conf, $langs;

View File

@@ -37,7 +37,7 @@ class modCron extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs, $conf; global $langs, $conf;

View File

@@ -37,7 +37,7 @@ class modDeplacement extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -39,7 +39,7 @@ class modDocumentGeneration extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 1520; $this->numero = 1520;

View File

@@ -40,7 +40,7 @@ class modDon extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 700; $this->numero = 700;

View File

@@ -36,7 +36,7 @@ class modDynamicPrices extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 2200; $this->numero = 2200;

View File

@@ -37,7 +37,7 @@ class modECM extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -41,7 +41,7 @@ class modExpedition extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -36,7 +36,7 @@ class modExpenseReport extends DolibarrModules
* *
* @param Database $db Database handler * @param Database $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -38,7 +38,7 @@ class modExport extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 240; $this->numero = 240;

View File

@@ -38,7 +38,7 @@ class modExternalRss extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -39,7 +39,7 @@ class modExternalSite extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -38,7 +38,7 @@ class modFTP extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -40,7 +40,7 @@ class modFacture extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -39,7 +39,7 @@ class modFckeditor extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 2000; $this->numero = 2000;

View File

@@ -42,7 +42,7 @@ class modFicheinter extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -39,7 +39,7 @@ class modFournisseur extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -37,7 +37,7 @@ class modGeoIPMaxmind extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 2900; $this->numero = 2900;

View File

@@ -36,7 +36,7 @@ class modGravatar extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -41,7 +41,7 @@ class modHoliday extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -38,7 +38,7 @@ class modImport extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 250; $this->numero = 250;

View File

@@ -38,7 +38,7 @@ class modIncoterm extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -38,7 +38,7 @@ class modLabel extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 60; $this->numero = 60;

View File

@@ -37,7 +37,7 @@ class modLdap extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 200; $this->numero = 200;

View File

@@ -37,7 +37,7 @@ class modLoan extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -39,7 +39,7 @@ class modMailing extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 22; $this->numero = 22;

View File

@@ -38,7 +38,7 @@ class modMailmanSpip extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 105; $this->numero = 105;

View File

@@ -35,7 +35,7 @@ class modMargin extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -35,7 +35,7 @@ class modModuleBuilder extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -36,7 +36,7 @@ class modNotification extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 600; $this->numero = 600;

View File

@@ -40,7 +40,7 @@ class modOauth extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db ; $this->db = $db ;
$this->numero = 66000; $this->numero = 66000;

View File

@@ -37,7 +37,7 @@ class modOpenSurvey extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -36,7 +36,7 @@ class modPayBox extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -37,7 +37,7 @@ class modPaypal extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -40,7 +40,7 @@ class modPrelevement extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -40,7 +40,7 @@ class modPrinting extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db ; $this->db = $db ;
$this->numero = 64000; $this->numero = 64000;

View File

@@ -42,7 +42,7 @@ class modProduct extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $mysoc; global $conf, $mysoc;

View File

@@ -38,7 +38,7 @@ class modProductBatch extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -41,7 +41,7 @@ class modProjet extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -41,7 +41,7 @@ class modPropale extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -40,7 +40,7 @@ class modReceiptPrinter extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db ; $this->db = $db ;
$this->numero = 67000; $this->numero = 67000;

View File

@@ -36,7 +36,7 @@ class modReception extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -40,7 +40,7 @@ class modService extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $mysoc; global $conf, $mysoc;

View File

@@ -36,7 +36,7 @@ class modSocialNetworks extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -41,7 +41,7 @@ class modSociete extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $user; global $conf, $user;

View File

@@ -40,7 +40,7 @@ class modStock extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf, $langs; global $conf, $langs;

View File

@@ -36,7 +36,7 @@ class modStripe extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -42,7 +42,7 @@ class modSupplierProposal extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;
@@ -206,7 +206,7 @@ class modSupplierProposal extends DolibarrModules
* @param string $options Options when enabling module ('', 'noboxes') * @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO * @return int 1 if OK, 0 if KO
*/ */
function init($options = '') public function init($options = '')
{ {
global $conf,$langs; global $conf,$langs;

View File

@@ -37,7 +37,7 @@ class modSyslog extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 42; $this->numero = 42;

View File

@@ -41,7 +41,7 @@ class modTax extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;

View File

@@ -38,7 +38,7 @@ class modUser extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $conf; global $conf;
@@ -331,7 +331,7 @@ class modUser extends DolibarrModules
* @param string $options Options when enabling module ('', 'noboxes') * @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO * @return int 1 if OK, 0 if KO
*/ */
function init($options = '') public function init($options = '')
{ {
global $conf; global $conf;

View File

@@ -35,7 +35,7 @@ class modWebServices extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 2600; $this->numero = 2600;

View File

@@ -35,7 +35,7 @@ class modWebServicesClient extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
$this->numero = 2660; $this->numero = 2660;

View File

@@ -36,7 +36,7 @@ class modWebsite extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
global $langs,$conf; global $langs,$conf;

View File

@@ -37,7 +37,7 @@ class modWorkflow extends DolibarrModules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;

View File

@@ -44,7 +44,7 @@ class Donations extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db, $conf; global $db, $conf;
$this->db = $db; $this->db = $db;
@@ -61,7 +61,7 @@ class Donations extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function get($id) public function get($id)
{ {
if(! DolibarrApiAccess::$user->rights->don->lire) { if(! DolibarrApiAccess::$user->rights->don->lire) {
throw new RestException(401); throw new RestException(401);
@@ -99,7 +99,7 @@ class Donations extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@@ -174,15 +174,15 @@ class Donations extends DolibarrApi
* @param array $request_data Request data * @param array $request_data Request data
* @return int ID of order * @return int ID of order
*/ */
function post($request_data = null) public function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->don->creer) { if (! DolibarrApiAccess::$user->rights->don->creer) {
throw new RestException(401, "Insuffisant rights"); throw new RestException(401, "Insuffisant rights");
} }
// Check mandatory fields // Check mandatory fields
$result = $this->_validate($request_data); $result = $this->_validate($request_data);
foreach($request_data as $field => $value) { foreach ($request_data as $field => $value) {
$this->don->$field = $value; $this->don->$field = $value;
} }
/*if (isset($request_data["lines"])) { /*if (isset($request_data["lines"])) {
@@ -208,7 +208,7 @@ class Donations extends DolibarrApi
* *
* @return int * @return int
*/ */
function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
if (! DolibarrApiAccess::$user->rights->don->creer) { if (! DolibarrApiAccess::$user->rights->don->creer) {
throw new RestException(401); throw new RestException(401);
@@ -222,7 +222,7 @@ class Donations extends DolibarrApi
if (! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) { if (! DolibarrApi::_checkAccessToResource('donation', $this->don->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
foreach($request_data as $field => $value) { foreach ($request_data as $field => $value) {
if ($field == 'id') continue; if ($field == 'id') continue;
$this->don->$field = $value; $this->don->$field = $value;
} }
@@ -243,7 +243,7 @@ class Donations extends DolibarrApi
* @param int $id Order ID * @param int $id Order ID
* @return array * @return array
*/ */
function delete($id) public function delete($id)
{ {
if(! DolibarrApiAccess::$user->rights->don->supprimer) { if(! DolibarrApiAccess::$user->rights->don->supprimer) {
throw new RestException(401); throw new RestException(401);
@@ -291,7 +291,7 @@ class Donations extends DolibarrApi
* *
* @return array * @return array
*/ */
function validate($id, $idwarehouse = 0, $notrigger = 0) public function validate($id, $idwarehouse = 0, $notrigger = 0)
{ {
if(! DolibarrApiAccess::$user->rights->don->creer) { if(! DolibarrApiAccess::$user->rights->don->creer) {
throw new RestException(401); throw new RestException(401);
@@ -332,7 +332,7 @@ class Donations extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
@@ -354,7 +354,7 @@ class Donations extends DolibarrApi
* @return array * @return array
* @throws RestException * @throws RestException
*/ */
function _validate($data) private function _validate($data)
{ {
$don = array(); $don = array();
foreach (Orders::$FIELDS as $field) { foreach (Orders::$FIELDS as $field) {

View File

@@ -39,12 +39,12 @@ class DonationStats extends Stats
*/ */
public $table_element; public $table_element;
var $socid; public $socid;
var $userid; public $userid;
var $from; public $from;
var $field; public $field;
var $where; public $where;
/** /**
@@ -55,7 +55,7 @@ class DonationStats extends Stats
* @param string $mode Option (not used) * @param string $mode Option (not used)
* @param int $userid Id user for filter (creation user) * @param int $userid Id user for filter (creation user)
*/ */
function __construct($db, $socid, $mode, $userid = 0) public function __construct($db, $socid, $mode, $userid = 0)
{ {
global $user, $conf; global $user, $conf;
@@ -83,7 +83,7 @@ class DonationStats 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 * @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 with number by month * @return array Array with number by month
*/ */
function getNbByMonth($year, $format = 0) public function getNbByMonth($year, $format = 0)
{ {
global $user; global $user;
@@ -104,7 +104,7 @@ class DonationStats extends Stats
* @return array Array with number by year * @return array Array with number by year
* *
*/ */
function getNbByYear() public function getNbByYear()
{ {
global $user; global $user;
@@ -122,7 +122,7 @@ class DonationStats extends Stats
* *
* @return array Array of values * @return array Array of values
*/ */
function getAllByYear() public function getAllByYear()
{ {
global $user; global $user;

View File

@@ -88,7 +88,7 @@ class PaymentDonation extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@@ -101,7 +101,7 @@ class PaymentDonation extends CommonObject
* @param bool $notrigger false=launch triggers after, true=disable triggers * @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, id of payment if OK * @return int <0 if KO, id of payment if OK
*/ */
function create($user, $notrigger = false) public function create($user, $notrigger = false)
{ {
global $conf, $langs; global $conf, $langs;
@@ -193,7 +193,7 @@ class PaymentDonation extends CommonObject
* @param int $id Id object * @param int $id Id object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id) public function fetch($id)
{ {
global $langs; global $langs;
$sql = "SELECT"; $sql = "SELECT";
@@ -264,7 +264,7 @@ class PaymentDonation extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user, $notrigger = 0) public function update($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@@ -344,7 +344,7 @@ class PaymentDonation extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($user, $notrigger = 0) public function delete($user, $notrigger = 0)
{ {
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
@@ -411,7 +411,7 @@ class PaymentDonation extends CommonObject
* @param int $fromid Id of object to clone * @param int $fromid Id of object to clone
* @return int New id of clone * @return int New id of clone
*/ */
function createFromClone($fromid) public function createFromClone($fromid)
{ {
global $user,$langs; global $user,$langs;
@@ -467,12 +467,12 @@ class PaymentDonation extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
* @return string Libelle * @return string Libelle
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return ''; return '';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@@ -480,7 +480,7 @@ class PaymentDonation extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle du statut * @return string Libelle du statut
*/ */
function LibStatut($statut, $mode = 0) public function LibStatut($statut, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@@ -496,7 +496,7 @@ class PaymentDonation extends CommonObject
* *
* @return void * @return void
*/ */
function initAsSpecimen() public function initAsSpecimen()
{ {
$this->id=0; $this->id=0;
@@ -526,7 +526,7 @@ class PaymentDonation extends CommonObject
* @param string $emetteur_banque Name of bank * @param string $emetteur_banque Name of bank
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
{ {
global $conf; global $conf;
@@ -597,14 +597,14 @@ class PaymentDonation extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Update link between the donation payment and the generated line in llx_bank * Update link between the donation payment and the generated line in llx_bank
* *
* @param int $id_bank Id if bank * @param int $id_bank Id if bank
* @return int >0 if OK, <=0 if KO * @return int >0 if OK, <=0 if KO
*/ */
function update_fk_bank($id_bank) public function update_fk_bank($id_bank)
{ {
// phpcs:enable // phpcs:enable
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; $sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
@@ -629,7 +629,7 @@ class PaymentDonation extends CommonObject
* @param int $maxlen Longueur max libelle * @param int $maxlen Longueur max libelle
* @return string Chaine avec URL * @return string Chaine avec URL
*/ */
function getNomUrl($withpicto = 0, $maxlen = 0) public function getNomUrl($withpicto = 0, $maxlen = 0)
{ {
global $langs; global $langs;

View File

@@ -109,7 +109,7 @@ class EmailCollector extends CommonObject
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>0, 'enabled'=>1, 'position'=>62, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>0, 'enabled'=>1, 'position'=>62, 'notnull'=>-1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>501, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>501, 'notnull'=>1,),
//'date_validation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502), //'date_validation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>510, 'notnull'=>1,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>510, 'notnull'=>1,),
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,),
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
@@ -305,14 +305,16 @@ class EmailCollector extends CommonObject
* *
* @return int <0 if KO, 0 if not found, >0 if OK * @return int <0 if KO, 0 if not found, >0 if OK
*/ */
/*public function fetchLines() /*
public function fetchLines()
{ {
$this->lines=array(); $this->lines=array();
// Load lines with object EmailCollectorLine // Load lines with object EmailCollectorLine
return count($this->lines)?1:0; return count($this->lines)?1:0;
}*/ }
*/
/** /**
* Fetch all account and load objects into an array * Fetch all account and load objects into an array
@@ -407,7 +409,7 @@ class EmailCollector extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @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 * @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, $hookmanager; global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -673,7 +675,7 @@ class EmailCollector extends CommonObject
* *
* @return string * @return string
*/ */
function getConnectStringIMAP() public function getConnectStringIMAP()
{ {
// Connect to IMAP // Connect to IMAP
$flags ='/service=imap'; // IMAP $flags ='/service=imap'; // IMAP

View File

@@ -111,29 +111,29 @@ class EmailCollectorAction extends CommonObject
// If this object has a subtable with lines // If this object has a subtable with lines
/** // /**
* @var int Name of subtable line // * @var int Name of subtable line
*/ // */
//public $table_element_line = 'emailcollectoractiondet'; //public $table_element_line = 'emailcollectoractiondet';
/** // /**
* @var int Field with ID of parent key if this field has a parent // * @var int Field with ID of parent key if this field has a parent
*/ // */
//public $fk_element = 'fk_emailcollectoraction'; //public $fk_element = 'fk_emailcollectoraction';
/** // /**
* @var int Name of subtable class that manage subtable lines // * @var int Name of subtable class that manage subtable lines
*/ // */
//public $class_element_line = 'EmailcollectorActionline'; //public $class_element_line = 'EmailcollectorActionline';
/** // /**
* @var array Array of child tables (child tables to delete before deleting a record) // * @var array Array of child tables (child tables to delete before deleting a record)
*/ // */
//protected $childtables=array('emailcollectoractiondet'); //protected $childtables=array('emailcollectoractiondet');
/** // /**
* @var EmailcollectorActionLine[] Array of subtable lines // * @var EmailcollectorActionLine[] Array of subtable lines
*/ // */
//public $lines = array(); //public $lines = array();
@@ -243,7 +243,10 @@ class EmailCollectorAction extends CommonObject
$result = $object->createCommon($user); $result = $object->createCommon($user);
if ($result < 0) { if ($result < 0) {
$error++; $error++;
$this->error = $object->error; $thi /**
* @var EmailcollectorActionLine[] Array of subtable lines
*/
s->error = $object->error;
$this->errors = $object->errors; $this->errors = $object->errors;
} }
@@ -321,7 +324,7 @@ class EmailCollectorAction extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @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 * @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, $hookmanager; global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;

View File

@@ -296,7 +296,7 @@ class EmailCollectorFilter extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @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 * @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, $hookmanager; global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo; global $dolibarr_main_authentication, $dolibarr_main_demo;

View File

@@ -45,7 +45,7 @@ class ExpenseReports extends DolibarrApi
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $db, $conf; global $db, $conf;
$this->db = $db; $this->db = $db;
@@ -62,7 +62,7 @@ class ExpenseReports extends DolibarrApi
* *
* @throws RestException * @throws RestException
*/ */
function get($id) public function get($id)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->lire) { if(! DolibarrApiAccess::$user->rights->expensereport->lire) {
throw new RestException(401); throw new RestException(401);
@@ -94,7 +94,7 @@ class ExpenseReports extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
* @return array Array of Expense Report objects * @return array Array of Expense Report objects
*/ */
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
{ {
global $db, $conf; global $db, $conf;
@@ -161,7 +161,7 @@ class ExpenseReports extends DolibarrApi
* @param array $request_data Request data * @param array $request_data Request data
* @return int ID of Expense Report * @return int ID of Expense Report
*/ */
function post($request_data = null) public function post($request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401, "Insuffisant rights"); throw new RestException(401, "Insuffisant rights");
@@ -195,8 +195,8 @@ class ExpenseReports extends DolibarrApi
* *
* @return int * @return int
*/ */
/* /*
function getLines($id) public function getLines($id)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->lire) { if(! DolibarrApiAccess::$user->rights->expensereport->lire) {
throw new RestException(401); throw new RestException(401);
@@ -217,7 +217,7 @@ class ExpenseReports extends DolibarrApi
} }
return $result; return $result;
} }
*/ */
/** /**
* Add a line to given Expense Report * Add a line to given Expense Report
@@ -229,8 +229,8 @@ class ExpenseReports extends DolibarrApi
* *
* @return int * @return int
*/ */
/* /*
function postLine($id, $request_data = null) public function postLine($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401); throw new RestException(401);
@@ -279,7 +279,7 @@ class ExpenseReports extends DolibarrApi
} }
return false; return false;
} }
*/ */
/** /**
* Update a line to given Expense Report * Update a line to given Expense Report
@@ -293,7 +293,7 @@ class ExpenseReports extends DolibarrApi
* @return object * @return object
*/ */
/* /*
function putLine($id, $lineid, $request_data = null) public function putLine($id, $lineid, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401); throw new RestException(401);
@@ -352,7 +352,7 @@ class ExpenseReports extends DolibarrApi
* @return int * @return int
*/ */
/* /*
function deleteLine($id, $lineid) public function deleteLine($id, $lineid)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401); throw new RestException(401);
@@ -385,7 +385,7 @@ class ExpenseReports extends DolibarrApi
* *
* @return int * @return int
*/ */
function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401); throw new RestException(401);
@@ -421,7 +421,7 @@ class ExpenseReports extends DolibarrApi
* *
* @return array * @return array
*/ */
function delete($id) public function delete($id)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->supprimer) { if(! DolibarrApiAccess::$user->rights->expensereport->supprimer) {
throw new RestException(401); throw new RestException(401);
@@ -463,7 +463,7 @@ class ExpenseReports extends DolibarrApi
* } * }
*/ */
/* /*
function validate($id, $idwarehouse=0) public function validate($id, $idwarehouse=0)
{ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401); throw new RestException(401);
@@ -495,7 +495,7 @@ class ExpenseReports extends DolibarrApi
* @param object $object Object to clean * @param object $object Object to clean
* @return array Array of cleaned object properties * @return array Array of cleaned object properties
*/ */
function _cleanObjectDatas($object) private function _cleanObjectDatas($object)
{ {
$object = parent::_cleanObjectDatas($object); $object = parent::_cleanObjectDatas($object);
@@ -515,7 +515,7 @@ class ExpenseReports extends DolibarrApi
* @return array * @return array
* @throws RestException * @throws RestException
*/ */
function _validate($data) private function _validate($data)
{ {
$expensereport = array(); $expensereport = array();
foreach (ExpenseReports::$FIELDS as $field) { foreach (ExpenseReports::$FIELDS as $field) {

View File

@@ -44,62 +44,62 @@ class ExpenseReport extends CommonObject
*/ */
public $table_element='expensereport'; public $table_element='expensereport';
var $table_element_line = 'expensereport_det'; public $table_element_line = 'expensereport_det';
var $fk_element = 'fk_expensereport'; public $fk_element = 'fk_expensereport';
var $picto = 'trip'; public $picto = 'trip';
var $lines=array(); public $lines=array();
public $date_debut; public $date_debut;
public $date_fin; public $date_fin;
var $status; public $status;
var $fk_statut; // -- 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied public $fk_statut; // -- 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
var $fk_c_paiement; public $fk_c_paiement;
var $paid; public $paid;
var $user_author_infos; public $user_author_infos;
var $user_validator_infos; public $user_validator_infos;
var $fk_typepayment; public $fk_typepayment;
var $num_payment; public $num_payment;
var $code_paiement; public $code_paiement;
var $code_statut; public $code_statut;
// ACTIONS // ACTIONS
// Create // Create
var $date_create; public $date_create;
var $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for. public $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
// Update // Update
var $date_modif; public $date_modif;
var $fk_user_modif; public $fk_user_modif;
// Refus // Refus
var $date_refuse; public $date_refuse;
var $detail_refuse; public $detail_refuse;
var $fk_user_refuse; public $fk_user_refuse;
// Annulation // Annulation
var $date_cancel; public $date_cancel;
var $detail_cancel; public $detail_cancel;
var $fk_user_cancel; public $fk_user_cancel;
var $fk_user_validator; // User that is defined to approve public $fk_user_validator; // User that is defined to approve
// Validation // Validation
var $date_valid; // User making validation public $date_valid; // User making validation
var $fk_user_valid; public $fk_user_valid;
var $user_valid_infos; public $user_valid_infos;
// Approve // Approve
var $date_approve; public $date_approve;
var $fk_user_approve; // User that has approved public $fk_user_approve; // User that has approved
// Paiement // Paiement
var $user_paid_infos; public $user_paid_infos;
/* /*
END ACTIONS END ACTIONS
@@ -2484,17 +2484,17 @@ class ExpenseReportLine
public $projet_ref; public $projet_ref;
public $projet_title; public $projet_title;
var $vatrate; public $vatrate;
var $total_ht; public $total_ht;
var $total_tva; public $total_tva;
var $total_ttc; public $total_ttc;
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Handlet database * @param DoliDB $db Handlet database
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db= $db; $this->db= $db;
} }
@@ -2505,7 +2505,7 @@ class ExpenseReportLine
* @param int $rowid Id of object to load * @param int $rowid Id of object to load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) public function fetch($rowid)
{ {
$sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet, fde.date,'; $sql = 'SELECT fde.rowid, fde.fk_expensereport, fde.fk_c_type_fees, fde.fk_c_exp_tax_cat, fde.fk_projet, fde.date,';
$sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,'; $sql.= ' fde.tva_tx as vatrate, fde.vat_src_code, fde.comments, fde.qty, fde.value_unit, fde.total_ht, fde.total_tva, fde.total_ttc,';
@@ -2557,7 +2557,7 @@ class ExpenseReportLine
* @param bool $fromaddline false=keep default behavior, true=exclude the update_price() of parent object * @param bool $fromaddline false=keep default behavior, true=exclude the update_price() of parent object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function insert($notrigger = 0, $fromaddline = false) public function insert($notrigger = 0, $fromaddline = false)
{ {
global $langs,$user,$conf; global $langs,$user,$conf;
@@ -2679,7 +2679,7 @@ class ExpenseReportLine
* @param User $fuser User * @param User $fuser User
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($fuser) public function update($fuser)
{ {
global $fuser,$langs,$conf; global $fuser,$langs,$conf;
@@ -2758,7 +2758,6 @@ class ExpenseReportLine
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des differents etats d'une note de frais. * Retourne la liste deroulante des differents etats d'une note de frais.
* Les valeurs de la liste sont les id de la table c_expensereport_statuts * Les valeurs de la liste sont les id de la table c_expensereport_statuts
@@ -2771,7 +2770,6 @@ class ExpenseReportLine
*/ */
function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $useempty = 1, $useshortlabel = 0) function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $useempty = 1, $useshortlabel = 0)
{ {
// phpcs:enable
global $db, $langs; global $db, $langs;
$tmpep=new ExpenseReport($db); $tmpep=new ExpenseReport($db);
@@ -2796,7 +2794,6 @@ function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $u
print '</select>'; print '</select>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of types of notes with select value = id * Return list of types of notes with select value = id
* *
@@ -2808,7 +2805,6 @@ function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $u
*/ */
function select_type_fees_id($selected = '', $htmlname = 'type', $showempty = 0, $active = 1) function select_type_fees_id($selected = '', $htmlname = 'type', $showempty = 0, $active = 1)
{ {
// phpcs:enable
global $db,$langs,$user; global $db,$langs,$user;
$langs->load("trips"); $langs->load("trips");

Some files were not shown because too many files have changed in this diff Show More