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/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. diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index af39da58cf7..1b290222a11 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 ); } @@ -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); } @@ -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 */ 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'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ba4094c2a14..004153e2fdc 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); @@ -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') @@ -1721,7 +1721,7 @@ abstract class CommonObject * @param string $clause OR, AND clause * @return void */ - function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR') + function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR') { global $conf; @@ -2278,7 +2278,7 @@ abstract class CommonObject */ function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='') { - global $_POST; + global $_POST, $conf; $out = ''; @@ -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; 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"); /* diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index a45aaeb2423..5d3d5352626 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; @@ -80,7 +80,7 @@ class DolCookie /** * Decrypt the cookie * - * @return void + * @return string */ function decryptCookie() { @@ -144,4 +144,4 @@ class DolCookie } -?> \ No newline at end of file +?> 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 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 diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index a980b4bef85..93cd55e31ca 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='') { @@ -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]; 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'); 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") { 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) 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'; 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; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 916f2cbcd9a..3ac6ce0eba1 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) @@ -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; 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; } 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; } 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 +?> diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index c884344dd1f..a754cc124e8 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -403,13 +403,13 @@ 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 * @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...) * @param array &$tabMenu Array with menu entries already loaded - * @return array Menu array for particular mainmenu value or full tabArray + * @return Menu Menu array for particular mainmenu value or full tabArray */ function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) { diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 13c7db642b1..06d26c94edf 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='') @@ -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) @@ -775,4 +775,4 @@ function xml2php($xml) } -?> \ No newline at end of file +?> 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(); 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; 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) 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; 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.= '