diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 1ad61007ec6..585717fc4c7 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -407,8 +407,8 @@ class CMailFile } } - // Set the To addresses with an associative array - if (! empty($to)) { + // Set the To addresses with an associative array + if (! empty($to)) { try { $result = $this->message->setTo($this->getArrayAddress($to)); } catch (Exception $e) { @@ -752,9 +752,9 @@ class CMailFile } elseif ($this->sendmode == 'swiftmailer') { - // Use Swift Mailer library - // ------------------------------------------ - require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; + // Use Swift Mailer library + // ------------------------------------------ + require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php'; // Clean parameters if (empty($conf->global->$keyforsmtpserver)) $conf->global->$keyforsmtpserver=ini_get('SMTP'); @@ -1251,7 +1251,7 @@ class CMailFile } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Try to create a socket connection * diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 8bd70d8e063..cd5c9ae28b7 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) + public function __construct($to, $from, $msg, $deliveryreceipt = 0, $deferred = 0, $priority = 3, $class = 1) { global $conf; @@ -94,7 +94,7 @@ class CSMSFile * * @return boolean True if sms sent, false otherwise */ - function sendfile() + public function sendfile() { global $conf; @@ -195,17 +195,17 @@ class CSMSFile } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - /** - * Write content of a SendSms request into a dump file (mode = all) - * Used for debugging. - * - * @return void - */ - function dump_sms() - { + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Write content of a SendSms request into a dump file (mode = all) + * Used for debugging. + * + * @return void + */ + public function dump_sms() + { // phpcs:enable - global $conf,$dolibarr_main_data_root; + global $conf,$dolibarr_main_data_root; if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir { @@ -226,7 +226,7 @@ class CSMSFile } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Write content of a SendSms result into a dump file (mode = all) * Used for debugging. @@ -234,7 +234,7 @@ class CSMSFile * @param int $result Result of sms sending * @return void */ - function dump_sms_result($result) + public function dump_sms_result($result) { // phpcs:enable global $conf,$dolibarr_main_data_root; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index f2d9f10ae06..ecbecdeee2d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -41,13 +41,13 @@ class Conf */ public $db; - //! To store properties found into database + //! To store properties found into database public $global; - //! To store browser info + //! To store browser info public $browser; - //! To store if javascript/ajax is enabked - public $use_javascript_ajax; + //! To store if javascript/ajax is enabked + public $use_javascript_ajax; //! Used to store current currency (ISO code like 'USD', 'EUR', ...) public $currency; //! Used to store current css (from theme) @@ -141,11 +141,11 @@ class Conf /** - * Load setup values into conf object (read llx_const) + * Load setup values into conf object (read llx_const) * Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setValues is called. * - * @param DoliDB $db Database handler - * @return int < 0 if KO, >= 0 if OK + * @param DoliDB $db Database handler + * @return int < 0 if KO, >= 0 if OK */ public function setValues($db) { @@ -218,8 +218,8 @@ class Conf $i++; } - $db->free($resql); - } + $db->free($resql); + } // Include other local consts.php files and fetch their values to the corresponding database constants. if (! empty($this->global->LOCAL_CONSTS_FILES)) { @@ -233,8 +233,8 @@ class Conf } } - //var_dump($this->modules); - //var_dump($this->modules_parts['theme']); + //var_dump($this->modules); + //var_dump($this->modules_parts['theme']); // If you can't set timezone of your PHP, set this constant. Better is to set it to UTC. // In future, this constant will be forced to 'UTC' so PHP server timezone will not have effect anymore. @@ -251,12 +251,10 @@ class Conf } // Object $mc - if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) - { + if (! defined('NOREQUIREMC') && ! empty($this->multicompany->enabled)) { global $mc; $ret = @dol_include_once('/multicompany/class/actions_multicompany.class.php'); - if ($ret) - { + if ($ret) { $mc = new ActionsMulticompany($db); $this->mc = $mc; } @@ -592,7 +590,9 @@ class Conf $this->adherent->subscription = new stdClass(); $this->adherent->subscription->warning_delay=(isset($this->global->MAIN_DELAY_MEMBERS)?$this->global->MAIN_DELAY_MEMBERS:0)*24*60*60; } - if (isset($this->agenda)) $this->agenda->warning_delay=(isset($this->global->MAIN_DELAY_ACTIONS_TODO)?$this->global->MAIN_DELAY_ACTIONS_TODO:7)*24*60*60; + if (isset($this->agenda)) { + $this->agenda->warning_delay=(isset($this->global->MAIN_DELAY_ACTIONS_TODO)?$this->global->MAIN_DELAY_ACTIONS_TODO:7)*24*60*60; + } if (isset($this->projet)) { $this->projet->warning_delay=(isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE)?$this->global->MAIN_DELAY_PROJECT_TO_CLOSE:7)*24*60*60; @@ -632,9 +632,9 @@ class Conf $this->bank->cheque->warning_delay=(isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT)?$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT:0)*24*60*60; } if (isset($this->expensereport)) { - $this->expensereport->approve = new stdClass(); + $this->expensereport->approve = new stdClass(); $this->expensereport->approve->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS)?$this->global->MAIN_DELAY_EXPENSEREPORTS:0)*24*60*60; - $this->expensereport->payment = new stdClass(); + $this->expensereport->payment = new stdClass(); $this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60; } diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index d90707db4dd..bd36dba199b 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) + public function __construct($options = null, $fk_element = null, $element = null) { global $db, $conf; global $object; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a30715c012c..a83ff1083e6 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3693,7 +3693,7 @@ class Form * @param string $moreattrib To add more attribute on select * @return int <0 if error, Num of establishment found if OK (0, 1, 2, ...) */ - function selectEstablishments($selected = '', $htmlname = 'entity', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '') + public function selectEstablishments($selected = '', $htmlname = 'entity', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '') { // phpcs:enable global $langs, $conf; @@ -4317,17 +4317,17 @@ class Form } /** - * Output HTML form to select list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) + * Output HTML form to select list of input reason (events that triggered an object creation, like after sending an emailing, making an advert, ...) * List found into table c_input_reason loaded by loadCacheInputReason * * @param string $page Page * @param string $selected Id condition pre-selectionne * @param string $htmlname Name of select html field - * @param int $addempty Add empty entry + * @param int $addempty Add empty entry * @return void - */ + */ public function formInputReason($page, $selected = '', $htmlname = 'demandreason', $addempty = 0) - { + { global $langs; if ($htmlname != "none") { @@ -4647,17 +4647,17 @@ class Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Show forms to select a contact - * - * @param string $page Page - * @param Societe $societe Filter on third party - * @param int $selected Id contact pre-selectionne - * @param string $htmlname Name of HTML select. If 'none', we just show contact link. - * @return void - */ + /** + * Show forms to select a contact + * + * @param string $page Page + * @param Societe $societe Filter on third party + * @param int $selected Id contact pre-selectionne + * @param string $htmlname Name of HTML select. If 'none', we just show contact link. + * @return void + */ public function form_contacts($page, $societe, $selected = '', $htmlname = 'contactid') - { + { // phpcs:enable global $langs, $conf; @@ -4856,10 +4856,10 @@ class Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load into the cache vat rates of a country + * Load into the cache vat rates of a country * - * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") - * @return int Nb of loaded lines, 0 if already loaded, <0 if KO + * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") + * @return int Nb of loaded lines, 0 if already loaded, <0 if KO */ public function load_cache_vatrates($country_code) { @@ -5143,7 +5143,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 = '') + public 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); @@ -5834,7 +5834,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) + public 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; @@ -5944,7 +5944,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) + public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; global $delayedhtmlcontent; @@ -6028,11 +6028,11 @@ class Form return $out; } - /** - * Return a HTML select string, built from an array of key+value, but content returned into select is defined into $array parameter. - * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. - * - * @param string $htmlname Name of html select area + /** + * Return a HTML select string, built from an array of key+value, but content returned into select is defined into $array parameter. + * Note: Do not apply langs->trans function on returned content of Ajax service, content may be entity encoded twice. + * + * @param string $htmlname Name of html select area * @param string $array Array (key=>array('text'=>'A text', 'url'=>'An url'), ...) * @param string $id Preselected key * @param string $moreparam Add more parameters onto the select tag @@ -6043,10 +6043,10 @@ class Form * @param int $callurlonselect If set to 1, some code is added so an url return by the ajax is called when value is selected. * @param string $placeholder String to use as placeholder * @param integer $acceptdelayedhtml 1 = caller is requesting to have html js content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) - * @return string HTML select string + * @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) + public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; global $delayedhtmlcontent; @@ -6164,7 +6164,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) + public 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; @@ -6274,7 +6274,7 @@ class Form * @return string HTML multiselect string * @see selectarray */ - static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage) + public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage) { global $conf,$langs,$user; @@ -7015,7 +7015,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 = '') + public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '') { global $conf,$langs; @@ -7505,6 +7505,6 @@ class Form dol_print_error($db); } - return $out; - } + return $out; + } } diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index a5b0a574c35..fa44c8dbcc9 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -55,7 +55,7 @@ class FormAccounting extends Form $this->db = $db; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of journals with label by nature * @@ -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) + public 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; @@ -138,7 +138,7 @@ class FormAccounting extends Form return $out; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of accounting category. * Use mysoc->country_id or mysoc->country_code so they must be defined. @@ -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) + public function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { // phpcs:enable global $db,$langs,$user,$mysoc; @@ -220,7 +220,7 @@ class FormAccounting extends Form print $out; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return select filter with date of transaction * @@ -228,7 +228,7 @@ class FormAccounting extends Form * @param string $selectedkey Value * @return string HTML edit field */ - function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') + public function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') { // phpcs:enable $options = array(); @@ -253,7 +253,7 @@ class FormAccounting extends Form return Form::selectarray($htmlname, $options, $selectedkey); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of accounts with label by chart of accounts * @@ -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 = '') + public 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; @@ -346,7 +346,7 @@ class FormAccounting extends Form return $out; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of auxilary thirdparty accounts * @@ -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') + public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth200') { // phpcs:enable @@ -429,7 +429,7 @@ class FormAccounting extends Form return $out; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return HTML combo list of years existing into book keepping * @@ -439,7 +439,7 @@ class FormAccounting extends Form * @param string $output_format (html/opton (for option html only)/array (to return options arrays * @return string/array */ - function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') + public function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') { // phpcs:enable global $conf; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index f8733420abb..6afe7552187 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -43,15 +43,15 @@ class FormActions /** * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler */ - function __construct($db) + public function __construct($db) { $this->db = $db; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Show list of action status * @@ -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') + public 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 = '') + public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlright = '') { global $langs,$conf,$user; global $bc; @@ -179,7 +179,7 @@ class FormActions $sortorder='DESC,DESC'; $listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', $sortfield, $sortorder, ($max?($max+1):0)); - if (! is_array($listofactions)) dol_print_error($this->db, 'FailedToGetActions'); + if (! is_array($listofactions)) dol_print_error($this->db, 'FailedToGetActions'); $num = count($listofactions); if ($num || $forceshowtitle) @@ -314,7 +314,7 @@ class FormActions } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Output html select list of type of event * @@ -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) + public 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 04235da29ed..1758480af8f 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -29,37 +29,37 @@ */ class FormAdmin { - var $db; - var $error; + public $db; + public $error; /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - /** - * Return html select list with available languages (key='en_US', value='United States' for example) - * - * @param string $selected Language pre-selected - * @param string $htmlname Name of HTML select - * @param int $showauto Show 'auto' choice - * @param array $filter Array of keys to exclude in list - * @param string $showempty '1'=Add empty value or string to show - * @param int $showwarning Show a warning if language is not complete - * @param int $disabled Disable edit of select - * @param string $morecss Add more css styles - * @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end - * @param int $forcecombo Force to use combo box (so no ajax beautify effect) - * @return string Return HTML select string with list of languages + * Constructor + * + * @param DoliDB $db Database handler */ - function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0) + public function __construct($db) + { + $this->db = $db; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return html select list with available languages (key='en_US', value='United States' for example) + * + * @param string $selected Language pre-selected + * @param string $htmlname Name of HTML select + * @param int $showauto Show 'auto' choice + * @param array $filter Array of keys to exclude in list + * @param string $showempty '1'=Add empty value or string to show + * @param int $showwarning Show a warning if language is not complete + * @param int $disabled Disable edit of select + * @param string $morecss Add more css styles + * @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end + * @param int $forcecombo Force to use combo box (so no ajax beautify effect) + * @return string Return HTML select string with list of languages + */ + public 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; @@ -121,8 +121,8 @@ class FormAdmin return $out; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** * Return list of available menus (eldy_backoffice, ...) * * @param string $selected Preselected menu value @@ -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 = '') + public function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '') { // phpcs:enable global $langs,$conf; @@ -212,7 +212,7 @@ class FormAdmin print ''; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return combo list of available menu families * @@ -221,13 +221,13 @@ class FormAdmin * @param string[] $dirmenuarray Directories to scan * @return void */ - function select_menu_families($selected, $htmlname, $dirmenuarray) + public function select_menu_families($selected, $htmlname, $dirmenuarray) { - // phpcs:enable - global $langs,$conf; + // phpcs:enable + global $langs,$conf; //$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set - $expdevmenu=array(); + $expdevmenu=array(); $menuarray=array(); @@ -285,7 +285,7 @@ class FormAdmin } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return a HTML select list of timezones * @@ -293,15 +293,15 @@ class FormAdmin * @param string $htmlname Nom de la zone select * @return void */ - function select_timezone($selected, $htmlname) + public function select_timezone($selected, $htmlname) { - // phpcs:enable - global $langs,$conf; + // phpcs:enable + global $langs,$conf; print ''; - } + foreach ($arraytz as $lib => $gmt) { + print ''."\n"; + } + print ''; + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return html select list with available languages (key='en_US', value='United States' for example) * * @param string $selected Paper format pre-selected * @param string $htmlname Name of HTML select field - * @param string $filter Value to filter on code - * @param int $showempty Add empty value - * @return string Return HTML output + * @param string $filter Value to filter on code + * @param int $showempty Add empty value + * @return string Return HTML output */ - function select_paper_format($selected = '', $htmlname = 'paperformat_id', $filter = 0, $showempty = 0) + public 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 f7a7199ab03..c41ba24f17f 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -45,7 +45,7 @@ class FormBarCode * * @param DoliDB $db Database handler */ - function __construct($db) + public function __construct($db) { $this->db = $db; } @@ -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') + public function setBarcodeEncoder($selected, $barcodelist, $code_id, $idForm = 'formbarcode') { global $conf, $langs; @@ -86,7 +86,7 @@ class FormBarCode { $disable = 'disabled'; } - + if (!empty($conf->use_javascript_ajax)) { $select_encoder = '
'; @@ -113,7 +113,7 @@ class FormBarCode return $select_encoder; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Print form to select type of barcode * @@ -123,7 +123,7 @@ class FormBarCode * @return void * @deprecated */ - function select_barcode_type($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) + public 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) + public function selectBarcodeType($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) { global $langs, $conf; @@ -183,7 +183,7 @@ class FormBarCode return $out; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Show form to select type of barcode * @@ -193,7 +193,7 @@ class FormBarCode * @return void * @deprecated */ - function form_barcode_type($page, $selected = '', $htmlname = 'barcodetype_id') + public 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') + public function formBarcodeType($page, $selected = '', $htmlname = 'barcodetype_id') { global $langs, $conf; $out = ''; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 13cf88e9aa2..0611d553af1 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -18,7 +18,7 @@ */ /** - * \file core/class/html.formcron.class.php + * \file htdocs/core/class/html.formcron.class.php * \brief Fichier de la classe des fonctions predefinie de composants html cron */ @@ -28,75 +28,75 @@ */ class FormCron extends Form { - /** + /** * @var DoliDB Database handler. */ public $db; - /** - * @var string Error code (or message) - */ - public $error=''; + /** + * @var string Error code (or message) + */ + public $error=''; - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - } + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - /** - * Display On Off selector - * - * @param string $htmlname Html control name - * @param integer $selected selected value - * @param integer $readonly Select is read only or not - * @return string HTML select field - */ - function select_typejob($htmlname, $selected = 0, $readonly = 0) - { + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Display On Off selector + * + * @param string $htmlname Html control name + * @param integer $selected selected value + * @param integer $readonly Select is read only or not + * @return string HTML select field + */ + public function select_typejob($htmlname, $selected = 0, $readonly = 0) + { // phpcs:enable - global $langs; + global $langs; - $langs->load('cron@cron'); - if (!empty($readonly)) { - if ($selected=='command') { - $out= $langs->trans('CronType_command'); - $out.=''; - $out.= ''; - $out.=''; - } elseif ($selected=='method') { - $out= $langs->trans('CronType_method'); - $out.=''; - $out.= ''; - $out.=''; - } - }else { + $langs->load('cron@cron'); + if (!empty($readonly)) { + if ($selected=='command') { + $out= $langs->trans('CronType_command'); + $out.=''; + $out.= ''; + $out.=''; + } elseif ($selected=='method') { + $out= $langs->trans('CronType_method'); + $out.=''; + $out.= ''; + $out.=''; + } + } else { - $out=''; + $out=''; - if ($selected=='command') { - $selected_attr=' selected '; - } else { - $selected_attr=''; - } - $out.= ''; + if ($selected=='command') { + $selected_attr=' selected '; + } else { + $selected_attr=''; + } + $out.= ''; - if ($selected=='method') { - $selected_attr=' selected '; - } else { - $selected_attr=''; - } - $out.= ''; + if ($selected=='method') { + $selected_attr=' selected '; + } else { + $selected_attr=''; + } + $out.= ''; - $out.=''; - } + $out.=''; + } - return $out; - } + return $out; + } } diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 280cd6acaae..c00f4003d5d 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -379,9 +379,9 @@ class Ldap /** * Change ldap protocol version to use. * - * @return boolean version + * @return boolean version */ - function setVersion() + public function setVersion() { // LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17 $ldapsetversion = ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->ldapProtocolVersion); @@ -391,9 +391,9 @@ class Ldap /** * changement du referrals. * - * @return boolean referrals + * @return boolean referrals */ - function setReferrals() + public function setReferrals() { // LDAP_OPT_REFERRALS est une constante qui vaut ? $ldapreferrals = ldap_set_option($this->connection, LDAP_OPT_REFERRALS, 0); @@ -559,7 +559,7 @@ class Ldap /** * Modify a LDAP entry (to use if dn != olddn) - * Ldap object connect and bind must have been done + * Ldap object connect and bind must have been done * * @param string $dn DN entry key * @param array $info Attributes array