diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 525797429b5..72eecacef3c 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -191,6 +191,15 @@ + + + + + + + 0 + + diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index fbab36c0120..569bcc9dfd4 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -50,7 +50,7 @@ class autoTranslator * @param string $_apikey Api key * @return void */ - function __construct($_destlang,$_refLang,$_langDir,$_limittofile,$_apikey) + function __construct($_destlang, $_refLang, $_langDir, $_limittofile, $_apikey) { // Set enviorment variables @@ -156,7 +156,7 @@ class autoTranslator * @param string $my_destlang Target language code * @return void */ - private function updateTranslationFile($destPath,$file,$my_destlang) + private function updateTranslationFile($destPath, $file, $my_destlang) { $this->_time_end = date('Y-m-d H:i:s'); @@ -183,7 +183,7 @@ class autoTranslator * @param string $my_destlang Target language code * @return void */ - private function createTranslationFile($path,$my_destlang) + private function createTranslationFile($path, $my_destlang) { $fp = fopen($path, 'w+'); fwrite($fp, "/*\n"); @@ -205,7 +205,7 @@ class autoTranslator * @param string $my_destlang Language code (ie: fr_FR) * @return int 0=Nothing translated, 1=Record translated */ - private function translateFileLine($content,$file,$key,$value,$my_destlang) + private function translateFileLine($content, $file, $key, $value, $my_destlang) { //print "key =".$key."\n"; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 809132b3719..0d1d5625958 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -811,7 +811,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='') +function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db; global $form; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 1f4748266b1..ebd8011469e 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -813,7 +813,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $context='') +function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db; global $form, $mysoc; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 111a707d51d..f26aba437e5 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -696,7 +696,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldListJournal($fieldlist, $obj='', $tabname='', $context='') +function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db; global $form, $mysoc; diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5b3282a3b29..70752f6d268 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -142,7 +142,7 @@ class AccountancyCategory // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -239,7 +239,7 @@ class AccountancyCategory // extends CommonObject * @param string $label Label * @return int <0 if KO, >0 if OK */ - function fetch($id, $code='', $label='') + function fetch($id, $code = '', $label = '') { $sql = "SELECT"; $sql.= " t.rowid,"; @@ -299,7 +299,7 @@ class AccountancyCategory // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; $error=0; @@ -379,7 +379,7 @@ class AccountancyCategory // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function delete($user, $notrigger=0) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -726,7 +726,7 @@ class AccountancyCategory // extends CommonObject * @param int $year Specifig year - Can be empty * @return integer <0 if KO, >= 0 if OK */ - public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code='nofilter', $month=0, $year=0) + public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code = 'nofilter', $month = 0, $year = 0) { global $conf; @@ -796,7 +796,7 @@ class AccountancyCategory // extends CommonObject * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups * @return array|int Array of groups or -1 if error */ - public function getCats($categorytype=-1) + public function getCats($categorytype = -1) { global $conf, $mysoc; @@ -853,7 +853,7 @@ class AccountancyCategory // extends CommonObject * @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts * @return array|int Array of accounting accounts or -1 if error */ - public function getCptsCat($cat_id, $predefinedgroupwhere='') + public function getCptsCat($cat_id, $predefinedgroupwhere = '') { global $conf, $mysoc; $sql = ''; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 886e19577fb..38f4e49f2a6 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -466,7 +466,7 @@ class AccountingAccount extends CommonObject * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string String with URL */ - function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; @@ -632,7 +632,7 @@ class AccountingAccount extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -645,7 +645,7 @@ class AccountingAccount extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 9bd21a4a5c4..94cfbf3bd66 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -213,7 +213,7 @@ class AccountingJournal extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0) + function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0) { global $langs, $conf, $user; @@ -270,7 +270,7 @@ class AccountingJournal extends CommonObject * @param int $mode 0=libelle long, 1=libelle court * @return string Label of type */ - function getLibType($mode=0) + function getLibType($mode = 0) { return $this->LibType($this->nature,$mode); } @@ -283,7 +283,7 @@ class AccountingJournal extends CommonObject * @param int $mode 0=libelle long, 1=libelle court * @return string Label of type */ - function LibType($nature,$mode=0) + function LibType($nature, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 297fe0e3e9c..047628a7b96 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -411,7 +411,7 @@ class BookKeeping extends CommonObject * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -470,7 +470,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return int <0 if KO, Id of created object if OK */ - public function createStd(User $user, $notrigger = false, $mode='') + public function createStd(User $user, $notrigger = false, $mode = '') { global $conf; @@ -641,7 +641,7 @@ class BookKeeping extends CommonObject * * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id, $ref = null, $mode='') + public function fetch($id, $ref = null, $mode = '') { global $conf; @@ -1090,7 +1090,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return int <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false, $mode='') + public function update(User $user, $notrigger = false, $mode = '') { $error = 0; @@ -1225,7 +1225,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return number <0 if KO, >0 if OK */ - public function updateByMvt($piece_num='', $field='', $value='', $mode='') + public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '') { $error=0; @@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return int <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false, $mode='') + public function delete(User $user, $notrigger = false, $mode = '') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -1338,7 +1338,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return int <0 if KO, >0 if OK */ - function deleteByYearAndJournal($delyear='', $journal='', $mode='') + function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '') { global $conf; @@ -1500,7 +1500,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return int <0 if KO, >0 if OK */ - public function fetchPerMvt($piecenum, $mode='') + public function fetchPerMvt($piecenum, $mode = '') { global $conf; @@ -1536,7 +1536,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return string Next numero to use */ - public function getNextNumMvt($mode='') + public function getNextNumMvt($mode = '') { global $conf; @@ -1565,7 +1565,7 @@ class BookKeeping extends CommonObject * @param string $mode Mode * @return int <0 if KO, >0 if OK */ - function fetchAllPerMvt($piecenum, $mode='') + function fetchAllPerMvt($piecenum, $mode = '') { global $conf; @@ -1687,7 +1687,7 @@ class BookKeeping extends CommonObject * @param string $piece_num Piece num * @return int int <0 if KO, >0 if OK */ - public function transformTransaction($direction=0,$piece_num='') + public function transformTransaction($direction = 0, $piece_num = '') { $error = 0; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 826e1ddef1d..d12d4b31aa2 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -246,7 +246,7 @@ class Adherent extends CommonObject * @param string $moreinheader Add more html headers * @return int <0 if KO, >0 if OK */ - function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='', $moreinheader='') + function send_an_email($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '') { // phpcs:enable global $conf,$langs; @@ -358,7 +358,7 @@ class Adherent extends CommonObject * @param string $morphy Nature of the adherent (physical or moral) * @return string Label */ - function getmorphylib($morphy='') + function getmorphylib($morphy = '') { global $langs; if (! $morphy) { $morphy=$this->morphy; } @@ -374,7 +374,7 @@ class Adherent extends CommonObject * @param int $notrigger 1 ne declenche pas les triggers, 0 sinon * @return int <0 if KO, >0 if OK */ - function create($user,$notrigger=0) + function create($user, $notrigger = 0) { global $conf,$langs; @@ -500,7 +500,7 @@ class Adherent extends CommonObject * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK */ - function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update') + function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update') { global $conf, $langs, $hookmanager; @@ -817,7 +817,7 @@ class Adherent extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, 0=nothing to do, >0 if OK */ - function delete($rowid, $user, $notrigger=0) + function delete($rowid, $user, $notrigger = 0) { global $conf, $langs; @@ -927,7 +927,7 @@ class Adherent extends CommonObject * @param int $nosyncuser Do not synchronize linked user * @return string If OK return clear password, 0 if no change, < 0 if error */ - function setPassword($user, $password='', $isencrypted=0, $notrigger=0, $nosyncuser=0) + function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0) { global $conf, $langs; @@ -1147,7 +1147,7 @@ class Adherent extends CommonObject * @param string $lastname Lastname * @return void */ - function fetch_name($firstname,$lastname) + function fetch_name($firstname, $lastname) { // phpcs:enable global $conf; @@ -1183,7 +1183,7 @@ class Adherent extends CommonObject * @param bool $fetch_subscriptions To load member subscriptions * @return int >0 if OK, 0 if not found, <0 if KO */ - function fetch($rowid,$ref='',$fk_soc='',$ref_ext='',$fetch_optionals=true,$fetch_subscriptions=true) + function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true) { global $langs; @@ -1400,7 +1400,7 @@ class Adherent extends CommonObject * @param int $datesubend Date end subscription * @return int rowid of record added, <0 if KO */ - function subscription($date, $amount, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0) + function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0) { global $conf,$langs,$user; @@ -1486,7 +1486,7 @@ class Adherent extends CommonObject * @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice. * @return int <0 if KO, >0 if OK */ - function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0) + function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0) { global $conf, $langs, $user, $mysoc; @@ -2018,7 +2018,7 @@ class Adherent extends CommonObject * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string Chaine avec URL */ - function getNomUrl($withpictoimg=0, $maxlen=0, $option='card', $mode='', $morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1) { global $conf, $langs; @@ -2109,7 +2109,7 @@ class Adherent extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode); } @@ -2124,7 +2124,7 @@ class Adherent extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0) + function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0) { // phpcs:enable global $langs; @@ -2307,7 +2307,7 @@ class Adherent extends CommonObject * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf,$langs; @@ -2400,7 +2400,7 @@ class Adherent extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - function _load_ldap_dn($info,$mode=0) + function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; @@ -2694,7 +2694,7 @@ class Adherent extends CommonObject * @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5' * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) */ - public function sendReminderForExpiredSubscription($daysbeforeendlist='10') + public function sendReminderForExpiredSubscription($daysbeforeendlist = '10') { global $conf, $langs, $mysoc, $user; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 984cf49d44d..263012df782 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -103,7 +103,7 @@ class AdherentType extends CommonObject * @param int $notrigger 1=do not execute triggers, 0 otherwise * @return int >0 if OK, < 0 if KO */ - function create($user,$notrigger=0) + function create($user, $notrigger = 0) { global $conf; @@ -170,7 +170,7 @@ class AdherentType extends CommonObject * @param int $notrigger 1=do not execute triggers, 0 otherwise * @return int >0 if OK, < 0 if KO */ - function update($user,$notrigger=0) + function update($user, $notrigger = 0) { global $conf, $hookmanager; @@ -356,7 +356,7 @@ class AdherentType extends CommonObject * 2=Return array of members id only * @return mixed Array of members or -1 on error */ - function listMembersForMemberType($excludefilter='', $mode=0) + function listMembersForMemberType($excludefilter = '', $mode = 0) { global $conf, $user; @@ -411,7 +411,7 @@ class AdherentType extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0) + function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0) { global $langs; @@ -449,7 +449,7 @@ class AdherentType extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - function _load_ldap_dn($info,$mode=0) + function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 310a40c52b3..f5ef24fb465 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -52,7 +52,7 @@ class AdherentStats extends Stats * @param int $socid Id third party * @param int $userid Id user for filter */ - function __construct($db, $socid=0, $userid=0) + function __construct($db, $socid = 0, $userid = 0) { global $user, $conf; @@ -85,7 +85,7 @@ class AdherentStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of nb each month */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { global $user; @@ -126,7 +126,7 @@ class AdherentStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of amount each month */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { global $user; diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 7db60a11003..9ced878a68e 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -361,7 +361,7 @@ class Members extends DolibarrApi * * @url POST {id}/subscriptions */ - function createSubscription($id, $start_date, $end_date, $amount, $label='') + function createSubscription($id, $start_date, $end_date, $amount, $label = '') { if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) { throw new RestException(401); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 96876eb82b6..319dbb1f75b 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -207,7 +207,7 @@ $type=$this->fk_type; * @param int $notrigger 0=Disable triggers * @return int <0 if KO, >0 if OK */ - function update($user, $notrigger=0) + function update($user, $notrigger = 0) { $error = 0; @@ -263,7 +263,7 @@ $type=$this->fk_type; * @param bool $notrigger false=launch triggers after, true=disable triggers * @return int <0 if KO, 0 if not found, >0 if OK */ - function delete($user, $notrigger=false) + function delete($user, $notrigger = false) { $error = 0; @@ -356,7 +356,7 @@ $type=$this->fk_type; * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1) { global $langs; @@ -395,7 +395,7 @@ $type=$this->fk_type; * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return ''; } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index a77583b44b8..c57a511b3c9 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1755,7 +1755,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return string '' or value of entity into table */ -function fieldList($fieldlist, $obj='', $tabname='', $context='') +function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db,$mysoc; global $form; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 92f776b9ea9..a21eb56cb2c 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -54,7 +54,7 @@ class Dolistore * * @param boolean $debug Enable debug of request on screen */ - function __construct($debug=false) + function __construct($debug = false) { global $conf, $langs; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index afda116772c..35f5e5d6e72 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -947,7 +947,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldList($fieldlist, $obj='', $tabname='', $context='') +function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf, $langs, $user, $db; global $form; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index e36b8d59df3..e4cc568ea03 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -659,7 +659,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='') +function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db; global $form; diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 816992a80e9..d79b34b8949 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -46,7 +46,7 @@ class DolibarrApi * @param string $cachedir Cache dir * @param boolean $refreshCache Update cache */ - function __construct($db, $cachedir='', $refreshCache=false) + function __construct($db, $cachedir = '', $refreshCache = false) { global $conf, $dolibarr_main_url_root; @@ -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') + static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid') { // Features/modules to check diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 86d1cfff87c..01b0fdd56da 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -55,7 +55,7 @@ class Login * @url GET / * @url POST / */ - public function index($login, $password, $entity='', $reset=0) + public function index($login, $password, $entity = '', $reset = 0) { global $conf, $dolibarr_main_authentication, $dolibarr_auto_user; diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 335a9f6e9d1..93f2e88f725 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -312,7 +312,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) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -369,7 +369,7 @@ 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -382,7 +382,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) + static function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 51d76d75155..54421b8910f 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -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) + 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) + function update($user, $notrigger = 0) { global $conf, $hookmanager; @@ -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) + 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) + function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0) { global $langs; diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index e08daf0b9b2..afdacdaa0a6 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -142,7 +142,7 @@ class BlockedLogAuthority * @param string $signature Signature of object to load * @return int >0 if OK, <0 if KO, 0 if not found */ - public function fetch($id, $signature='') + public function fetch($id, $signature = '') { global $langs; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 17931e14457..2b4198eb08e 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -725,7 +725,7 @@ class BlockedLog * @param string $mode 0=unserialize, 1=json_decode * @return string Value unserialized */ - public function dolDecodeBlockedData($data, $mode=0) + public function dolDecodeBlockedData($data, $mode = 0) { try { @@ -763,7 +763,7 @@ class BlockedLog * @param int $forcesignature Force signature (for example '0000000000' when we disabled the module) * @return int <0 if KO, >0 if OK */ - public function create($user, $forcesignature='') + public function create($user, $forcesignature = '') { global $conf,$langs,$hookmanager; @@ -878,7 +878,7 @@ class BlockedLog * @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database. * @return boolean True if OK, False if KO */ - public function checkSignature($previoushash='') + public function checkSignature($previoushash = '') { if (empty($previoushash)) { @@ -921,7 +921,7 @@ class BlockedLog * @param int $beforeid ID of a record * @return string Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0) */ - public function getPreviousHash($withlock=0, $beforeid=0) + public function getPreviousHash($withlock = 0, $beforeid = 0) { global $conf; @@ -972,7 +972,7 @@ class BlockedLog * @param string $search_code search code * @return array|int Array of object log or <0 if error */ - public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref='', $search_amount='', $search_code='') + public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '') { global $conf, $cachedlogs; @@ -1070,7 +1070,7 @@ class BlockedLog * @param int $ignoresystem Ignore system events for the test * @return bool */ - function alreadyUsed($ignoresystem=0) + function alreadyUsed($ignoresystem = 0) { global $conf; diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 436f8135efc..e92ce019418 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -283,7 +283,7 @@ class Facturation * @param int $aId Id * @return id */ - public function id($aId=null) + public function id($aId = null) { if ( !$aId ) @@ -308,7 +308,7 @@ class Facturation * @param string $aRef Ref * @return string Ref */ - public function ref($aRef=null) + public function ref($aRef = null) { if (is_null($aRef)) @@ -331,7 +331,7 @@ class Facturation * @param int $aQte Qty * @return int Qty */ - public function qte($aQte=null) + public function qte($aQte = null) { if (is_null($aQte)) { @@ -354,7 +354,7 @@ class Facturation * @param string $aStock Stock * @return string Stock */ - public function stock($aStock=null) + public function stock($aStock = null) { if (is_null($aStock)) @@ -377,7 +377,7 @@ class Facturation * @param string $aRemisePercent Discount * @return string Discount */ - public function remisePercent($aRemisePercent=null) + public function remisePercent($aRemisePercent = null) { if (is_null($aRemisePercent)) @@ -400,7 +400,7 @@ class Facturation * @param int $aMontantRemise Amount * @return string Amount */ - public function montantRemise($aMontantRemise=null) + public function montantRemise($aMontantRemise = null) { if (is_null($aMontantRemise)) { @@ -421,7 +421,7 @@ class Facturation * @param int $aPrix Price * @return string Stock */ - public function prix($aPrix=null) + public function prix($aPrix = null) { if (is_null($aPrix)) { @@ -442,7 +442,7 @@ class Facturation * @param int $aTva Vat * @return int Vat */ - public function tva($aTva=null) + public function tva($aTva = null) { if (is_null($aTva)) { @@ -462,7 +462,7 @@ class Facturation * @param string $aNumFacture Invoice ref * @return string Invoice ref */ - public function numInvoice($aNumFacture=null) + public function numInvoice($aNumFacture = null) { if (is_null($aNumFacture)) { @@ -482,7 +482,7 @@ class Facturation * @param int $aModeReglement Payment mode * @return int Payment mode */ - public function getSetPaymentMode($aModeReglement=null) + public function getSetPaymentMode($aModeReglement = null) { if (is_null($aModeReglement)) { @@ -503,7 +503,7 @@ class Facturation * @param int $aMontantEncaisse Amount * @return int Amount */ - public function montantEncaisse($aMontantEncaisse=null) + public function montantEncaisse($aMontantEncaisse = null) { if (is_null($aMontantEncaisse)) { @@ -524,7 +524,7 @@ class Facturation * @param int $aMontantRendu Amount * @return int Amount */ - public function montantRendu($aMontantRendu=null) + public function montantRendu($aMontantRendu = null) { if (is_null($aMontantRendu)) { @@ -545,7 +545,7 @@ class Facturation * @param date $aPaiementLe Date * @return date Date */ - public function paiementLe($aPaiementLe=null) + public function paiementLe($aPaiementLe = null) { if (is_null($aPaiementLe)) { @@ -565,7 +565,7 @@ class Facturation * @param int $aTotalHt Total amount * @return int Total amount */ - public function prixTotalHt($aTotalHt=null) + public function prixTotalHt($aTotalHt = null) { if (is_null($aTotalHt)) { @@ -585,7 +585,7 @@ class Facturation * @param int $aMontantTva Amount vat * @return int Amount vat */ - public function montantTva($aMontantTva=null) + public function montantTva($aMontantTva = null) { if (is_null($aMontantTva)) { @@ -605,7 +605,7 @@ class Facturation * @param int $aTotalTtc Amount ttc * @return int Amount ttc */ - public function prixTotalTtc($aTotalTtc=null) + public function prixTotalTtc($aTotalTtc = null) { if (is_null($aTotalTtc)) { diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index da6c7c20a5c..d9da1eef35b 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -234,7 +234,7 @@ class Categorie extends CommonObject * @param string $type Type of category ('product', '...') or (0, 1, ...) * @return int <0 if KO, >0 if OK */ - function fetch($id, $label='', $type=null) + function fetch($id, $label = '', $type = null) { global $conf; @@ -501,7 +501,7 @@ class Categorie extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 KO >0 OK */ - function delete($user, $notrigger=0) + function delete($user, $notrigger = 0) { global $conf,$langs; @@ -691,7 +691,7 @@ class Categorie extends CommonObject * * @return int 1 if OK, -1 if KO */ - function del_type($obj,$type) + function del_type($obj, $type) { // phpcs:enable global $user,$langs,$conf; @@ -749,7 +749,7 @@ class Categorie extends CommonObject * @return array|int -1 if KO, array of instance of object if OK * @see containsObject */ - function getObjectsInCateg($type, $onlyids=0) + function getObjectsInCateg($type, $onlyids = 0) { $objs = array(); @@ -821,7 +821,7 @@ class Categorie extends CommonObject * @param int $page Page number * @return array|int Array of categories, 0 if no cat, -1 on error */ - function getListForItem($id, $type='customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) + function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) { global $conf; @@ -990,7 +990,7 @@ class Categorie extends CommonObject * * @return array|int Array of categories. this->cats and this->motherof are set, -1 on error */ - function get_full_arbo($type, $markafterid=0) + function get_full_arbo($type, $markafterid = 0) { // phpcs:enable global $conf, $langs; @@ -1076,7 +1076,7 @@ class Categorie extends CommonObject * @param int $protection Deep counter to avoid infinite loop * @return void */ - function build_path_from_id_categ($id_categ,$protection=1000) + function build_path_from_id_categ($id_categ, $protection = 1000) { // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG); @@ -1143,7 +1143,7 @@ class Categorie extends CommonObject * @param boolean $parent Just parent categories if true * @return array|int Table of Object Category, -1 on error */ - function get_all_categories($type=null, $parent=false) + function get_all_categories($type = null, $parent = false) { // phpcs:enable if (! is_numeric($type)) $type = $this->MAP_ID[$type]; @@ -1232,7 +1232,7 @@ class Categorie extends CommonObject * @param int $type Type of category (0, 1, ...) * @return array */ - function get_main_categories($type=null) + function get_main_categories($type = null) { // phpcs:enable return $this->get_all_categories($type, true); @@ -1248,7 +1248,7 @@ class Categorie extends CommonObject * @param int $nocolor 0 * @return array */ - function print_all_ways($sep = " >> ", $url='', $nocolor=0) + function print_all_ways($sep = " >> ", $url = '', $nocolor = 0) { // phpcs:enable $ways = array(); @@ -1376,7 +1376,7 @@ class Categorie extends CommonObject * labels, 'id'= Get array of category IDs * @return array|int Array of category objects or < 0 if KO */ - function containing($id, $type, $mode='object') + function containing($id, $type, $mode = 'object') { $cats = array(); @@ -1522,7 +1522,7 @@ class Categorie extends CommonObject * @param int $maxlength Max length of text * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='',$maxlength=0) + function getNomUrl($withpicto = 0, $option = '', $maxlength = 0) { global $langs; @@ -1608,7 +1608,7 @@ class Categorie extends CommonObject * @param int $nbmax Nombre maximum de photos (0=pas de max) * @return array Tableau de photos */ - function liste_photos($dir,$nbmax=0) + function liste_photos($dir, $nbmax = 0) { // phpcs:enable include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 0e9463cd43c..8ae44951ca5 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -566,7 +566,7 @@ class ActionComm extends CommonObject * @param string $ref_ext Ref ext to get * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='',$ref_ext='') + function fetch($id, $ref = '', $ref_ext = '') { global $langs; @@ -761,7 +761,7 @@ class ActionComm extends CommonObject * @param int $notrigger 1 = disable triggers, 0 = enable triggers * @return int <0 if KO, >0 if OK */ - function delete($notrigger=0) + function delete($notrigger = 0) { global $user,$langs,$conf; @@ -838,7 +838,7 @@ class ActionComm extends CommonObject * @param int $notrigger 1 = disable triggers, 0 = enable triggers * @return int <0 if KO, >0 if OK */ - function update($user,$notrigger=0) + function update($user, $notrigger = 0) { global $langs,$conf,$hookmanager; @@ -999,7 +999,7 @@ class ActionComm extends CommonObject * @param string $limit Limit number of answers * @return array or string Error string if KO, array with actions if OK */ - static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='a.datep', $sortorder='DESC', $limit=0) + static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0) { global $conf, $langs; @@ -1051,7 +1051,7 @@ class ActionComm extends CommonObject * @param int $load_state_board Charge indicateurs this->nb de tableau de bord * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - function load_board($user, $load_state_board=0) + function load_board($user, $load_state_board = 0) { // phpcs:enable global $conf, $langs; @@ -1164,7 +1164,7 @@ class ActionComm extends CommonObject * @param int $hidenastatus 1=Show nothing if status is "Not applicable" * @return string String with status */ - function getLibStatut($mode,$hidenastatus=0) + function getLibStatut($mode, $hidenastatus = 0) { return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep); } @@ -1179,7 +1179,7 @@ class ActionComm extends CommonObject * @param int $datestart Date start of event * @return string Label */ - function LibStatut($percent,$mode,$hidenastatus=0,$datestart='') + function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '') { // phpcs:enable global $langs; @@ -1257,7 +1257,7 @@ class ActionComm 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, $classname='', $option='', $overwritepicto=0, $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1) { global $conf, $langs, $user, $hookmanager, $action; @@ -1391,7 +1391,7 @@ class ActionComm extends CommonObject * @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...) * @return int <0 if error, nb of events in new file if ok */ - function build_exportfile($format,$type,$cachedelay,$filename,$filters) + function build_exportfile($format, $type, $cachedelay, $filename, $filters) { // phpcs:enable global $conf,$langs,$dolibarr_main_url_root,$mysoc; diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 6631d0e375d..4d5536e50fc 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -178,7 +178,7 @@ class ActionCommReminder 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -191,7 +191,7 @@ class ActionCommReminder 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) + static function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index d6c25f6d4c1..8efb6ab0515 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -130,7 +130,7 @@ class CActionComm * @param int $shortlabel 1=Get short label instead of long label * @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. */ - function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0) + function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0) { // phpcs:enable global $langs,$conf; @@ -223,7 +223,7 @@ class CActionComm * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Picto only * @return string Label of action type */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto = 0) { global $langs; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 5eaf2c5a6a5..4448fee5366 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1277,7 +1277,7 @@ $db->close(); * @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button" * @return void */ -function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0) +function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0) { global $user, $conf, $langs; global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 789ef82daa3..2a5691279a1 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -757,7 +757,7 @@ $db->close(); * @param bool $var true or false for alternat style on tr/td * @return void */ -function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false) +function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $showheader = false, $colorsbytype = array(), $var = false) { global $db; global $user, $conf, $langs, $hookmanager, $action; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 075e5997fbd..f208c25a058 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -905,7 +905,7 @@ $db->close(); * @param bool $var true or false for alternat style on tr/td * @return void */ -function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false) +function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $showheader = false, $colorsbytype = array(), $var = false) { global $db; global $user, $conf, $langs, $hookmanager, $action; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 84d20180f20..0de2efbd9cf 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -108,7 +108,7 @@ class AdvanceTargetingMailing extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -260,7 +260,7 @@ class AdvanceTargetingMailing extends CommonObject * @param int $id Id object * @return int <0 if KO, >0 if OK */ - function fetch_by_mailing($id=0) + function fetch_by_mailing($id = 0) { // phpcs:enable global $langs; @@ -327,7 +327,7 @@ class AdvanceTargetingMailing extends CommonObject * @param string $type_element Type target * @return int <0 if KO, >0 if OK */ - function fetch_by_element($id=0, $type_element='mailing') + function fetch_by_element($id = 0, $type_element = 'mailing') { // phpcs:enable global $langs; @@ -390,7 +390,7 @@ class AdvanceTargetingMailing 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) + function update($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -466,7 +466,7 @@ class AdvanceTargetingMailing 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) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -525,7 +525,7 @@ class AdvanceTargetingMailing extends CommonObject * @param array $arrayquery All element to Query * @return int <0 if KO, >0 if OK */ - function savequery($user,$arrayquery) + function savequery($user, $arrayquery) { global $langs,$conf; @@ -946,7 +946,7 @@ class AdvanceTargetingMailing extends CommonObject * For exemple jean;joe;jim%%;!jimo;!jima%> will target all jean, joe, start with jim but not jimo and not everythnig taht start by jima * @return string Sql to use for the where condition */ - public function transformToSQL($column_to_test,$criteria) + public function transformToSQL($column_to_test, $criteria) { $return_sql_criteria = '('; diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 19b1ce3e9b4..369c0536a33 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -92,7 +92,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array or Code or Label of preselected country * @return string HTML string with select */ - function multiselectCountry($htmlname = 'country_id', $selected_array=array()) + function multiselectCountry($htmlname = 'country_id', $selected_array = array()) { global $conf, $langs; @@ -194,7 +194,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array selected array * @return string combo list code */ - function multiselectselectLanguage($htmlname='', $selected_array=array()) + function multiselectselectLanguage($htmlname = '', $selected_array = array()) { global $conf,$langs; @@ -290,7 +290,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array Array * @return string HTML combo */ - function multiselectCivility($htmlname='civilite_id',$selected_array = array()) + function multiselectCivility($htmlname = 'civilite_id', $selected_array = array()) { global $conf,$langs,$user; $langs->load("dict"); @@ -356,7 +356,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array value selected * @return string HTML combo */ - function multiselectCustomerCategories($htmlname='cust_cat',$selected_array = array()) + function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array()) { return $this->multiselectCategories($htmlname,$selected_array,2); } @@ -368,7 +368,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array value selected * @return string HTML combo */ - function multiselectContactCategories($htmlname='contact_cat',$selected_array = array()) + function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array()) { return $this->multiselectCategories($htmlname,$selected_array,4); } @@ -381,7 +381,7 @@ class FormAdvTargetEmailing extends Form * @param int $type Type * @return string HTML combo */ - public function multiselectCategories($htmlname='',$selected_array = array(), $type=0) + public function multiselectCategories($htmlname = '', $selected_array = array(), $type = 0) { global $conf,$langs,$user; $langs->load("dict"); @@ -427,7 +427,7 @@ class FormAdvTargetEmailing extends Form * @param string $type_element Type element. Example: 'mailing' * @return string HTML combo */ - public function selectAdvtargetemailingTemplate($htmlname='template_id', $selected=0, $showempty=0, $type_element='mailing') + public function selectAdvtargetemailingTemplate($htmlname = 'template_id', $selected = 0, $showempty = 0, $type_element = 'mailing') { global $conf, $user, $langs; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index b807ea23334..7e1073a0f2a 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -271,7 +271,7 @@ class Mailing extends CommonObject * @param int $option2 Not used * @return int New id of clone */ - function createFromClone($fromid,$option1,$option2) + function createFromClone($fromid, $option1, $option2) { global $user,$langs; @@ -536,7 +536,7 @@ class Mailing 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) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $db, $conf, $langs, $hookmanager; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -607,7 +607,7 @@ class Mailing extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -620,7 +620,7 @@ class Mailing extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -670,7 +670,7 @@ class Mailing extends CommonObject * @param strin $desc Desc error * @return string Label */ - public static function libStatutDest($statut,$mode=0,$desc='') + public static function libStatutDest($statut, $mode = 0, $desc = '') { global $langs; $langs->load('mails'); diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index a03624f3122..6ce38f8c432 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -559,7 +559,7 @@ class Proposals extends DolibarrApi * * @return array */ - function validate($id, $notrigger=0) + function validate($id, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); @@ -607,7 +607,7 @@ class Proposals extends DolibarrApi * * @return array */ - function close($id, $status, $note_private='', $notrigger=0) + function close($id, $status, $note_private = '', $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 12de0610ad4..b3da0634aee 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -239,7 +239,7 @@ class Propal extends CommonObject * @param int $socid Id third party * @param int $propalid Id proposal */ - function __construct($db, $socid="", $propalid=0) + function __construct($db, $socid = "", $propalid = 0) { global $conf,$langs; @@ -267,7 +267,7 @@ class Propal extends CommonObject * TODO Replace calls to this function by generation objet Ligne * inserted into table $this->products */ - function add_product($idproduct, $qty, $remise_percent=0) + function add_product($idproduct, $qty, $remise_percent = 0) { // phpcs:enable global $conf, $mysoc; @@ -434,7 +434,7 @@ class Propal extends CommonObject * @return int >0 if OK, <0 if KO * @see add_product */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise=0, $fk_remise_except=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0) { global $mysoc, $conf, $langs; @@ -663,7 +663,7 @@ class Propal extends CommonObject * @param int $notrigger disable line update trigger * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0) + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) { global $mysoc; @@ -869,7 +869,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >=0 if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf,$hookmanager; $error=0; @@ -1216,7 +1216,7 @@ class Propal extends CommonObject * @param int $socid Id of thirdparty * @return int New id of clone */ - function createFromClone($socid=0) + function createFromClone($socid = 0) { global $user,$conf,$hookmanager; @@ -1340,7 +1340,7 @@ class Propal extends CommonObject * @param string $ref Ref of proposal * @return int >0 if OK, <0 if KO */ - function fetch($rowid,$ref='') + function fetch($rowid, $ref = '') { $sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc"; @@ -1504,7 +1504,7 @@ class Propal extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; @@ -1599,7 +1599,7 @@ class Propal extends CommonObject * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - function fetch_lines($only_product=0) + function fetch_lines($only_product = 0) { // phpcs:enable $this->lines=array(); @@ -1718,7 +1718,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0=execute triggers * @return int <0 if KO, 0=Nothing done, >=0 if OK */ - function valid($user, $notrigger=0) + function valid($user, $notrigger = 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1842,7 +1842,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_date($user, $date, $notrigger=0) + function set_date($user, $date, $notrigger = 0) { // phpcs:enable if (empty($date)) @@ -1911,7 +1911,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_echeance($user, $date_fin_validite, $notrigger=0) + function set_echeance($user, $date_fin_validite, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer)) @@ -1973,7 +1973,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_date_livraison($user, $date_livraison, $notrigger=0) + function set_date_livraison($user, $date_livraison, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer)) @@ -2035,7 +2035,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_availability($user, $id, $notrigger=0) + function set_availability($user, $id, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) @@ -2106,7 +2106,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_demand_reason($user, $id, $notrigger=0) + function set_demand_reason($user, $id, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) @@ -2179,7 +2179,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_ref_client($user, $ref_client, $notrigger=0) + function set_ref_client($user, $ref_client, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer)) @@ -2244,7 +2244,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_remise_percent($user, $remise, $notrigger=0) + function set_remise_percent($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2311,7 +2311,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_remise_absolue($user, $remise, $notrigger=0) + function set_remise_absolue($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2380,7 +2380,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function reopen($user, $statut, $note='', $notrigger=0) + function reopen($user, $statut, $note = '', $notrigger = 0) { $this->statut = $statut; @@ -2441,7 +2441,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - function cloture($user, $statut, $note="", $notrigger=0) + function cloture($user, $statut, $note = "", $notrigger = 0) { global $langs,$conf; @@ -2544,7 +2544,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - function classifyBilled(User $user, $notrigger=0) + function classifyBilled(User $user, $notrigger = 0) { $error=0; @@ -2600,7 +2600,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_draft($user, $notrigger=0) + function set_draft($user, $notrigger = 0) { // phpcs:enable $error=0; @@ -2665,7 +2665,7 @@ class Propal extends CommonObject * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC') + function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datep', $sortorder = 'DESC') { // phpcs:enable global $user; @@ -2833,7 +2833,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int 1 if ok, otherwise if error */ - function delete($user, $notrigger=0) + function delete($user, $notrigger = 0) { global $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -2957,7 +2957,7 @@ class Propal extends CommonObject * @return int >0 if OK, <0 if KO * @deprecated use set_availability */ - function availability($availability_id, $notrigger=0) + function availability($availability_id, $notrigger = 0) { global $user; @@ -3028,7 +3028,7 @@ class Propal extends CommonObject * @return int >0 si ok, <0 si ko * @deprecated use set_demand_reason */ - function demand_reason($demand_reason_id, $notrigger=0) + function demand_reason($demand_reason_id, $notrigger = 0) { // phpcs:enable global $user; @@ -3153,7 +3153,7 @@ class Propal 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -3166,7 +3166,7 @@ class Propal 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 */ - function LibStatut($statut,$mode=1) + function LibStatut($statut, $mode = 1) { // phpcs:enable global $conf; @@ -3213,7 +3213,7 @@ class Propal extends CommonObject * @param int $mode "opened" for proposal to close, "signed" for proposal to invoice * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - function load_board($user,$mode) + function load_board($user, $mode) { // phpcs:enable global $conf, $langs; @@ -3495,7 +3495,7 @@ class Propal 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='', $get_params='', $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user; @@ -3585,7 +3585,7 @@ class Propal extends CommonObject * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf,$langs; @@ -3854,7 +3854,7 @@ class PropaleLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function insert($notrigger=0) + function insert($notrigger = 0) { global $conf,$user; @@ -3997,7 +3997,7 @@ class PropaleLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function delete(User $user, $notrigger=0) + function delete(User $user, $notrigger = 0) { global $conf; @@ -4051,7 +4051,7 @@ class PropaleLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function update($notrigger=0) + function update($notrigger = 0) { global $conf,$user; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index bdd4a9dfba2..4286bb17448 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -56,7 +56,7 @@ class PropaleStats extends Stats * @param int $userid Id user for filter (creation user) * @param string $mode Option ('customer', 'supplier') */ - function __construct($db, $socid=0, $userid=0, $mode='customer') + function __construct($db, $socid = 0, $userid = 0, $mode = 'customer') { global $user, $conf; @@ -106,7 +106,7 @@ class PropaleStats 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) + function getNbByMonth($year, $format = 0) { global $user; diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 7005f495481..2c91990332b 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -496,7 +496,7 @@ class Orders extends DolibarrApi * * @return array */ - function validate($id, $idwarehouse=0, $notrigger=0) + function validate($id, $idwarehouse = 0, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); @@ -629,7 +629,7 @@ class Orders extends DolibarrApi * * @return int */ - function close($id, $notrigger=0) + function close($id, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); @@ -675,7 +675,7 @@ class Orders extends DolibarrApi * * @return array */ - function settodraft($id, $idwarehouse=-1) + function settodraft($id, $idwarehouse = -1) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1ec2f5d8ef8..5c000ce6d2d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -313,7 +313,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <=0 if OK, 0=Nothing done, >0 if KO */ - function valid($user, $idwarehouse=0, $notrigger=0) + function valid($user, $idwarehouse = 0, $notrigger = 0) { global $conf,$langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -474,7 +474,7 @@ class Commande extends CommonOrder * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) * @return int <0 if KO, >0 if OK */ - function set_draft($user, $idwarehouse=-1) + function set_draft($user, $idwarehouse = -1) { //phpcs:enable global $conf,$langs; @@ -617,7 +617,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - function cloture($user, $notrigger=0) + function cloture($user, $notrigger = 0) { global $conf; @@ -677,7 +677,7 @@ class Commande extends CommonOrder * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function cancel($idwarehouse=-1) + function cancel($idwarehouse = -1) { global $conf,$user,$langs; @@ -758,7 +758,7 @@ class Commande extends CommonOrder * @param int $notrigger Disable all triggers * @return int <0 if KO, >0 if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf,$langs; $error=0; @@ -1060,7 +1060,7 @@ class Commande extends CommonOrder * @param int $socid Id of thirdparty * @return int New id of clone */ - function createFromClone($socid=0) + function createFromClone($socid = 0) { global $user,$hookmanager; @@ -1302,7 +1302,7 @@ class Commande extends CommonOrder * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0) { global $mysoc, $conf, $langs, $user; @@ -1531,7 +1531,7 @@ class Commande extends CommonOrder * TODO Remplacer les appels a cette fonction par generation objet Ligne * insere dans tableau $this->products */ - function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='') + function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '') { // phpcs:enable global $conf, $mysoc; @@ -1616,7 +1616,7 @@ class Commande extends CommonOrder * @param string $ref_int Internal reference of other object * @return int >0 if OK, <0 if KO, 0 if not found */ - function fetch($id, $ref='', $ref_ext='', $ref_int='') + function fetch($id, $ref = '', $ref_ext = '', $ref_int = '') { // Check parameters @@ -1845,7 +1845,7 @@ class Commande extends CommonOrder * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - function fetch_lines($only_product=0) + function fetch_lines($only_product = 0) { // phpcs:enable $this->lines=array(); @@ -2027,7 +2027,7 @@ class Commande extends CommonOrder * @param int $filtre_statut Filter on shipment status * @return int <0 if KO, Nb of lines found if OK */ - function loadExpeditions($filtre_statut=-1) + function loadExpeditions($filtre_statut = -1) { $this->expeditions = array(); @@ -2103,7 +2103,7 @@ class Commande extends CommonOrder * * TODO FONCTION NON FINIE A FINIR */ - function stock_array($filtre_statut=self::STATUS_CANCELED) + function stock_array($filtre_statut = self::STATUS_CANCELED) { // phpcs:enable $this->stocks = array(); @@ -2143,7 +2143,7 @@ class Commande extends CommonOrder * @param int $lineid Id of line to delete * @return int >0 if OK, 0 if nothing to do, <0 if KO */ - function deleteline($user=null, $lineid=0) + function deleteline($user = null, $lineid = 0) { if ($this->statut == self::STATUS_DRAFT) { @@ -2221,7 +2221,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_remise($user, $remise, $notrigger=0) + function set_remise($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2289,7 +2289,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_remise_absolue($user, $remise, $notrigger=0) + function set_remise_absolue($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2357,7 +2357,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_date($user, $date, $notrigger=0) + function set_date($user, $date, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2423,7 +2423,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - function set_date_livraison($user, $date_livraison, $notrigger=0) + function set_date_livraison($user, $date_livraison, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2494,7 +2494,7 @@ class Commande extends CommonOrder * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC') + function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC') { // phpcs:enable global $user; @@ -2562,7 +2562,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >0 if OK, <0 if KO */ - function availability($availability_id, $notrigger=0) + function availability($availability_id, $notrigger = 0) { global $user; @@ -2633,7 +2633,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >0 if ok, <0 if ko */ - function demand_reason($demand_reason_id, $notrigger=0) + function demand_reason($demand_reason_id, $notrigger = 0) { // phpcs:enable global $user; @@ -2706,7 +2706,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_ref_client($user, $ref_client, $notrigger=0) + function set_ref_client($user, $ref_client, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2769,7 +2769,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function classifyBilled(User $user, $notrigger=0) + function classifyBilled(User $user, $notrigger = 0) { $error = 0; @@ -2904,7 +2904,7 @@ class Commande extends CommonOrder * @param int $notrigger disable line update trigger * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) { global $conf, $mysoc, $langs, $user; @@ -3094,7 +3094,7 @@ class Commande extends CommonOrder * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; @@ -3189,7 +3189,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <=0 if KO, >0 if OK */ - function delete($user, $notrigger=0) + function delete($user, $notrigger = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -3408,7 +3408,7 @@ class Commande extends CommonOrder * @param int $donotshowbilled Do not show billed status after order status * @return string Label of status */ - function LibStatut($statut,$billed,$mode,$donotshowbilled=0) + function LibStatut($statut, $billed, $mode, $donotshowbilled = 0) { // phpcs:enable global $langs, $conf; @@ -3501,7 +3501,7 @@ class Commande extends CommonOrder * @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='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1) { global $conf, $langs, $user; @@ -3782,7 +3782,7 @@ class Commande extends CommonOrder * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf,$langs; @@ -4022,7 +4022,7 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 si ko, >0 si ok */ - function delete(User $user, $notrigger=0) + function delete(User $user, $notrigger = 0) { global $conf, $langs; @@ -4083,7 +4083,7 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 1 = disable triggers * @return int <0 if KO, >0 if OK */ - function insert($user=null, $notrigger=0) + function insert($user = null, $notrigger = 0) { global $langs, $conf; @@ -4228,7 +4228,7 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 1 = disable triggers * @return int <0 si ko, >0 si ok */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf,$langs; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 3c6ec07c6cb..edd072854d3 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -55,7 +55,7 @@ class CommandeStats extends Stats * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ - function __construct($db, $socid, $mode, $userid=0) + function __construct($db, $socid, $mode, $userid = 0) { global $user, $conf; @@ -101,7 +101,7 @@ class CommandeStats 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) + function getNbByMonth($year, $format = 0) { global $user; @@ -144,7 +144,7 @@ class CommandeStats 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 amount by month */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { global $user; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 6d34c965871..9e94d262c18 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -352,7 +352,7 @@ class Account extends CommonObject * @param string $type To search using type * @return array|int Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error */ - function get_url($fk_bank='', $url_id='', $type='') + function get_url($fk_bank = '', $url_id = '', $type = '') { // phpcs:enable $lines = array(); @@ -417,7 +417,7 @@ class Account extends CommonObject * @param int $datev Date value * @return int Rowid of added entry, <0 if KO */ - function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur='',$banque='', $accountancycode='', $datev=null) + function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null) { // Deprecation warning if (is_numeric($oper)) { @@ -525,7 +525,7 @@ class Account extends CommonObject * @param int $notrigger 1=Disable triggers * @return int < 0 if KO, > 0 if OK */ - function create(User $user, $notrigger=0) + function create(User $user, $notrigger = 0) { global $langs,$conf, $hookmanager; @@ -860,7 +860,7 @@ class Account extends CommonObject * @param string $ref Ref of bank account to get * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { global $conf; @@ -1076,7 +1076,7 @@ class Account 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->clos,$mode); } @@ -1163,7 +1163,7 @@ class Account extends CommonObject * @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) * @return int Current sold (value date <= today) */ - function solde($option=0) + function solde($option = 0) { $solde=0; @@ -1329,7 +1329,7 @@ class Account extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $mode='', $option='', $save_lastsearch_value=-1, $notooltip=0) + function getNomUrl($withpicto = 0, $mode = '', $option = '', $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs, $user; @@ -1549,7 +1549,7 @@ class Account extends CommonObject * @return array * @see useDetailedBBAN */ - public function getFieldsToShow($includeibanbic=0) + public function getFieldsToShow($includeibanbic = 0) { //Get the required properties depending on the country $detailedBBAN = $this->useDetailedBBAN(); @@ -1765,7 +1765,7 @@ class AccountLine extends CommonObject * @param string $num External num to load (ex: num of transaction for paypal fee) * @return int <0 if KO, 0 if OK but not found, >0 if OK and found */ - function fetch($rowid,$ref='',$num='') + function fetch($rowid, $ref = '', $num = '') { global $conf; @@ -2011,7 +2011,7 @@ class AccountLine extends CommonObject * @param int $conciliated 1=Set transaction to conciliated, 0=Keep transaction non conciliated * @return int <0 if KO, >0 if OK */ - function update_conciliation(User $user, $cat, $conciliated=1) + function update_conciliation(User $user, $cat, $conciliated = 1) { // phpcs:enable global $conf,$langs; @@ -2075,7 +2075,7 @@ class AccountLine extends CommonObject * @param int $sign 1 or -1 * @return int >0 if OK, 0 if KO */ - function datev_change($rowid,$sign=1) + function datev_change($rowid, $sign = 1) { // phpcs:enable $sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; @@ -2142,7 +2142,7 @@ class AccountLine extends CommonObject * @param int $sign 1 or -1 * @return int >0 if OK, 0 if KO */ - function dateo_change($rowid,$sign=1) + function dateo_change($rowid, $sign = 1) { // phpcs:enable $sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; @@ -2257,7 +2257,7 @@ class AccountLine extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$maxlen=0,$option='',$notooltip=0) + function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip = 0) { global $langs; @@ -2298,7 +2298,7 @@ class AccountLine 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -2311,7 +2311,7 @@ class AccountLine 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) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index ffe01f41e7a..feaaccaa50f 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -325,7 +325,7 @@ class BankAccounts extends DolibarrApi * * @url POST {id}/lines */ - function addLine($id, $date, $type, $label, $amount, $category=0, $cheque_number='', $cheque_writer='', $cheque_bank='') + function addLine($id, $date, $type, $label, $amount, $category = 0, $cheque_number = '', $cheque_writer = '', $cheque_bank = '') { if (! DolibarrApiAccess::$user->rights->banque->modifier) { throw new RestException(401); diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 47edacb2410..cb8f21ecc5a 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -111,7 +111,7 @@ class PaymentVarious extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -181,7 +181,7 @@ class PaymentVarious extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; $sql = "SELECT"; @@ -505,7 +505,7 @@ class PaymentVarious 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 * @return string Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -518,7 +518,7 @@ class PaymentVarious 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 * @return string Libelle */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -567,7 +567,7 @@ class PaymentVarious extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $save_lastsearch_value=-1, $notooltip=0) + function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0) { global $db, $conf, $langs, $hookmanager; global $langs; diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index d0a10ec94da..946658208df 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -295,7 +295,7 @@ class CashControl 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 */ - public function getLibStatut($mode=0) + public function getLibStatut($mode = 0) { return $this->LibStatut($this->status, $mode); } @@ -308,7 +308,7 @@ class CashControl 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 */ - public function LibStatut($status, $mode=0) + public function LibStatut($status, $mode = 0) { // phpcs:enable if (empty($this->labelstatus)) @@ -364,7 +364,7 @@ class CashControl extends CommonObject * @param int $notooltip No tooltip * @return string String with URL */ - public function getNomUrl($withpicto=0, $option='', $maxlength=0, $save_lastsearch_value=-1, $notooltip=0) + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs, $hookmanager; include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 2c21c2694ae..60108eed794 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -245,7 +245,7 @@ class Deplacement extends CommonObject * @param string $ref Ref of record * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { $sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement"; @@ -316,7 +316,7 @@ class Deplacement 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 * @return string Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -329,7 +329,7 @@ class Deplacement 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 * @return string Libelle */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -374,7 +374,7 @@ class Deplacement extends CommonObject * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @return string Chaine avec URL */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto = 0) { global $langs; @@ -400,7 +400,7 @@ class Deplacement extends CommonObject * @param int $active Active or not * @return array */ - function listOfTypes($active=1) + function listOfTypes($active = 1) { global $langs; diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 5baea1c866a..e7277b0ca58 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -50,7 +50,7 @@ class DeplacementStats extends Stats * @param mixed $userid Id user for filter or array of user ids * @return void */ - function __construct($db, $socid=0, $userid=0) + function __construct($db, $socid = 0, $userid = 0) { global $conf; @@ -96,7 +96,7 @@ class DeplacementStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { $sql = "SELECT MONTH(dated) as dm, count(*)"; $sql.= " FROM ".$this->from; @@ -118,7 +118,7 @@ class DeplacementStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { $sql = "SELECT date_format(dated,'%m') as dm, sum(".$this->field.")"; $sql.= " FROM ".$this->from; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 04c2bedeb41..e145ed477aa 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -104,7 +104,7 @@ class Invoices extends DolibarrApi * * @throws RestException */ - function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '') { global $db, $conf; @@ -600,7 +600,7 @@ class Invoices extends DolibarrApi * @throws 500 * */ - function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger=0) + function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -650,7 +650,7 @@ class Invoices extends DolibarrApi * @throws 500 * */ - function settodraft($id, $idwarehouse=-1) + function settodraft($id, $idwarehouse = -1) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -702,7 +702,7 @@ class Invoices extends DolibarrApi * * @return array */ - function validate($id, $idwarehouse=0, $notrigger=0) + function validate($id, $idwarehouse = 0, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -753,7 +753,7 @@ class Invoices extends DolibarrApi * @throws 404 * @throws 500 */ - function settopaid($id, $close_code='', $close_note='') + function settopaid($id, $close_code = '', $close_note = '') { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -994,7 +994,7 @@ class Invoices extends DolibarrApi * @throws 401 * @throws 404 */ - function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') + function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement = '', $comment = '', $chqemetteur = '', $chqbank = '') { global $conf; @@ -1114,7 +1114,7 @@ class Invoices extends DolibarrApi * @throws 403 * @throws 404 */ - function addPaymentDistributed($arrayofamounts, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') + function addPaymentDistributed($arrayofamounts, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement = '', $comment = '', $chqemetteur = '', $chqbank = '') { global $conf; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index bc0e4289289..35a8a45bd20 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -321,7 +321,7 @@ class FactureRec extends CommonInvoice * @param int $ref_int Internal reference of other object * @return int >0 if OK, <0 if KO, 0 if not found */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='') + function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '') { $sql = 'SELECT f.rowid, f.entity, f.titre, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; @@ -573,7 +573,7 @@ class FactureRec extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function delete(User $user, $notrigger=0, $idwarehouse=-1) + function delete(User $user, $notrigger = 0, $idwarehouse = -1) { $rowid=$this->id; @@ -644,7 +644,7 @@ class FactureRec extends CommonInvoice * @param int $date_end_fill 1=Flag to fill end date when generating invoice * @return int <0 if KO, Id of line if OK */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null, $pu_ht_devise=0, $date_start_fill=0, $date_end_fill=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $date_start_fill = 0, $date_end_fill = 0) { global $mysoc; @@ -826,7 +826,7 @@ class FactureRec extends CommonInvoice * @param int $date_end_fill 1=Flag to fill end date when generating invoice * @return int <0 if KO, Id of line if OK */ - function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null, $pu_ht_devise = 0, $notrigger=0, $date_start_fill=0, $date_end_fill=0) + function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0) { global $mysoc; @@ -1002,7 +1002,7 @@ class FactureRec extends CommonInvoice * @param int $forcevalidation 1=Force validation of invoice whatever is template auto_validate flag. * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - function createRecurringInvoices($restrictioninvoiceid=0, $forcevalidation=0) + function createRecurringInvoices($restrictioninvoiceid = 0, $forcevalidation = 0) { global $conf, $langs, $db, $user, $hookmanager; @@ -1159,7 +1159,7 @@ class FactureRec extends CommonInvoice * @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='',$max=0,$short=0,$moretitle='',$notooltip='',$save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = '', $save_lastsearch_value = -1) { global $langs; @@ -1210,7 +1210,7 @@ class FactureRec extends CommonInvoice * @param integer $alreadypaid Not used on recurring invoices * @return string Label of status */ - function getLibStatut($mode=0, $alreadypaid=-1) + function getLibStatut($mode = 0, $alreadypaid = -1) { return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, empty($this->type)?0:$this->type); @@ -1227,7 +1227,7 @@ class FactureRec extends CommonInvoice * @param int $type Type invoice * @return string Label of status */ - function LibStatut($recur, $status, $mode=0, $alreadypaid=-1, $type=0) + function LibStatut($recur, $status, $mode = 0, $alreadypaid = -1, $type = 0) { // phpcs:enable global $langs; @@ -1328,7 +1328,7 @@ class FactureRec extends CommonInvoice * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $user,$langs,$conf; @@ -1480,7 +1480,7 @@ class FactureRec extends CommonInvoice * @param string $unit unit of frequency (d, m, y) * @return int <0 if KO, >0 if OK */ - function setFrequencyAndUnit($frequency,$unit) + function setFrequencyAndUnit($frequency, $unit) { if (! $this->table_element) { @@ -1523,7 +1523,7 @@ class FactureRec extends CommonInvoice * @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done * @return int <0 if KO, >0 if OK */ - function setNextDate($date, $increment_nb_gen_done=0) + function setNextDate($date, $increment_nb_gen_done = 0) { if (! $this->table_element) { @@ -1823,7 +1823,7 @@ class FactureLigneRec extends CommonInvoiceLine * @param int $notrigger No trigger * @return int <0 if KO, Id of line if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index dd90b466d30..14d01419037 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -289,7 +289,7 @@ class Facture extends CommonInvoice * @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value * @return int <0 if KO, >0 if OK */ - function create(User $user, $notrigger=0, $forceduedate=0) + function create(User $user, $notrigger = 0, $forceduedate = 0) { global $langs,$conf,$mysoc,$hookmanager; $error=0; @@ -854,7 +854,7 @@ class Facture extends CommonInvoice * @param int $invertdetail Reverse sign of amounts for lines * @return int <0 if KO, >0 if OK */ - function createFromCurrent(User $user, $invertdetail=0) + function createFromCurrent(User $user, $invertdetail = 0) { global $conf; @@ -945,7 +945,7 @@ class Facture extends CommonInvoice * @param int $socid Id of thirdparty * @return int New id of clone */ - function createFromClone($socid=0) + function createFromClone($socid = 0) { global $user,$hookmanager, $conf; @@ -1162,7 +1162,7 @@ class Facture extends CommonInvoice * @param int $withpicto Add download picto into link * @return string HTML link to file */ - function getDirectExternalLink($withpicto=0) + function getDirectExternalLink($withpicto = 0) { global $dolibarr_main_url_root; @@ -1193,7 +1193,7 @@ class Facture extends CommonInvoice * @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='', $max=0, $short=0, $moretitle='', $notooltip=0, $addlinktonotes=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $addlinktonotes = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user, $form; @@ -1301,7 +1301,7 @@ class Facture extends CommonInvoice * @param bool $fetch_situation Fetch the previous and next situation in $tab_previous_situation_invoice and $tab_next_situation_invoice * @return int >0 if OK, <0 if KO, 0 if not found */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $fetch_situation=false) + function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '', $fetch_situation = false) { global $conf; @@ -1604,7 +1604,7 @@ class Facture extends CommonInvoice * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; @@ -1819,7 +1819,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_ref_client($ref_client, $notrigger=0) + function set_ref_client($ref_client, $notrigger = 0) { // phpcs:enable global $user; @@ -1884,7 +1884,7 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, 0=Refused, >0 if OK */ - function delete($user, $notrigger=0, $idwarehouse=-1) + function delete($user, $notrigger = 0, $idwarehouse = -1) { global $langs,$conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -2058,7 +2058,7 @@ class Facture extends CommonInvoice * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) * @return int <0 if KO, >0 if OK */ - function set_paid($user, $close_code='', $close_note='') + function set_paid($user, $close_code = '', $close_note = '') { // phpcs:enable $error=0; @@ -2168,7 +2168,7 @@ class Facture extends CommonInvoice * @param string $close_note Comment * @return int <0 if KO, >0 if OK */ - function set_canceled($user, $close_code='', $close_note='') + function set_canceled($user, $close_code = '', $close_note = '') { // phpcs:enable @@ -2231,7 +2231,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK */ - function validate($user, $force_number='', $idwarehouse=0, $notrigger=0) + function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0) { global $conf,$langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -2529,7 +2529,7 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function set_draft($user,$idwarehouse=-1) + function set_draft($user, $idwarehouse = -1) { // phpcs:enable global $conf,$langs; @@ -2649,7 +2649,7 @@ class Facture extends CommonInvoice * @param double $pu_ht_devise Unit price in currency * @return int <0 if KO, Id of line if OK */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_options=0, $situation_percent=100, $fk_prev_id=0, $fk_unit = null, $pu_ht_devise = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = 0, $fk_remise_except = '', $price_base_type = 'HT', $pu_ttc = 0, $type = self::TYPE_STANDARD, $rang = -1, $special_code = 0, $origin = '', $origin_id = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $situation_percent = 100, $fk_prev_id = 0, $fk_unit = null, $pu_ht_devise = 0) { // Deprecation warning if ($label) { @@ -2879,7 +2879,7 @@ class Facture extends CommonInvoice * @param int $notrigger disable line update trigger * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null, $pu_ht_devise = 0, $notrigger=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = self::TYPE_STANDARD, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $situation_percent = 100, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) { global $conf,$user; // Deprecation warning @@ -3197,7 +3197,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_remise($user, $remise, $notrigger=0) + function set_remise($user, $remise, $notrigger = 0) { // phpcs:enable // Clean parameters @@ -3263,7 +3263,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_remise_absolue($user, $remise, $notrigger=0) + function set_remise_absolue($user, $remise, $notrigger = 0) { // phpcs:enable if (empty($remise)) $remise=0; @@ -3330,7 +3330,7 @@ class Facture extends CommonInvoice * @param string $mode 'next' for next value or 'last' for last value * @return string free ref or last ref */ - function getNextNumRef($soc,$mode='next') + function getNextNumRef($soc, $mode = 'next') { global $conf, $langs; $langs->load("bills"); @@ -3472,7 +3472,7 @@ class Facture extends CommonInvoice * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') + function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'f.datef,f.rowid', $sortorder = 'DESC') { // phpcs:enable global $conf,$user; @@ -3543,7 +3543,7 @@ class Facture extends CommonInvoice * @param int $socid Id thirdparty * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ - function list_replacable_invoices($socid=0) + function list_replacable_invoices($socid = 0) { // phpcs:enable global $conf; @@ -3593,7 +3593,7 @@ class Facture extends CommonInvoice * @param int $socid Id thirdparty * @return array Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) */ - function list_qualified_avoir_invoices($socid=0) + function list_qualified_avoir_invoices($socid = 0) { // phpcs:enable global $conf; @@ -3668,7 +3668,7 @@ class Facture extends CommonInvoice * @param float $amount Amount we request direct debit for * @return int <0 if KO, >0 if OK */ - function demande_prelevement($fuser, $amount=0) + function demande_prelevement($fuser, $amount = 0) { // phpcs:enable @@ -3894,7 +3894,7 @@ class Facture extends CommonInvoice * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $langs; @@ -4110,7 +4110,7 @@ class Facture extends CommonInvoice * @param null|array $moreparams Array to provide more information * @return int <0 if KO, >0 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf,$langs; @@ -4215,7 +4215,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function setFinal(User $user, $notrigger=0) + function setFinal(User $user, $notrigger = 0) { $error=0; @@ -4512,7 +4512,7 @@ class FactureLigne extends CommonInvoiceLine * @param int $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another * @return int <0 if KO, >0 if OK */ - function insert($notrigger=0, $noerrorifdiscountalreadylinked=0) + function insert($notrigger = 0, $noerrorifdiscountalreadylinked = 0) { global $langs,$user,$conf; @@ -4729,7 +4729,7 @@ class FactureLigne extends CommonInvoiceLine * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function update($user='',$notrigger=0) + function update($user = '', $notrigger = 0) { global $user,$conf; @@ -4945,7 +4945,7 @@ class FactureLigne extends CommonInvoiceLine * @param bool $include_credit_note Include credit note or not * @return int >= 0 */ - function get_prev_progress($invoiceid, $include_credit_note=true) + function get_prev_progress($invoiceid, $include_credit_note = true) { // phpcs:enable if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 4cf9477613e..ea065d81636 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -53,7 +53,7 @@ class FactureStats extends Stats * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ - function __construct($db, $socid, $mode, $userid=0) + function __construct($db, $socid, $mode, $userid = 0) { global $user, $conf; @@ -100,7 +100,7 @@ class FactureStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { global $user; @@ -145,7 +145,7 @@ class FactureStats 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 amount by month */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { global $user; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 55a3e40b55f..3d4f0881de2 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -82,7 +82,7 @@ class PaymentTerm // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -268,7 +268,7 @@ class PaymentTerm // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -345,7 +345,7 @@ class PaymentTerm // 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) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 49c95c26c2e..d80b9cc4783 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -163,7 +163,7 @@ class Localtax extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf, $langs; @@ -628,7 +628,7 @@ class Localtax extends CommonObject * @param string $option Sur quoi pointe le lien * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $option='') + function getNomUrl($withpicto = 0, $option = '') { global $langs; @@ -652,7 +652,7 @@ class Localtax 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -665,7 +665,7 @@ class Localtax 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($status, $mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index b69b1788eda..ccb42343907 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -84,7 +84,7 @@ class RemiseCheque extends CommonObject * @param string $ref Ref record * @return int <0 if KO, > 0 if OK */ - function fetch($id,$ref='') + function fetch($id, $ref = '') { global $conf; @@ -299,7 +299,7 @@ class RemiseCheque extends CommonObject * @param User $user Utilisateur qui effectue l'operation * @return int */ - function delete($user='') + function delete($user = '') { global $conf; @@ -416,7 +416,7 @@ class RemiseCheque extends CommonObject * @param string $mode 'next' for next value or 'last' for last value * @return string free ref or last ref */ - function getNextNumRef($mode='next') + function getNextNumRef($mode = 'next') { global $conf, $db, $langs, $mysoc; $langs->load("bills"); @@ -988,7 +988,7 @@ class RemiseCheque extends CommonObject * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $user,$langs,$conf; @@ -1013,7 +1013,7 @@ class RemiseCheque 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, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $conf, $langs; @@ -1064,7 +1064,7 @@ class RemiseCheque 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -1077,7 +1077,7 @@ class RemiseCheque 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 Libelle du statut */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 657a29cebbe..0003043fef4 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -157,7 +157,7 @@ class Paiement extends CommonObject * @param int $fk_bank Id of bank line associated to payment * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id, $ref='', $fk_bank='') + public function fetch($id, $ref = '', $fk_bank = '') { $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank,'; $sql.= ' c.code as type_code, c.libelle as type_libelle,'; @@ -224,7 +224,7 @@ class Paiement extends CommonObject * @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more * @return int id of created payment, < 0 if error */ - function create($user, $closepaidinvoices=0) + function create($user, $closepaidinvoices = 0) { global $conf, $langs; @@ -488,7 +488,7 @@ class Paiement extends CommonObject * @param int $notrigger No trigger * @return int <0 si ko, >0 si ok */ - function delete($notrigger=0) + function delete($notrigger = 0) { global $conf, $user, $langs; @@ -598,7 +598,7 @@ class Paiement extends CommonObject * @param int $notrigger No trigger * @return int <0 if KO, bank_line_id if OK */ - function addPaymentToBank($user,$mode,$label,$accountid,$emetteur_nom,$emetteur_banque,$notrigger=0) + function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) { global $conf,$langs,$user; @@ -897,7 +897,7 @@ class Paiement extends CommonObject * @param User $user User making validation * @return int <0 if KO, >0 if OK */ - function valide(User $user=null) + function valide(User $user = null) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 1 WHERE rowid = '.$this->id; @@ -921,7 +921,7 @@ class Paiement extends CommonObject * @param User $user User making reject * @return int <0 if KO, >0 if OK */ - function reject(User $user=null) + function reject(User $user = null) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 2 WHERE rowid = '.$this->id; @@ -989,7 +989,7 @@ class Paiement extends CommonObject * @param string $filter Critere de filtre * @return array Tableau des id de factures */ - function getBillsArray($filter='') + function getBillsArray($filter = '') { $sql = 'SELECT fk_facture'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'facture as f'; @@ -1027,7 +1027,7 @@ class Paiement extends CommonObject * @param string $mode 'next' for next value or 'last' for last value * @return string free ref or last ref */ - function getNextNumRef($soc,$mode='next') + function getNextNumRef($soc, $mode = 'next') { global $conf, $db, $langs; $langs->load("bills"); @@ -1138,7 +1138,7 @@ class Paiement extends CommonObject * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $user,$langs,$conf; @@ -1164,7 +1164,7 @@ class Paiement extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $option='', $mode='withlistofinvoices', $notooltip=0) + function getNomUrl($withpicto = 0, $option = '', $mode = 'withlistofinvoices', $notooltip = 0) { global $conf, $langs; @@ -1222,7 +1222,7 @@ class Paiement 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -1235,7 +1235,7 @@ class Paiement 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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage @@ -1286,7 +1286,7 @@ class Paiement extends CommonObject * @param int $force_thirdparty_id Force thirdparty id * @return int <0 if KO, >0 if OK */ - function fetch_thirdparty($force_thirdparty_id=0) + function fetch_thirdparty($force_thirdparty_id = 0) { // phpcs:enable include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 3f7dd23059d..f39ed254df3 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -81,7 +81,7 @@ class BonPrelevement extends CommonObject * @param DoliDB $db Database handler * @param string $filename Filename of withdraw receipt */ - function __construct($db, $filename='') + function __construct($db, $filename = '') { global $conf,$langs; @@ -276,7 +276,7 @@ class BonPrelevement extends CommonObject * @param string $ref Ref of direct debit * @return int >0 if OK, <0 if KO */ - function fetch($rowid, $ref='') + function fetch($rowid, $ref = '') { global $conf; @@ -630,7 +630,7 @@ class BonPrelevement extends CommonObject * @param int $amounts If you want to get the amount of the order for each invoice * @return array Id of invoices */ - private function getListInvoices($amounts=0) + private function getListInvoices($amounts = 0) { global $conf; @@ -731,7 +731,7 @@ class BonPrelevement extends CommonObject * @param int $agence dolibarr mysoc agence * @return int 0 if OK, <0 if KO */ - function delete($user=null) + function delete($user = null) { $this->db->begin(); @@ -1178,7 +1178,7 @@ class BonPrelevement extends CommonObject * @param string $option link target * @return string URL of target */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto = 0, $option = '') { global $langs; @@ -1299,7 +1299,7 @@ class BonPrelevement extends CommonObject * @param string $executiondate Date to execute transfer * @return int 0 if OK, <0 if KO */ - function generate($format='ALL',$executiondate='') + function generate($format = 'ALL', $executiondate = '') { global $conf,$langs,$mysoc; @@ -1493,7 +1493,7 @@ class BonPrelevement extends CommonObject * @param string $rib_dom rib domiciliation * @return void */ - function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom='') + function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '') { // phpcs:enable fputs($this->file, "06"); @@ -1726,7 +1726,7 @@ class BonPrelevement extends CommonObject * @param string $format FRST or RCUR or ALL * @return string String with SEPA Sender */ - function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST') + function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST') { // phpcs:enable // SEPA INITIALISATION @@ -1905,7 +1905,7 @@ class BonPrelevement extends CommonObject * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -1918,7 +1918,7 @@ class BonPrelevement 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 */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable if (empty($this->labelstatut)) diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 7e100022c7a..d47eb32504a 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -123,7 +123,7 @@ class LignePrelevement * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -136,7 +136,7 @@ class LignePrelevement * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 4797121a24c..46b4242944b 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -82,7 +82,7 @@ class RejetPrelevement * @param int $facturation Facturation * @return void */ - function create($user, $id, $motif, $date_rejet, $bonid, $facturation=0) + function create($user, $id, $motif, $date_rejet, $bonid, $facturation = 0) { global $langs,$conf; @@ -282,7 +282,7 @@ class RejetPrelevement * @return array Array List of invoices related to the withdrawal line * @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? */ - private function getListInvoices($amounts=0) + private function getListInvoices($amounts = 0) { global $conf; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 76a8284daff..8f55b5804cc 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -108,7 +108,7 @@ class PaymentSalary extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -189,7 +189,7 @@ class PaymentSalary extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; $sql = "SELECT"; @@ -544,7 +544,7 @@ class PaymentSalary 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 with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $db, $conf, $langs, $hookmanager; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -652,7 +652,7 @@ class PaymentSalary 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -665,7 +665,7 @@ class PaymentSalary 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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/salaries/class/salariesstats.class.php b/htdocs/compta/salaries/class/salariesstats.class.php index eaf5ff362ae..1a96fbc56aa 100644 --- a/htdocs/compta/salaries/class/salariesstats.class.php +++ b/htdocs/compta/salaries/class/salariesstats.class.php @@ -49,7 +49,7 @@ class SalariesStats extends Stats * @param mixed $userid Id user for filter or array of user ids * @return void */ - function __construct($db, $socid=0, $userid=0) + function __construct($db, $socid = 0, $userid = 0) { global $conf; @@ -94,7 +94,7 @@ class SalariesStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { $sql = "SELECT MONTH(datep) as dm, count(*)"; $sql.= " FROM ".$this->from; @@ -116,7 +116,7 @@ class SalariesStats extends Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { $sql = "SELECT date_format(datep,'%m') as dm, sum(".$this->field.")"; $sql.= " FROM ".$this->from; diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index 9e13ffcd8a5..f7c829294f8 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -404,7 +404,7 @@ class Cchargesociales * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -438,7 +438,7 @@ class Cchargesociales * @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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -451,7 +451,7 @@ class Cchargesociales * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index cca5a4d7dd2..1828e750914 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -93,7 +93,7 @@ class ChargeSociales extends CommonObject * @param string $ref Ref * @return int <0 KO >0 OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { $sql = "SELECT cs.rowid, cs.date_ech"; $sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; @@ -419,7 +419,7 @@ class ChargeSociales extends CommonObject * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ - function getLibStatut($mode=0,$alreadypaid=-1) + function getLibStatut($mode = 0, $alreadypaid = -1) { return $this->LibStatut($this->paye,$mode,$alreadypaid); } @@ -433,7 +433,7 @@ class ChargeSociales extends CommonObject * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ - function LibStatut($statut,$mode=0,$alreadypaid=-1) + function LibStatut($statut, $mode = 0, $alreadypaid = -1) { // phpcs:enable global $langs; @@ -491,7 +491,7 @@ class ChargeSociales 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 link */ - function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0, $short=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $short = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user, $form; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 74ddce68230..bd678904df6 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -104,7 +104,7 @@ class PaymentSocialContribution extends CommonObject * @param int $closepaidcontrib 1=Also close payed contributions to paid, 0=Do nothing more * @return int <0 if KO, id of payment if OK */ - function create($user, $closepaidcontrib=0) + function create($user, $closepaidcontrib = 0) { global $conf, $langs; @@ -292,7 +292,7 @@ class PaymentSocialContribution extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; $error=0; @@ -379,7 +379,7 @@ class PaymentSocialContribution 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) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -540,7 +540,7 @@ class PaymentSocialContribution 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) + function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) { global $conf; @@ -656,7 +656,7 @@ class PaymentSocialContribution 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -669,7 +669,7 @@ class PaymentSocialContribution 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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage @@ -720,7 +720,7 @@ class PaymentSocialContribution extends CommonObject * @param int $maxlen Longueur max libelle * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$maxlen=0) + function getNomUrl($withpicto = 0, $maxlen = 0) { global $langs; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 33d48de8bfc..5da7b0e144c 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -173,7 +173,7 @@ class Tva extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user, $notrigger=0) + function update($user, $notrigger = 0) { global $conf, $langs; @@ -241,7 +241,7 @@ class Tva extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; $sql = "SELECT"; @@ -687,7 +687,7 @@ class Tva extends CommonObject * @param string $morecss More CSS * @return string Chaine with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '') { global $langs, $conf; @@ -813,7 +813,7 @@ class Tva 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -826,7 +826,7 @@ class Tva 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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index b8e82e78632..4dbd78f5085 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -313,7 +313,7 @@ class Contact extends CommonObject * @param int $nosyncuser No sync linked user (external users and contacts are linked) * @return int <0 if KO, >0 if OK */ - function update($id, $user=null, $notrigger=0, $action='update', $nosyncuser=0) + function update($id, $user = null, $notrigger = 0, $action = 'update', $nosyncuser = 0) { global $conf, $langs, $hookmanager; @@ -501,7 +501,7 @@ class Contact extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - function _load_ldap_dn($info,$mode=0) + function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; @@ -597,7 +597,7 @@ class Contact extends CommonObject * @param int $notrigger 0=no, 1=yes * @return int <0 if KO, >=0 if OK */ - function update_perso($id, $user=null, $notrigger=0) + function update_perso($id, $user = null, $notrigger = 0) { // phpcs:enable $error=0; @@ -686,7 +686,7 @@ class Contact extends CommonObject * @param string $email Email * @return int -1 if KO, 0 if OK but not found, 1 if OK */ - function fetch($id, $user=null, $ref_ext='', $email='') + function fetch($id, $user = null, $ref_ext = '', $email = '') { global $langs; @@ -931,7 +931,7 @@ class Contact extends CommonObject * @param int $notrigger Disable all trigger * @return int <0 if KO, >0 if OK */ - function delete($notrigger=0) + function delete($notrigger = 0) { global $conf, $langs, $user; @@ -1124,7 +1124,7 @@ class Contact extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $maxlen=0, $moreparam='', $save_lastsearch_value=-1, $notooltip=0) + function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs, $hookmanager; @@ -1231,7 +1231,7 @@ class Contact 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 */ - function LibStatut($statut,$mode) + function LibStatut($statut, $mode) { // phpcs:enable global $langs; diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 585d5399771..8631becc515 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -555,7 +555,7 @@ class Contracts extends DolibarrApi * "notrigger": 0 * } */ - function validate($id, $notrigger=0) + 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) + function close($id, $notrigger = 0) { if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 635d7c5851e..81a8ddba115 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -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='') + 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); @@ -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='') + 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='') + 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='') + 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) + 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) + 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='') + 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,"; @@ -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) + 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) + 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) + 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; @@ -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) + function LibStatut($statut, $mode) { // phpcs:enable global $langs; @@ -1909,7 +1909,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) + function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1) { global $conf, $langs, $user; @@ -2022,7 +2022,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) + function array_detail($statut = -1) { // phpcs:enable $tab=array(); @@ -2059,7 +2059,7 @@ class Contrat extends CommonObject * @param string $option 'all' or 'others' * @return array Array of contracts id */ - function getListOfContracts($option='all') + function getListOfContracts($option = 'all') { $tab=array(); @@ -2100,7 +2100,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) + function load_board($user, $mode) { // phpcs:enable global $conf, $langs; @@ -2336,7 +2336,7 @@ class Contrat extends CommonObject * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf,$langs; @@ -2382,7 +2382,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) + function createFromClone($socid = 0, $notrigger = 0) { global $db, $user, $langs, $conf, $hookmanager, $extrafields; @@ -2658,7 +2658,7 @@ class ContratLigne extends CommonObjectLine * @param string $moreatt More attribute * @return string Libelle */ - static function LibStatut($statut,$mode,$expired=-1,$moreatt='') + static function LibStatut($statut, $mode, $expired = -1, $moreatt = '') { // phpcs:enable global $langs; @@ -2720,7 +2720,7 @@ class ContratLigne extends CommonObjectLine * @param int $maxlength Max length * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$maxlength=0) + function getNomUrl($withpicto = 0, $maxlength = 0) { global $langs; @@ -2747,7 +2747,7 @@ class ContratLigne extends CommonObjectLine * @param string $ref Ref of contract * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { // Check parameters @@ -2879,7 +2879,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) + function update($user, $notrigger = 0) { global $conf, $langs, $mysoc; @@ -3257,7 +3257,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) + function close_line($user, $date_end, $comment = '', $notrigger = 0) { // phpcs:enable global $langs, $conf; diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index d90a3f5f316..1e4dde7e0a4 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -337,7 +337,7 @@ if ((! isset($mode) || $mode != 'noajax') && is_object($db)) $db->close(); * @param int $depth Depth * @return void */ -function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth=0) +function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth = 0) { global $conf, $db, $langs, $form; global $dolibarr_main_data_root; diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index aea85fd111e..55804430113 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -54,7 +54,7 @@ class box_actions extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $user; @@ -69,7 +69,7 @@ class box_actions extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -189,7 +189,7 @@ class box_actions extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { global $langs, $conf; $out = parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 413dc43d8b2..e18114a5bc7 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -53,7 +53,7 @@ class box_activity extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $conf, $user; @@ -74,7 +74,7 @@ class box_activity extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -457,7 +457,7 @@ class box_activity extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index c3a29877104..ec091956701 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -50,7 +50,7 @@ class box_bookmarks extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -65,7 +65,7 @@ class box_bookmarks extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -157,7 +157,7 @@ class box_bookmarks extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 9b1e4e34261..c4e34a72e9b 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -54,7 +54,7 @@ class box_clients extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -72,7 +72,7 @@ class box_clients extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -173,7 +173,7 @@ class box_clients extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 3f86909f04a..795bf36bd0b 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -54,7 +54,7 @@ class box_commandes extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -69,7 +69,7 @@ class box_commandes extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -198,7 +198,7 @@ class box_commandes extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 5a5c2f59986..0f0d0f83fed 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -56,7 +56,7 @@ class box_comptes extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -75,7 +75,7 @@ class box_comptes extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -184,7 +184,7 @@ class box_comptes extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 2d9d7e9461b..2654607e2eb 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -56,7 +56,7 @@ class box_contacts extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -71,7 +71,7 @@ class box_contacts extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -185,7 +185,7 @@ class box_contacts extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 7239fa78919..bd499855cc4 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -53,7 +53,7 @@ class box_contracts extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_contracts extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -189,7 +189,7 @@ class box_contracts extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index fa7d35f6db0..d7165198201 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -56,7 +56,7 @@ class box_external_rss extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { $this->db=$db; $this->paramdef=$param; @@ -69,7 +69,7 @@ class box_external_rss extends ModeleBoxes * @param int $cachedelay Delay we accept for cache file * @return void */ - function loadBox($max=5, $cachedelay=3600) + function loadBox($max = 5, $cachedelay = 3600) { global $user, $langs, $conf; $langs->load("boxes"); @@ -195,7 +195,7 @@ class box_external_rss extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index ae4a32fad7c..b45c530a085 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -52,7 +52,7 @@ class box_factures extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -67,7 +67,7 @@ class box_factures extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -209,7 +209,7 @@ class box_factures extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 617f041d7d2..cc8cd3bd1da 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -53,7 +53,7 @@ class box_factures_fourn extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_factures_fourn extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -214,7 +214,7 @@ class box_factures_fourn extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index bd8fde32aab..181994fc1e3 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -52,7 +52,7 @@ class box_factures_fourn_imp extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -67,7 +67,7 @@ class box_factures_fourn_imp extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -201,7 +201,7 @@ class box_factures_fourn_imp extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 11331f7f3e7..6193924ebc7 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -55,7 +55,7 @@ class box_factures_imp extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -70,7 +70,7 @@ class box_factures_imp extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -207,7 +207,7 @@ class box_factures_imp extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 76d1414f53f..b4016bb3758 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -53,7 +53,7 @@ class box_ficheinter extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_ficheinter extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=10) + function loadBox($max = 10) { global $user, $langs, $db, $conf; @@ -166,7 +166,7 @@ class box_ficheinter extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index c66c7f674c2..aa04d312f54 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -53,7 +53,7 @@ class box_fournisseurs extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_fournisseurs extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; $langs->load("boxes"); @@ -160,7 +160,7 @@ class box_fournisseurs extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 138326d6c01..0cca908f5d8 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -55,7 +55,7 @@ class box_goodcustomers extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -74,7 +74,7 @@ class box_goodcustomers extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -169,7 +169,7 @@ class box_goodcustomers extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index fd0b4e593c0..b288912915d 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -48,7 +48,7 @@ class box_graph_invoices_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_invoices_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -275,7 +275,7 @@ class box_graph_invoices_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index f13b19259c9..be4b8722cf2 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -48,7 +48,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -274,7 +274,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index fefa90c5fea..390499bd359 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -48,7 +48,7 @@ class box_graph_orders_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_orders_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -273,7 +273,7 @@ class box_graph_orders_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index e388d226fd2..098cbb4d038 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -48,7 +48,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -272,7 +272,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 5eff8a7405d..704a0922472 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -51,7 +51,7 @@ class box_graph_product_distribution extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user, $conf; @@ -70,7 +70,7 @@ class box_graph_product_distribution extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -412,7 +412,7 @@ class box_graph_product_distribution extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index f28b0ec2c99..4abd3a8725a 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -48,7 +48,7 @@ class box_graph_propales_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_propales_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -276,7 +276,7 @@ class box_graph_propales_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 9ce7dd91605..34281d13c82 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -187,7 +187,7 @@ class box_last_modified_ticket extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index a824a707168..a1a52c3070d 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -187,7 +187,7 @@ class box_last_ticket extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index c8149c6384b..d1ae1e7abf4 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -53,7 +53,7 @@ class box_lastlogin extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $conf; @@ -66,7 +66,7 @@ class box_lastlogin extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -109,7 +109,7 @@ class box_lastlogin extends ModeleBoxes * @param int $nooutput No print, only return string * @return void */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index b0f999f54f1..8ffa90de5a4 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -55,7 +55,7 @@ class box_members extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -74,7 +74,7 @@ class box_members extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -178,7 +178,7 @@ class box_members extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 3dd66eb1da2..bb64e46ecc4 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -55,7 +55,7 @@ class box_produits extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $conf, $user; @@ -73,7 +73,7 @@ class box_produits extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf, $hookmanager; @@ -226,7 +226,7 @@ class box_produits extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 896ceb93df6..b14cc2e659f 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -57,7 +57,7 @@ class box_produits_alerte_stock extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf,$user; @@ -75,7 +75,7 @@ class box_produits_alerte_stock extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf, $hookmanager; @@ -238,7 +238,7 @@ class box_produits_alerte_stock extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index a48543a00f6..3784294298a 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -51,7 +51,7 @@ class box_project extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $user, $langs; @@ -70,7 +70,7 @@ class box_project extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -195,7 +195,7 @@ class box_project extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 2b3426f21b8..aa3a9f8fb00 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -54,7 +54,7 @@ class box_propales extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -69,7 +69,7 @@ class box_propales extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -188,7 +188,7 @@ class box_propales extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index a4382f86048..2c58bdbe1c3 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -56,7 +56,7 @@ class box_prospect extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -74,7 +74,7 @@ class box_prospect extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -176,7 +176,7 @@ class box_prospect extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 708b781f092..264b95d5c65 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -54,7 +54,7 @@ class box_services_contracts extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -69,7 +69,7 @@ class box_services_contracts extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -241,7 +241,7 @@ class box_services_contracts extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index ed62e127816..0bae23fef95 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -52,7 +52,7 @@ class box_services_expired extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -67,7 +67,7 @@ class box_services_expired extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -185,7 +185,7 @@ class box_services_expired extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 4621950843e..142fd2820be 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -52,7 +52,7 @@ class box_supplier_orders extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -184,7 +184,7 @@ class box_supplier_orders extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index cf1e799e486..bfcf5d2c301 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -54,7 +54,7 @@ class box_task extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $user, $langs; @@ -73,7 +73,7 @@ class box_task extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -152,7 +152,7 @@ class box_task extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 9ae35403ec7..971c04848c7 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -115,7 +115,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { $this->db=$db; } @@ -204,7 +204,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { global $langs, $user, $conf; @@ -385,7 +385,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box * @param array $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. * @return array Array list of widget */ - static function getWidgetsList($forcedirwidget=null) + static function getWidgetsList($forcedirwidget = null) { global $conf, $langs, $db; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 868d9b27039..9b0ee84ceed 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -119,7 +119,7 @@ class CMailFile * @param string $sendcontext 'standard', 'emailing', ... (used to define with sending mode and parameters to use) * @param string $replyto Reply-to email (will be set to same value than From by default if not provided) */ - function __construct($subject, $to, $from, $msg, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=0, $errors_to='', $css='', $trackid='', $moreinheader='', $sendcontext='standard', $replyto='') + function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '') { global $conf, $dolibarr_main_data_root; @@ -1178,7 +1178,7 @@ class CMailFile * @param array $mimefilename_list Tableau * @return string Chaine fichiers encodes */ - function write_files($filename_list,$mimetype_list,$mimefilename_list) + function write_files($filename_list, $mimetype_list, $mimefilename_list) { // phpcs:enable $out = ''; @@ -1259,7 +1259,7 @@ class CMailFile * @param int $port Example: 25, 465 * @return int Socket id if ok, 0 if KO */ - function check_server_port($host,$port) + function check_server_port($host, $port) { // phpcs:enable global $conf; @@ -1457,7 +1457,7 @@ class CMailFile * If format 3: '' or '"John Doe" ' or '"=?UTF-8?B?Sm9obiBEb2U=?=" ' * If format 4: 'John Doe' or 'john@doe.com' if no label exists */ - static function getValidAddress($address,$format,$encode=0,$maxnumberofemail=0) + static function getValidAddress($address, $format, $encode = 0, $maxnumberofemail = 0) { global $conf; diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index c3aa2e23417..ebdcad5ccf8 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -59,7 +59,7 @@ class CSMSFile * @param int $priority Priority * @param int $class Class */ - function __construct($to,$from,$msg,$deliveryreceipt=0,$deferred=0,$priority=3,$class=1) + function __construct($to, $from, $msg, $deliveryreceipt = 0, $deferred = 0, $priority = 3, $class = 1) { global $conf; diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 4694a5e4652..f822b178536 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -60,7 +60,7 @@ class Canvas * @param DoliDB $db Database handler * @param string $actiontype Action type ('create', 'view', 'edit', 'list') */ - function __construct($db, $actiontype='view') + function __construct($db, $actiontype = 'view') { $this->db = $db; @@ -142,7 +142,7 @@ class Canvas * @param string $ref Object ref (if id not provided) * @return void */ - function assign_values(&$action='view', $id=0, $ref='') + function assign_values(&$action = 'view', $id = 0, $ref = '') { // phpcs:enable if (method_exists($this->control,'assign_values')) $this->control->assign_values($action, $id, $ref); @@ -204,7 +204,7 @@ class Canvas * @return mixed Return return code of doActions of canvas * @see http://wiki.dolibarr.org/index.php/Canvas_development */ - function doActions(&$action='view', $id=0) + function doActions(&$action = 'view', $id = 0) { if (method_exists($this->control,'doActions')) { diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index f07916a7511..e93af622a27 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -86,7 +86,7 @@ class Ccountry // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -165,7 +165,7 @@ class Ccountry // extends CommonObject * @param string $code Code * @return int >0 if OK, 0 if not found, <0 if KO */ - function fetch($id,$code='') + function fetch($id, $code = '') { global $langs; $sql = "SELECT"; @@ -214,7 +214,7 @@ class Ccountry // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; $error=0; @@ -285,7 +285,7 @@ class Ccountry // 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) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 332f7e115ef..ddcce49cef4 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -82,7 +82,7 @@ class Comment extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; @@ -155,7 +155,7 @@ class Comment extends CommonObject * @param int $ref ref object * @return int <0 if KO, 0 if not found, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { global $langs; @@ -213,7 +213,7 @@ class Comment extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <=0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -278,7 +278,7 @@ class Comment 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) + function delete($user, $notrigger = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index d6a0e5845eb..79f266ed8a2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -69,7 +69,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - function get_substitutionarray_user($user,$outputlangs) + function get_substitutionarray_user($user, $outputlangs) { // phpcs:enable global $conf; @@ -107,7 +107,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - function get_substitutionarray_mysoc($mysoc,$outputlangs) + function get_substitutionarray_mysoc($mysoc, $outputlangs) { // phpcs:enable global $conf; @@ -167,7 +167,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - function get_substitutionarray_thirdparty($object,$outputlangs) + function get_substitutionarray_thirdparty($object, $outputlangs) { // phpcs:enable global $conf; @@ -361,7 +361,7 @@ abstract class CommonDocGenerator * @param string $array_key Name of the key for return array * @return array Array of substitution */ - function get_substitutionarray_object($object,$outputlangs,$array_key='object') + function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { // phpcs:enable global $conf; @@ -604,7 +604,7 @@ abstract class CommonDocGenerator * @param array $array_key Name of the key for return array * @return array Array of substitution */ - function get_substitutionarray_shipment($object,$outputlangs,$array_key='object') + function get_substitutionarray_shipment($object, $outputlangs, $array_key = 'object') { // phpcs:enable global $conf; @@ -716,7 +716,7 @@ abstract class CommonDocGenerator * @param boolean $recursive Want to fetch child array or child object * @return array Array of substitution key->code */ - function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) + function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = true) { // phpcs:enable $array_other = array(); @@ -747,7 +747,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ - function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs) + function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs) { // phpcs:enable global $conf; @@ -834,7 +834,7 @@ abstract class CommonDocGenerator * @param int $hidebottom Hide bottom * @return void */ - function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) + function printRect($pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0) { if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); $pdf->line($x+$l, $y, $x+$l, $y+$h); @@ -870,7 +870,7 @@ abstract class CommonDocGenerator * @param int $hideref Do not show ref * @return null */ - function prepareArrayColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) + function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { global $conf; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index cd346dd95e2..5615ecf3b20 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -97,7 +97,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return double Remain of amount to pay */ - function getRemainToPay($multicurrency=0) + function getRemainToPay($multicurrency = 0) { $alreadypaid=0; $alreadypaid+=$this->getSommePaiement($multicurrency); @@ -112,7 +112,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return int Amount of payment already done, <0 if KO */ - function getSommePaiement($multicurrency=0) + function getSommePaiement($multicurrency = 0) { $table='paiement_facture'; $field='fk_facture'; @@ -149,7 +149,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of deposits amount otherwise */ - function getSumDepositsUsed($multicurrency=0) + function getSumDepositsUsed($multicurrency = 0) { if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { @@ -178,7 +178,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and deposits amount otherwise */ - function getSumCreditNotesUsed($multicurrency=0) + function getSumCreditNotesUsed($multicurrency = 0) { require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; @@ -233,7 +233,7 @@ abstract class CommonInvoice extends CommonObject * @param string $option filtre sur statut ('', 'validated', ...) * @return int <0 si KO, 0 si aucune facture ne remplace, id facture sinon */ - function getIdReplacingInvoice($option='') + function getIdReplacingInvoice($option = '') { $sql = 'SELECT rowid'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element; @@ -274,7 +274,7 @@ abstract class CommonInvoice extends CommonObject * @param string $filtertype 1 to filter on type of payment == 'PRE' * @return array Array with list of payments */ - function getListOfPayments($filtertype='') + function getListOfPayments($filtertype = '') { $retarray=array(); @@ -447,7 +447,7 @@ abstract class CommonInvoice extends CommonObject * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label of status */ - function getLibStatut($mode=0, $alreadypaid=-1) + function getLibStatut($mode = 0, $alreadypaid = -1) { return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type); } @@ -463,7 +463,7 @@ abstract class CommonInvoice extends CommonObject * @param int $type Type invoice * @return string Label of status */ - function LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=0) + function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = 0) { // phpcs:enable global $langs; @@ -593,7 +593,7 @@ abstract class CommonInvoice extends CommonObject * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @return date Date limite de reglement si ok, <0 si ko */ - function calculate_date_lim_reglement($cond_reglement=0) + function calculate_date_lim_reglement($cond_reglement = 0) { // phpcs:enable if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f9fd88513c8..649b9d317b7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -417,7 +417,7 @@ abstract class CommonObject * @param string $ref_ext Ref ext of object to check * @return int <0 if KO, 0 if OK but not found, >0 if OK and exists */ - static function isExistingObject($element, $id, $ref='', $ref_ext='') + static function isExistingObject($element, $id, $ref = '', $ref_ext = '') { global $db,$conf; @@ -505,7 +505,7 @@ abstract class CommonObject * @param int $maxlen Maximum length * @return string String with full name */ - function getFullName($langs,$option=0,$nameorder=-1,$maxlen=0) + function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0) { //print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."\n"; $lastname=$this->lastname; @@ -532,7 +532,7 @@ abstract class CommonObject * @param int $withregion 1=Add region into address string * @return string Full address string */ - function getFullAddress($withcountry=0, $sep="\n", $withregion=0) + function getFullAddress($withcountry = 0, $sep = "\n", $withregion = 0) { if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) { @@ -682,7 +682,7 @@ abstract class CommonObject * @param int $relativelink 0=Return full external link, 1=Return link relative to root of file * @return string Link or empty string if there is no download link */ - function getLastMainDocLink($modulepart, $initsharekey=0, $relativelink=0) + function getLastMainDocLink($modulepart, $initsharekey = 0, $relativelink = 0) { global $user, $dolibarr_main_url_root; @@ -779,7 +779,7 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int <0 if KO, >0 if OK */ - function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0) + function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0) { // phpcs:enable global $user,$langs; @@ -901,7 +901,7 @@ abstract class CommonObject * @param string $source Nature of contact ('internal' or 'external') * @return int >0 if OK, <0 if KO */ - function copy_linked_contact($objFrom, $source='internal') + function copy_linked_contact($objFrom, $source = 'internal') { // phpcs:enable $contacts = $objFrom->liste_contact(-1, $source); @@ -926,7 +926,7 @@ abstract class CommonObject * @param int $fk_socpeople Id of soc_people to update (not modified if 0) * @return int <0 if KO, >= 0 if OK */ - function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) + function update_contact($rowid, $statut, $type_contact_id = 0, $fk_socpeople = 0) { // phpcs:enable // Insert into database @@ -955,7 +955,7 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - function delete_contact($rowid, $notrigger=0) + function delete_contact($rowid, $notrigger = 0) { // phpcs:enable global $user; @@ -994,7 +994,7 @@ abstract class CommonObject * @param string $code Type of contact (code or id) * @return int >0 if OK, <0 if KO */ - function delete_linked_contact($source='',$code='') + function delete_linked_contact($source = '', $code = '') { // phpcs:enable $temp = array(); @@ -1033,7 +1033,7 @@ abstract class CommonObject * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @return array|int Array of contacts, -1 if error */ - function liste_contact($statut=-1,$source='external',$list=0,$code='') + function liste_contact($statut = -1, $source = 'external', $list = 0, $code = '') { // phpcs:enable global $langs; @@ -1143,7 +1143,7 @@ abstract class CommonObject * @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE') * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) */ - function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='') + function liste_type_contact($source = 'internal', $order = 'position', $option = 0, $activeonly = 0, $code = '') { // phpcs:enable global $langs; @@ -1197,7 +1197,7 @@ abstract class CommonObject * @param int $status limited to a certain status * @return array List of id for such contacts */ - function getIdContact($source,$code,$status=0) + function getIdContact($source, $code, $status = 0) { global $conf; @@ -1257,7 +1257,7 @@ abstract class CommonObject * @param int $contactid Id du contact. Use this->contactid if empty. * @return int <0 if KO, >0 if OK */ - function fetch_contact($contactid=null) + function fetch_contact($contactid = null) { // phpcs:enable if (empty($contactid)) $contactid=$this->contactid; @@ -1278,7 +1278,7 @@ abstract class CommonObject * @param int $force_thirdparty_id Force thirdparty id * @return int <0 if KO, >0 if OK */ - function fetch_thirdparty($force_thirdparty_id=0) + function fetch_thirdparty($force_thirdparty_id = 0) { // phpcs:enable global $conf; @@ -1542,7 +1542,7 @@ abstract class CommonObject * @return int <0 if KO, >0 if OK * @see updateExtraField() */ - function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='', $fk_user_field='fk_user_modif') + function setValueFrom($field, $value, $table = '', $id = null, $format = '', $id_field = '', $fuser = null, $trigkey = '', $fk_user_field = 'fk_user_modif') { global $user,$langs,$conf; @@ -1621,7 +1621,7 @@ abstract class CommonObject * @param int $nodbprefix Do not include DB prefix to forge table name * @return int <0 if KO, >0 if OK */ - function load_previous_next_ref($filter, $fieldid, $nodbprefix=0) + function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0) { // phpcs:enable global $conf, $user; @@ -1745,7 +1745,7 @@ abstract class CommonObject * @return array Array of id of contacts (if source=external or internal) * Array of id of third parties with at least one contact on object (if source=thirdparty) */ - function getListContactId($source='external') + function getListContactId($source = 'external') { $contactAlreadySelected = array(); $tab = $this->liste_contact(-1,$source); @@ -1892,7 +1892,7 @@ abstract class CommonObject * @param int $mode mode 1 : amounts in company currency will be recalculated, mode 2 : amounts in foreign currency * @return int >0 if OK, <0 if KO */ - function setMulticurrencyRate($rate, $mode=1) + function setMulticurrencyRate($rate, $mode = 1) { dol_syslog(get_class($this).'::setMulticurrencyRate('.$id.')'); if ($this->statut >= 0 || $this->element == 'societe') @@ -2068,7 +2068,7 @@ abstract class CommonObject * * @return int 1 if OK, 0 if KO */ - function setShippingMethod($shipping_method_id, $notrigger=false, $userused=null) + function setShippingMethod($shipping_method_id, $notrigger = false, $userused = null) { global $user; @@ -2192,7 +2192,7 @@ abstract class CommonObject * @param User $userused Object user * @return int 1 if OK, 0 if KO */ - function setBankAccount($fk_account, $notrigger=false, $userused=null) + function setBankAccount($fk_account, $notrigger = false, $userused = null) { global $user; @@ -2257,7 +2257,7 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return int <0 if KO, >0 if OK */ - function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true) + function line_order($renum = false, $rowidorder = 'ASC', $fk_parent_line = true) { // phpcs:enable if (! $this->table_element_line) @@ -2376,7 +2376,7 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_up($rowid, $fk_parent_line=true) + function line_up($rowid, $fk_parent_line = true) { // phpcs:enable $this->line_order(false, 'ASC', $fk_parent_line); @@ -2396,7 +2396,7 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_down($rowid, $fk_parent_line=true) + function line_down($rowid, $fk_parent_line = true) { // phpcs:enable $this->line_order(false, 'ASC', $fk_parent_line); @@ -2418,7 +2418,7 @@ abstract class CommonObject * @param int $rang Position * @return void */ - function updateRangOfLine($rowid,$rang) + function updateRangOfLine($rowid, $rang) { $fieldposition = 'rang'; if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; @@ -2457,7 +2457,7 @@ abstract class CommonObject * @param int $rang Position * @return void */ - function updateLineUp($rowid,$rang) + function updateLineUp($rowid, $rang) { if ($rang > 1) { @@ -2491,7 +2491,7 @@ abstract class CommonObject * @param int $max Max * @return void */ - function updateLineDown($rowid,$rang,$max) + function updateLineDown($rowid, $rang, $max) { if ($rang < $max) { @@ -2563,7 +2563,7 @@ abstract class CommonObject * @param int $fk_parent_line Parent line id * @return int Max value of rang in table of lines */ - function line_max($fk_parent_line=0) + function line_max($fk_parent_line = 0) { // phpcs:enable // Search the last rang with fk_parent_line @@ -2645,7 +2645,7 @@ abstract class CommonObject * @param string $suffix '', '_public' or '_private' * @return int <0 if KO, >0 if OK */ - function update_note($note, $suffix='') + function update_note($note, $suffix = '') { // phpcs:enable global $user; @@ -2716,7 +2716,7 @@ abstract class CommonObject * @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object. * @return int <0 if KO, >0 if OK */ - function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null) + function update_price($exclspec = 0, $roundingadjust = 'none', $nodatabaseupdate = 0, $seller = null) { // phpcs:enable global $conf, $hookmanager, $action; @@ -2953,7 +2953,7 @@ abstract class CommonObject * @return int <=0 if KO, >0 if OK * @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked() */ - function add_object_linked($origin=null, $origin_id=null) + function add_object_linked($origin = null, $origin_id = null) { // phpcs:enable $origin = (! empty($origin) ? $origin : $this->origin); @@ -3014,7 +3014,7 @@ abstract class CommonObject * @return int <0 if KO, >0 if OK * @see add_object_linked(), updateObjectLinked(), deleteObjectLinked() */ - function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1,$orderby='sourcetype',$loadalsoobjects=1) + function fetchObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $clause = 'OR', $alsosametype = 1, $orderby = 'sourcetype', $loadalsoobjects = 1) { global $conf; @@ -3218,7 +3218,7 @@ abstract class CommonObject * @return int >0 if OK, <0 if KO * @see add_object_linked(), fetObjectLinked(), deleteObjectLinked() */ - function updateObjectLinked($sourceid=null, $sourcetype='', $targetid=null, $targettype='') + function updateObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '') { $updatesource=false; $updatetarget=false; @@ -3265,7 +3265,7 @@ abstract class CommonObject * @return int >0 if OK, <0 if KO * @see add_object_linked, updateObjectLinked, fetchObjectLinked */ - function deleteObjectLinked($sourceid=null, $sourcetype='', $targetid=null, $targettype='', $rowid='') + function deleteObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $rowid = '') { $deletesource=false; $deletetarget=false; @@ -3326,7 +3326,7 @@ abstract class CommonObject * @param string $trigkey Trigger key to use for trigger * @return int <0 if KO, >0 if OK */ - function setStatut($status, $elementId=null, $elementType='', $trigkey='') + function setStatut($status, $elementId = null, $elementType = '', $trigkey = '') { global $user,$langs,$conf; @@ -3414,7 +3414,7 @@ abstract class CommonObject * @param string $ref Record ref * @return int <0 if KO, 0 if nothing done, >0 if OK */ - function getCanvas($id=0,$ref='') + function getCanvas($id = 0, $ref = '') { global $conf; @@ -3474,7 +3474,7 @@ abstract class CommonObject * @param int $id Force id of object * @return int <0 if KO, 0 if not used, >0 if already used */ - function isObjectUsed($id=0) + function isObjectUsed($id = 0) { global $langs; @@ -3543,7 +3543,7 @@ abstract class CommonObject * @param int $predefined -1=All, 0=Count free product/service only, 1=Count predefined product/service only, 2=Count predefined product, 3=Count predefined service * @return int <0 if KO, 0 if no predefined products, nb of lines with predefined products if found */ - function hasProductsOrServices($predefined=-1) + function hasProductsOrServices($predefined = -1) { $nb=0; @@ -3881,7 +3881,7 @@ abstract class CommonObject * @param int $dateSelector 1=Show also date range input fields * @return void */ - function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0) + function printObjectLines($action, $seller, $buyer, $selected = 0, $dateSelector = 0) { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! @@ -4035,7 +4035,7 @@ abstract class CommonObject * @param int $extrafieldsline Object of extrafield line attribute * @return void */ - function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0) + function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafieldsline = 0) { global $conf,$langs,$user,$object,$hookmanager; global $form,$bc,$bcdd; @@ -4153,7 +4153,7 @@ abstract class CommonObject * @param string $restrictlist ''=All lines, 'services'=Restrict to services only * @return void */ - function printOriginLinesList($restrictlist='') + function printOriginLinesList($restrictlist = '') { global $langs, $hookmanager, $conf; @@ -4207,7 +4207,7 @@ abstract class CommonObject * @param string $restrictlist ''=All lines, 'services'=Restrict to services only (strike line if not) * @return void */ - function printOriginLine($line, $var, $restrictlist='') + function printOriginLine($line, $var, $restrictlist = '') { global $langs, $conf; @@ -4353,7 +4353,7 @@ abstract class CommonObject * @param int $mandatory Mandatory or not * @return int <=0 if KO, >0 if OK */ - function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0) + function add_element_resource($resource_id, $resource_type, $busy = 0, $mandatory = 0) { // phpcs:enable $this->db->begin(); @@ -4397,7 +4397,7 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - function delete_resource($rowid, $element, $notrigger=0) + function delete_resource($rowid, $element, $notrigger = 0) { // phpcs:enable global $user; @@ -4460,7 +4460,7 @@ abstract class CommonObject * @return int >0 if OK, <0 if KO * @see addFileIntoDatabaseIndex() */ - protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null) + protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams = null) { global $conf, $langs, $user; @@ -4742,7 +4742,7 @@ abstract class CommonObject * @param string $alternatevalue Alternate value to use * @return string|string[] Default value (can be an array if the GETPOST return an array) **/ - function getDefaultCreateValueFor($fieldname, $alternatevalue=null) + function getDefaultCreateValueFor($fieldname, $alternatevalue = null) { global $conf, $_POST; @@ -4818,7 +4818,7 @@ abstract class CommonObject * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. * @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded */ - function fetch_optionals($rowid=null, $optionsArray=null) + function fetch_optionals($rowid = null, $optionsArray = null) { // phpcs:enable if (empty($rowid)) $rowid=$this->id; @@ -4962,7 +4962,7 @@ abstract class CommonObject * @return int -1=error, O=did nothing, 1=OK * @see updateExtraField(), setValueFrom() */ - function insertExtraFields($trigger='', $userused=null) + function insertExtraFields($trigger = '', $userused = null) { global $conf,$langs,$user; @@ -5208,7 +5208,7 @@ abstract class CommonObject * @return int -1=error, O=did nothing, 1=OK * @see setValueFrom(), insertExtraFields() */ - function updateExtraField($key, $trigger=null, $userused=null) + function updateExtraField($key, $trigger = null, $userused = null) { global $conf,$langs,$user; @@ -5342,7 +5342,7 @@ abstract class CommonObject * @param string|int $morecss Value for css to define style/length of field. May also be a numeric. * @return string */ - function showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss=0) + function showInputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = 0) { global $conf,$langs,$form; @@ -5953,7 +5953,7 @@ abstract class CommonObject * @param mixed $showsize Value for css to define size. May also be a numeric. * @return string */ - function showOutputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0) + function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $showsize = 0) { global $conf,$langs,$form; @@ -6324,7 +6324,7 @@ abstract class CommonObject * @param string $onetrtd All fields in same tr td * @return string */ - function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='', $keyprefix='', $onetrtd=0) + function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0) { global $db, $conf, $langs, $action, $form; @@ -6531,7 +6531,7 @@ abstract class CommonObject * @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one) * @return bool True if success, False if error */ - public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0) + public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) { foreach ($tables as $table) { @@ -6647,7 +6647,7 @@ abstract class CommonObject * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto */ - function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0) + function show_photos($modulepart, $sdir, $size = 0, $nbmax = 0, $nbbyrow = 5, $showfilename = 0, $showaction = 0, $maxHeight = 120, $maxWidth = 160, $nolink = 0, $notitle = 0, $usesharelink = 0) { // phpcs:enable global $conf,$user,$langs; @@ -7349,7 +7349,7 @@ abstract class CommonObject * @param int $forcechilddeletion 0=no, 1=Force deletion of children * @return int <=0 if KO, >0 if OK */ - public function deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0) + public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0) { $error=0; diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 91d4245ff88..891ea5e4bc6 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -57,7 +57,7 @@ abstract class CommonObjectLine extends CommonObject * @param string $type Label type (long or short) * @return string|int <0 if ko, label if ok */ - public function getLabelOfUnit($type='long') + public function getLabelOfUnit($type = 'long') { global $langs; diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index d5bf6f3317e..2cbf6a9ecb7 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -107,7 +107,7 @@ abstract class CommonStickerGenerator * @param string $outputdir Output directory for pdf file * @return int 1=OK, 0=KO */ - abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir=''); + abstract function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = ''); // phpcs:enable /** @@ -118,7 +118,7 @@ abstract class CommonStickerGenerator * @param array $param Associative array containing label content and optional parameters * @return void */ - abstract function addSticker(&$pdf,$outputlangs,$param); + abstract function addSticker(&$pdf, $outputlangs, $param); // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** @@ -129,7 +129,7 @@ abstract class CommonStickerGenerator * @param int $pt point * @return void */ - function Set_Char_Size(&$pdf,$pt) + function Set_Char_Size(&$pdf, $pt) { // phpcs:enable if ($pt > 3) { @@ -152,7 +152,7 @@ abstract class CommonStickerGenerator * @param int $nbPointilles Nb pointilles * @return void */ - function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15) + function _Pointille(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $nbPointilles = 15) { // phpcs:enable $pdf->SetLineWidth($epaisseur); @@ -195,7 +195,7 @@ abstract class CommonStickerGenerator * @param int $taille Size * @return void */ - function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4) + function _Croix(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $taille = 4) { // phpcs:enable $pdf->SetDrawColor(192,192,192); diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php index a77b1cc8793..a3a8a0dd5ff 100644 --- a/htdocs/core/class/coreobject.class.php +++ b/htdocs/core/class/coreobject.class.php @@ -123,7 +123,7 @@ class CoreObject extends CommonObject * @param bool $try_to_load Force the fetch if an id is given * @return int */ - public function addChild($tabName, $id=0, $key='id', $try_to_load = false) + public function addChild($tabName, $id = 0, $key = 'id', $try_to_load = false) { if(!empty($id)) { @@ -154,7 +154,7 @@ class CoreObject extends CommonObject * @param string $key Attribute name of the object id * @return bool */ - public function removeChild($tabName, $id, $key='id') + public function removeChild($tabName, $id, $key = 'id') { foreach ($this->{$tabName} as &$object) { @@ -370,7 +370,7 @@ class CoreObject extends CommonObject * @param string $format Output date format * @return string */ - public function getDate($field, $format='') + public function getDate($field, $format = '') { if(empty($this->{$field})) return ''; else diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 4320446d7b5..6ad6523f199 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -92,7 +92,7 @@ class Cstate // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -168,7 +168,7 @@ class Cstate // extends CommonObject * @param string $code Code * @return int <0 if KO, >0 if OK */ - function fetch($id,$code='') + function fetch($id, $code = '') { global $langs; $sql = "SELECT"; @@ -212,7 +212,7 @@ class Cstate // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; $error=0; @@ -281,7 +281,7 @@ class Cstate // 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) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index db8ed461727..ffaccbfe964 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -76,7 +76,7 @@ class Ctypent // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, Id of created object if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -166,7 +166,7 @@ class Ctypent // extends CommonObject * @param string $label Label * @return int <0 if KO, >0 if OK */ - function fetch($id,$code='',$label='') + function fetch($id, $code = '', $label = '') { global $langs; $sql = "SELECT"; @@ -214,7 +214,7 @@ class Ctypent // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; $error=0; @@ -285,7 +285,7 @@ class Ctypent // 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) + function delete($user, $notrigger = 0) { global $conf, $langs; $error=0; diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 95c642772e2..4ceb7ed37c8 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -159,7 +159,7 @@ class Ctyperesource * * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id,$code='',$label='') + public function fetch($id, $code = '', $label = '') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -223,7 +223,7 @@ class Ctyperesource * * @return int <0 if KO, >0 if OK */ - public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND') + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index bb1e10e7a43..eb44fac13ea 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -109,7 +109,7 @@ class DiscountAbsolute * @param int $fk_invoice_supplier_source fk_invoice_supplier_source * @return int <0 if KO, =0 if not found, >0 if OK */ - function fetch($rowid, $fk_facture_source=0, $fk_invoice_supplier_source=0) + function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0) { global $conf; @@ -396,7 +396,7 @@ class DiscountAbsolute * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice) * @return int <0 if KO, >0 if OK */ - function link_to_invoice($rowidline,$rowidinvoice) + function link_to_invoice($rowidline, $rowidinvoice) { // phpcs:enable // Check parameters @@ -484,7 +484,7 @@ class DiscountAbsolute * @param int $discount_type 0 => customer discount, 1 => supplier discount * @return int <0 if KO, amount otherwise */ - function getAvailableDiscounts($company='', $user='',$filter='', $maxvalue=0, $discount_type=0) + function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0) { global $conf; @@ -527,7 +527,7 @@ class DiscountAbsolute * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and deposits amount otherwise */ - function getSumDepositsUsed($invoice, $multicurrency=0) + function getSumDepositsUsed($invoice, $multicurrency = 0) { dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG); @@ -573,7 +573,7 @@ class DiscountAbsolute * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and excess received amount otherwise */ - function getSumCreditNotesUsed($invoice, $multicurrency=0) + function getSumCreditNotesUsed($invoice, $multicurrency = 0) { dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG); @@ -619,7 +619,7 @@ class DiscountAbsolute * @param string $option Where to link to ('invoice' or 'discount') * @return string String with URL */ - function getNomUrl($withpicto,$option='invoice') + function getNomUrl($withpicto, $option = 'invoice') { global $langs; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 548721be05f..5d375e420f4 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -64,7 +64,7 @@ class DolEditor * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') * @param int $readonly 0=Read/Edit, 1=Read only */ - function __construct($htmlname, $content, $width='', $height=200, $toolbarname='Basic', $toolbarlocation='In', $toolbarstartexpanded=false, $uselocalbrowser=true, $okforextendededitor=true, $rows=0, $cols=0, $readonly=0) + function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = true, $okforextendededitor = true, $rows = 0, $cols = 0, $readonly = 0) { global $conf,$langs; @@ -149,7 +149,7 @@ class DolEditor * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @return void|string */ - function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') + function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '') { // phpcs:enable global $conf,$langs; diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 871951e3df0..035fe1a1486 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -41,7 +41,7 @@ class DolGeoIP * @param string $type 'country' or 'city' * @param string $datfile Data file */ - function __construct($type,$datfile) + function __construct($type, $datfile) { if ($type == 'country') { diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 29d49c0ff9a..01ed83bf176 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -88,7 +88,7 @@ class DolGraph * * @param string $library 'jflot' (default) or 'artichow' (no more supported) */ - function __construct($library='jflot') + function __construct($library = 'jflot') { global $conf; global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; @@ -658,7 +658,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return integer|null */ - function draw($file, $fileurl='') + function draw($file, $fileurl = '') { if (empty($file)) { @@ -690,7 +690,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return void */ - private function draw_artichow($file,$fileurl) + private function draw_artichow($file, $fileurl) { // phpcs:enable global $artichow_defaultfont; @@ -1127,7 +1127,7 @@ class DolGraph * @param int $shownographyet Show graph to say there is not enough data * @return string HTML string to show graph */ - function show($shownographyet=0) + function show($shownographyet = 0) { global $langs; @@ -1149,7 +1149,7 @@ class DolGraph * @param string $defaultsize Value we want as default size * @return int Value of width or height to use by default */ - static function getDefaultGraphSizeForStats($direction,$defaultsize='') + static function getDefaultGraphSizeForStats($direction, $defaultsize = '') { global $conf; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index f38afc67807..19de8abb3f6 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -311,7 +311,7 @@ class dolReceiptPrinter extends Escpos * @param string $htmlname select html name * @return int 0 if OK; >0 if KO */ - function selectTypePrinter($selected='', $htmlname='printertypeid') + function selectTypePrinter($selected = '', $htmlname = 'printertypeid') { global $langs; @@ -335,7 +335,7 @@ class dolReceiptPrinter extends Escpos * @param string $htmlname select html name * @return int 0 if OK; >0 if KO */ - function selectProfilePrinter($selected='', $htmlname='printerprofileid') + function selectProfilePrinter($selected = '', $htmlname = 'printerprofileid') { global $langs; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 3a1fba460c4..3ce9623a05d 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -277,7 +277,7 @@ class EmailSenderProfile extends CommonObject * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @return string String with URL */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto = 0) { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -309,7 +309,7 @@ class EmailSenderProfile extends CommonObject * @param int $withpicto Add download picto into link * @return string HTML link to file */ - function getDirectExternalLink($withpicto=0) + function getDirectExternalLink($withpicto = 0) { return 'todo'; } @@ -320,7 +320,7 @@ class EmailSenderProfile 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -333,7 +333,7 @@ class EmailSenderProfile 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) + static function LibStatut($status, $mode = 0) { global $langs; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 68e029dae4b..ecaaba8f4c7 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -183,7 +183,7 @@ class Events // extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -220,7 +220,7 @@ class Events // extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b09b48e1d3d..77ee805295d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -171,7 +171,7 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $computed='', $entity='', $langfile='', $enabled='1') + function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1') { if (empty($attrname)) return -1; if (empty($label)) return -1; @@ -221,7 +221,7 @@ class ExtraFields * @param string $computed Computed value * @return int <=0 if KO, >0 if OK */ - private function create($attrname, $type='varchar', $length=255, $elementtype='member', $unique=0, $required=0, $default_value='',$param='', $perms='', $list='0', $computed='') + private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -317,7 +317,7 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $default='', $computed='',$entity='', $langfile='', $enabled='1') + private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1') { // phpcs:enable global $conf,$user; @@ -414,7 +414,7 @@ class ExtraFields * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @return int < 0 if KO, 0 if nothing is done, 1 if OK */ - function delete($attrname, $elementtype='member') + function delete($attrname, $elementtype = 'member') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -472,7 +472,7 @@ class ExtraFields * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @return int < 0 if KO, 0 if nothing is done, 1 if OK */ - private function delete_label($attrname, $elementtype='member') + private function delete_label($attrname, $elementtype = 'member') { // phpcs:enable global $conf; @@ -529,7 +529,7 @@ class ExtraFields * @param int $totalizable Is extrafield totalizable on list * @return int >0 if OK, <=0 if KO */ - function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1', $totalizable=0) + function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0) { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -639,7 +639,7 @@ class ExtraFields * @param int $totalizable Is extrafield totalizable on list * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0) + private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0) { // phpcs:enable global $conf, $user; @@ -770,7 +770,7 @@ class ExtraFields * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required. * @return array Array of attributes keys+label for all extra fields. */ - function fetch_name_optionals_label($elementtype,$forceload=false) + function fetch_name_optionals_label($elementtype, $forceload = false) { // phpcs:enable global $conf; @@ -893,7 +893,7 @@ class ExtraFields * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @return string */ - function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='', $objectid=0, $extrafieldsobjectkey='') + function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '') { global $conf,$langs,$form; @@ -1508,7 +1508,7 @@ class ExtraFields * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @return string Formated value */ - function showOutputField($key, $value, $moreparam='', $extrafieldsobjectkey='') + function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '') { global $conf,$langs; @@ -1820,7 +1820,7 @@ class ExtraFields * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data * @return string Formated value */ - function getAlignFlag($key, $extrafieldsobjectkey='') + function getAlignFlag($key, $extrafieldsobjectkey = '') { global $conf,$langs; @@ -1890,7 +1890,7 @@ class ExtraFields * @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset. * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) */ - function setOptionalsFromPost($extralabels, &$object, $onlykey='') + function setOptionalsFromPost($extralabels, &$object, $onlykey = '') { global $_POST, $langs; $nofillrequired='';// For error when required field left blank @@ -1989,7 +1989,7 @@ class ExtraFields * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @return array|int array_options set or 0 if no value */ - function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix='', $keysuffix='') + function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix = '', $keysuffix = '') { global $_POST; diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index bf1045aaa35..3a085821694 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -41,7 +41,7 @@ class FileUpload * @param int $fk_element fk_element * @param string $element element */ - function __construct($options=null,$fk_element=null,$element=null) + function __construct($options = null, $fk_element = null, $element = null) { global $db, $conf; global $object; diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index c1c288cbf79..cf6a3cf345d 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -264,7 +264,7 @@ class Fiscalyear 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 * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -277,7 +277,7 @@ class Fiscalyear 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 * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/core/class/google.class.php b/htdocs/core/class/google.class.php index 615729ba9c3..797f0a14af1 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -44,7 +44,7 @@ class GoogleAPI * @param DoliDB $db Database handler * @param string $key Google key */ - function __construct($db,$key) + function __construct($db, $key) { $this->db=$db; $this->key=$key; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 98193f1e32e..47edef4011d 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -136,7 +136,7 @@ class HookManager * All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller. * $this->error or this->errors are also defined by class called by this function if error. */ - function executeHooks($method, $parameters=array(), &$object='', &$action='') + function executeHooks($method, $parameters = array(), &$object = '', &$action = '') { if (! is_array($this->hooks) || empty($this->hooks)) return ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1b9b54f2bc3..bb710c5e29f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -102,7 +102,7 @@ class Form * @param string $paramid Key of parameter for id ('id', 'socid') * @return string HTML edit field */ - function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0, $paramid='id') + function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id') { global $conf,$langs; @@ -164,7 +164,7 @@ class Form * @param string $paramid Key of parameter for id ('id', 'socid') * @return string HTML edit field */ - function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=0, $formatfunc='', $paramid='id') + function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata = 'string', $editvalue = '', $extObject = null, $custommsg = null, $moreparam = '', $notabletag = 0, $formatfunc = '', $paramid = 'id') { global $conf,$langs,$db; @@ -306,7 +306,7 @@ class Form * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @return string HTML edit in place */ - private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null) + private function editInPlace($object, $value, $htmlname, $condition, $inputType = 'textarea', $editvalue = null, $extObject = null, $custommsg = null) { global $conf; @@ -441,7 +441,7 @@ class Form * @see Use function textwithpicto if you can. * TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip */ - function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger='', $forcenowrap=0) + function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) { global $conf; @@ -526,7 +526,7 @@ class Form * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) * @return string HTML code of text, picto, tooltip */ - function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger='', $forcenowrap=0) + function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger = '', $forcenowrap = 0) { global $conf, $langs; @@ -578,7 +578,7 @@ class Form * @param int $alwaysvisible 1=select button always visible * @return string Select list */ - function selectMassAction($selected, $arrayofaction, $alwaysvisible=0) + function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0) { global $conf,$langs,$hookmanager; @@ -678,7 +678,7 @@ class Form * @param int $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...) * @return string HTML string with select */ - function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0, $addspecialentries=0) + function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0) { // phpcs:enable global $conf,$langs,$mysoc; @@ -791,7 +791,7 @@ class Form * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @return string HTML string with select and input */ - function select_incoterms($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array()) + function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array()) { // phpcs:enable global $conf,$langs; @@ -884,7 +884,7 @@ class Form * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service') * @return void */ - function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) + function select_type_of_lines($selected = '', $htmlname = 'type', $showempty = 0, $hidetext = 0, $forceall = 0) { // phpcs:enable global $db,$langs,$user,$conf; @@ -987,7 +987,7 @@ class Form * @param int $showempty Add an empty field * @return void */ - function select_type_fees($selected='',$htmlname='type',$showempty=0) + function select_type_fees($selected = '', $htmlname = 'type', $showempty = 0) { // phpcs:enable global $user, $langs; @@ -1031,7 +1031,7 @@ class Form * @return string Return select box for thirdparty. * @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0) */ - function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0) + function select_thirdparty($selected = '', $htmlname = 'socid', $filter = '', $limit = 20, $ajaxoptions = array(), $forcecombo = 0) { // phpcs:enable return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0, $limit); @@ -1057,7 +1057,7 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) * @return string HTML string with select box for thirdparty. */ - function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false) + function select_company($selected = '', $htmlname = 'socid', $filter = '', $showempty = '', $showtype = 0, $forcecombo = 0, $events = array(), $limit = 0, $morecss = 'minwidth100', $moreparam = '', $selected_input_value = '', $hidelabel = 1, $ajaxoptions = array(), $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -1121,7 +1121,7 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return string HTML string with */ - function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false) + function select_thirdparty_list($selected = '', $htmlname = 'socid', $filter = '', $showempty = '', $showtype = 0, $forcecombo = 0, $events = array(), $filterkey = '', $outputmode = 0, $limit = 0, $morecss = 'minwidth100', $moreparam = '', $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -1295,7 +1295,7 @@ class Form * @param int $maxvalue Max value for lines that can be selected * @return int Return number of qualifed lines in list */ - function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0) + function select_remises($selected, $htmlname, $filter, $socid, $maxvalue = 0) { // phpcs:enable global $langs,$conf; @@ -1382,7 +1382,7 @@ class Form * @return int <0 if KO, Nb of contact in list if OK * @deprected You can use selectcontacts directly (warning order of param was changed) */ - function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='') + function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '') { // phpcs:enable print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid); @@ -1412,7 +1412,7 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return int <0 if KO, Nb of contact in list if OK */ - function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='', $multiple=false) + function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false) { global $conf,$langs,$hookmanager,$action; @@ -1559,7 +1559,7 @@ class Form * @deprecated Use select_dolusers instead * @see select_dolusers() */ - function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0') + function select_users($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0') { // phpcs:enable print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity); @@ -1589,7 +1589,7 @@ class Form * @return string HTML select string * @see select_dolgroups */ - function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false) + function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -1797,7 +1797,7 @@ class Form * @return string HTML select string * @see select_dolgroups */ - function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array()) + function select_dolusers_forevent($action = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $showproperties = 0, $listofuserid = array(), $listofcontactid = array(), $listofotherid = array()) { // phpcs:enable global $conf, $user, $langs; @@ -1890,7 +1890,7 @@ class Form * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) * @return void */ - function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array()) + function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = array()) { // phpcs:enable global $langs,$conf; @@ -2032,7 +2032,7 @@ class Form * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @return array Array of keys for json */ - function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='') + function select_produits_list($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $filterkey = '', $status = 1, $finished = 2, $outputmode = 0, $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '') { // phpcs:enable global $langs,$conf,$user,$db; @@ -2324,7 +2324,7 @@ class Form * @param int $hidepriceinlabel Hide price in label * @return void */ - private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel=0) + private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel = 0) { global $langs,$conf,$user,$db; @@ -2546,7 +2546,7 @@ class Form * @param string $morecss More CSS * @return void */ - function select_produits_fournisseurs($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0, $morecss='') + function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '') { // phpcs:enable global $langs,$conf; @@ -2592,7 +2592,7 @@ class Form * @param string $morecss Add more CSS * @return array Array of keys for json */ - function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100,$alsoproductwithnosupplierprice=0,$morecss='') + function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '') { // phpcs:enable global $langs,$conf,$db; @@ -2816,7 +2816,7 @@ class Form * @param int $selected_supplier Pre-selected supplier if more than 1 result * @return void */ - function select_product_fourn_price($productid, $htmlname='productfournpriceid', $selected_supplier='') + function select_product_fourn_price($productid, $htmlname = 'productfournpriceid', $selected_supplier = '') { // phpcs:enable global $langs,$conf; @@ -2930,7 +2930,7 @@ class Form * @param int $showempty Add an empty field * @return integer|null */ - function select_address($selected, $socid, $htmlname='address_id',$showempty=0) + function select_address($selected, $socid, $htmlname = 'address_id', $showempty = 0) { // phpcs:enable // looking for users @@ -3081,7 +3081,7 @@ class Form * @param int $addempty Add empty entry * @return void */ - function selectAvailabilityDelay($selected='',$htmlname='availid',$filtertype='',$addempty=0) + function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0) { global $langs,$user; @@ -3167,7 +3167,7 @@ class Form * @param int $addempty Add an empty entry * @return void */ - function selectInputReason($selected='',$htmlname='demandreasonid',$exclude='',$addempty=0) + function selectInputReason($selected = '', $htmlname = 'demandreasonid', $exclude = '', $addempty = 0) { global $langs,$user; @@ -3263,7 +3263,7 @@ class Form * @param string $morecss Add more CSS on select tag * @return void */ - function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='') + function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '') { // phpcs:enable global $langs, $user, $conf; @@ -3310,7 +3310,7 @@ class Form * @param string $morecss Add more CSS on select tag * @return void */ - function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='') + function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '') { // phpcs:enable global $langs,$user; @@ -3364,7 +3364,7 @@ class Form * @param string $htmlname Nom de la zone select * @return string Code of HTML select to chose tax or not */ - function selectPriceBaseType($selected='',$htmlname='price_base_type') + function selectPriceBaseType($selected = '', $htmlname = 'price_base_type') { global $langs; @@ -3402,7 +3402,7 @@ class Form * @param string $moreattrib To add more attribute on select * @return void */ - function selectShippingMethod($selected='',$htmlname='shipping_method_id',$filtre='',$useempty=0,$moreattrib='') + function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '') { global $langs, $conf, $user; @@ -3455,7 +3455,7 @@ class Form * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ - function formSelectShippingMethod($page, $selected='', $htmlname='shipping_method_id', $addempty=0) + function formSelectShippingMethod($page, $selected = '', $htmlname = 'shipping_method_id', $addempty = 0) { global $langs, $db; @@ -3540,7 +3540,7 @@ class Form * @param int $showempty Add a nempty line * @return string HTML select */ - function selectUnits($selected = '', $htmlname = 'units', $showempty=0) + function selectUnits($selected = '', $htmlname = 'units', $showempty = 0) { global $langs; @@ -3591,7 +3591,7 @@ class Form * @param int $showcurrency Show currency in label * @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...) */ - function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0) + function select_comptes($selected = '', $htmlname = 'accountid', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0) { // phpcs:enable global $langs, $conf; @@ -3661,7 +3661,7 @@ class Form * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ - function formSelectAccount($page, $selected='', $htmlname='fk_account', $addempty=0) + function formSelectAccount($page, $selected = '', $htmlname = 'fk_account', $addempty = 0) { global $langs; if ($htmlname != "none") { @@ -3699,7 +3699,7 @@ class Form * @return string * @see select_categories */ - function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0) + function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $excludeafterid = 0, $outputmode = 0) { // phpcs:enable global $conf, $langs; @@ -3790,7 +3790,7 @@ class Form * @deprecated * @see formconfirm() */ - function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) + function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) { // phpcs:enable dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); @@ -3821,7 +3821,7 @@ class Form * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a section. * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form */ - function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice='', $useajax=0, $height=210, $width=500, $disableformtag=0) + function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 210, $width = 500, $disableformtag = 0) { global $langs,$conf; global $useglobalvars; @@ -4101,7 +4101,7 @@ class Form * @param int $nooutput No print is done. String is returned. * @return string Return html content */ - function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0) + function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0) { // phpcs:enable global $langs; @@ -4157,7 +4157,7 @@ class Form * @param int $addempty Add empty entry * @return void */ - function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) + function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0) { // phpcs:enable global $langs; @@ -4192,7 +4192,7 @@ class Form * @param int $addempty Ajoute entree vide * @return void */ - function form_availability($page, $selected='', $htmlname='availability', $addempty=0) + function form_availability($page, $selected = '', $htmlname = 'availability', $addempty = 0) { // phpcs:enable global $langs; @@ -4227,7 +4227,7 @@ class Form * @param int $addempty Add empty entry * @return void */ - function formInputReason($page, $selected='', $htmlname='demandreason', $addempty=0) + function formInputReason($page, $selected = '', $htmlname = 'demandreason', $addempty = 0) { global $langs; if ($htmlname != "none") @@ -4271,7 +4271,7 @@ class Form * @return string * @see selectDate */ - function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0) + function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0) { // phpcs:enable global $langs; @@ -4312,7 +4312,7 @@ class Form * @param array $include List of users id to include * @return void */ - function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='') + function form_users($page, $selected = '', $htmlname = 'userid', $exclude = '', $include = '') { // phpcs:enable global $langs; @@ -4353,7 +4353,7 @@ class Form * @param int $addempty 1=Add empty entry * @return void */ - function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1, $addempty=0) + function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0) { // phpcs:enable global $langs; @@ -4387,7 +4387,7 @@ class Form * @param string $htmlname Name of select html field * @return void */ - function form_multicurrency_code($page, $selected='', $htmlname='multicurrency_code') + function form_multicurrency_code($page, $selected = '', $htmlname = 'multicurrency_code') { // phpcs:enable global $langs; @@ -4417,7 +4417,7 @@ class Form * @param string $currency Currency code to explain the rate * @return void */ - function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='') + function form_multicurrency_rate($page, $rate = '', $htmlname = 'multicurrency_tx', $currency = '') { // phpcs:enable global $langs, $mysoc, $conf; @@ -4466,7 +4466,7 @@ class Form * @param int $discount_type 0 => customer discount, 1 => supplier discount * @return void */ - function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0) + function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter = '', $maxvalue = 0, $more = '', $hidelist = 0, $discount_type = 0) { // phpcs:enable global $conf,$langs; @@ -4557,7 +4557,7 @@ class Form * @param string $htmlname Name of HTML select. If 'none', we just show contact link. * @return void */ - function form_contacts($page, $societe, $selected='', $htmlname='contactid') + function form_contacts($page, $societe, $selected = '', $htmlname = 'contactid') { // phpcs:enable global $langs, $conf; @@ -4608,7 +4608,7 @@ class Form * @param int $nooutput No print output. Return it only. * @return void */ - function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $nooutput=0) + function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0) { // phpcs:enable global $langs; @@ -4651,7 +4651,7 @@ class Form * @deprecated * @return void */ - function select_currency($selected='',$htmlname='currency_id') + function select_currency($selected = '', $htmlname = 'currency_id') { // phpcs:enable print $this->selectCurrency($selected,$htmlname); @@ -4664,7 +4664,7 @@ class Form * @param string $htmlname name of HTML select list * @return string */ - function selectCurrency($selected='',$htmlname='currency_id') + function selectCurrency($selected = '', $htmlname = 'currency_id') { global $conf,$langs,$user; @@ -4707,7 +4707,7 @@ class Form * @param integer $useempty 1=Add empty line * @return string */ - function selectMultiCurrency($selected='', $htmlname='multicurrency_code', $useempty=0) + function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0) { global $db,$conf,$langs,$user; @@ -4844,7 +4844,7 @@ class Form * @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key * @return string */ - function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0) + function load_tva($htmlname = 'tauxtva', $selectedrate = '', $societe_vendeuse = '', $societe_acheteuse = '', $idprod = 0, $info_bits = 0, $type = '', $options_only = false, $mode = 0) { // phpcs:enable global $langs,$conf,$mysoc; @@ -5044,7 +5044,7 @@ class Form * @deprecated * @see form_date, select_month, select_year, select_dayofweek */ - function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='') + function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') { // phpcs:enable $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); @@ -5077,7 +5077,7 @@ class Form * @return string Html for selectDate * @see form_date, select_month, select_year, select_dayofweek */ - function selectDate($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $disabled=0, $fullday='', $addplusone='', $adddateof='') + function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') { global $conf,$langs; @@ -5440,7 +5440,7 @@ class Form * @param int $nooutput Do not output html string but return it * @return string|void */ - function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0) + function select_duration($prefix, $iSecond = '', $disabled = 0, $typehour = 'select', $minunderhours = 0, $nooutput = 0) { // phpcs:enable global $langs; @@ -5528,7 +5528,7 @@ class Form * @return string Return HTML string * @see selectForFormsList select_thirdparty */ - function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0) + function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0) { global $conf, $user; @@ -5598,7 +5598,7 @@ class Form * @return string Return HTML string * @see selectForForms */ - function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $outputmode=0) + function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0) { global $conf, $langs, $user; @@ -5735,7 +5735,7 @@ class Form * @return string HTML select string. * @see multiselectarray, selectArrayAjax, selectArrayFilter */ - static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0) + static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 0, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) { global $conf, $langs; @@ -5845,7 +5845,7 @@ class Form * @return string HTML select string * @see selectArrayFilter, ajax_combobox in ajax.lib.php */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0) + static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; global $delayedhtmlcontent; @@ -5947,7 +5947,7 @@ class Form * @return string HTML select string * @see selectArrayAjax, ajax_combobox in ajax.lib.php */ - static function selectArrayFilter($htmlname, $array, $id='', $moreparam='', $disableFiltering=0, $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0) + static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; global $delayedhtmlcontent; @@ -6065,7 +6065,7 @@ class Form * @return string HTML multiselect string * @see selectarray, selectArrayAjax, selectArrayFilter */ - static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='', $placeholder='', $addjscombo=-1) + static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1) { global $conf, $langs; @@ -6264,7 +6264,7 @@ class Form * @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended) * @return string String with categories */ - function showCategories($id, $type, $rendermode=0) + function showCategories($id, $type, $rendermode = 0) { global $db; @@ -6309,7 +6309,7 @@ class Form * @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action * @return int <0 if KO, >=0 if OK */ - function showLinkedObjectBlock($object, $morehtmlright='',$compatibleImportElementsList=false) + function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false) { global $conf,$langs,$hookmanager; global $bc; @@ -6457,7 +6457,7 @@ class Form * @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion. * @return string <0 if KO, >0 if OK */ - function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinksto=array()) + function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array()) { global $conf, $langs, $hookmanager; global $bc; @@ -6630,7 +6630,7 @@ class Form * @param int $useempty 1=Add empty line * @return string See option */ - function selectyesno($htmlname, $value='', $option=0, $disabled=false, $useempty=0) + function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0) { global $langs; @@ -6672,7 +6672,7 @@ class Form * @param int $useempty Affiche valeur vide dans liste * @return void */ - function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) + function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0) { // phpcs:enable $sql = "SELECT rowid, label"; @@ -6730,7 +6730,7 @@ class Form * @param string $morehtmlright More html code to show after ref. * @return string Portion HTML with ref + navigation buttons */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') + function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '') { global $langs,$conf,$hookmanager; @@ -6880,7 +6880,7 @@ class Form * @param int $width Width of photo * @return string HTML code to output barcode */ - function showbarcode(&$object,$width=100) + function showbarcode(&$object, $width = 100) { global $conf; @@ -6917,7 +6917,7 @@ class Form * @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty. * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='') + static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '') { global $conf,$langs; @@ -7076,7 +7076,7 @@ class Form * @return string * @see select_dolusers */ - function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0', $multiple=false) + function select_dolgroups($selected = '', $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -7191,7 +7191,7 @@ class Form * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes * @return string */ - function showCheckAddButtons($cssclass='checkforaction', $calljsfunction=0) + function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0) { global $conf, $langs; @@ -7230,7 +7230,7 @@ class Form * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes * @return string */ - function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0) + function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0) { $out.=$this->showFilterButtons(); if ($addcheckuncheckall) @@ -7252,7 +7252,7 @@ class Form * @param array $params param to give * @return string */ - function selectExpenseCategories($selected='', $htmlname='fk_c_exp_tax_cat', $useempty=0, $excludeid=array(), $target='', $default_selected=0, $params=array()) + function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array()) { global $db, $conf, $langs, $user; @@ -7341,7 +7341,7 @@ class Form * @param integer $useempty 1=Add empty line * @return string */ - function selectExpenseRanges($selected='', $htmlname='fk_range', $useempty=0) + function selectExpenseRanges($selected = '', $htmlname = 'fk_range', $useempty = 0) { global $db,$conf,$langs; @@ -7378,7 +7378,7 @@ class Form * @param integer $useid 0=use 'code' as key, 1=use 'id' as key * @return string */ - function selectExpense($selected='', $htmlname='fk_c_type_fees', $useempty=0, $allchoice=1, $useid=0) + function selectExpense($selected = '', $htmlname = 'fk_c_type_fees', $useempty = 0, $allchoice = 1, $useid = 0) { global $db,$langs; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 5ffaf0463a6..41476fb4966 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -70,7 +70,7 @@ class FormAccounting extends Form * @param int $disabledajaxcombo Disable ajax combo box. * @return string String with HTML select */ - function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0) + function select_journal($selectid, $htmlname = 'journal', $nature = 0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss = 'maxwidth300 maxwidthonsmartphone', $usecache = '', $disabledajaxcombo = 0) { // phpcs:enable global $conf,$langs; @@ -151,7 +151,7 @@ class FormAccounting extends Form * @param int $allcountries All countries * @return void */ - function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0) + function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { // phpcs:enable global $db,$langs,$user,$mysoc; @@ -267,7 +267,7 @@ class FormAccounting extends Form * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @return string String with HTML select */ - function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='') + function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'maxwidth300 maxwidthonsmartphone', $usecache = '') { // phpcs:enable global $conf, $langs; @@ -356,7 +356,7 @@ class FormAccounting extends Form * @param string $morecss More css * @return string String with HTML select */ - function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') + function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth200') { // phpcs:enable diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 15db641a5ec..2f345bb20e4 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -64,7 +64,7 @@ class FormActions * @param string $morecss More css on select field * @return void */ - function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100') + function form_select_status_action($formname, $selected, $canedit = 1, $htmlname = 'complete', $showempty = 0, $onlyselect = 0, $morecss = 'maxwidth100') { // phpcs:enable global $langs,$conf; @@ -168,7 +168,7 @@ class FormActions * @param string $morehtmlright More html text on right of title line * @return int <0 if KO, >=0 if OK */ - function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='', $morehtmlright='') + function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlright = '') { global $langs,$conf,$user; global $bc; @@ -327,7 +327,7 @@ class FormActions * @param int $nooutput 1=No output * @return string */ - function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) + function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0) { // phpcs:enable global $langs,$user,$form,$conf; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 350c3c747ee..ddfe8682081 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -59,7 +59,7 @@ class FormAdmin * @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @return string Return HTML select string with list of languages */ - function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0) + function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0) { // phpcs:enable global $langs; @@ -131,7 +131,7 @@ class FormAdmin * @param string $moreattrib More attributes on html select tag * @return integer|null */ - function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') + function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '') { // phpcs:enable global $langs,$conf; @@ -293,7 +293,7 @@ class FormAdmin * @param string $htmlname Nom de la zone select * @return void */ - function select_timezone($selected,$htmlname) + function select_timezone($selected, $htmlname) { // phpcs:enable global $langs,$conf; @@ -349,7 +349,7 @@ class FormAdmin * @param int $showempty Add empty value * @return string Return HTML output */ - function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0) + function select_paper_format($selected = '', $htmlname = 'paperformat_id', $filter = 0, $showempty = 0) { // phpcs:enable global $langs; diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 65a3213bad8..f7a7199ab03 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -60,7 +60,7 @@ class FormBarCode * @param int $idForm Id du formulaire * @return string HTML select string */ - function setBarcodeEncoder($selected,$barcodelist,$code_id,$idForm='formbarcode') + function setBarcodeEncoder($selected, $barcodelist, $code_id, $idForm = 'formbarcode') { global $conf, $langs; @@ -123,7 +123,7 @@ class FormBarCode * @return void * @deprecated */ - function select_barcode_type($selected='', $htmlname='barcodetype_id', $useempty=0) + function select_barcode_type($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) { // phpcs:enable print $this->selectBarcodeType($selected, $htmlname, $useempty); @@ -137,7 +137,7 @@ class FormBarCode * @param int $useempty Display empty value in select * @return string */ - function selectBarcodeType($selected='', $htmlname='barcodetype_id', $useempty=0) + function selectBarcodeType($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) { global $langs, $conf; @@ -193,7 +193,7 @@ class FormBarCode * @return void * @deprecated */ - function form_barcode_type($page, $selected='', $htmlname='barcodetype_id') + function form_barcode_type($page, $selected = '', $htmlname = 'barcodetype_id') { // phpcs:enable print $this->formBarcodeType($page, $selected, $htmlname); @@ -207,7 +207,7 @@ class FormBarCode * @param string $htmlname Nom du formulaire select * @return string */ - function formBarcodeType($page, $selected='', $htmlname='barcodetype_id') + function formBarcodeType($page, $selected = '', $htmlname = 'barcodetype_id') { global $langs, $conf; $out = ''; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index edeab6a5983..e1315a9b244 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -60,7 +60,7 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types */ - function typent_array($mode=0, $filter='') + function typent_array($mode = 0, $filter = '') { // phpcs:enable global $langs,$mysoc; @@ -103,7 +103,7 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types d'effectifs */ - function effectif_array($mode=0, $filter='') + function effectif_array($mode = 0, $filter = '') { // phpcs:enable $effs = array(); @@ -145,7 +145,7 @@ class FormCompany * @param int $empty Add empty value in list * @return void */ - function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0) + function form_prospect_level($page, $selected = '', $htmlname = 'prospect_level_id', $empty = 0) { // phpcs:enable global $user, $langs; @@ -199,7 +199,7 @@ class FormCompany * @param string $htmlname Id of department * @return void */ - function select_departement($selected='',$country_codeid=0, $htmlname='state_id') + function select_departement($selected = '', $country_codeid = 0, $htmlname = 'state_id') { // phpcs:enable print $this->select_state($selected,$country_codeid, $htmlname); @@ -219,7 +219,7 @@ class FormCompany * @return string String with HTML select * @see select_country */ - function select_state($selected='',$country_codeid=0, $htmlname='state_id') + function select_state($selected = '', $country_codeid = 0, $htmlname = 'state_id') { // phpcs:enable global $conf,$langs,$user; @@ -332,7 +332,7 @@ class FormCompany * @param string $htmlname Name of HTML select field * @return void */ - function select_region($selected='',$htmlname='region_id') + function select_region($selected = '', $htmlname = 'region_id') { // phpcs:enable global $conf,$langs; @@ -398,7 +398,7 @@ class FormCompany * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ - function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') + function select_civility($selected = '', $htmlname = 'civility_id', $morecss = 'maxwidth100') { // phpcs:enable global $conf,$langs,$user; @@ -459,7 +459,7 @@ class FormCompany * @deprecated Use print xxx->select_juridicalstatus instead * @see select_juridicalstatus() */ - function select_forme_juridique($selected='', $country_codeid=0, $filter='') + function select_forme_juridique($selected = '', $country_codeid = 0, $filter = '') { // phpcs:enable print $this->select_juridicalstatus($selected, $country_codeid, $filter); @@ -476,7 +476,7 @@ class FormCompany * @param string $htmlname HTML name of select * @return string String with HTML select */ - function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code') + function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code') { // phpcs:enable global $conf,$langs,$user; @@ -581,7 +581,7 @@ class FormCompany * @param string $morecss More CSS on select component * @return int The selected third party ID */ - function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='', $morecss='') + function selectCompaniesForNewContact($object, $var_id, $selected = '', $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '') { global $conf, $langs; @@ -740,7 +740,7 @@ class FormCompany * @param string $morecss Add more css to select component * @return void */ - function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $sortorder='position', $showempty=0, $morecss='') + function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '') { global $user, $langs; @@ -774,7 +774,7 @@ class FormCompany * @param string $morecss More css * @return string */ - function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') + function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = '', $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '') { // phpcs:enable global $conf; @@ -805,7 +805,7 @@ class FormCompany * @param string $morecss More css * @return string HTML string with prof id */ - function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent') + function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent') { // phpcs:enable global $conf,$langs; diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index be028b5fe14..862c1e56b23 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -60,7 +60,7 @@ class FormContract * @param int $showempty Show empty line * @return int Nbr of project if OK, <0 if KO */ - function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1) { // phpcs:enable global $db,$user,$conf,$langs; @@ -177,7 +177,7 @@ class FormContract * @param int $showempty Show empty line * @return int Nbr of project if OK, <0 if KO */ - function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1) { global $langs; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 94747481cb0..13cf88e9aa2 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -58,7 +58,7 @@ class FormCron extends Form * @param integer $readonly Select is read only or not * @return string HTML select field */ - function select_typejob($htmlname,$selected=0,$readonly=0) + function select_typejob($htmlname, $selected = 0, $readonly = 0) { // phpcs:enable global $langs; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5bb922d43ed..8261b737e43 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -77,7 +77,7 @@ class FormFile * @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @return int <0 if KO, >0 if OK */ - function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='') + function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '') { // phpcs:enable global $conf,$langs, $hookmanager; @@ -255,7 +255,7 @@ class FormFile * @return int <0 if KO, number of shown files if OK * @deprecated Use print xxx->showdocuments() instead. */ - function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + function show_documents($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '') { // phpcs:enable $this->numoffiles=0; @@ -288,7 +288,7 @@ class FormFile * @param int $hideifempty Hide section of generated files if there is no file * @return string Output string with HTML array of documents (might be empty string) */ - function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null,$hideifempty=0) + function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0) { // Deprecation warning if (! empty($iconPDF)) { @@ -887,7 +887,7 @@ class FormFile * @param string $filter Filter filenames on this regex string (Example: '\.pdf$') * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles */ - function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter='') + function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '') { global $conf, $langs; @@ -1022,7 +1022,7 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_autoecmfiles */ - function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) + function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0) { // phpcs:enable global $user, $conf, $langs, $hookmanager; @@ -1412,7 +1412,7 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_documents */ - function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) + function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permtodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0) { // phpcs:enable global $user, $conf, $langs, $form; @@ -1695,7 +1695,7 @@ class FormFile * @param string $param More param to add into URL * @return int Number of links */ - public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') + public function listOfLinks($object, $permtodelete = 1, $action = null, $selected = null, $param = '') { global $user, $conf, $langs, $user; global $sortfield, $sortorder; @@ -1831,7 +1831,7 @@ class FormFile * @param string $param More param on http links * @return string $out Output string with HTML */ - public function showPreview($file, $modulepart, $relativepath, $ruleforpicto=0, $param='') + public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '') { global $langs, $conf; diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index ae35b74fad9..a9602f8a158 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -60,7 +60,7 @@ class FormIntervention * @param int $showempty Show empty line * @return int Nbre of project if OK, <0 if KO */ - function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1) + function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1) { // phpcs:enable global $db,$user,$conf,$langs; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 4c0f4bd2953..6a5cfea92d9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -183,7 +183,7 @@ class FormMail extends Form * @param string $type Mime type (can be dol_mimetype($file)) * @return void */ - function add_attached_files($path, $file='', $type='') + function add_attached_files($path, $file = '', $type = '') { // phpcs:enable $listofpaths=array(); @@ -268,7 +268,7 @@ class FormMail extends Form * @param string $removefileaction Name of action when removing file attachments * @return void */ - function show_form($addfileaction='addfile',$removefileaction='removefile') + function show_form($addfileaction = 'addfile', $removefileaction = 'removefile') { // phpcs:enable print $this->get_form($addfileaction,$removefileaction); @@ -285,7 +285,7 @@ class FormMail extends Form * @param string $removefileaction Name of action when removing file attachments * @return string Form to show */ - function get_form($addfileaction='addfile', $removefileaction='removefile') + function get_form($addfileaction = 'addfile', $removefileaction = 'removefile') { // phpcs:enable global $conf, $langs, $user, $hookmanager, $form; @@ -1143,7 +1143,7 @@ class FormMail extends Form * @param string $label Label of template * @return ModelMail One instance of ModelMail */ - public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1, $label='') + public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '') { $ret = new ModelMail(); @@ -1267,7 +1267,7 @@ class FormMail extends Form * @param int $active 1=Only active template, 0=Only disabled, -1=All * @return int <0 if KO, nb of records found if OK */ - public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active=1) + public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active = 1) { $ret=array(); @@ -1378,7 +1378,7 @@ class FormMail extends Form * @param Object $object Object if applicable * @return array Array of substitution values for emails. */ - static function getAvailableSubstitKey($mode='formemail', $object=null) + static function getAvailableSubstitKey($mode = 'formemail', $object = null) { global $conf, $langs; diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index 067692f5094..95c2c057b40 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -40,7 +40,7 @@ class FormMailing extends Form * @param integer $show_empty Show empty option * @return string HTML select */ - public function selectDestinariesStatus($selectedid='', $htmlname='dest_status', $show_empty=0) + public function selectDestinariesStatus($selectedid = '', $htmlname = 'dest_status', $show_empty = 0) { global $langs; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index cdd827145b0..8492237d68f 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -59,7 +59,7 @@ class FormMargin * @param boolean $force_price True of not * @return array Array with info */ - function getMarginInfosArray($object, $force_price=false) + function getMarginInfosArray($object, $force_price = false) { global $conf, $db; @@ -191,7 +191,7 @@ class FormMargin * @param boolean $force_price Force price * @return void */ - function displayMarginInfos($object, $force_price=false) + function displayMarginInfos($object, $force_price = false) { global $langs, $conf, $user; diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 781b3f76e4f..c16f292d10d 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -39,7 +39,7 @@ class FormOrder extends Form * @param string $hmlname Name of HTML select element * @return void */ - public function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status') + public function selectSupplierOrderStatus($selected = '', $short = 0, $hmlname = 'order_status') { $options = array(); @@ -74,7 +74,7 @@ class FormOrder extends Form * @param int $addempty 0=list with no empty value, 1=list with empty value * @return array Tableau des sources de commandes */ - public function selectInputMethod($selected='',$htmlname='source_id',$addempty=0) + public function selectInputMethod($selected = '', $htmlname = 'source_id', $addempty = 0) { global $langs; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8ca0b988fda..ce3fe126a51 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -67,7 +67,7 @@ class FormOther * @param int $fk_user Utilisateur créant le modèle * @return void */ - function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null) + function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null) { // phpcs:enable $sql = "SELECT rowid, label"; @@ -119,7 +119,7 @@ class FormOther * @param int $useempty Affiche valeur vide dans liste * @return void */ - function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0) + function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0) { // phpcs:enable $sql = "SELECT rowid, label"; @@ -168,7 +168,7 @@ class FormOther * @param string $htmlname Name of combo list * @return integer */ - function select_ecotaxes($selected='', $htmlname='ecotaxe_id') + function select_ecotaxes($selected = '', $htmlname = 'ecotaxe_id') { // phpcs:enable global $langs; @@ -227,7 +227,7 @@ class FormOther * @param string $country_code Country Code * @return string HTML select list */ - function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='') + function select_revenue_stamp($selected = '', $htmlname = 'revenuestamp', $country_code = '') { // phpcs:enable global $langs; @@ -290,7 +290,7 @@ class FormOther * @param int $showempty Add also an empty line * @return string HTML select string */ - function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0) + function select_percent($selected = 0, $htmlname = 'percent', $disabled = 0, $increment = 5, $start = 0, $end = 100, $showempty = 0) { // phpcs:enable $return = ''; @@ -328,7 +328,7 @@ class FormOther * @return string Html combo list code * @see select_all_categories */ - function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='') + function select_categories($type, $selected = 0, $htmlname = 'search_categ', $nocateg = 0, $showempty = 1, $morecss = '') { // phpcs:enable global $conf, $langs; @@ -389,7 +389,7 @@ class FormOther * @param string $morecss More CSS * @return string Html combo list code */ - function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='') + function select_salesrepresentatives($selected, $htmlname, $user, $showstatus = 0, $showempty = 1, $morecss = '') { // phpcs:enable global $conf,$langs; @@ -490,7 +490,7 @@ class FormOther * @param string $morecss More css * @return void */ - function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_parent', $modeproject=0, $modetask=0, $mode=0, $useempty=0, $disablechildoftaskid=0, $filteronprojstatus='', $morecss='') + function selectProjectTasks($selectedtask = '', $projectid = 0, $htmlname = 'task_parent', $modeproject = 0, $modetask = 0, $mode = 0, $useempty = 0, $disablechildoftaskid = 0, $filteronprojstatus = '', $morecss = '') { global $user, $langs; @@ -528,7 +528,7 @@ class FormOther * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id * @return void */ - private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0) + private function _pLineSelect(&$inc, $parent, $lines, $level = 0, $selectedtask = 0, $selectedproject = 0, $disablechildoftaskid = 0) { global $langs, $user, $conf; @@ -621,7 +621,7 @@ class FormOther * @return string HTML code for color thumb * @see selectColor */ - static function showColor($color, $textifnotdefined='') + static function showColor($color, $textifnotdefined = '') { $textcolor='FFF'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -646,7 +646,7 @@ class FormOther * @deprecated Use instead selectColor * @see selectColor() */ - function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='') + function select_color($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '') { // phpcs:enable print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors); @@ -664,7 +664,7 @@ class FormOther * @return string * @see showColor */ - static function selectColor($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='', $morecss='') + static function selectColor($set_color = '', $prefix = 'f_color', $form_name = '', $showcolorbox = 1, $arrayofcolors = '', $morecss = '') { // Deprecation warning if ($form_name) { @@ -763,7 +763,7 @@ class FormOther * @param int $y Hauteur de l'image en pixels * @return void */ - function CreateColorIcon($color,$module,$name,$x='12',$y='12') + function CreateColorIcon($color, $module, $name, $x = '12', $y = '12') { // phpcs:enable global $conf; @@ -802,7 +802,7 @@ class FormOther * @param int $useempty Affiche valeur vide dans liste * @return string */ - function select_dayofweek($selected='',$htmlname='weekid',$useempty=0) + function select_dayofweek($selected = '', $htmlname = 'weekid', $useempty = 0) { // phpcs:enable global $langs; @@ -850,7 +850,7 @@ class FormOther * @param string $morecss More Css * @return string */ - function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='') + function select_month($selected = '', $htmlname = 'monthid', $useempty = 0, $longlabel = 0, $morecss = '') { // phpcs:enable global $langs; @@ -897,7 +897,7 @@ class FormOther * @param string $morecss More CSS * @return string */ - function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') + function select_year($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto') { // phpcs:enable print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss); @@ -917,7 +917,7 @@ class FormOther * @param string $morecss More css * @return string */ - function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') + function selectyear($selected = '', $htmlname = 'yearid', $useempty = 0, $min_year = 10, $max_year = 5, $offset = 0, $invert = 0, $option = '', $morecss = 'valignmiddle widthauto') { $out=''; @@ -968,7 +968,7 @@ class FormOther * @param int $originid Id de l'origine * @return void */ - function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='') + function form_address($page, $selected, $socid, $htmlname = 'address_id', $origin = '', $originid = '') { // phpcs:enable global $langs,$conf; @@ -1011,7 +1011,7 @@ class FormOther * @param String $areacode Code of area for pages ('0'=value for Home page) * @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>) */ - static function getBoxesArea($user,$areacode) + static function getBoxesArea($user, $areacode) { global $conf,$langs,$db; @@ -1231,7 +1231,7 @@ class FormOther * @param string $moreattrib More attributes on HTML select tag * @return void */ - function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='') + function select_dictionary($htmlname, $dictionarytable, $keyfield = 'code', $labelfield = 'label', $selected = '', $useempty = 0, $moreattrib = '') { // phpcs:enable global $langs, $conf; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 299de827dca..15deb48da01 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -71,7 +71,7 @@ class FormProjets * @param int $htmlid Html id to use instead of htmlname * @return string Return html content */ - function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='', $htmlid='') + function select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '') { // phpcs:enable global $langs,$conf,$form; @@ -140,7 +140,7 @@ class FormProjets * @param string $morecss More CSS * @return int Nb of project if OK, <0 if KO */ - function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0, $forceaddid=0, $htmlid='', $morecss='maxwidth500') + function select_projects_list($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500') { // phpcs:enable global $user,$conf,$langs; @@ -320,7 +320,7 @@ class FormProjets * @param User $usertofilter User object to use for filtering * @return int Nbr of project if OK, <0 if KO */ - function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null) + function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null) { global $user,$conf,$langs; @@ -488,7 +488,7 @@ class FormProjets * @param string $projectkey Equivalent key to fk_projet for actual table_element * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet") + function select_element($table_element, $socid = 0, $morecss = '', $limitonstatus = -2, $projectkey = "fk_projet") { // phpcs:enable global $conf, $langs; @@ -618,7 +618,7 @@ class FormProjets * @param string $morecss Add more css * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - function selectOpportunityStatus($htmlname, $preselected='-1', $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0, $morecss='') + function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '') { global $conf, $langs; diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index c4ac522d98a..1f4fad0829c 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -60,7 +60,7 @@ class FormPropal * @param string $htmlname Name of select field * @return void */ - function selectProposalStatus($selected='',$short=0, $excludedraft=0, $showempty=1, $mode='customer',$htmlname='propal_statut') + function selectProposalStatus($selected = '', $short = 0, $excludedraft = 0, $showempty = 1, $mode = 'customer', $htmlname = 'propal_statut') { global $langs; diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index cde7d0b61d2..416b68c71aa 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -100,7 +100,7 @@ class FormSms * @param int $showform Show form tags and submit button (recommanded is to use with value 0) * @return void */ - function show_form($morecss='titlefield', $showform=1) + function show_form($morecss = 'titlefield', $showform = 1) { // phpcs:enable global $conf, $langs, $user, $form; diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 99e36878390..9f9ed7ab1d2 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -61,7 +61,7 @@ class FormSocialContrib * @param string $morecss Add more CSS on select * @return void */ - function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300') + function select_type_socialcontrib($selected = '', $htmlname = 'actioncode', $useempty = 0, $maxlen = 40, $help = 1, $morecss = 'minwidth300') { // phpcs:enable global $conf,$db,$langs,$user,$mysoc; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 6c4a9703014..a04032463c9 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -124,7 +124,7 @@ class FormTicket * @param int $withdolfichehead With dol_fiche_head * @return void */ - public function showForm($withdolfichehead=0) + public function showForm($withdolfichehead = 0) { global $conf, $langs, $user, $hookmanager; @@ -431,7 +431,7 @@ class FormTicket * @param string $morecss More CSS * @return void */ - public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss='') + public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') { global $langs, $user; @@ -531,7 +531,7 @@ class FormTicket * @param string $morecss More CSS * @return void */ - public function selectCategoriesTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss='') + public function selectCategoriesTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') { global $langs, $user; @@ -632,7 +632,7 @@ class FormTicket * @param string $morecss More CSS * @return void */ - public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss='') + public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') { global $langs, $user; diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index f5feccd5860..fea4f34332c 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -54,7 +54,7 @@ class FormWebsite * @param int $useempty Show empty value or not * @return string Html component */ - function selectWebsite($selected='',$htmlname='exportmodelid',$useempty=0) + function selectWebsite($selected = '', $htmlname = 'exportmodelid', $useempty = 0) { $out=''; @@ -107,7 +107,7 @@ class FormWebsite * @param string $moreattrib More attributes on HTML select tag * @return void */ - function selectTypeOfContainer($htmlname, $selected='', $useempty=0, $moreattrib='') + function selectTypeOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '') { global $langs, $conf, $user; @@ -170,7 +170,7 @@ class FormWebsite * @param string $moreattrib More attributes on HTML select tag * @return void */ - function selectSampleOfContainer($htmlname, $selected='', $useempty=0, $moreattrib='') + function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '') { global $langs, $conf, $user; diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index dedf3ec384f..0a97429be44 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -48,7 +48,7 @@ class InfoBox * @param int $includehidden Include also hidden boxes * @return array Array of boxes */ - static function listBoxes($db, $mode, $zone, $user=null, $excludelist=array(), $includehidden=1) + static function listBoxes($db, $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1) { global $conf; @@ -186,7 +186,7 @@ class InfoBox * @param int $userid Id of user * @return int <0 if KO, 0=Nothing done, > 0 if OK */ - static function saveboxorder($db, $zone,$boxorder,$userid=0) + static function saveboxorder($db, $zone, $boxorder, $userid = 0) { global $conf; diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 7a19546dfb3..1c488483be3 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -65,7 +65,7 @@ class Interfaces * @param Conf $conf Objet conf * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. */ - function run_triggers($action,$object,$user,$langs,$conf) + function run_triggers($action, $object, $user, $langs, $conf) { // phpcs:enable // Check parameters @@ -241,7 +241,7 @@ class Interfaces * @param array $forcedirtriggers null=All default directories. This parameter is used by modulebuilder module only. * @return array Array list of triggers */ - function getTriggersList($forcedirtriggers=null) + function getTriggersList($forcedirtriggers = null) { global $conf, $langs, $db; diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 8c42d691d39..2c845440ec1 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -333,7 +333,7 @@ class Ldap * @param string $pass Password * @return boolean true or false */ - function bindauth($bindDn,$pass) + function bindauth($bindDn, $pass) { if (! $this->result = @ldap_bind($this->connection, $bindDn, $pass)) { @@ -569,7 +569,7 @@ class Ldap * @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) (for ldap_rename) * @return int <0 if KO, >0 if OK */ - function update($dn, $info, $user, $olddn, $newrdn=false, $newparent=false) + function update($dn, $info, $user, $olddn, $newrdn = false, $newparent = false) { global $conf; @@ -741,7 +741,7 @@ class Ldap * @param int $timeout Timeout in second (default 1s) * @return boolean true or false */ - function serverPing($host, $port=389, $timeout=1) + function serverPing($host, $port = 389, $timeout = 1) { // Replace ldaps:// by ssl:// if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/',$host, $regs)) { @@ -925,7 +925,7 @@ class Ldap * @param string $filter Filter * @return int|array <0 or false if KO, array if OK */ - function getAttribute($dn,$filter) + function getAttribute($dn, $filter) { // Check parameters if (! $this->connection) @@ -970,7 +970,7 @@ class Ldap * @param string $attribute Attributes * @return void */ - function getAttributeValues($filterrecord,$attribute) + function getAttributeValues($filterrecord, $attribute) { $attributes=array(); $attributes[0] = $attribute; @@ -1015,7 +1015,7 @@ class Ldap * @param array $attributeAsArray Array of fields wanted as an array not a string * @return array Array of [id_record][ldap_field]=value */ - function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0, $attributeAsArray=array()) + function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter = 0, $attributeAsArray = array()) { $fulllist=array(); @@ -1260,7 +1260,7 @@ class Ldap * Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com) * @return int >0 if OK, <0 if KO */ - function fetch($user,$filter) + function fetch($user, $filter) { // Perform the search and get the entry handles @@ -1463,7 +1463,7 @@ class Ldap * @param string $pagecodefrom Page code of src string * @return string Converted string */ - private function convToOutputCharset($str,$pagecodefrom='UTF-8') + private function convToOutputCharset($str, $pagecodefrom = 'UTF-8') { global $conf; if ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_encode($str); @@ -1478,7 +1478,7 @@ class Ldap * @param string $pagecodeto Page code for result string * @return string Converted string */ - function convFromOutputCharset($str,$pagecodeto='UTF-8') + function convFromOutputCharset($str, $pagecodeto = 'UTF-8') { global $conf; if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str); @@ -1493,7 +1493,7 @@ class Ldap * @param string $keygroup Key of group * @return int gid number */ - function getNextGroupGid($keygroup='LDAP_KEY_GROUPS') + function getNextGroupGid($keygroup = 'LDAP_KEY_GROUPS') { global $conf; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 8413725ab11..82069e10204 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -72,7 +72,7 @@ class Link extends CommonObject * @param User $user Object of user that ask creation * @return int >= 0 if OK, < 0 if KO */ - public function create($user='') + public function create($user = '') { global $langs,$conf; @@ -156,7 +156,7 @@ class Link extends CommonObject * @param int $call_trigger 0=no, 1=yes * @return int <0 if KO, >=0 if OK */ - public function update($user='', $call_trigger=1) + public function update($user = '', $call_trigger = 1) { global $langs,$conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -241,7 +241,7 @@ class Link extends CommonObject * @param string $sortorder sort order * @return int 1 if ok, 0 if no records, -1 if error **/ - public function fetchAll(&$links, $objecttype, $objectid, $sortfield=null, $sortorder=null) + public function fetchAll(&$links, $objecttype, $objectid, $sortfield = null, $sortorder = null) { global $conf; @@ -315,7 +315,7 @@ class Link extends CommonObject * @param int $rowid Id of link to load * @return int 1 if ok, 0 if no record found, -1 if error **/ - public function fetch($rowid=null) + public function fetch($rowid = null) { global $conf; diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 3d9d92189a3..872f871b202 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -65,7 +65,7 @@ class Menu * @param string $prefix Prefix to title (image or picto) * @return void */ - function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0, $id='', $idsel='', $classname='', $prefix='') + function add($url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '') { $this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix); } @@ -88,7 +88,7 @@ class Menu * @param string $prefix Prefix to title (image or picto) * @return void */ - function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0, $id='', $idsel='', $classname='', $prefix='') + function insert($idafter, $url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '') { $array_start = array_slice($this->liste,0,($idafter+1)); $array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix)); diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 15c22116d46..6d6f8471721 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -91,7 +91,7 @@ class Menubase * @param DoliDB $db Database handler * @param string $menu_handler Menu handler */ - function __construct($db,$menu_handler='') + function __construct($db, $menu_handler = '') { $this->db = $db; $this->menu_handler = $menu_handler; @@ -105,7 +105,7 @@ class Menubase * @param User $user User that create * @return int <0 if KO, Id of record if OK */ - function create($user=null) + function create($user = null) { global $conf, $langs; @@ -245,7 +245,7 @@ class Menubase * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -310,7 +310,7 @@ class Menubase * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index e7cd7cabe53..e5616c31c40 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -105,7 +105,7 @@ class Notify * @param Object $object Object the notification is about * @return string Message */ - function confirmMessage($action,$socid,$object) + function confirmMessage($action, $socid, $object) { global $langs; $langs->load("mails"); @@ -146,7 +146,7 @@ class Notify * @param array $scope Scope where to search * @return array|int <0 if KO, array of notifications to send if OK */ - function getNotificationsArray($notifcode, $socid=0, $object=null, $userid=0, $scope=array('thirdparty', 'user', 'global')) + function getNotificationsArray($notifcode, $socid = 0, $object = null, $userid = 0, $scope = array('thirdparty', 'user', 'global')) { global $conf, $user; @@ -309,7 +309,7 @@ class Notify * @param array $mimefilename_list List of attached file name in message * @return int <0 if KO, or number of changes if OK */ - function send($notifcode, $object, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array()) + function send($notifcode, $object, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array()) { global $user,$conf,$langs,$mysoc; global $hookmanager; diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php index 48de42ad847..2254ec25cf2 100644 --- a/htdocs/core/class/openid.class.php +++ b/htdocs/core/class/openid.class.php @@ -301,7 +301,7 @@ class SimpleOpenID * @param string $params Params * @return boolean|unknown */ - function FSOCK_Request($url, $method="GET", $params = "") + function FSOCK_Request($url, $method = "GET", $params = "") { // phpcs:enable $fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds @@ -335,7 +335,7 @@ class SimpleOpenID * @param string $params Params * @return string */ - function CURL_Request($url, $method="GET", $params = "") + function CURL_Request($url, $method = "GET", $params = "") { // phpcs:enable // Remember, SSL MUST BE SUPPORTED @@ -394,7 +394,7 @@ class SimpleOpenID * @param string $url Url to found endpoint * @return string Endpoint */ - function GetOpenIDServer($url='') + function GetOpenIDServer($url = '') { // phpcs:enable global $conf; @@ -518,7 +518,7 @@ class SimpleOpenID * @param string $url Url of endpoint to request * @return string First endpoint OpenID server found. False if it failed to found. */ - function sendDiscoveryRequestToGetXRDS($url='') + function sendDiscoveryRequestToGetXRDS($url = '') { global $conf; diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 454d8281770..c27a5a71f41 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -184,7 +184,7 @@ class RssParser * @param string $cachedir Directory where to save cache file * @return int <0 if KO, >0 if OK */ - public function parser($urlRSS, $maxNb=0, $cachedelay=60, $cachedir='') + public function parser($urlRSS, $maxNb = 0, $cachedelay = 60, $cachedir = '') { global $conf; @@ -666,7 +666,7 @@ class RssParser * @param string $str2 Str2 * @return string String cancatenated */ - function concat(&$str1, $str2="") + function concat(&$str1, $str2 = "") { if (!isset($str1) ) { $str1=""; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 780be1ba441..e83e83dde83 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -310,7 +310,7 @@ class SMTPs * @param boolean $_part Variant * @return string Errors to */ - function getErrorsTo($_part = true ) + function getErrorsTo($_part = true) { $_retValue = ''; @@ -328,7 +328,7 @@ class SMTPs * @param boolean $_vDebug Value for debug * @return void */ - function setDebug($_vDebug = false ) + function setDebug($_vDebug = false) { $this->_debug = $_vDebug; } @@ -1659,7 +1659,7 @@ class SMTPs * @param integer $_value Message Priority * @return void */ - function setPriority( $_value = 3 ) + function setPriority($_value = 3) { if ( ( is_numeric($_value) ) && ( ( $_value >= 0 ) && ( $_value <= 5 ) ) ) @@ -1748,7 +1748,7 @@ class SMTPs * @param string $type Type of boundary * @return string $_smtpsBoundary MIME message Boundary */ - function _getBoundary($type='mixed') + function _getBoundary($type = 'mixed') { if ($type == 'mixed') return $this->_smtpsBoundary; elseif ($type == 'related') return $this->_smtpsRelatedBoundary; @@ -1807,7 +1807,7 @@ class SMTPs * @param string $CRLF CRLF * @return boolean|null True or false */ - function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) + function socket_send_str($_strSend, $_returnCode = null, $CRLF = "\r\n") { // phpcs:enable if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log @@ -1828,7 +1828,7 @@ class SMTPs * @param string $_errMsg Error Message * @return void */ - function _setErr( $_errNum, $_errMsg ) + function _setErr($_errNum, $_errMsg) { $this->_smtpsErrors[] = array( 'num' => $_errNum, diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 90986e7b6da..eab2ef70e8a 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -42,7 +42,7 @@ abstract class Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay=0, $format=0) + function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0) { global $conf,$user,$langs; @@ -136,7 +136,7 @@ abstract class Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of values */ - function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay=0, $format=0) + function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $format = 0) { global $conf,$user,$langs; @@ -228,7 +228,7 @@ abstract class Stats * @param int $startyear End year * @return array Array of values */ - function getAverageByMonthWithPrevYear($endyear,$startyear) + function getAverageByMonthWithPrevYear($endyear, $startyear) { if ($startyear > $endyear) return -1; @@ -264,7 +264,7 @@ abstract class Stats * @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) * @return array Array of values */ - function getAllByProductEntry($year,$cachedelay=0) + function getAllByProductEntry($year, $cachedelay = 0) { global $conf,$user,$langs; @@ -413,7 +413,7 @@ abstract class Stats * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month * @return array Array of nb each month */ - function _getNbByMonth($year, $sql, $format=0) + function _getNbByMonth($year, $sql, $format = 0) { global $langs; @@ -470,7 +470,7 @@ abstract class 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 */ - function _getAmountByMonth($year, $sql, $format=0) + function _getAmountByMonth($year, $sql, $format = 0) { global $langs; @@ -524,7 +524,7 @@ abstract class 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 */ - function _getAverageByMonth($year, $sql, $format=0) + function _getAverageByMonth($year, $sql, $format = 0) { global $langs; @@ -577,7 +577,7 @@ abstract class Stats * @param int $limit Limit * @return array */ - function _getAllByProduct($sql, $limit=10) + function _getAllByProduct($sql, $limit = 10) { global $langs; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 2c1683fd68c..2b3e0ed66a5 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -62,7 +62,7 @@ class Translate * @param string $srclang Language to use. If '' or 'auto', we use browser lang. * @return void */ - function setDefaultLang($srclang='en_US') + function setDefaultLang($srclang = 'en_US') { global $conf; @@ -132,7 +132,7 @@ class Translate * @param int $mode 0=Long language code, 1=Short language code (en, fr, es, ...) * @return string Language code used (en_US, en_AU, fr_FR, ...) */ - function getDefaultLang($mode=0) + function getDefaultLang($mode = 0) { if (empty($mode)) return $this->defaultlang; else return substr($this->defaultlang,0,2); @@ -173,7 +173,7 @@ class Translate * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK * @see loadLangs */ - function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfileonly=0) + function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0) { global $conf,$db; @@ -594,7 +594,7 @@ class Translate * @param int $maxsize Max length of text * @return string Translated string (encoded into HTML entities and UTF8) */ - function trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0) + function trans($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $maxsize = 0) { global $conf; @@ -655,7 +655,7 @@ class Translate * @param string $param5 chaine de param5 * @return string Translated string (encoded into UTF8) */ - function transnoentities($key, $param1='', $param2='', $param3='', $param4='', $param5='') + function transnoentities($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '') { return $this->convToOutputCharset($this->transnoentitiesnoconv($key, $param1, $param2, $param3, $param4, $param5)); } @@ -676,7 +676,7 @@ class Translate * @param string $param5 chaine de param5 * @return string Translated string */ - function transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='', $param5='') + function transnoentitiesnoconv($key, $param1 = '', $param2 = '', $param3 = '', $param4 = '', $param5 = '') { global $conf; @@ -747,7 +747,7 @@ class Translate * @param string $pagecodefrom Page code of src string * @return string Converted string */ - function convToOutputCharset($str,$pagecodefrom='UTF-8') + function convToOutputCharset($str, $pagecodefrom = 'UTF-8') { if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') $str=utf8_encode($str); if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') $str=utf8_decode(str_replace('€',chr(128),$str)); @@ -764,7 +764,7 @@ class Translate * @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code * @return array List of languages */ - function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0) + function get_available_languages($langdir = DOL_DOCUMENT_ROOT, $maxlength = 0, $usecode = 0) { // phpcs:enable global $conf; @@ -804,7 +804,7 @@ class Translate * @param integer $searchalt Search also alernate language file * @return boolean true if exists and readable */ - function file_exists($filename,$searchalt=0) + function file_exists($filename, $searchalt = 0) { // phpcs:enable // Test si fichier dans repertoire de la langue @@ -836,7 +836,7 @@ class Translate * 10 if setDefaultLang was en_US => ten * 123 if setDefaultLang was fr_FR => cent vingt trois */ - function getLabelFromNumber($number,$isamount=0) + function getLabelFromNumber($number, $isamount = 0) { global $conf; @@ -879,7 +879,7 @@ class Translate * @return string Label in UTF8 (but without entities) * @see dol_getIdFromCode */ - function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel,$keyforselect='',$filteronentity=0) + function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect = '', $filteronentity = 0) { // If key empty if ($key == '') return ''; @@ -947,7 +947,7 @@ class Translate * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. * @return string Currency symbol encoded into UTF8 */ - function getCurrencySymbol($currency_code, $forceloadall=0) + function getCurrencySymbol($currency_code, $forceloadall = 0) { $currency_sign = ''; // By default return iso code diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9061539a804..b9720c400a6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -53,7 +53,7 @@ class Utils * @param string $choice Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than 24h, 'allfiles', 'logfile') * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - function purgeFiles($choice='tempfilesold') + function purgeFiles($choice = 'tempfilesold') { global $conf, $langs, $dolibarr_main_data_root; @@ -182,7 +182,7 @@ class Utils * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - function dumpDatabase($compression='none', $type='auto', $usedefault=1, $file='auto', $keeplastnfiles=0, $execmethod=0) + function dumpDatabase($compression = 'none', $type = 'auto', $usedefault = 1, $file = 'auto', $keeplastnfiles = 0, $execmethod = 0) { global $db, $conf, $langs, $dolibarr_main_data_root; global $dolibarr_main_db_name, $dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_port, $dolibarr_main_db_pass; @@ -501,7 +501,7 @@ class Utils * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method * @return array array('result'=>...,'output'=>...,'error'=>...). result = 0 means OK. */ - function executeCLI($command, $outputfile, $execmethod=0) + function executeCLI($command, $outputfile, $execmethod = 0) { global $conf, $langs; @@ -835,7 +835,7 @@ class Utils * @param string $tables Table name or '*' for all * @return int <0 if KO, >0 if OK */ - function backupTables($outputfile, $tables='*') + function backupTables($outputfile, $tables = '*') { global $db, $langs; global $errormsg; diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 27144c9293a..9cb98f4838e 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -42,7 +42,7 @@ function encode($string) * @param int $line_max Max length of lines * @return string Encoded string */ -function dol_quoted_printable_encode($input, $line_max=76) +function dol_quoted_printable_encode($input, $line_max = 76) { $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); $lines = preg_split("/(\?:\r\n|\r|\n)/", $input); @@ -98,7 +98,7 @@ class vCard * @param string $type Type * @return void */ - function setPhoneNumber($number, $type="") + function setPhoneNumber($number, $type = "") { // type may be PREF | WORK | HOME | VOICE | FAX | MSG | CELL | PAGER | BBS | CAR | MODEM | ISDN | VIDEO or any senseful combination, e.g. "PREF;WORK;VOICE" $key = "TEL"; @@ -142,7 +142,7 @@ class vCard * @param string $suffix Suffix * @return void */ - function setName($family="", $first="", $additional="", $prefix="", $suffix="") + function setName($family = "", $first = "", $additional = "", $prefix = "", $suffix = "") { $this->properties["N;CHARSET=".$this->encoding] = encode($family).";".encode($first).";".encode($additional).";".encode($prefix).";".encode($suffix); $this->filename = "$first%20$family.vcf"; @@ -174,7 +174,7 @@ class vCard * @param string $type Type * @return void */ - function setAddress($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") + function setAddress($postoffice = "", $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME;POSTAL") { // $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL" $key = "ADR"; @@ -201,7 +201,7 @@ class vCard * @param string $type Type * @return void */ - function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") + function setLabel($postoffice = "", $extended = "", $street = "", $city = "", $region = "", $zip = "", $country = "", $type = "HOME;POSTAL") { $label = ""; if ($postoffice!="") $label.= "$postoffice\r\n"; @@ -222,7 +222,7 @@ class vCard * @param string $type Vcard type * @return void */ - function setEmail($address,$type="internet,pref") + function setEmail($address, $type = "internet,pref") { $this->properties["EMAIL;TYPE=".$type] = $address; } @@ -293,7 +293,7 @@ class vCard * @param string $type Type * @return void */ - function setURL($url, $type="") + function setURL($url, $type = "") { // $type may be WORK | HOME $key = "URL"; diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 6d0cd48ccfe..b6df52d2ef9 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -141,7 +141,7 @@ function xyzToUnixTimestamp($mysqldate) * @param int $year Year * @return void */ -function displayBox($selectedDate,$month,$year) +function displayBox($selectedDate, $month, $year) { global $langs,$conf; diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 54b950fdee7..e62692b233a 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -419,7 +419,7 @@ interface Database * @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ * @return int|string Date TMS or '' */ - function jdate($string, $gm=false); + function jdate($string, $gm = false); /** * Encrypt sensitive data in database diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index ecc27bf88dc..da1c3cd74fb 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -75,7 +75,7 @@ abstract class DoliDB implements Database * @param string $resko resultat si test non egal * @return string SQL string */ - function ifsql($test,$resok,$resko) + function ifsql($test, $resok, $resko) { return 'IF('.$test.','.$resok.','.$resko.')'; } @@ -135,7 +135,7 @@ abstract class DoliDB implements Database * @param string $log Add more log to default log line * @return int 1 if validation is OK or transaction level no started, 0 if ERROR */ - function commit($log='') + function commit($log = '') { dol_syslog('',0,-1); if ($this->transaction_opened<=1) @@ -165,7 +165,7 @@ abstract class DoliDB implements Database * @param string $log Add more log to default log line * @return resource|int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur */ - function rollback($log='') + function rollback($log = '') { dol_syslog('',0,-1); if ($this->transaction_opened<=1) @@ -189,7 +189,7 @@ abstract class DoliDB implements Database * @param int $offset Numero of line from where starting fetch * @return string String with SQL syntax to add a limit and offset */ - function plimit($limit=0,$offset=0) + function plimit($limit = 0, $offset = 0) { global $conf; if (empty($limit)) return ""; @@ -225,7 +225,7 @@ abstract class DoliDB implements Database * @param string $sortorder Sort order, separated by comma. Example: 'ASC,DESC'; * @return string String to provide syntax of a sort sql string */ - function order($sortfield=null,$sortorder=null) + function order($sortfield = null, $sortorder = null) { if (! empty($sortfield)) { @@ -278,7 +278,7 @@ abstract class DoliDB implements Database * @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ * @return int|string Date TMS or '' */ - function jdate($string, $gm=false) + function jdate($string, $gm = false) { // TODO GMT must set param gm to true by default if ($string==0 || $string=="0000-00-00 00:00:00") return ''; diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 0f2ca55c0e8..ea65ad940e3 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -55,7 +55,7 @@ class DoliDBMssql extends DoliDB * @param string $name Nom de la database * @param int $port Port of database server */ - function __construct($type, $host, $user, $pass, $name='', $port=0) + function __construct($type, $host, $user, $pass, $name = '', $port = 0) { global $langs; @@ -134,7 +134,7 @@ class DoliDBMssql extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return string SQL request line converted */ - static function convertSQLFromMysql($line,$type='ddl') + static function convertSQLFromMysql($line, $type = 'ddl') { return $line; } @@ -163,7 +163,7 @@ class DoliDBMssql extends DoliDB * @return false|resource|true Database access handler * @see close */ - function connect($host, $login, $passwd, $name, $port=0) + function connect($host, $login, $passwd, $name, $port = 0) { dol_syslog(get_class($this)."::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name"); $newhost=$host; @@ -263,7 +263,7 @@ class DoliDBMssql extends DoliDB * @param string $log Add more log to default log line * @return bool true if validation is OK or transaction level no started, false if ERROR */ - function commit($log='') + function commit($log = '') { $res=mssql_query('select @@TRANCOUNT'); $this->transaction_opened=mssql_result($res, 0, 0); @@ -296,7 +296,7 @@ class DoliDBMssql extends DoliDB * @param string $log Add more log to default log line * @return bool true si annulation ok ou transaction non ouverte, false en cas d'erreur */ - function rollback($log='') + function rollback($log = '') { $res=mssql_query('select @@TRANCOUNT'); $this->transaction_opened=mssql_result($res, 0, 0); @@ -324,7 +324,7 @@ class DoliDBMssql extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return false|resource|true Resultset of answer */ - function query($query,$usesavepoint=0,$type='auto') + function query($query, $usesavepoint = 0, $type = 'auto') { $query = trim($query); @@ -548,7 +548,7 @@ class DoliDBMssql extends DoliDB * @param resource $resultset Curseur de la requete voulue * @return bool */ - function free($resultset=null) + function free($resultset = null) { // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } @@ -657,7 +657,7 @@ class DoliDBMssql extends DoliDB * @param string $fieldid Field name * @return int Id of row or -1 on error */ - function last_insert_id($tab,$fieldid='rowid') + function last_insert_id($tab, $fieldid = 'rowid') { // phpcs:enable $res = $this->query("SELECT @@IDENTITY as id"); @@ -679,7 +679,7 @@ class DoliDBMssql extends DoliDB * @param int $withQuotes Return string with quotes * @return string XXX(field) or XXX('value') or field or 'value' */ - function encrypt($fieldorvalue, $withQuotes=0) + function encrypt($fieldorvalue, $withQuotes = 0) { global $conf; @@ -744,7 +744,7 @@ class DoliDBMssql extends DoliDB * @param string $owner Username of database owner * @return false|resource|true resource defined if OK, false if KO */ - function DDLCreateDb($database,$charset='',$collation='',$owner='') + function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') { // phpcs:enable /*if (empty($charset)) $charset=$this->forcecharset; @@ -778,7 +778,7 @@ class DoliDBMssql extends DoliDB * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - function DDLListTables($database,$table='') + function DDLListTables($database, $table = '') { // phpcs:enable $this->_results = mssql_list_tables($database, $this->db); @@ -817,7 +817,7 @@ class DoliDBMssql extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) + function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) { // phpcs:enable // FIXME: $fulltext_keys parameter is unused @@ -911,7 +911,7 @@ class DoliDBMssql extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return false|resource|true Resource */ - function DDLDescTable($table,$field="") + function DDLDescTable($table, $field = "") { // phpcs:enable $sql="DESC ".$table." ".$field; @@ -931,7 +931,7 @@ class DoliDBMssql extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - function DDLAddField($table,$field_name,$field_desc,$field_position="") + function DDLAddField($table, $field_name, $field_desc, $field_position = "") { // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra @@ -968,7 +968,7 @@ class DoliDBMssql extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - function DDLUpdateField($table,$field_name,$field_desc) + function DDLUpdateField($table, $field_name, $field_desc) { // phpcs:enable $sql = "ALTER TABLE ".$table; @@ -992,7 +992,7 @@ class DoliDBMssql extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - function DDLDropField($table,$field_name) + function DDLDropField($table, $field_name) { // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; @@ -1015,7 +1015,7 @@ class DoliDBMssql extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) + function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) { // phpcs:enable $sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'"; @@ -1141,7 +1141,7 @@ class DoliDBMssql extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerParametersValues($filter='') + function getServerParametersValues($filter = '') { // FIXME: Dummy method // TODO: Implement @@ -1157,7 +1157,7 @@ class DoliDBMssql extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerStatusValues($filter='') + function getServerStatusValues($filter = '') { // FIXME: Dummy method // TODO: Implement @@ -1188,7 +1188,7 @@ class DoliDBMssql extends DoliDB * @param mixed $fields String for one field or array of string for multiple field * @return false|object */ - function GetFieldInformation($table,$fields) + function GetFieldInformation($table, $fields) { // phpcs:enable $sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME"; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 07d915f8c0d..0c8fb3cbd0b 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -54,7 +54,7 @@ class DoliDBMysqli extends DoliDB * @param string $name Nom de la database * @param int $port Port of database server */ - function __construct($type, $host, $user, $pass, $name='', $port=0) + function __construct($type, $host, $user, $pass, $name = '', $port = 0) { global $conf,$langs; @@ -162,7 +162,7 @@ class DoliDBMysqli extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return string SQL request line converted */ - static function convertSQLFromMysql($line,$type='ddl') + static function convertSQLFromMysql($line, $type = 'ddl') { return $line; } @@ -250,7 +250,7 @@ class DoliDBMysqli extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return bool|mysqli_result Resultset of answer */ - function query($query,$usesavepoint=0,$type='auto') + function query($query, $usesavepoint = 0, $type = 'auto') { global $conf; @@ -382,7 +382,7 @@ class DoliDBMysqli extends DoliDB * @param mysqli_result $resultset Curseur de la requete voulue * @return void */ - function free($resultset=null) + function free($resultset = null) { // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } @@ -476,7 +476,7 @@ class DoliDBMysqli extends DoliDB * @param string $fieldid Field name * @return int|string Id of row */ - function last_insert_id($tab,$fieldid='rowid') + function last_insert_id($tab, $fieldid = 'rowid') { // phpcs:enable return $this->db->insert_id; @@ -491,7 +491,7 @@ class DoliDBMysqli extends DoliDB * @return string XXX(field) or XXX('value') or field or 'value' * */ - function encrypt($fieldorvalue, $withQuotes=0) + function encrypt($fieldorvalue, $withQuotes = 0) { global $conf; @@ -582,7 +582,7 @@ class DoliDBMysqli extends DoliDB * @param string $owner Username of database owner * @return bool|mysqli_result resource defined if OK, null if KO */ - function DDLCreateDb($database,$charset='',$collation='',$owner='') + function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') { // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; @@ -612,7 +612,7 @@ class DoliDBMysqli extends DoliDB * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - function DDLListTables($database, $table='') + function DDLListTables($database, $table = '') { // phpcs:enable $listtables=array(); @@ -671,7 +671,7 @@ class DoliDBMysqli extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) + function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) { // phpcs:enable // FIXME: $fulltext_keys parameter is unused @@ -768,7 +768,7 @@ class DoliDBMysqli extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return bool|mysqli_result Resultset x (x->Field, x->Type, ...) */ - function DDLDescTable($table,$field="") + function DDLDescTable($table, $field = "") { // phpcs:enable $sql="DESC ".$table." ".$field; @@ -788,7 +788,7 @@ class DoliDBMysqli extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - function DDLAddField($table,$field_name,$field_desc,$field_position="") + function DDLAddField($table, $field_name, $field_desc, $field_position = "") { // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra @@ -839,7 +839,7 @@ class DoliDBMysqli extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - function DDLUpdateField($table,$field_name,$field_desc) + function DDLUpdateField($table, $field_name, $field_desc) { // phpcs:enable $sql = "ALTER TABLE ".$table; @@ -885,7 +885,7 @@ class DoliDBMysqli extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - function DDLDropField($table,$field_name) + function DDLDropField($table, $field_name) { // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; @@ -908,7 +908,7 @@ class DoliDBMysqli extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) + function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) { // phpcs:enable $sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'"; @@ -1082,7 +1082,7 @@ class DoliDBMysqli extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerParametersValues($filter='') + function getServerParametersValues($filter = '') { $result=array(); @@ -1103,7 +1103,7 @@ class DoliDBMysqli extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerStatusValues($filter='') + function getServerStatusValues($filter = '') { $result=array(); diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index c5cac435b08..82c51479f79 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -62,7 +62,7 @@ class DoliDBPgsql extends DoliDB * @param string $name Nom de la database * @param int $port Port of database server */ - function __construct($type, $host, $user, $pass, $name='', $port=0) + function __construct($type, $host, $user, $pass, $name = '', $port = 0) { global $conf,$langs; @@ -150,7 +150,7 @@ class DoliDBPgsql extends DoliDB * @param bool $unescapeslashquot Unescape slash quote with quote quote * @return string SQL request line converted */ - static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=false) + static function convertSQLFromMysql($line, $type = 'auto', $unescapeslashquot = false) { // Removed empty line if this is a comment line for SVN tagging if (preg_match('/^--\s\$Id/i',$line)) { @@ -389,7 +389,7 @@ class DoliDBPgsql extends DoliDB * @return false|resource Database access handler * @see close */ - function connect($host, $login, $passwd, $name, $port=0) + function connect($host, $login, $passwd, $name, $port = 0) { // use pg_pconnect() instead of pg_connect() if you want to use persistent connection costing 1ms, instead of 30ms for non persistent @@ -483,7 +483,7 @@ class DoliDBPgsql extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return false|resource Resultset of answer */ - function query($query,$usesavepoint=0,$type='auto') + function query($query, $usesavepoint = 0, $type = 'auto') { global $conf; @@ -631,7 +631,7 @@ class DoliDBPgsql extends DoliDB * @param resource $resultset Result set of request * @return void */ - function free($resultset=null) + function free($resultset = null) { // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } @@ -647,7 +647,7 @@ class DoliDBPgsql extends DoliDB * @param int $offset Numero of line from where starting fetch * @return string String with SQL syntax to add a limit and offset */ - function plimit($limit=0,$offset=0) + function plimit($limit = 0, $offset = 0) { global $conf; if (empty($limit)) return ""; @@ -688,7 +688,7 @@ class DoliDBPgsql extends DoliDB * @param string $resko resultat si test non egal * @return string chaine formate SQL */ - function ifsql($test,$resok,$resko) + function ifsql($test, $resok, $resko) { return '(CASE WHEN '.$test.' THEN '.$resok.' ELSE '.$resko.' END)'; } @@ -777,7 +777,7 @@ class DoliDBPgsql extends DoliDB * @param string $fieldid Field name * @return string Id of row */ - function last_insert_id($tab,$fieldid='rowid') + function last_insert_id($tab, $fieldid = 'rowid') { // phpcs:enable //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); @@ -800,7 +800,7 @@ class DoliDBPgsql extends DoliDB * @param int $withQuotes Return string with quotes * @return string XXX(field) or XXX('value') or field or 'value' */ - function encrypt($fieldorvalue, $withQuotes=0) + function encrypt($fieldorvalue, $withQuotes = 0) { global $conf; @@ -862,7 +862,7 @@ class DoliDBPgsql extends DoliDB * @param string $owner Username of database owner * @return false|resource resource defined if OK, null if KO */ - function DDLCreateDb($database,$charset='',$collation='',$owner='') + function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') { // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; @@ -885,7 +885,7 @@ class DoliDBPgsql extends DoliDB * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ - function DDLListTables($database, $table='') + function DDLListTables($database, $table = '') { // phpcs:enable $listtables=array(); @@ -958,7 +958,7 @@ class DoliDBPgsql extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) + function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) { // phpcs:enable // FIXME: $fulltext_keys parameter is unused @@ -1054,7 +1054,7 @@ class DoliDBPgsql extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) + function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) { // phpcs:enable // Note: using ' on user does not works with pgsql @@ -1078,7 +1078,7 @@ class DoliDBPgsql extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return false|resource Resultset x (x->attname) */ - function DDLDescTable($table,$field="") + function DDLDescTable($table, $field = "") { // phpcs:enable $sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid"; @@ -1100,7 +1100,7 @@ class DoliDBPgsql extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - function DDLAddField($table,$field_name,$field_desc,$field_position="") + function DDLAddField($table, $field_name, $field_desc, $field_position = "") { // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra @@ -1140,7 +1140,7 @@ class DoliDBPgsql extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - function DDLUpdateField($table,$field_name,$field_desc) + function DDLUpdateField($table, $field_name, $field_desc) { // phpcs:enable $sql = "ALTER TABLE ".$table; @@ -1184,7 +1184,7 @@ class DoliDBPgsql extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - function DDLDropField($table,$field_name) + function DDLDropField($table, $field_name) { // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name; @@ -1343,7 +1343,7 @@ class DoliDBPgsql extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerParametersValues($filter='') + function getServerParametersValues($filter = '') { $result=array(); @@ -1364,7 +1364,7 @@ class DoliDBPgsql extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerStatusValues($filter='') + function getServerStatusValues($filter = '') { /* This is to return current running requests. $sql='SELECT datname,procpid,current_query FROM pg_stat_activity ORDER BY procpid'; diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 6a4b11317e5..18dfece171c 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -57,7 +57,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $name Nom de la database * @param int $port Port of database server */ - function __construct($type, $host, $user, $pass, $name='', $port=0) + function __construct($type, $host, $user, $pass, $name = '', $port = 0) { global $conf; @@ -134,7 +134,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return string SQL request line converted */ - static function convertSQLFromMysql($line,$type='ddl') + static function convertSQLFromMysql($line, $type = 'ddl') { // Removed empty line if this is a comment line for SVN tagging if (preg_match('/^--\s\$Id/i',$line)) { @@ -323,7 +323,7 @@ class DoliDBSqlite3 extends DoliDB * @return SQLite3 Database access handler * @see close */ - function connect($host, $login, $passwd, $name, $port=0) + function connect($host, $login, $passwd, $name, $port = 0) { global $main_data_dir; @@ -401,7 +401,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return SQLite3Result Resultset of answer */ - function query($query,$usesavepoint=0,$type='auto') + function query($query, $usesavepoint = 0, $type = 'auto') { $ret=null; $query = trim($query); @@ -602,7 +602,7 @@ class DoliDBSqlite3 extends DoliDB * @param SQLite3Result $resultset Curseur de la requete voulue * @return void */ - function free($resultset=null) + function free($resultset = null) { // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } @@ -710,7 +710,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $fieldid Field name * @return int Id of row */ - function last_insert_id($tab,$fieldid='rowid') + function last_insert_id($tab, $fieldid = 'rowid') { // phpcs:enable return $this->db->lastInsertRowId(); @@ -724,7 +724,7 @@ class DoliDBSqlite3 extends DoliDB * @param int $withQuotes Return string with quotes * @return string XXX(field) or XXX('value') or field or 'value' */ - function encrypt($fieldorvalue, $withQuotes=0) + function encrypt($fieldorvalue, $withQuotes = 0) { global $conf; @@ -810,7 +810,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $owner Username of database owner * @return SQLite3Result resource defined if OK, null if KO */ - function DDLCreateDb($database,$charset='',$collation='',$owner='') + function DDLCreateDb($database, $charset = '', $collation = '', $owner = '') { // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; @@ -840,7 +840,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ - function DDLListTables($database, $table='') + function DDLListTables($database, $table = '') { // phpcs:enable $listtables=array(); @@ -900,7 +900,7 @@ class DoliDBSqlite3 extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) + function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null) { // phpcs:enable // FIXME: $fulltext_keys parameter is unused @@ -993,7 +993,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return SQLite3Result Resource */ - function DDLDescTable($table,$field="") + function DDLDescTable($table, $field = "") { // phpcs:enable $sql="DESC ".$table." ".$field; @@ -1013,7 +1013,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - function DDLAddField($table,$field_name,$field_desc,$field_position="") + function DDLAddField($table, $field_name, $field_desc, $field_position = "") { // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra @@ -1057,7 +1057,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - function DDLUpdateField($table,$field_name,$field_desc) + function DDLUpdateField($table, $field_name, $field_desc) { // phpcs:enable $sql = "ALTER TABLE ".$table; @@ -1080,7 +1080,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - function DDLDropField($table,$field_name) + function DDLDropField($table, $field_name) { // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; @@ -1104,7 +1104,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) + function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name) { // phpcs:enable $sql = "INSERT INTO user "; @@ -1236,7 +1236,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerParametersValues($filter='') + function getServerParametersValues($filter = '') { $result=array(); static $pragmas; @@ -1285,7 +1285,7 @@ class DoliDBSqlite3 extends DoliDB * @param string $filter Filter list on a particular value * @return array Array of key-values (key=>value) */ - function getServerStatusValues($filter='') + function getServerStatusValues($filter = '') { $result=array(); /* diff --git a/htdocs/core/filemanagerdol/connectors/php/basexml.php b/htdocs/core/filemanagerdol/connectors/php/basexml.php index f1fe5365e7a..72722a1a948 100644 --- a/htdocs/core/filemanagerdol/connectors/php/basexml.php +++ b/htdocs/core/filemanagerdol/connectors/php/basexml.php @@ -55,7 +55,7 @@ function SetXmlHeaders() * @param string $currentFolder Current folder * @return void */ -function CreateXmlHeader( $command, $resourceType, $currentFolder ) +function CreateXmlHeader($command, $resourceType, $currentFolder) { SetXmlHeaders(); diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index e35d8d328ab..1934c702dfb 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -67,7 +67,7 @@ function GetFolders($resourceType, $currentFolder) * @param string $currentFolder Current folder * @return void */ -function GetFoldersAndFiles( $resourceType, $currentFolder ) +function GetFoldersAndFiles($resourceType, $currentFolder) { // Map the virtual path to the local server path. $sServerDir = ServerMapFolder($resourceType, $currentFolder, 'GetFoldersAndFiles'); @@ -132,7 +132,7 @@ function GetFoldersAndFiles( $resourceType, $currentFolder ) * @param string $currentFolder Current folder * @return void */ -function CreateFolder( $resourceType, $currentFolder ) +function CreateFolder($resourceType, $currentFolder) { if (!isset($_GET)) { global $_GET; diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 3ac325ed5d4..7d544ae9cce 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -29,7 +29,7 @@ * @param string $sFolder sFolder * @return string Combined path */ -function CombinePaths( $sBasePath, $sFolder ) +function CombinePaths($sBasePath, $sFolder) { return RemoveFromEnd($sBasePath, '/') . '/' . RemoveFromStart($sFolder, '/'); } @@ -238,7 +238,7 @@ function GetRootPath() // Emulate the asp Server.mapPath function. // given an url path return the physical directory that it corresponds to -function Server_MapPath( $path ) +function Server_MapPath($path) { // This function is available only for Apache if (function_exists('apache_lookup_uri')) { @@ -339,7 +339,7 @@ function GetCurrentFolder() } // Do a cleanup of the folder name to avoid possible problems -function SanitizeFolderName( $sNewFolderName ) +function SanitizeFolderName($sNewFolderName) { $sNewFolderName = stripslashes($sNewFolderName); @@ -350,7 +350,7 @@ function SanitizeFolderName( $sNewFolderName ) } // Do a cleanup of the file name to avoid possible problems -function SanitizeFileName( $sNewFileName ) +function SanitizeFileName($sNewFileName) { global $Config ; @@ -367,7 +367,7 @@ function SanitizeFileName( $sNewFileName ) } // This is the function that sends the results of the uploading process. -function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' ) +function SendUploadResults($errorNumber, $fileUrl = '', $fileName = '', $customMsg = '') { // Minified version of the document.domain automatic fix script (#1919). // The original script can be found at _dev/domain_fix_template.js diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index f23ba45550a..0b39003f494 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -82,7 +82,7 @@ function FindBadUtf8($string) * @param string $value Value * @return string */ -function ConvertToXmlAttribute( $value ) +function ConvertToXmlAttribute($value) { if ( defined('PHP_OS') ) { @@ -110,7 +110,7 @@ function ConvertToXmlAttribute( $value ) * @param array $formExtensions Array of extensions * @return boolean */ -function IsHtmlExtension( $ext, $formExtensions ) +function IsHtmlExtension($ext, $formExtensions) { if (!$formExtensions || !is_array($formExtensions) ) { @@ -132,7 +132,7 @@ function IsHtmlExtension( $ext, $formExtensions ) * @param string $filePath absolute path to file * @return boolean */ -function DetectHtml( $filePath ) +function DetectHtml($filePath) { $fp = @fopen($filePath, 'rb'); @@ -202,7 +202,7 @@ function DetectHtml( $filePath ) * @param string $extension File extension * @return boolean True or false */ -function IsImageValid( $filePath, $extension ) +function IsImageValid($filePath, $extension) { if (!@is_readable($filePath)) { return -1; diff --git a/htdocs/core/lib/accounting.lib.php b/htdocs/core/lib/accounting.lib.php index b0b6dc6855c..30ace607536 100644 --- a/htdocs/core/lib/accounting.lib.php +++ b/htdocs/core/lib/accounting.lib.php @@ -152,7 +152,7 @@ function length_accounta($accounta) * @param string $varlink Add a variable into the address of the page * @return void */ -function journalHead($nom,$variante,$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array(),$calcmode='', $varlink='') +function journalHead($nom, $variante, $period, $periodlink, $description, $builddate, $exportlink = '', $moreparam = array(), $calcmode = '', $varlink = '') { global $langs; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index aae550d65f8..77a21100f48 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -55,7 +55,7 @@ function versiontostring($versionarray) * 0 if same * 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference) */ -function versioncompare($versionarray1,$versionarray2) +function versioncompare($versionarray1, $versionarray2) { $ret=0; $level=0; @@ -127,7 +127,7 @@ function versiondolibarrarray() * @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value * @return int <=0 if KO, >0 if OK */ -function run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0, $offsetforchartofaccount=0) +function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0) { global $db, $conf, $langs, $user; @@ -432,7 +432,7 @@ function run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', * * @see dolibarr_get_const, dolibarr_set_const, dol_set_user_param */ -function dolibarr_del_const($db, $name, $entity=1) +function dolibarr_del_const($db, $name, $entity = 1) { global $conf; @@ -472,7 +472,7 @@ function dolibarr_del_const($db, $name, $entity=1) * * @see dolibarr_del_const, dolibarr_set_const, dol_set_user_param */ -function dolibarr_get_const($db, $name, $entity=1) +function dolibarr_get_const($db, $name, $entity = 1) { global $conf; $value=''; @@ -507,7 +507,7 @@ function dolibarr_get_const($db, $name, $entity=1) * * @see dolibarr_del_const, dolibarr_get_const, dol_set_user_param */ -function dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1) +function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $note = '', $entity = 1) { global $conf; @@ -864,7 +864,7 @@ function purgeSessions($mysessionid) * @param int $withdeps Activate/Disable also all dependencies * @return array array('nbmodules'=>nb modules activated with success, 'errors=>array of error messages, 'nbperms'=>Nb permission added); */ -function activateModule($value,$withdeps=1) +function activateModule($value, $withdeps = 1) { global $db, $modules, $langs, $conf, $mysoc; @@ -1008,7 +1008,7 @@ function activateModule($value,$withdeps=1) * @param int $requiredby 1=Desactive aussi modules dependants * @return string Error message or ''; */ -function unActivateModule($value, $requiredby=1) +function unActivateModule($value, $requiredby = 1) { global $db, $modules, $conf; @@ -1085,7 +1085,7 @@ function unActivateModule($value, $requiredby=1) * @param array $tabfieldcheck Tabfieldcheck * @return int 1 */ -function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond,&$tabhelp,&$tabfieldcheck) +function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tabsql, &$tabsqlsort, &$tabfield, &$tabfieldvalue, &$tabfieldinsert, &$tabrowid, &$tabcond, &$tabhelp, &$tabfieldcheck) { global $db, $modules, $conf, $langs; @@ -1362,7 +1362,7 @@ function complete_elementList_with_modules(&$elementList) * @param string $helptext Help * @return void */ -function form_constantes($tableau, $strictw3c=0, $helptext='') +function form_constantes($tableau, $strictw3c = 0, $helptext = '') { global $db,$bc,$langs,$conf,$user; global $_Avery_Labels; @@ -1606,7 +1606,7 @@ function showModulesExludedForExternal($modules) * @param string $description Model description * @return int <0 if KO, >0 if OK */ -function addDocumentModel($name, $type, $label='', $description='') +function addDocumentModel($name, $type, $label = '', $description = '') { global $db, $conf; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6dab036193d..9b7481af7af 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -47,7 +47,7 @@ * @param int $resourceid Preselected value of resource for filter on resource * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0) +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode = '', $usergroupid = '', $excludetype = '', $resourceid = 0) { global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; @@ -209,7 +209,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh * @param int $max Max nb of records * @return void */ -function show_array_actions_to_do($max=5) +function show_array_actions_to_do($max = 5) { global $langs, $conf, $user, $db, $bc, $socid; @@ -309,7 +309,7 @@ function show_array_actions_to_do($max=5) * @param int $max Max nb of records * @return void */ -function show_array_last_actions_done($max=5) +function show_array_last_actions_done($max = 5) { global $langs, $conf, $user, $db, $bc, $socid; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 4b4d36aa20b..8a2aa8f91a9 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -43,7 +43,7 @@ * - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) * @return string Script */ -function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array()) +function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLength = 2, $autoselect = 0, $ajaxoptions = array()) { if (empty($minLength)) $minLength=1; @@ -221,7 +221,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt * @param int $autoselect Automatic selection if just one value * @return string Script */ -function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLength=2, $autoselect=0) +function ajax_multiautocompleter($htmlname, $fields, $url, $option = '', $minLength = 2, $autoselect = 0) { $script = ''."\n"; $script.= ' @@ -353,27 +353,30 @@ $( document ).ready(function() { - - + + - - 7 - 8 - 9 - trans("Qty"); ?> - 4 - 5 - 6 - trans("Price"); ?> - 1 - 2 - 3 - trans("ReductionShort"); ?> - 0 - . - C - X - + + + + + 7 + 8 + 9 + trans("Qty"); ?> + 4 + 5 + 6 + trans("Price"); ?> + 1 + 2 + 3 + trans("ReductionShort"); ?> + 0 + . + C + X + - + '.$menu['title'].''; } ?> - - - + + + + - id='catdiv'> - width="98%" id='catimg'/> - - - - + id='catdiv'> + width="98%" id='catimg'/> + + + + - + - + - onclick="MoreProducts('less');" onclick="MoreProducts('more');" > - width="95%" id='proimg'/> - - - - + onclick="MoreProducts('less');" onclick="MoreProducts('more');" > + width="95%" id='proimg'/> + + + + + + - = 0, we force the search on a specific entity. If -1, means search depens on default setup. * @return int <0 if KO, 0 not found, >0 if OK */ - function fetch($id='', $login='', $sid='', $loadpersonalconf=0, $entity=-1) + function fetch($id = '', $login = '', $sid = '', $loadpersonalconf = 0, $entity = -1) { global $conf, $user; @@ -501,7 +501,7 @@ class User extends CommonObject * @return int > 0 if OK, < 0 if KO * @see clearrights, delrights, getrights */ - function addrights($rid, $allmodule='', $allperms='', $entity=0, $notrigger=0) + function addrights($rid, $allmodule = '', $allperms = '', $entity = 0, $notrigger = 0) { global $conf, $user, $langs; @@ -627,7 +627,7 @@ class User extends CommonObject * @return int > 0 if OK, < 0 if OK * @see clearrights, addrights, getrights */ - function delrights($rid, $allmodule='', $allperms='', $entity=0, $notrigger=0) + function delrights($rid, $allmodule = '', $allperms = '', $entity = 0, $notrigger = 0) { global $conf, $user, $langs; @@ -762,7 +762,7 @@ class User extends CommonObject * @return void * @see clearrights, delrights, addrights */ - function getrights($moduletag='', $forcereload=0) + function getrights($moduletag = '', $forcereload = 0) { global $conf; @@ -1102,7 +1102,7 @@ class User extends CommonObject * @param int $notrigger 1=do not execute triggers, 0 otherwise * @return int <0 if KO, id of created user if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf,$langs; global $mysoc; @@ -1236,7 +1236,7 @@ class User extends CommonObject * @param string $password Password to force * @return int <0 if error, if OK returns id of created user */ - function create_from_contact($contact,$login='',$password='') + function create_from_contact($contact, $login = '', $password = '') { // phpcs:enable global $conf,$user,$langs; @@ -1316,7 +1316,7 @@ class User extends CommonObject * @param string $login Login to force * @return int <0 if KO, if OK, return id of created account */ - function create_from_member($member,$login='') + function create_from_member($member, $login = '') { // phpcs:enable global $conf,$user,$langs; @@ -1438,7 +1438,7 @@ class User extends CommonObject * @param int $nosynccontact 0=Synchronize linked contact, 1=Do not synchronize linked contact * @return int <0 si KO, >=0 si OK */ - function update($user, $notrigger=0, $nosyncmember=0, $nosyncmemberpass=0, $nosynccontact=0) + function update($user, $notrigger = 0, $nosyncmember = 0, $nosyncmemberpass = 0, $nosynccontact = 0) { global $conf, $langs; @@ -1777,7 +1777,7 @@ class User extends CommonObject * @param int $nosyncmember Do not synchronize linked member * @return string If OK return clear password, 0 if no change, < 0 if error */ - function setPassword($user, $password='', $changelater=0, $notrigger=0, $nosyncmember=0) + function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT .'/core/lib/security2.lib.php'; @@ -1909,7 +1909,7 @@ class User extends CommonObject * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @TODO Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ - function send_password($user, $password='', $changelater=0) + function send_password($user, $password = '', $changelater = 0) { // phpcs:enable global $conf, $langs; @@ -2102,7 +2102,7 @@ class User extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function SetInGroup($group, $entity, $notrigger=0) + function SetInGroup($group, $entity, $notrigger = 0) { // phpcs:enable global $conf, $langs, $user; @@ -2164,7 +2164,7 @@ class User extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function RemoveFromGroup($group, $entity, $notrigger=0) + function RemoveFromGroup($group, $entity, $notrigger = 0) { // phpcs:enable global $conf,$langs,$user; @@ -2224,7 +2224,7 @@ class User extends CommonObject * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='', $imagesize='') + function getPhotoUrl($width, $height, $cssclass = '', $imagesize = '') { $result =''; $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); @@ -2248,7 +2248,7 @@ class User 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($withpictoimg=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpictoimg = 0, $option = '', $infologin = 0, $notooltip = 0, $maxlen = 24, $hidethirdpartylogo = 0, $mode = '', $morecss = '', $save_lastsearch_value = -1) { global $langs, $conf, $db, $hookmanager, $user; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -2385,7 +2385,7 @@ class User extends CommonObject * @param string $option Sur quoi pointe le lien * @return string Chaine avec URL */ - function getLoginUrl($withpicto=0,$option='') + function getLoginUrl($withpicto = 0, $option = '') { global $langs, $user; @@ -2422,7 +2422,7 @@ class User 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut,$mode); } @@ -2435,7 +2435,7 @@ class User extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -2484,7 +2484,7 @@ class User extends CommonObject * 2=Return key only (RDN) (uid=qqq) * @return string DN */ - function _load_ldap_dn($info,$mode=0) + function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; @@ -2735,7 +2735,7 @@ class User extends CommonObject * @param int $admin Filter on admin tag * @return int Number of users */ - function getNbOfUsers($limitTo, $option='', $admin=-1) + function getNbOfUsers($limitTo, $option = '', $admin = -1) { global $conf; @@ -2891,7 +2891,7 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - function get_full_tree($deleteafterid=0, $filter='') + function get_full_tree($deleteafterid = 0, $filter = '') { // phpcs:enable global $conf, $user; @@ -2993,7 +2993,7 @@ class User extends CommonObject * @return array Array of user id lower than user (all levels under user). This overwrite this->users. * @see get_children */ - function getAllChildIds($addcurrentuser=0) + function getAllChildIds($addcurrentuser = 0) { $childids=array(); @@ -3031,7 +3031,7 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - function build_path_from_id_user($id_user,$protection=0) + function build_path_from_id_user($id_user, $protection = 0) { // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); @@ -3134,7 +3134,7 @@ class User extends CommonObject * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf, $user, $langs; @@ -3166,7 +3166,7 @@ class User extends CommonObject * @param string $mode 'email' or 'mobile' * @return string Email of user with format: "Full name " */ - function user_get_property($rowid,$mode) + function user_get_property($rowid, $mode) { // phpcs:enable $user_property=''; @@ -3208,7 +3208,7 @@ class User extends CommonObject * @param string $filtermode Filter mode (AND or OR) * @return int <0 if KO, >0 if OK */ - function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter=array(), $filtermode='AND') + function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND') { global $conf; diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 7870fe9c35e..d18ece1f89e 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -62,7 +62,7 @@ class UserBankAccount extends Account * @param int $notrigger 1=Disable triggers * @return int <0 if KO, >= 0 if OK */ - function create(User $user=null, $notrigger=0) + function create(User $user = null, $notrigger = 0) { $now=dol_now(); @@ -92,7 +92,7 @@ class UserBankAccount extends Account * @param int $notrigger 1=Disable triggers * @return int <=0 if KO, >0 if OK */ - function update(User $user=null, $notrigger=0) + function update(User $user = null, $notrigger = 0) { global $conf; @@ -139,7 +139,7 @@ class UserBankAccount extends Account * @param int $userid User id * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='', $userid=0) + function fetch($id, $ref = '', $userid = 0) { if (empty($id) && empty($ref) && empty($userid)) return -1; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index c490aeddb3f..a6e443a26dc 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -107,7 +107,7 @@ class UserGroup extends CommonObject * @param boolean $load_members Load all members of the group * @return int <0 if KO, >0 if OK */ - function fetch($id='', $groupname='', $load_members = true) + function fetch($id = '', $groupname = '', $load_members = true) { global $conf; @@ -224,7 +224,7 @@ class UserGroup extends CommonObject * @param int $mode 0=Return array of user instance, 1=Return array of users id only * @return mixed Array of users or -1 on error */ - function listUsersForGroup($excludefilter='', $mode=0) + function listUsersForGroup($excludefilter = '', $mode = 0) { global $conf, $user; @@ -289,7 +289,7 @@ class UserGroup extends CommonObject * @param int $entity Entity to use * @return int > 0 if OK, < 0 if KO */ - function addrights($rid, $allmodule='', $allperms='', $entity=0) + function addrights($rid, $allmodule = '', $allperms = '', $entity = 0) { global $conf, $user, $langs; @@ -415,7 +415,7 @@ class UserGroup extends CommonObject * @param int $entity Entity to use * @return int > 0 if OK, < 0 if OK */ - function delrights($rid, $allmodule='', $allperms='', $entity=0) + function delrights($rid, $allmodule = '', $allperms = '', $entity = 0) { global $conf, $user, $langs; @@ -537,7 +537,7 @@ class UserGroup extends CommonObject * @param string $moduletag Name of module we want permissions ('' means all) * @return int <0 if KO, >0 if OK */ - function getrights($moduletag='') + function getrights($moduletag = '') { global $conf; @@ -676,7 +676,7 @@ class UserGroup extends CommonObject * @param int $notrigger 0=triggers enabled, 1=triggers disabled * @return int <0 if KO, >=0 if OK */ - function create($notrigger=0) + function create($notrigger = 0) { global $user, $conf, $langs, $hookmanager; @@ -747,7 +747,7 @@ class UserGroup extends CommonObject * @param int $notrigger 0=triggers enabled, 1=triggers disabled * @return int <0 if KO, >=0 if OK */ - function update($notrigger=0) + function update($notrigger = 0) { global $user, $conf, $langs, $hookmanager; @@ -817,7 +817,7 @@ class UserGroup 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) + function getLibStatut($mode = 0) { return $this->LibStatut(0,$mode); } @@ -830,7 +830,7 @@ class UserGroup extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -849,7 +849,7 @@ class UserGroup 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) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $langs, $conf, $db, $hookmanager; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -925,7 +925,7 @@ class UserGroup extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - function _load_ldap_dn($info,$mode=0) + function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; @@ -1011,7 +1011,7 @@ class UserGroup extends CommonObject * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ - public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf,$user,$langs; diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index a9edcb0557a..763dd500366 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -244,7 +244,7 @@ $server->register( * @param int $id Id of object * @return mixed */ -function getActionComm($authentication,$id) +function getActionComm($authentication, $id) { global $db,$conf,$langs; @@ -408,7 +408,7 @@ function getListActionCommType($authentication) * @param ActionComm $actioncomm $actioncomm * @return array Array result */ -function createActionComm($authentication,$actioncomm) +function createActionComm($authentication, $actioncomm) { global $db,$conf,$langs; @@ -491,7 +491,7 @@ function createActionComm($authentication,$actioncomm) * @param ActionComm $actioncomm $actioncomm * @return array Array result */ -function updateActionComm($authentication,$actioncomm) +function updateActionComm($authentication, $actioncomm) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index a941c2aceff..491122f748c 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -186,7 +186,7 @@ $server->register( * @param int $id Id of object * @return mixed */ -function getCategory($authentication,$id) +function getCategory($authentication, $id) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index edb429af0d3..8143b4cd178 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -235,7 +235,7 @@ $server->register( * @param string $ref_ext Ref external of object * @return mixed */ -function getContact($authentication,$id,$ref_ext) +function getContact($authentication, $id, $ref_ext) { global $db,$conf,$langs; @@ -352,7 +352,7 @@ function getContact($authentication,$id,$ref_ext) * @param Contact $contact $contact * @return array Array result */ -function createContact($authentication,$contact) +function createContact($authentication, $contact) { global $db,$conf,$langs; @@ -463,7 +463,7 @@ function createContact($authentication,$contact) * @param int $idthirdparty Id thirdparty * @return array Array result */ -function getContactsForThirdParty($authentication,$idthirdparty) +function getContactsForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; @@ -595,7 +595,7 @@ function getContactsForThirdParty($authentication,$idthirdparty) * @param Contact $contact Contact * @return array Array result */ -function updateContact($authentication,$contact) +function updateContact($authentication, $contact) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 4e8d3ec41d8..8287d3bff48 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -286,7 +286,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getInvoice($authentication,$id='',$ref='',$ref_ext='') +function getInvoice($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -399,7 +399,7 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='') * @param int $idthirdparty Id thirdparty * @return array Array result */ -function getInvoicesForThirdParty($authentication,$idthirdparty) +function getInvoicesForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; @@ -534,7 +534,7 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) * @param Facture $invoice Invoice * @return array Array result */ -function createInvoice($authentication,$invoice) +function createInvoice($authentication, $invoice) { global $db,$conf,$langs; @@ -654,7 +654,7 @@ function createInvoice($authentication,$invoice) * @param string $ref_ext_order ref_ext of order to copy invoice from * @return array Array result */ -function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $ref_ext_order='') +function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '', $ref_ext_order = '') { global $db,$conf; @@ -740,7 +740,7 @@ function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $re * @param Facture $invoice Invoice * @return array Array result */ -function updateInvoice($authentication,$invoice) +function updateInvoice($authentication, $invoice) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index c74b5660873..0d38d601b99 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -344,7 +344,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getOrder($authentication,$id='',$ref='',$ref_ext='') +function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -496,7 +496,7 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='') * @param int $idthirdparty Id of thirdparty * @return array Array result */ -function getOrdersForThirdParty($authentication,$idthirdparty) +function getOrdersForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; @@ -655,7 +655,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty) * @param array $order Order info * @return int Id of new order */ -function createOrder($authentication,$order) +function createOrder($authentication, $order) { global $db,$conf,$langs; @@ -795,7 +795,7 @@ function createOrder($authentication,$order) * @param int $id_warehouse Id of warehouse to use for stock decrease * @return array Array result */ -function validOrder($authentication,$id='',$id_warehouse=0) +function validOrder($authentication, $id = '', $id_warehouse = 0) { global $db,$conf,$langs; @@ -875,7 +875,7 @@ function validOrder($authentication,$id='',$id_warehouse=0) * @param array $order Order info * @return array Array result */ -function updateOrder($authentication,$order) +function updateOrder($authentication, $order) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 895e5d55af4..6037b5285e0 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -181,7 +181,7 @@ function getVersions($authentication) * @param string $refname Ref of object to check permission for external users (autodetect if not provided) * @return void */ -function getDocument($authentication, $modulepart, $file, $refname='') +function getDocument($authentication, $modulepart, $file, $refname = '') { global $db,$conf,$langs,$mysoc; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 188ebdf09d2..b4ad2460700 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -333,7 +333,7 @@ $server->register( * @param string $lang Lang to force * @return mixed */ -function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='') +function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = '', $lang = '') { global $db,$conf,$langs; @@ -467,7 +467,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='' * @param Product $product Product * @return array Array result */ -function createProductOrService($authentication,$product) +function createProductOrService($authentication, $product) { global $db,$conf,$langs; @@ -635,7 +635,7 @@ function createProductOrService($authentication,$product) * @param Product $product Product * @return array Array result */ -function updateProductOrService($authentication,$product) +function updateProductOrService($authentication, $product) { global $db,$conf,$langs; @@ -823,7 +823,7 @@ function updateProductOrService($authentication,$product) * @param string $listofidstring List of id with comma * @return array Array result */ -function deleteProductOrService($authentication,$listofidstring) +function deleteProductOrService($authentication, $listofidstring) { global $db,$conf,$langs; @@ -920,7 +920,7 @@ function deleteProductOrService($authentication,$listofidstring) * @param array $filterproduct Filter fields * @return array Array result */ -function getListOfProductsOrServices($authentication,$filterproduct) +function getListOfProductsOrServices($authentication, $filterproduct) { global $db,$conf,$langs; @@ -997,7 +997,7 @@ function getListOfProductsOrServices($authentication,$filterproduct) * @param $lang $lang Force lang * @return array Array result */ -function getProductsForCategory($authentication,$id,$lang='') +function getProductsForCategory($authentication, $id, $lang = '') { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 822081011aa..a064eff1ebc 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -329,7 +329,7 @@ function createProject($authentication, $project) * @param string $ref internal reference * @return array Array result */ -function getProject($authentication,$id='',$ref='') +function getProject($authentication, $id = '', $ref = '') { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 50e5498dbe1..c5005dab24d 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -223,7 +223,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getSupplierInvoice($authentication,$id='',$ref='',$ref_ext='') +function getSupplierInvoice($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -333,7 +333,7 @@ function getSupplierInvoice($authentication,$id='',$ref='',$ref_ext='') * @return array Array result * */ -function getSupplierInvoicesForThirdParty($authentication,$idthirdparty) +function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 7f0b590ee9a..1587a403940 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -283,7 +283,7 @@ $server->register( * @param string $ref_ext external reference * @return array Array result */ -function getThirdParty($authentication,$id='',$ref='',$ref_ext='') +function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -399,7 +399,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='') * @param Societe $thirdparty Thirdparty * @return array Array result */ -function createThirdParty($authentication,$thirdparty) +function createThirdParty($authentication, $thirdparty) { global $db,$conf,$langs; @@ -525,7 +525,7 @@ function createThirdParty($authentication,$thirdparty) * @param Societe $thirdparty Thirdparty * @return array Array result */ -function updateThirdParty($authentication,$thirdparty) +function updateThirdParty($authentication, $thirdparty) { global $db,$conf,$langs; @@ -655,7 +655,7 @@ function updateThirdParty($authentication,$thirdparty) * @param array $filterthirdparty Filter fields (key=>value to filer on. For example 'client'=>2, 'supplier'=>1, 'category'=>idcateg, 'name'=>'searchstring', ...) * @return array Array result */ -function getListOfThirdParties($authentication,$filterthirdparty) +function getListOfThirdParties($authentication, $filterthirdparty) { global $db,$conf,$langs; @@ -760,7 +760,7 @@ function getListOfThirdParties($authentication,$filterthirdparty) * @param string $ref_ext external reference * @return array Array result */ -function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='') +function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 81702c55456..5bc8350d563 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -301,7 +301,7 @@ $server->register( * @param string $ref_ext Ref external of object * @return mixed */ -function getUser($authentication,$id,$ref='',$ref_ext='') +function getUser($authentication, $id, $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -473,7 +473,7 @@ function getListOfGroups($authentication) * @param array $thirdpartywithuser Datas * @return mixed */ -function createUserFromThirdparty($authentication,$thirdpartywithuser) +function createUserFromThirdparty($authentication, $thirdpartywithuser) { global $db,$conf,$langs; @@ -681,7 +681,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) * @param array $shortuser Array of login/password info * @return mixed */ -function setUserPassword($authentication,$shortuser) +function setUserPassword($authentication, $shortuser) { global $db,$conf,$langs; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 0e6ee83aa9d..e0cd985ced1 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -301,7 +301,7 @@ class Website extends CommonObject * * @return int <0 if KO, >0 if OK */ - public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND') + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -517,7 +517,7 @@ class Website extends CommonObject * @param string $newlang New language * @return mixed New object created, <0 if KO */ - public function createFromClone($user, $fromid, $newref, $newlang='') + public function createFromClone($user, $fromid, $newref, $newlang = '') { global $hookmanager, $langs; global $dolibarr_main_data_root; @@ -671,7 +671,7 @@ class Website extends CommonObject * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -707,7 +707,7 @@ class Website 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -720,7 +720,7 @@ class Website extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; @@ -1094,7 +1094,7 @@ class Website extends CommonObject * @param string $htmlname Suffix for HTML name * @return string HTML select component */ - public function componentSelectLang($languagecodes, $weblangs, $morecss='', $htmlname='') + public function componentSelectLang($languagecodes, $weblangs, $morecss = '', $htmlname = '') { global $websitepagefile, $website; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index ffa2176f142..778998f8ac2 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -256,7 +256,7 @@ class WebsitePage extends CommonObject * @param string $filtermode Filter mode (AND or OR) * @return array|int int <0 if KO, array of pages if OK */ - public function fetchAll($websiteid, $sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND') + public function fetchAll($websiteid, $sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -407,7 +407,7 @@ class WebsitePage extends CommonObject * @param int $keeptitleunchanged 1=Keep title unchanged * @return mixed New object created, <0 if KO */ - public function createFromClone(User $user, $fromid, $newref, $newlang='', $istranslation=0, $newwebsite=0, $keeptitleunchanged=0) + public function createFromClone(User $user, $fromid, $newref, $newlang = '', $istranslation = 0, $newwebsite = 0, $keeptitleunchanged = 0) { global $hookmanager, $langs; @@ -472,7 +472,7 @@ class WebsitePage extends CommonObject * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -507,7 +507,7 @@ class WebsitePage 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) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status,$mode); } @@ -520,7 +520,7 @@ class WebsitePage extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 43a0b2524e6..9e51804857c 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -220,7 +220,7 @@ else * @param int $duration_value duration value * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget,$duration_value) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value) { global $conf,$langs; diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index a23652a779f..8ee56ddf2eb 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -187,7 +187,7 @@ else * @param int $duration_value duration value * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresentative,$duration_value) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative, $duration_value) { global $conf,$langs; diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 873fc0ae9fb..228f130dbb3 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -255,7 +255,7 @@ exit(0); * @param string $script_file filename * @return void */ -function usage($path,$script_file) +function usage($path, $script_file) { global $conf; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 57fdeeed76f..23026336347 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -218,7 +218,7 @@ else * @param string $oldtarget Target name * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget) { global $conf,$langs; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 37b421bcefd..d79d402863e 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -192,7 +192,7 @@ else * @param string $oldsalerepresentative Old sale representative * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresentative) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative) { global $conf,$langs; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 07d728eb0ec..432c3556ff0 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -171,7 +171,7 @@ class FactureRecTest extends PHPUnit_Framework_TestCase * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) { $retAr=array(); diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index cb23c7d092e..abf1f286a90 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -349,7 +349,7 @@ class FactureTest extends PHPUnit_Framework_TestCase * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) { $retAr=array(); diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 9b8e5217183..58e08affb69 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -321,7 +321,7 @@ class UserTest extends PHPUnit_Framework_TestCase * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) { $retAr=array();