From 83dd3a532bd70a2403a9a70746f2ff24819e5737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:24:58 +0200 Subject: [PATCH 001/118] Qual: Better type check --- htdocs/admin/const.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index ae4b9eb35dd..4a80df017cb 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -38,7 +38,7 @@ $action=GETPOST('action','alpha'); $update=GETPOST('update','alpha'); $delete=GETPOST('delete'); // Do not use alpha here $debug=GETPOST('debug','int'); -$consts=GETPOST('const'); +$consts=GETPOST('const','array'); $constname=GETPOST('constname','alpha'); $constvalue=GETPOST('constvalue'); $constnote=GETPOST('constnote','alpha'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 46cc8e79991..2db0ac1fe29 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -174,7 +174,7 @@ function dol_shutdown() * @param string $paramname Name of parameter to found * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'az'=check it's a-z only, 'array'=check it's array) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) - * @return string Value found, or '' if check fails + * @return string||string[] Value found, or '' if check fails */ function GETPOST($paramname,$check='',$method=0) { From 39c064cb740176ff3b312673757dc9e4cae36fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:29:25 +0200 Subject: [PATCH 002/118] Qual: Removed useless assignment from void method --- htdocs/core/ajax/row.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 55e0d1c27b5..9a5ecd3562c 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -60,7 +60,7 @@ if ((isset($_POST['roworder']) && ! empty($_POST['roworder'])) && (isset($_POST[ $row->table_element_line = $table_element_line; $row->fk_element = $fk_element; $row->id = $element_id; - $result=$row->line_ajaxorder($newrowordertab); + $row->line_ajaxorder($newrowordertab); // Reorder line to have position of chilren lines sharing same counter than parent lines // This should be useless because there is no need to have children sharing same counter that parent. From 4bf426c816e3706336c38e883484a8e925f9b19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:40:34 +0200 Subject: [PATCH 003/118] Qual: Undeclared variable replacement --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index af39da58cf7..545744ae8cd 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -62,7 +62,7 @@ abstract class CommonDocGenerator 'myuser_fax'=>$user->office_fax, 'myuser_mobile'=>$user->user_mobile, 'myuser_email'=>$user->email, - 'myuser_logo'=>$logotouse, + 'myuser_logo'=>$user->photo, 'myuser_web'=>'' // url not exist in $user object ); } From 284057d44748855685359a25e0d2249fd67207d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:41:49 +0200 Subject: [PATCH 004/118] Qual: Wrong variable name --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 545744ae8cd..299fd4753e5 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -139,7 +139,7 @@ abstract class CommonDocGenerator { $object->country=$outputlangs->transnoentitiesnoconv("Country".$object->country_code); } - if (empty($mysoc->state) && ! empty($mysoc->state_code)) + if (empty($object->state) && ! empty($object->state_code)) { $object->state=getState($object->state_code,0); } From c8b1c3b57d5091ce55887025038e64e902b85072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:44:32 +0200 Subject: [PATCH 005/118] Qual: Wrong type in method documentation --- htdocs/core/class/commondocgenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 299fd4753e5..1b290222a11 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -418,7 +418,7 @@ abstract class CommonDocGenerator * @param Object $object Object with extrafields (must have $object->array_options filled) * @param array $array_to_fill Substitution array * @param Extrafields $extrafields Extrafields object - * @param array_key $array_key Name of the key for return array + * @param string $array_key Name of the key for return array * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ From 7cf553a6365dfc37fe94feb523d96edad6c5c148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:46:37 +0200 Subject: [PATCH 006/118] Qual: Missing variable declaration --- htdocs/core/class/commoninvoice.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 0314bf34413..5c9d6257fb9 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -253,6 +253,7 @@ abstract class CommonInvoice extends CommonObject } if ($mode == 4) { + $prefix=''; if (! $paye) { if ($status == 0) return img_picto($langs->trans('BillStatusDraft'),'statut0').' '.$langs->trans('BillStatusDraft'); From 84c9a390eb898f6ffb22907bcd594eae01009491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:48:59 +0200 Subject: [PATCH 007/118] Qual: Mistyped class property --- htdocs/core/class/commonobject.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ba4094c2a14..22b340a6fab 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -83,10 +83,10 @@ abstract class CommonObject if (empty($firstname)) $firstname=$this->firstname; $ret=''; - if ($option && $this->civilite_id) + if ($option && $this->civility_id) { - if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; - else $ret.=$this->civilite_id.' '; + if ($langs->transnoentitiesnoconv("Civility".$this->civility_id)!="Civility".$this->civility_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civility_id).' '; + else $ret.=$this->civility_id.' '; } $ret.=dolGetFirstLastname($firstname, $lastname, $nameorder); From 6cfcdbfe5683cbf839423320f3fadaada406d5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:52:48 +0200 Subject: [PATCH 008/118] Qual: Wrong type in method documentation --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 22b340a6fab..5508887f139 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -241,8 +241,8 @@ abstract class CommonObject /** * Copy contact from one element to current * - * @param int $objFrom Source element - * @param int $source Nature of contact ('internal' or 'external') + * @param CommonObject $objFrom Source element + * @param string $source Nature of contact ('internal' or 'external') * @return int >0 if OK, <0 if KO */ function copy_linked_contact($objFrom, $source='internal') From db91684193e960af467adf5b7d35dbadd2193d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:57:11 +0200 Subject: [PATCH 009/118] Qual: Wrong type in method documentation --- htdocs/core/lib/price.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index a546d229481..7be5f3e2ee5 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -45,7 +45,7 @@ * @param string $price_base_type HT=on calcule sur le HT, TTC=on calcule sur le TTC * @param int $info_bits Miscellaneous informations on line * @param int $type 0/1=Product/service - * @param string $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc. + * @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc. * @param array $localtaxes_array Array with localtaxes info (loaded by getLocalTaxesFromRate function). * @return result[ 0=total_ht, * 1=total_vat, From 670e861d7b3b4c8df90a809e4b06337907ade2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:57:53 +0200 Subject: [PATCH 010/118] Qual: Missing global declaration --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5508887f139..7fc5d9b50c2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2278,7 +2278,7 @@ abstract class CommonObject */ function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='') { - global $_POST; + global $_POST, $conf; $out = ''; From d57b4192b65dec99da4865ed862c38c3bd573037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 11:59:33 +0200 Subject: [PATCH 011/118] Qual: Wrong variable name --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7fc5d9b50c2..838894fc851 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2482,7 +2482,7 @@ abstract class CommonObject $i=0; while ($i < $num) { - $obj = $this->db->fetch_object($query); + $obj = $this->db->fetch_object($resql); $pu_ht = $obj->pu_ht; $qty= $obj->qty; From 3eabffbc7c92887bc529eb755218bdb49ca4cde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 12:01:51 +0200 Subject: [PATCH 012/118] Qual: Missing global declaration --- htdocs/core/class/conf.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index e9b2728ad3f..a79cb494bd4 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -119,6 +119,8 @@ class Conf */ function setValues($db) { + global $conf; + dol_syslog(get_class($this)."::setValues"); /* From 258c92ab1c71a767d7b48b914718be369daae4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 12:03:01 +0200 Subject: [PATCH 013/118] Qual: Avoid wrong declaration --- htdocs/core/class/discount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index ede7615a65a..78c0add9aab 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -188,7 +188,7 @@ class DiscountAbsolute // Check if we can remove the discount if ($this->fk_facture_source) { - $sql.="SELECT COUNT(rowid) as nb"; + $sql="SELECT COUNT(rowid) as nb"; $sql.=" FROM ".MAIN_DB_PREFIX."societe_remise_except"; $sql.=" WHERE (fk_facture_line IS NOT NULL"; // Not used as absolute simple discount $sql.=" OR fk_facture IS NOT NULL)"; // Not used as credit note and not used as deposit From b522d51d494b29573ff150cc7ea821b99f588024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 12:04:19 +0200 Subject: [PATCH 014/118] Qual: Missing global declaration --- htdocs/core/class/dolprintipp.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/dolprintipp.class.php b/htdocs/core/class/dolprintipp.class.php index 926f5c42b42..768741d9368 100644 --- a/htdocs/core/class/dolprintipp.class.php +++ b/htdocs/core/class/dolprintipp.class.php @@ -126,7 +126,7 @@ class dolprintIPP */ function list_jobs($module) { - global $conf,$db; + global $conf, $db, $bc; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; $ipp = new CupsPrintIPP(); $ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose From a22ead5e9735e4d60e2bc37eb72620124b7a58b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 12:07:22 +0200 Subject: [PATCH 015/118] Qual: Wrong type in method documentation --- htdocs/core/class/extrafields.class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a980b4bef85..d5aa8594076 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -207,16 +207,16 @@ class ExtraFields /** * Add description of a new optional attribute * - * @param string $attrname code of attribute - * @param string $label label of attribute - * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour', 'float') - * @param int $pos Position of attribute - * @param int $size Size/length of attribute - * @param string $elementtype Element type ('member', 'product', 'company', ...) - * @param int $unique Is field unique or not - * @param int $required Is field required or not - * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) - * @return int <=0 if KO, >0 if OK + * @param string $attrname code of attribute + * @param string $label label of attribute + * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour', 'float') + * @param int $pos Position of attribute + * @param int $size Size/length of attribute + * @param string $elementtype Element type ('member', 'product', 'company', ...) + * @param int $unique Is field unique or not + * @param int $required Is field required or not + * @param array||string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) + * @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='') { From 70c9dda9642c3e96c0983d9520477d9054f0b846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 12:11:15 +0200 Subject: [PATCH 016/118] Qual: Missing global declaration --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d5aa8594076..93cd55e31ca 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -581,7 +581,7 @@ class ExtraFields */ function showInputField($key,$value,$moreparam='',$keyprefix='') { - global $conf,$langs; + global $conf,$langs,$db; $label=$this->attribute_label[$key]; $type =$this->attribute_type[$key]; From 2938ec06b213b67686f01e54bab59410e31784b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:26:57 +0200 Subject: [PATCH 017/118] Qual: Fixed typo --- htdocs/core/class/cookie.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index a45aaeb2423..629cf927815 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -34,7 +34,7 @@ class DolCookie var $myExpire; var $myPath; var $myDomain; - var $mySsecure; + var $mySecure; var $cookiearray; var $cookie; @@ -144,4 +144,4 @@ class DolCookie } -?> \ No newline at end of file +?> From 70cf592270aa783fa6d6ef5a7b246562b015ec43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:27:17 +0200 Subject: [PATCH 018/118] Qual: Wrong type in method documentation --- htdocs/core/class/cookie.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index 629cf927815..5d3d5352626 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -80,7 +80,7 @@ class DolCookie /** * Decrypt the cookie * - * @return void + * @return string */ function decryptCookie() { From e3385119a4276159586e82bb468a2512f72cbb81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:30:57 +0200 Subject: [PATCH 019/118] Qual: Missing argument --- htdocs/core/class/fileupload.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 910ad55e0a0..b5483139fb6 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -558,7 +558,8 @@ class FileUpload isset($_SERVER['HTTP_X_FILE_NAME']) ? $_SERVER['HTTP_X_FILE_NAME'] : (isset($upload['name']) ? $upload['name'] : null), isset($_SERVER['HTTP_X_FILE_SIZE']) ? $_SERVER['HTTP_X_FILE_SIZE'] : (isset($upload['size']) ? $upload['size'] : null), isset($_SERVER['HTTP_X_FILE_TYPE']) ? $_SERVER['HTTP_X_FILE_TYPE'] : (isset($upload['type']) ? $upload['type'] : null), - isset($upload['error']) ? $upload['error'] : null + isset($upload['error']) ? $upload['error'] : null, + 0 ); } header('Vary: Accept'); From cd774c0dcd048e2389854b7fdab8c465f97a8741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:31:39 +0200 Subject: [PATCH 020/118] Qual: Missing global declaration --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0943bce1e87..0c5fe571eda 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3160,7 +3160,7 @@ class Form */ function form_contacts($page, $societe, $selected='', $htmlname='contactidp') { - global $langs; + global $langs, $conf; if ($htmlname != "none") { From 9d7fc43951985697c55f3aadc27dffd5321ac4d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:37:20 +0200 Subject: [PATCH 021/118] Qual: Wrong type in method documentation --- htdocs/core/class/html.formadmin.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 6d570b70880..cf23a0871a5 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -199,9 +199,9 @@ class FormAdmin /** * Return combo list of available menu families * - * @param string $selected Menu pre-selected - * @param string $htmlname Name of html select - * @param string $dirmenuarray Directories to scan + * @param string $selected Menu pre-selected + * @param string $htmlname Name of html select + * @param string[] $dirmenuarray Directories to scan * @return void */ function select_menu_families($selected, $htmlname, $dirmenuarray) From 0be3d3bd2f74601452a58fbb1adce0e0ce78842a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:39:32 +0200 Subject: [PATCH 022/118] Qual: Missing global declaration --- htdocs/core/class/html.formfile.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 5317d49c23c..334fb9a5d9e 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -257,8 +257,7 @@ class FormFile */ function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='') { - global $langs,$conf,$hookmanager; - global $bc; + global $langs,$conf,$hookmanager,$user,$bc; // filedir = $conf->...->dir_ouput."/".get_exdir(id) include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 7039fd38927e54fcc383b997e2929d0ceeb4f321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:41:58 +0200 Subject: [PATCH 023/118] Qual: Missing class property declaration --- htdocs/core/class/html.formmail.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a76877c9994..b2c91087916 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -58,7 +58,8 @@ class FormMail var $withreplytoreadonly; var $withtoreadonly; var $withtoccreadonly; - var $withtopicreadonly; + var $withtocccreadonly; + var $withtopicreadonly; var $withfilereadonly; var $withdeliveryreceipt; var $withcancel; @@ -95,6 +96,7 @@ class FormMail $this->withreplytoreadonly=1; $this->withtoreadonly=0; $this->withtoccreadonly=0; + $this->withtocccreadonly=0; $this->witherrorstoreadonly=0; $this->withtopicreadonly=0; $this->withfilereadonly=0; From 0ca5a46345fdd5456f94c68ca3226e34f02fc164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:44:43 +0200 Subject: [PATCH 024/118] Qual: Bad copy/paste --- htdocs/core/class/html.formother.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 916f2cbcd9a..85bd466f948 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -391,7 +391,7 @@ class FormOther $moreinfo=0; if (! empty($conf->global->MAIN_SHOW_LOGIN)) { - $out.=($moreinfo?' - ':' (').$obj->login; + $moreforfilter.=($moreinfo?' - ':' (').$obj_usr->login; $moreinfo++; } if ($showstatus >= 0) From 32ad4461b8469062db15de578c6c2271e2a802be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:47:02 +0200 Subject: [PATCH 025/118] Qual: Missing method argument --- htdocs/core/class/html.formother.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 85bd466f948..3ac6ce0eba1 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1095,9 +1095,10 @@ class FormOther * @param string $labelfield Label field * @param string $selected Selected value * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib More attributes on HTML select tag * @return void */ - function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0) + function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='') { global $langs, $conf; From 749973f1b650a96390da5707b539a3176e3b98d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:51:08 +0200 Subject: [PATCH 026/118] Qual: Missing variable declaration --- htdocs/core/class/html.formsms.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 808c3fc4b8e..910460b4884 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -213,6 +213,7 @@ function limitChars(textarea, limit, infodiv) else { dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE", LOG_WARNING); + $resultsender=array(); $resultsender[0]->number=$this->fromsms; } From 0fa803977ee43ea3e0c9877765c649fe5a2cf134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:54:34 +0200 Subject: [PATCH 027/118] Qual: Removed call to inexistant object --- htdocs/core/class/infobox.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 622cc757983..2e04fdfa752 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -201,7 +201,7 @@ class InfoBox $tab[$confuserzone]=1; if (dol_set_user_param($db, $conf, $user, $tab) < 0) { - $this->error=$db->lasterror(); + $error=$db->lasterror(); $db->rollback(); return -3; } From 1bb99da8db1cf43ba807525422b0736a8b4a567b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 14:57:47 +0200 Subject: [PATCH 028/118] Qual: Wrong type in method documentation --- htdocs/core/class/ldap.class.php | 50 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 2a3eb3647ae..5a6c2e8b6de 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -359,10 +359,10 @@ class Ldap * Add a LDAP entry * Ldap object connect and bind must have been done * - * @param string $dn DN entry key - * @param string $info Attributes array - * @param User $user Objet user that create - * @return int <0 if KO, >0 if OK + * @param string $dn DN entry key + * @param string[] $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function add($dn, $info, $user) { @@ -413,7 +413,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string $info Attributes array + * @param string[] $info Attributes array * @param string $user Objet user that modify * @return int <0 if KO, >0 if OK */ @@ -465,7 +465,7 @@ class Ldap * Ldap object connect and bind must have been done * * @param string $dn DN entry key - * @param string $info Attributes array + * @param string[] $info Attributes array * @param User $user Objet user that update * @param string $olddn Old DN entry key (before update) * @return int <0 if KO, >0 if OK @@ -552,9 +552,9 @@ class Ldap /** * Build a LDAP message * - * @param string $dn DN entry key - * @param string $info Attributes array - * @return string Content of file + * @param string $dn DN entry key + * @param string[] $info Attributes array + * @return string Content of file */ function dump_content($dn, $info) { @@ -594,9 +594,9 @@ class Ldap /** * Dump a LDAP message to ldapinput.in file * - * @param string $dn DN entry key - * @param string $info Attributes array - * @return int <0 if KO, >0 if OK + * @param string $dn DN entry key + * @param string[] $info Attributes array + * @return int <0 if KO, >0 if OK */ function dump($dn, $info) { @@ -631,10 +631,10 @@ class Ldap * Add a LDAP attribute in entry * Ldap object connect and bind must have been done * - * @param string $dn DN entry key - * @param string $info Attributes array - * @param User $user Objet user that create - * @return int <0 if KO, >0 if OK + * @param string $dn DN entry key + * @param string[] $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function addAttribute($dn, $info, $user) { @@ -683,10 +683,10 @@ class Ldap * Update a LDAP attribute in entry * Ldap object connect and bind must have been done * - * @param string $dn DN entry key - * @param string $info Attributes array - * @param User $user Objet user that create - * @return int <0 if KO, >0 if OK + * @param string $dn DN entry key + * @param string[] $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function updateAttribute($dn, $info, $user) { @@ -735,10 +735,10 @@ class Ldap * Delete a LDAP attribute in entry * Ldap object connect and bind must have been done * - * @param string $dn DN entry key - * @param string $info Attributes array - * @param User $user Objet user that create - * @return int <0 if KO, >0 if OK + * @param string $dn DN entry key + * @param string[] $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function deleteAttribute($dn, $info, $user) { @@ -1370,4 +1370,4 @@ class Ldap } -?> \ No newline at end of file +?> From aa5d0b37b728ba2d5735f0eba6bb60ebf74f9acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:03:56 +0200 Subject: [PATCH 029/118] Qual: Wrong type in method documentation --- htdocs/core/class/menubase.class.php | 2 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index c884344dd1f..88908abfbe6 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -403,7 +403,7 @@ class Menubase /** * Load entries found from database in this->newmenu array. * - * @param array $newmenu Menu array to complete (in most cases, it's empty, may be already initialized with some menu manager like eldy) + * @param Menu $newmenu Menu array to complete (in most cases, it's empty, may be already initialized with some menu manager like eldy) * @param string $mymainmenu Value for mainmenu to filter menu to load (often $_SESSION["mainmenu"]) * @param string $myleftmenu Value for leftmenu to filter menu to load (always '') * @param int $type_user 0=Menu for backoffice, 1=Menu for front office diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index c395b775937..a820243ba66 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -202,7 +202,7 @@ function print_end_menu_array_auguria() * @param array $menu_array_before Table of menu entries to show before entries of menu handler * @param array $menu_array_after Table of menu entries to show after entries of menu handler * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param array &$menu Object Menu to return back list of menu entries + * @param Menu &$menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 0088de9955c..e400c72c027 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -427,7 +427,7 @@ function print_end_menu_array() * @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) * @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @param array &$menu Object Menu to return back list of menu entries + * @param Menu &$menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) From 63166f3f5c82d1723d2f87eb4eec2a021b720e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:05:00 +0200 Subject: [PATCH 030/118] Qual: Wrong type in method documentation --- htdocs/core/class/rssparser.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 13c7db642b1..6569027d483 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -174,7 +174,7 @@ class RssParser * @param string $urlRSS Url to parse * @param int $maxNb Max nb of records to get (0 for no limit) * @param int $cachedelay 0=No cache, nb of seconds we accept cache files (cachedir must also be defined) - * @param strnig $cachedir Directory where to save cache file + * @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='') @@ -775,4 +775,4 @@ function xml2php($xml) } -?> \ No newline at end of file +?> From af7d2d0b5069a17e13491be884cb1fa3b673bc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:11:26 +0200 Subject: [PATCH 031/118] Qual: Wrong type in method documentation --- htdocs/core/class/rssparser.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 6569027d483..06d26c94edf 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -722,7 +722,7 @@ class RssParser /** * Function to convert an XML object into an array * - * @param string $xml Xml + * @param SimpleXMLElement $xml Xml * @return void */ function xml2php($xml) From b6312d1efdb1de64294d1b487e5e6a531f7cdbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:23:02 +0200 Subject: [PATCH 032/118] Qual: Missing method argument --- htdocs/core/class/stats.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 874a2740edc..6162e0dcdd0 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -491,9 +491,10 @@ abstract class Stats * * @param int $year Year * @param string $sql SQL - * @return array + * @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is a number + * @return array */ - function _getAverageByMonth($year, $sql) + function _getAverageByMonth($year, $sql, $format=0) { $result=array(); $res=array(); From 43606c8ac4991aa779f3cd26d15eea2901454b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:24:09 +0200 Subject: [PATCH 033/118] Qual: Fixed typo --- htdocs/core/class/translate.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 7a855eb9325..394dd4fad82 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -703,7 +703,7 @@ class Translate */ function getCurrencyAmount($currency_code, $amount) { - $symbol=$this->getCurrencSymbol($currency_code); + $symbol=$this->getCurrencySymbol($currency_code); if (in_array($currency_code, array('USD'))) return $symbol.$amount; else return $amount.$symbol; From e5975d52a960553bc3d35ef627d2e2e0525c30c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:28:00 +0200 Subject: [PATCH 034/118] Qual: Wrong type in method documentation --- htdocs/core/filemanagerdol/connectors/php/util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/filemanagerdol/connectors/php/util.php b/htdocs/core/filemanagerdol/connectors/php/util.php index d221c936fbf..0a7b5fbf9ad 100644 --- a/htdocs/core/filemanagerdol/connectors/php/util.php +++ b/htdocs/core/filemanagerdol/connectors/php/util.php @@ -51,7 +51,7 @@ function RemoveFromEnd($sourceString, $charToRemove) /** * FindBadUtf8 * - * @param unknown_type $string String + * @param string $string String * @return boolean */ function FindBadUtf8($string) From aad43597860ca7574cba86761154c7502c144e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:33:15 +0200 Subject: [PATCH 035/118] Qual: Removed missing variable from function call --- htdocs/core/lib/agenda.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index e66d24e576e..40d1e043c1d 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -386,14 +386,14 @@ function agenda_prepare_head() $head[$h][2] = 'other'; $h++; - complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin'); + complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin'); $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'attributes'; $h++; - complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin','remove'); + complete_head_from_modules($conf,$langs,null,$head,$h,'agenda_admin','remove'); return $head; From 75eb98033ffa5edec3cd9bff26e1fb84e4d7c587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Wed, 23 Apr 2014 15:33:51 +0200 Subject: [PATCH 036/118] Qual: Fixed typo --- htdocs/core/lib/ajax.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 72592b1e68f..cddd5cc557e 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -272,7 +272,7 @@ function ajax_dialog($title,$message,$w=350,$h=150) { global $langs; - $msg.= '
'; + $msg= '
'; $msg.= $message; $msg.= '
'."\n"; $msg.= '