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

View File

@@ -43,7 +43,7 @@ class Documents extends DolibarrApi
/**
* Constructor
*/
function __construct()
public function __construct()
{
global $db;
$this->db = $db;
@@ -86,8 +86,7 @@ class Documents extends DolibarrApi
$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];
$original_file = $check_access['original_file'];
if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file))
{
if (preg_match('/\.\./', $original_file) || preg_match('/[<>|]/', $original_file)) {
throw new RestException(401);
}
if (!$accessallowed) {
@@ -245,7 +244,7 @@ class Documents extends DolibarrApi
*
* @url GET /
*/
function getDocumentsListByElement($modulepart, $id=0, $ref='', $sortfield='', $sortorder='')
public function getDocumentsListByElement($modulepart, $id = 0, $ref = '', $sortfield = '', $sortorder = '')
{
global $conf;
@@ -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 $fileencoding File encoding (''=no encoding, 'base64'=Base 64) {@example '' or 'base64'}
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @return string
*
* @throws 200
* @throws 400
@@ -576,6 +576,7 @@ class Documents extends DolibarrApi
return dol_basename($destfile);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
/**
* Validate fields before create or update object
*
@@ -583,7 +584,8 @@ class Documents extends DolibarrApi
* @return array
* @throws RestException
*/
function _validate_file($data) {
private function _validate_file($data) {
// phpcs:enable
$result = array();
foreach (Documents::$DOCUMENT_FIELDS as $field) {
if (!isset($data[$field]))

View File

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

View File

@@ -38,7 +38,7 @@ class Setup extends DolibarrApi
/**
* Constructor
*/
function __construct()
public function __construct()
{
global $db;
$this->db = $db;
@@ -61,7 +61,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException
* @throws 200 OK
*/
function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getPaymentTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -128,7 +128,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getListOfCountries($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '')
public function getListOfCountries($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $filter = '', $lang = '', $sqlfilters = '')
{
$list = array();
@@ -195,7 +195,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getCountryByID($id, $lang = '')
public function getCountryByID($id, $lang = '')
{
$country = new Ccountry($this->db);
@@ -228,7 +228,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException
* @throws 200 OK
*/
function getAvailability($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getAvailability($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -279,7 +279,7 @@ class Setup extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object)
private function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@@ -334,7 +334,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getListOfEventTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
public function getListOfEventTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
{
$list = array();
@@ -397,7 +397,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
{
$list = array();
@@ -458,7 +458,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getListOfCurrencies($sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getListOfCurrencies($sortfield = "code_iso", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
//TODO link with multicurrency module
@@ -516,7 +516,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '')
public function getListOfExtrafields($sortfield = "t.pos", $sortorder = 'ASC', $type = '', $sqlfilters = '')
{
$list = array();
@@ -595,7 +595,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getListOfTowns($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $active = 1, $sqlfilters = '')
public function getListOfTowns($sortfield = "zip,town", $sortorder = 'ASC', $limit = 100, $page = 0, $zipcode = '', $town = '', $active = 1, $sqlfilters = '')
{
$list = array();
@@ -659,7 +659,7 @@ class Setup extends DolibarrApi
* @throws 400 RestException
* @throws 200 OK
*/
function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getPaymentTerms($sortfield = "sortorder", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -720,7 +720,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -780,7 +780,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -840,7 +840,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
@@ -898,7 +898,7 @@ class Setup extends DolibarrApi
*
* @throws RestException
*/
function getCheckIntegrity($target)
public function getCheckIntegrity($target)
{
global $langs, $conf;

View File

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

View File

@@ -23,8 +23,6 @@
*/
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/**
* Class for Asset
@@ -312,7 +310,7 @@ class Asset extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -369,12 +367,12 @@ class Asset extends CommonObject
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Label of status
*/
function getLibStatut($mode = 0)
public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->status, $mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return the status
*
@@ -382,7 +380,7 @@ class Asset extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label of status
*/
static function LibStatut($status, $mode = 0)
public static function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
@@ -425,7 +423,7 @@ class Asset extends CommonObject
* @param int $id Id of order
* @return void
*/
function info($id)
public function info($id)
{
$sql = 'SELECT rowid, date_creation as datec, tms as datem,';
$sql.= ' fk_user_creat, fk_user_modif';

View File

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

View File

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

View File

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

View File

@@ -188,7 +188,7 @@ class Contrat extends CommonObject
*
* @param DoliDB $db Database handler
*/
function __construct($db)
public function __construct($db)
{
$this->db = $db;
}
@@ -199,7 +199,7 @@ class Contrat extends CommonObject
* @param Societe $soc Thirdparty object
* @return string free reference for contract
*/
function getNextNumRef($soc)
public function getNextNumRef($soc)
{
global $db, $langs, $conf;
$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
*
@@ -261,7 +261,7 @@ class Contrat extends CommonObject
* @param string $comment A comment typed by user
* @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
$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
*
@@ -284,7 +284,7 @@ class Contrat extends CommonObject
* @param string $comment A comment typed by user
* @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
$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
* @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();
@@ -363,7 +363,7 @@ class Contrat extends CommonObject
* @return int <0 if KO, >0 if OK
* @see activateAll
*/
function closeAll(User $user, $notrigger = 0, $comment = '')
public function closeAll(User $user, $notrigger = 0, $comment = '')
{
$this->db->begin();
@@ -419,7 +419,7 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @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';
global $langs, $conf;
@@ -547,7 +547,7 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @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';
global $langs, $conf;
@@ -614,7 +614,7 @@ class Contrat extends CommonObject
* @param string $ref_supplier Supplier ref
* @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.= " 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.
* This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed
*
* @return ContratLigne[] Return array of contract lines
*/
function fetch_lines()
public function fetch_lines()
{
// phpcs:enable
$this->nbofserviceswait=0;
@@ -869,7 +869,7 @@ class Contrat extends CommonObject
* @param User $user User that create
* @return int <0 if KO, id of contract if OK
*/
function create($user)
public function create($user)
{
global $conf,$langs,$mysoc;
@@ -1088,7 +1088,7 @@ class Contrat extends CommonObject
* @param User $user Utilisateur qui supprime
* @return int < 0 si erreur, > 0 si ok
*/
function delete($user)
public function delete($user)
{
global $conf, $langs;
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
* @return int <0 if KO, >0 if OK
*/
function update($user, $notrigger = 0)
public function update($user, $notrigger = 0)
{
global $conf, $langs;
$error=0;
@@ -1360,7 +1360,7 @@ class Contrat extends CommonObject
* @param string $rang Position
* @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;
$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
* @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;
@@ -1733,7 +1733,7 @@ class Contrat extends CommonObject
* @param User $user User that delete
* @return int >0 if OK, <0 if KO
*/
function deleteline($idline, User $user)
public function deleteline($idline, User $user)
{
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
*
@@ -1800,7 +1800,7 @@ class Contrat extends CommonObject
* @return int <0 if KO, >0 if OK
* @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
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
@@ -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
* @return string Label
*/
function getLibStatut($mode)
public function getLibStatut($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
* @return string Label
*/
function LibStatut($statut, $mode)
public function LibStatut($statut, $mode)
{
// phpcs:enable
global $langs;
@@ -1872,8 +1872,7 @@ class Contrat extends CommonObject
elseif ($mode == 4 || $mode == 6 || $mode == 7)
{
$text='';
if ($mode == 4)
{
if ($mode == 4) {
$text ='<span class="hideonsmartphone">';
$text.=($this->nbofserviceswait+$this->nbofservicesopened+$this->nbofservicesexpired+$this->nbofservicesclosed);
$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
* @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;
@@ -1973,7 +1972,7 @@ class Contrat extends CommonObject
* @param int $id id du contrat a charger
* @return void
*/
function info($id)
public function info($id)
{
$sql = "SELECT c.rowid, c.ref, c.datec, c.date_cloture,";
$sql.= " c.tms as date_modification,";
@@ -2022,7 +2021,7 @@ class Contrat extends CommonObject
* @param int $statut Status of lines to get
* @return array Array of line's rowid
*/
function array_detail($statut = -1)
public function array_detail($statut = -1)
{
// phpcs:enable
$tab=array();
@@ -2059,7 +2058,7 @@ class Contrat extends CommonObject
* @param string $option 'all' or 'others'
* @return array Array of contracts id
*/
function getListOfContracts($option = 'all')
public function getListOfContracts($option = 'all')
{
$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)
*
@@ -2100,7 +2099,7 @@ class Contrat extends CommonObject
* @param string $mode "inactive" pour services a activer, "expired" pour services expires
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
function load_board($user, $mode)
public function load_board($user, $mode)
{
// phpcs:enable
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
*
* @return int <0 si ko, >0 si ok
*/
function load_state_board()
public function load_state_board()
{
// phpcs:enable
global $conf, $user;
@@ -2223,7 +2222,7 @@ class Contrat extends CommonObject
*
* @return array Liste des id contacts facturation
*/
function getIdBillingContact()
public function getIdBillingContact()
{
return $this->getIdContact('external', 'BILLING');
}
@@ -2233,7 +2232,7 @@ class Contrat extends CommonObject
*
* @return array Liste des id contacts prestation
*/
function getIdServiceContact()
public function getIdServiceContact()
{
return $this->getIdContact('external', 'SERVICE');
}
@@ -2246,7 +2245,7 @@ class Contrat extends CommonObject
*
* @return void
*/
function initAsSpecimen()
public function initAsSpecimen()
{
global $user,$langs,$conf;
@@ -2319,7 +2318,7 @@ class Contrat extends CommonObject
*
* @return int >0 if OK, <0 if KO
*/
function getLinesArray()
public function getLinesArray()
{
return $this->fetch_lines();
}
@@ -2382,7 +2381,7 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @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;
@@ -2631,7 +2630,7 @@ class ContratLigne extends CommonObjectLine
*
* @param DoliDb $db Database handler
*/
function __construct($db)
public function __construct($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
* @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));
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return label of a contract line status
*
@@ -2658,7 +2657,7 @@ class ContratLigne extends CommonObjectLine
* @param string $moreatt More attribute
* @return string Libelle
*/
static function LibStatut($statut, $mode, $expired = -1, $moreatt = '')
public static function LibStatut($statut, $mode, $expired = -1, $moreatt = '')
{
// phpcs:enable
global $langs;
@@ -2720,7 +2719,7 @@ class ContratLigne extends CommonObjectLine
* @param int $maxlength Max length
* @return string Chaine avec URL
*/
function getNomUrl($withpicto = 0, $maxlength = 0)
public function getNomUrl($withpicto = 0, $maxlength = 0)
{
global $langs;
@@ -2747,7 +2746,7 @@ class ContratLigne extends CommonObjectLine
* @param string $ref Ref of contract
* @return int <0 if KO, >0 if OK
*/
function fetch($id, $ref = '')
public function fetch($id, $ref = '')
{
// Check parameters
@@ -2879,7 +2878,7 @@ class ContratLigne extends CommonObjectLine
* @param int $notrigger 0=no, 1=yes (no update trigger)
* @return int <0 if KO, >0 if OK
*/
function update($user, $notrigger = 0)
public function update($user, $notrigger = 0)
{
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
* Used by migration process
*
* @return int <0 if KO, >0 if OK
*/
function update_total()
public function update_total()
{
// phpcs:enable
$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
*
@@ -3198,7 +3197,7 @@ class ContratLigne extends CommonObjectLine
* @param string $comment A comment typed by user
* @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
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
*
@@ -3257,7 +3256,7 @@ class ContratLigne extends CommonObjectLine
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @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
global $langs, $conf;

View File

@@ -61,7 +61,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
/**
* Constructor
*/
function __construct()
public function __construct()
{
$this->code_null = 0;
$this->code_modifiable = 1;
@@ -77,7 +77,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Translate $langs Object langs
* @return string Description of module
*/
function info($langs)
public function info($langs)
{
global $conf, $mc;
global $form;
@@ -119,7 +119,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Product $objproduct Object product
* @return string Return string example
*/
function getExample($langs, $objproduct = 0)
public function getExample($langs, $objproduct = 0)
{
$examplebarcode = $this->getNextValue($objproduct, '');
if (! $examplebarcode)
@@ -142,7 +142,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param string $type Type of barcode (EAN, ISBN, ...)
* @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;
@@ -184,7 +184,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* -3 ErrorCustomerCodeAlreadyUsed
* -4 ErrorPrefixRequired
*/
function verif($db, &$code, $product, $thirdparty_type, $type)
public function verif($db, &$code, $product, $thirdparty_type, $type)
{
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)
*
@@ -244,7 +244,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param Product $product Objet product
* @return int 0 if available, <0 if KO
*/
function verif_dispo($db, $code, $product)
public function verif_dispo($db, $code, $product)
{
// phpcs:enable
$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
*
@@ -277,7 +277,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
* @param string $typefortest Type of barcode (ISBN, EAN, ...)
* @return int 0 if OK, <0 if KO
*/
function verif_syntax($codefortest, $typefortest)
public function verif_syntax($codefortest, $typefortest)
{
// phpcs:enable
global $conf;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -44,7 +44,7 @@ class Donations extends DolibarrApi
/**
* Constructor
*/
function __construct()
public function __construct()
{
global $db, $conf;
$this->db = $db;
@@ -61,7 +61,7 @@ class Donations extends DolibarrApi
*
* @throws RestException
*/
function get($id)
public function get($id)
{
if(! DolibarrApiAccess::$user->rights->don->lire) {
throw new RestException(401);
@@ -99,7 +99,7 @@ class Donations extends DolibarrApi
*
* @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;
@@ -174,7 +174,7 @@ class Donations extends DolibarrApi
* @param array $request_data Request data
* @return int ID of order
*/
function post($request_data = null)
public function post($request_data = null)
{
if (! DolibarrApiAccess::$user->rights->don->creer) {
throw new RestException(401, "Insuffisant rights");
@@ -208,7 +208,7 @@ class Donations extends DolibarrApi
*
* @return int
*/
function put($id, $request_data = null)
public function put($id, $request_data = null)
{
if (! DolibarrApiAccess::$user->rights->don->creer) {
throw new RestException(401);
@@ -243,7 +243,7 @@ class Donations extends DolibarrApi
* @param int $id Order ID
* @return array
*/
function delete($id)
public function delete($id)
{
if(! DolibarrApiAccess::$user->rights->don->supprimer) {
throw new RestException(401);
@@ -291,7 +291,7 @@ class Donations extends DolibarrApi
*
* @return array
*/
function validate($id, $idwarehouse = 0, $notrigger = 0)
public function validate($id, $idwarehouse = 0, $notrigger = 0)
{
if(! DolibarrApiAccess::$user->rights->don->creer) {
throw new RestException(401);
@@ -332,7 +332,7 @@ class Donations extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object)
private function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@@ -354,7 +354,7 @@ class Donations extends DolibarrApi
* @return array
* @throws RestException
*/
function _validate($data)
private function _validate($data)
{
$don = array();
foreach (Orders::$FIELDS as $field) {

View File

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

View File

@@ -88,7 +88,7 @@ class PaymentDonation extends CommonObject
*
* @param DoliDB $db Database handler
*/
function __construct($db)
public function __construct($db)
{
$this->db = $db;
}
@@ -101,7 +101,7 @@ class PaymentDonation extends CommonObject
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, id of payment if OK
*/
function create($user, $notrigger = false)
public function create($user, $notrigger = false)
{
global $conf, $langs;
@@ -193,7 +193,7 @@ class PaymentDonation extends CommonObject
* @param int $id Id object
* @return int <0 if KO, >0 if OK
*/
function fetch($id)
public function fetch($id)
{
global $langs;
$sql = "SELECT";
@@ -264,7 +264,7 @@ class PaymentDonation extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function update($user, $notrigger = 0)
public function update($user, $notrigger = 0)
{
global $conf, $langs;
$error=0;
@@ -344,7 +344,7 @@ class PaymentDonation extends CommonObject
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger = 0)
public function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error=0;
@@ -411,7 +411,7 @@ class PaymentDonation extends CommonObject
* @param int $fromid Id of object to clone
* @return int New id of clone
*/
function createFromClone($fromid)
public function createFromClone($fromid)
{
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
* @return string Libelle
*/
function getLibStatut($mode = 0)
public function getLibStatut($mode = 0)
{
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* 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
* @return string Libelle du statut
*/
function LibStatut($statut, $mode = 0)
public function LibStatut($statut, $mode = 0)
{
// phpcs:enable
global $langs;
@@ -496,7 +496,7 @@ class PaymentDonation extends CommonObject
*
* @return void
*/
function initAsSpecimen()
public function initAsSpecimen()
{
$this->id=0;
@@ -526,7 +526,7 @@ class PaymentDonation extends CommonObject
* @param string $emetteur_banque Name of bank
* @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;
@@ -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
*
* @param int $id_bank Id if bank
* @return int >0 if OK, <=0 if KO
*/
function update_fk_bank($id_bank)
public function update_fk_bank($id_bank)
{
// phpcs:enable
$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
* @return string Chaine avec URL
*/
function getNomUrl($withpicto = 0, $maxlen = 0)
public function getNomUrl($withpicto = 0, $maxlen = 0)
{
global $langs;

View File

@@ -305,14 +305,16 @@ class EmailCollector extends CommonObject
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
/*public function fetchLines()
/*
public function fetchLines()
{
$this->lines=array();
// Load lines with object EmailCollectorLine
return count($this->lines)?1:0;
}*/
}
*/
/**
* 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
* @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 $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -673,7 +675,7 @@ class EmailCollector extends CommonObject
*
* @return string
*/
function getConnectStringIMAP()
public function getConnectStringIMAP()
{
// Connect to IMAP
$flags ='/service=imap'; // IMAP

View File

@@ -111,29 +111,29 @@ class EmailCollectorAction extends CommonObject
// 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';
/**
* @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';
/**
* @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';
/**
* @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');
/**
* @var EmailcollectorActionLine[] Array of subtable lines
*/
// /**
// * @var EmailcollectorActionLine[] Array of subtable lines
// */
//public $lines = array();
@@ -243,7 +243,10 @@ class EmailCollectorAction extends CommonObject
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
$this->error = $object->error;
$thi /**
* @var EmailcollectorActionLine[] Array of subtable lines
*/
s->error = $object->error;
$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
* @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 $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
* @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 $dolibarr_main_authentication, $dolibarr_main_demo;

View File

@@ -45,7 +45,7 @@ class ExpenseReports extends DolibarrApi
/**
* Constructor
*/
function __construct()
public function __construct()
{
global $db, $conf;
$this->db = $db;
@@ -62,7 +62,7 @@ class ExpenseReports extends DolibarrApi
*
* @throws RestException
*/
function get($id)
public function get($id)
{
if(! DolibarrApiAccess::$user->rights->expensereport->lire) {
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')"
* @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;
@@ -161,7 +161,7 @@ class ExpenseReports extends DolibarrApi
* @param array $request_data Request data
* @return int ID of Expense Report
*/
function post($request_data = null)
public function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401, "Insuffisant rights");
@@ -196,7 +196,7 @@ class ExpenseReports extends DolibarrApi
* @return int
*/
/*
function getLines($id)
public function getLines($id)
{
if(! DolibarrApiAccess::$user->rights->expensereport->lire) {
throw new RestException(401);
@@ -230,7 +230,7 @@ class ExpenseReports extends DolibarrApi
* @return int
*/
/*
function postLine($id, $request_data = null)
public function postLine($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
@@ -293,7 +293,7 @@ class ExpenseReports extends DolibarrApi
* @return object
*/
/*
function putLine($id, $lineid, $request_data = null)
public function putLine($id, $lineid, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
@@ -352,7 +352,7 @@ class ExpenseReports extends DolibarrApi
* @return int
*/
/*
function deleteLine($id, $lineid)
public function deleteLine($id, $lineid)
{
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
@@ -385,7 +385,7 @@ class ExpenseReports extends DolibarrApi
*
* @return int
*/
function put($id, $request_data = null)
public function put($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
@@ -421,7 +421,7 @@ class ExpenseReports extends DolibarrApi
*
* @return array
*/
function delete($id)
public function delete($id)
{
if(! DolibarrApiAccess::$user->rights->expensereport->supprimer) {
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) {
throw new RestException(401);
@@ -495,7 +495,7 @@ class ExpenseReports extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
function _cleanObjectDatas($object)
private function _cleanObjectDatas($object)
{
$object = parent::_cleanObjectDatas($object);
@@ -515,7 +515,7 @@ class ExpenseReports extends DolibarrApi
* @return array
* @throws RestException
*/
function _validate($data)
private function _validate($data)
{
$expensereport = array();
foreach (ExpenseReports::$FIELDS as $field) {

View File

@@ -44,62 +44,62 @@ class ExpenseReport extends CommonObject
*/
public $table_element='expensereport';
var $table_element_line = 'expensereport_det';
var $fk_element = 'fk_expensereport';
var $picto = 'trip';
public $table_element_line = 'expensereport_det';
public $fk_element = 'fk_expensereport';
public $picto = 'trip';
var $lines=array();
public $lines=array();
public $date_debut;
public $date_fin;
var $status;
var $fk_statut; // -- 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
var $fk_c_paiement;
var $paid;
public $status;
public $fk_statut; // -- 0=draft, 2=validated (attente approb), 4=canceled, 5=approved, 6=payed, 99=denied
public $fk_c_paiement;
public $paid;
var $user_author_infos;
var $user_validator_infos;
public $user_author_infos;
public $user_validator_infos;
var $fk_typepayment;
var $num_payment;
var $code_paiement;
var $code_statut;
public $fk_typepayment;
public $num_payment;
public $code_paiement;
public $code_statut;
// ACTIONS
// Create
var $date_create;
var $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
public $date_create;
public $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
// Update
var $date_modif;
var $fk_user_modif;
public $date_modif;
public $fk_user_modif;
// Refus
var $date_refuse;
var $detail_refuse;
var $fk_user_refuse;
public $date_refuse;
public $detail_refuse;
public $fk_user_refuse;
// Annulation
var $date_cancel;
var $detail_cancel;
var $fk_user_cancel;
public $date_cancel;
public $detail_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
var $date_valid; // User making validation
var $fk_user_valid;
var $user_valid_infos;
public $date_valid; // User making validation
public $fk_user_valid;
public $user_valid_infos;
// Approve
var $date_approve;
var $fk_user_approve; // User that has approved
public $date_approve;
public $fk_user_approve; // User that has approved
// Paiement
var $user_paid_infos;
public $user_paid_infos;
/*
END ACTIONS
@@ -2484,17 +2484,17 @@ class ExpenseReportLine
public $projet_ref;
public $projet_title;
var $vatrate;
var $total_ht;
var $total_tva;
var $total_ttc;
public $vatrate;
public $total_ht;
public $total_tva;
public $total_ttc;
/**
* Constructor
*
* @param DoliDB $db Handlet database
*/
function __construct($db)
public function __construct($db)
{
$this->db= $db;
}
@@ -2505,7 +2505,7 @@ class ExpenseReportLine
* @param int $rowid Id of object to load
* @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.= ' 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
* @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;
@@ -2679,7 +2679,7 @@ class ExpenseReportLine
* @param User $fuser User
* @return int <0 if KO, >0 if OK
*/
function update($fuser)
public function update($fuser)
{
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.
* 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)
{
// phpcs:enable
global $db, $langs;
$tmpep=new ExpenseReport($db);
@@ -2796,7 +2794,6 @@ function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $u
print '</select>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* 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)
{
// phpcs:enable
global $db,$langs,$user;
$langs->load("trips");

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