From 7a8f244ae986f190b178448712d7acd91ef32fac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jul 2014 16:03:55 +0200 Subject: [PATCH 01/23] Fix: Translation --- htdocs/langs/fa_IR/main.lang | 30 +++++++++++++++--------------- test/phpunit/LangTest.php | 10 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/langs/fa_IR/main.lang b/htdocs/langs/fa_IR/main.lang index df308499c01..73252f2f85a 100644 --- a/htdocs/langs/fa_IR/main.lang +++ b/htdocs/langs/fa_IR/main.lang @@ -7,21 +7,21 @@ DIRECTION=لیتر FONTFORPDF=DejaVuSans FONTSIZEFORPDF=10 SeparatorDecimal=. -SeparatorThousand=، -FormatDateShort=٪ M /٪ د /٪ Y -FormatDateShortInput=٪ M /٪ د /٪ Y -FormatDateShortJava=MM / DD / YYYY -FormatDateShortJavaInput=MM / DD / YYYY -FormatDateShortJQuery=ماه / روز / سا -FormatDateShortJQueryInput=ماه / روز / سا -FormatHourShort=٪ I:٪ M٪ P -FormatHourShortDuration=٪ H:٪ M -FormatDateTextShort=٪ B٪ د،٪ Y -FormatDateText=٪ B٪ د،٪ Y -FormatDateHourShort=٪ M /٪ د /٪ Y٪ I:٪ M٪ P -FormatDateHourSecShort=٪ M /٪ د /٪ Y٪ I:٪ M:٪ S٪ P -FormatDateHourTextShort=٪ B٪ د،٪ Y،٪ I:٪ M٪ P -FormatDateHourText=٪ B٪ د،٪ Y،٪ I:٪ M٪ P +SeparatorThousand=None +FormatDateShort=%m/%d/%Y +FormatDateShortInput=%m/%d/%Y +FormatDateShortJava=MM/dd/yyyy +FormatDateShortJavaInput=MM/dd/yyyy +FormatDateShortJQuery=yy/dd/mm +FormatDateShortJQueryInput=yy/dd/mm +FormatHourShort=%I:%M +FormatHourShortDuration=%H:%M +FormatDateTextShort=%b %d %Y +FormatDateText=%B %d %Y +FormatDateHourShort=%m/%d/%Y %I:%M:%S %p +FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p +FormatDateHourTextShort=%b %d %Y %I:%M %p +FormatDateHourText=%B %d %Y %H:%M %p DatabaseConnection=اتصال به پایگاه داده NoTranslation=بدون ترجمه NoRecordFound=هیچ سابقه ای پیدا نشد diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 7d173481501..c0788feef8a 100755 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -146,7 +146,7 @@ class LangTest extends PHPUnit_Framework_TestCase { if (! preg_match('/^[a-z]+_[A-Z]+$/',$code)) continue; - print 'Check language file for code='.$code."\n"; + print 'Check language file for lang code='.$code."\n"; $tmplangs=new Translate('',$conf); $langcode=$code; $tmplangs->setDefaultLang($langcode); @@ -154,19 +154,19 @@ class LangTest extends PHPUnit_Framework_TestCase $result=$tmplangs->trans("SeparatorDecimal"); print __METHOD__." SeparatorDecimal=".$result."\n"; - $this->assertContains($result,array('.',',','/',' ','','None'), 'Error for code '.$code); + $this->assertContains($result,array('.',',','/',' ','','None'), 'Error for decimal separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported $result=$tmplangs->trans("SeparatorThousand"); print __METHOD__." SeparatorThousand=".$result."\n"; - $this->assertContains($result, array('.',',','/',' ','','None','Space'), 'Error for code '.$code); + $this->assertContains($result, array('.',',','/',' ','','None','Space'), 'Error for thousand separator for lang code '.$code); // Note that ، that is coma for RTL languages is not supported // Test java string contains only d,M,y,/,-,. and not m,... $result=$tmplangs->trans("FormatDateShortJava"); print __METHOD__." FormatDateShortJava=".$result."\n"; - $this->assertRegExp('/^[dMy\/\-\.]+$/',$result); + $this->assertRegExp('/^[dMy\/\-\.]+$/',$result,'FormatDateShortJava'); $result=$tmplangs->trans("FormatDateShortJavaInput"); print __METHOD__." FormatDateShortJavaInput=".$result."\n"; - $this->assertRegExp('/^[dMy\/\-\.]+$/',$result); + $this->assertRegExp('/^[dMy\/\-\.]+$/',$result,'FormatDateShortJavaInput'); unset($tmplangs); } From 109ccf9b74d8e334afdcb9a98a7f658fbe5bc301 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 19 Jul 2014 22:40:53 +0200 Subject: [PATCH 02/23] Fix: SQL syntax error with pgsql Conflicts: htdocs/contrat/class/contrat.class.php --- htdocs/contrat/class/contrat.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d384eea9b91..09900e14d49 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -448,14 +448,14 @@ class Contrat extends CommonObject $this->extraparams = (array) json_decode($result["extraparams"], true); $this->db->free($resql); - + // Retreive all extrafield for thirdparty // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); $extrafields=new ExtraFields($this->db); $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); - + return $this->id; } @@ -728,7 +728,7 @@ class Contrat extends CommonObject $sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,"; $sql.= " ref, entity, note_private, note_public)"; $sql.= " VALUES ('".$this->db->idate($now)."',".$this->socid.",".$user->id; - $sql.= ",".$this->db->idate($this->date_contrat); + $sql.= ", '".$this->db->idate($this->date_contrat)."'"; $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); $sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL"); $sql.= ",".($this->fk_project>0?$this->fk_project:"NULL"); @@ -761,8 +761,8 @@ class Contrat extends CommonObject // Insert contacts commerciaux ('SALESREPFOLL','contrat') $result=$this->add_contact($this->commercial_suivi_id,'SALESREPFOLL','internal'); if ($result < 0) $error++; - - + + if (! $error) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used From a9779ca1ffc7243e330d5872d925cb1ad493e6ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 02:18:21 +0200 Subject: [PATCH 03/23] Fix: bad colspan for line with date selector --- htdocs/core/tpl/objectline_create.tpl.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 170cc1e0fc7..68613492df8 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -244,7 +244,7 @@ else { table_element_line=='commandedet') { $newline = new OrderLine($this->db); @@ -259,7 +259,7 @@ else { print $newline->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$coldisplay+8)); } } - ?> + ?> service->enabled) && $dateSelector) { if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; else $colspan = 9; + if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc + if (in_array($object->element,array('propal','facture','invoice','commande','order'))) $colspan++; // With this, there is a column move button if (! empty($usemargins)) { From 8137fd7fe427bf42ab461842e826efc678432996 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 02:36:03 +0200 Subject: [PATCH 04/23] Fix: Type of line (product/service) could not be edited on supplier order/invoice. --- htdocs/core/class/html.form.class.php | 6 +++--- htdocs/fourn/commande/fiche.php | 12 +++++++----- htdocs/fourn/facture/fiche.php | 8 ++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f5d14b7529..09730a93545 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -544,7 +544,7 @@ class Form * @param string $htmlname Name of field in html form * @param int $showempty Add an empty field * @param int $hidetext Do not show label before combo box - * @param string $forceall Force to show products and services in combo list, whatever are activated modules + * @param string $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service') * @return void */ function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) @@ -552,8 +552,8 @@ class Form global $db,$langs,$user,$conf; // If product & services are enabled or both disabled. - if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) - || (empty($conf->product->enabled) && empty($conf->service->enabled))) + if ($forceall > 0 || (empty($forceall) && ! empty($conf->product->enabled) && ! empty($conf->service->enabled)) + || (empty($forceall) && empty($conf->product->enabled) && empty($conf->service->enabled)) ) { if (empty($hidetext)) print $langs->trans("Type").': '; print ''; - if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $object->lines[$i]->fk_product) + if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $object->lines[$i]->fk_product > 0) { print ''; $product_static=new ProductFournisseur($db); @@ -1964,9 +1964,9 @@ else print '
'; } else - { + { $forceall=1; // For suppliers, we always show all types - print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1); + print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1,0,$forceall); if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; } From 5cbb39594f617aeb1d6712132f514c411c7f002c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 05:03:40 +0200 Subject: [PATCH 05/23] Fix: I hate duplicated documentation. --- README-FR.md | 4 ++-- README.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README-FR.md b/README-FR.md index 4fda8c4c3e6..aa8c3c1f5da 100644 --- a/README-FR.md +++ b/README-FR.md @@ -115,8 +115,8 @@ Divers: - Application simple à utiliser. - Plusieurs thèmes visuels. - Code simple et facilement personnalisable. -- Fonctionne avec PHP 5.3+, MySQL 4.1+ ou PostgreSql 8.1.4+. -- Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP. +- Requiert PHP et Mysql ou Postgresql (Voir versions exactes sur http://wiki.dolibarr.org/index.php/Prérequis). +- Compatible avec toutes les offres Cloud du marché respectant les prérequis MySQL et PHP ou Postgresql. ## CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE) diff --git a/README.md b/README.md index bf95452487b..93b9d275beb 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ See ChangeLog file found into package. - Very user friendly and easy to use. - Highly customizable: Enable only modules you need, user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one). - Works with PHP 5.3+, MySql 4.1 or PostgreSQL 8.1. +- Require PHP and Mysql or Postgresql (See exatc versions on http://wiki.dolibarr.org/index.php/Prerequisite). - Compatible with all Cloud solutions that match MySql, PHP or PostgreSQL prerequisites. - An easy to understand, maintain and code interfaces with your own system information (PHP with no heavy frameworks, trigger and hook architecture). - Support countries specific features: From 4f173d095c7d12c89e921756ecbcb14ac64e2f53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 13:32:06 +0200 Subject: [PATCH 06/23] Qual: Add php unit for function is_ip --- test/phpunit/Functions2LibTest.php | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 8e4bfe7550f..ab792a10183 100755 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -154,4 +154,41 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase $this->assertEquals(0,$result); } + /** + * isIP + * + * @return void + */ + public function testIsIP() + { + $ip='a299.299.299.299'; + $result=is_ip($ip); + print __METHOD__." for ".$ip." result=".$result."\n"; + $this->assertEquals(0,$result,$ip); + + $ip='1.2.3.4'; + $result=is_ip($ip); + print __METHOD__." for ".$ip." result=".$result."\n"; + $this->assertEquals(1,$result,$ip); + + $ip='10.0.0.0'; + $result=is_ip($ip); + print __METHOD__." for ".$ip." result=".$result."\n"; + $this->assertEquals(2,$result,$ip); + + $ip='172.16.0.0'; + $result=is_ip($ip); + print __METHOD__." for ".$ip." result=".$result."\n"; + $this->assertEquals(2,$result,$ip); + + $ip='192.168.0.0'; + $result=is_ip($ip); + print __METHOD__." for ".$ip." result=".$result."\n"; + $this->assertEquals(2,$result,$ip); + + $ip='169.254.0.0'; + $result=is_ip($ip); + print __METHOD__." for ".$ip." result=".$result."\n"; + $this->assertEquals(2,$result,$ip); + } } From bd095f597d58b5275371b24001975cbaeb846d9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 14:54:30 +0200 Subject: [PATCH 07/23] Fix: CheckStyle --- htdocs/core/lib/functions.lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e91ee751727..8fbb5fd34ec 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4053,10 +4053,11 @@ function dolGetFirstLastname($firstname,$lastname,$nameorder=-1) /** - * Set event message in dol_events session + * Set event message in dol_events session object. Will be output by calling dol_htmloutput_events. + * Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function. * * @param mixed $mesgs Message string or array - * @param string $style Which style to use ('mesgs', 'warnings', 'errors') + * @param string $style Which style to use ('mesgs' by default, 'warnings', 'errors') * @return void * @see dol_htmloutput_events */ @@ -4078,6 +4079,8 @@ function setEventMessage($mesgs, $style='mesgs') /** * Print formated messages to output (Used to show messages on html output). + * Note: Calling dol_htmloutput_events is done into pages by standard llxFooter() function, so there is + * no need to call it explicitely. * * @return void * @see dol_htmloutput_mesg From ad104470d8b94961b465c0d449b6a01f68175ea7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 14:55:18 +0200 Subject: [PATCH 08/23] Fix: CheckStyle --- htdocs/admin/fckeditor.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 650def1f1af..2541a6265e7 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -15,7 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -120,10 +119,7 @@ $var=true; if (empty($conf->use_javascript_ajax)) { - setEventMessage(array( - $langs->trans("NotAvailable"), - $langs->trans("JavascriptDisabled") - ), 'errors'); + setEventMessage(array($langs->trans("NotAvailable"), $langs->trans("JavascriptDisabled")), 'errors'); } else { From cfc337a79a52fba9e0dd19a7881c14356ac55174 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 15:27:38 +0200 Subject: [PATCH 09/23] Qual: Enable php checkstyle rule Zend.Files.ClosingTag Fix: Solve a lot of checkstyle errors. --- dev/codesniffer/ruleset.dtd | 3 ++- dev/codesniffer/ruleset.xml | 6 ++++- htdocs/core/class/interfaces.class.php | 20 +++++++++++++--- .../core/triggers/DolibarrTriggers.class.php | 10 ++++---- .../interface_20_all_Logevents.class.php | 12 +++++----- ...face_20_modPaypal_PaypalWorkflow.class.php | 12 +++++----- ...e_20_modWorkflow_WorkflowManager.class.php | 8 +++---- ...terface_50_modAgenda_ActionsAuto.class.php | 6 ++--- ...interface_50_modLdap_Ldapsynchro.class.php | 6 ++--- ...odMailmanspip_Mailmanspipsynchro.class.php | 6 ++--- ..._50_modNotification_Notification.class.php | 6 ++--- .../interface_90_all_Demo.class.php-NORUN | 6 ++--- htdocs/livraison/class/livraison.class.php | 6 ++--- htdocs/opensurvey/fonctions.php | 24 +++++++++---------- htdocs/opensurvey/results.php | 1 - htdocs/printipp/admin/printipp.php | 7 +++--- htdocs/societe/ajaxcompanies.php | 2 -- .../canvas/actions_card_common.class.php | 2 -- test/phpunit/CommandeFournisseurTest.php | 1 - test/phpunit/CommandeTest.php | 1 - test/phpunit/CommonObjectTest.php | 1 - test/phpunit/CompanyBankAccountTest.php | 1 - test/phpunit/EntrepotTest.php | 1 - test/phpunit/ExportTest.php | 1 - test/phpunit/FactureRecTest.php | 13 +++++----- test/phpunit/FactureTest.php | 1 - test/phpunit/FunctionsLibTest.php | 1 - test/phpunit/PropalTest.php | 1 - test/phpunit/SocieteTest.php | 1 - test/phpunit/UserTest.php | 1 - test/phpunit/WebservicesInvoicesTest.php | 1 - test/phpunit/WebservicesThirdpartyTest.php | 1 - 32 files changed, 81 insertions(+), 88 deletions(-) diff --git a/dev/codesniffer/ruleset.dtd b/dev/codesniffer/ruleset.dtd index 0d498bb033c..e307d564e12 100755 --- a/dev/codesniffer/ruleset.dtd +++ b/dev/codesniffer/ruleset.dtd @@ -1,7 +1,8 @@ - + + diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 9d605cefbb1..ba1a1ba65c3 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -3,6 +3,10 @@ Dolibarr coding standard. + */conf.php + */includes/* + */documents/* + @@ -19,7 +23,7 @@ - + diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 2f70c91ac6d..50a9cced421 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -149,9 +149,23 @@ class Interfaces $objMod = new $modName($this->db); if ($objMod) { - dol_syslog(get_class($this)."::run_triggers action=".$action." Launch triggers for file '".$files[$key]."'", LOG_INFO); + $result=0; + + if (method_exists($objMod, 'runTrigger')) // New method to implement + { + dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_INFO); + $result=$objMod->runTrigger($action,$object,$user,$langs,$conf); + } + elseif (method_exists($objMod, 'run_trigger')) // Deprecated method + { + dol_syslog(get_class($this)."::run_triggers action=".$action." Launch run_trigger for file '".$files[$key]."'", LOG_INFO); + $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); + } + else + { + dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR); + } - $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); if ($result > 0) { // Action OK @@ -173,7 +187,7 @@ class Interfaces } } else - { + { dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR); } } diff --git a/htdocs/core/triggers/DolibarrTriggers.class.php b/htdocs/core/triggers/DolibarrTriggers.class.php index 8d3227e6482..1fd29359d74 100644 --- a/htdocs/core/triggers/DolibarrTriggers.class.php +++ b/htdocs/core/triggers/DolibarrTriggers.class.php @@ -1,7 +1,5 @@ +/* Copyright (C) 2014 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,15 +133,15 @@ abstract class DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - abstract function run_trigger($action, $object, User $user, Translate $langs, Conf $conf); + abstract function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); } \ No newline at end of file diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index a16eb82e2ab..0770af54520 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -36,16 +36,16 @@ class InterfaceLogevents extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object - * @param User $user Object user - * @param Translate $langs Object langs - * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @param User $user Object user + * @param Translate $langs Object langs + * @param conf $conf Object conf + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (! empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0; // Log events is disabled (hidden features) diff --git a/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php b/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php index 631b6a28639..13647814bb4 100644 --- a/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php +++ b/htdocs/core/triggers/interface_20_modPaypal_PaypalWorkflow.class.php @@ -35,16 +35,16 @@ class InterfacePaypalWorkflow extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object - * @param User $user Object user - * @param Translate $langs Object langs - * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @param User $user Object user + * @param Translate $langs Object langs + * @param conf $conf Object conf + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { // Mettre ici le code a executer en reaction de l'action // Les donnees de l'action sont stockees dans $object diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 074118ebdd4..c1e3995afa8 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -37,16 +37,16 @@ class InterfaceWorkflowManager extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->workflow->enabled)) return 0; // Module not active, we do nothing @@ -116,7 +116,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers return $ret; } } - + // classify billed order if ($action == 'BILL_VALIDATE') { diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 8ad12b34638..a30c26ece3b 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -38,7 +38,7 @@ class InterfaceActionsAuto extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * Following properties must be filled: * $object->actiontypecode (translation action code: AC_OTH, ...) @@ -55,9 +55,9 @@ class InterfaceActionsAuto extends DolibarrTriggers * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { // Module not active, we do nothing if (empty($conf->agenda->enabled)) { diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index f98d8bf5248..dcecdc26991 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -37,16 +37,16 @@ class InterfaceLdapsynchro extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->ldap->enabled)) return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index 51f84d2f39e..d2c01f5f508 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -37,16 +37,16 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->mailmanspip->enabled)) return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 159b3575855..c26ca4e33ef 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -46,16 +46,16 @@ class InterfaceNotification extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { if (empty($conf->notification->enabled)) return 0; // Module not active, we do nothing diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index 1599ec2c45d..d1f093af09b 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -43,16 +43,16 @@ class InterfaceDemo extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * * @param string $action Event action code * @param Object $object Object * @param User $user Object user * @param Translate $langs Object langs * @param conf $conf Object conf - * @return int <0 if KO, 0 if no triggered ran, >0 if OK + * @return int <0 if KO, 0 if no triggered ran, >0 if OK */ - public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf) + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) { // Put here code you want to execute when a Dolibarr business events occurs. // Data and type of action are stored into $object and $action diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index c46e333c191..7db42b6ac44 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -606,8 +606,8 @@ class Livraison extends CommonObject if ($result < 0) { $this->db->rollback(); - return -4; - } + return -4; + } // End call triggers return 1; @@ -959,5 +959,3 @@ class LivraisonLigne } } - -?> diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index c3c80a59b86..b65abcaffe9 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -25,14 +25,14 @@ /** * Returns an array with the tabs for the "Opensurvey poll" section * It loads tabs from modules looking for the entity Opensurveyso - * + * * @param Opensurveysondage $object Current viewing poll * @return array Tabs for the opensurvey section */ function opensurvey_prepare_head(Opensurveysondage $object) { - + global $langs, $conf; - + $h = 0; $head = array(); @@ -40,7 +40,7 @@ function opensurvey_prepare_head(Opensurveysondage $object) { $head[0][1] = $langs->trans("Card"); $head[0][2] = 'general'; $h++; - + $head[1][0] = 'results.php?id='.$object->id_sondage; $head[1][1] = $langs->trans("SurveyResults"); $head[1][2] = 'preview'; @@ -111,12 +111,12 @@ function showlogo() $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file=thumbs/'.urlencode($mysoc->logo_small); } } - + if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))) { $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; } - + print '
Logo
'; print '
'; } @@ -205,14 +205,14 @@ function dol_survey_random($car) function ajouter_sondage() { global $db, $user; - + require_once DOL_DOCUMENT_ROOT.'/opensurvey/class/opensurveysondage.class.php'; $sondage=dol_survey_random(16); $allow_comments = empty($_SESSION['allow_comments']) ? 0 : 1; $allow_spy = empty($_SESSION['allow_spy']) ? 0 : 1; - + // Insert survey $opensurveysondage = new Opensurveysondage($db); $opensurveysondage->id_sondage = $sondage; @@ -226,9 +226,9 @@ function ajouter_sondage() $opensurveysondage->allow_comments = $allow_comments; $opensurveysondage->allow_spy = $allow_spy; $opensurveysondage->sujet = $_SESSION['toutchoix']; - + $res = $opensurveysondage->create($user); - + if ($res < 0) { dol_print_error($db); } @@ -243,11 +243,9 @@ function ajouter_sondage() unset($_SESSION['toutchoix']); unset($_SESSION['totalchoixjour']); unset($_SESSION['champdatefin']); - + $urlback=dol_buildpath('/opensurvey/card.php',1).'?id='.$sondage; header("Location: ".$urlback); exit(); } - -?> diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 7dbdac8c2bc..63c56f9d5e3 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -1078,4 +1078,3 @@ print ''."\n"; llxFooterSurvey(); $db->close(); -?> diff --git a/htdocs/printipp/admin/printipp.php b/htdocs/printipp/admin/printipp.php index 08202b38f8e..68dee5ca22b 100644 --- a/htdocs/printipp/admin/printipp.php +++ b/htdocs/printipp/admin/printipp.php @@ -149,7 +149,7 @@ if ($mode == 'config' && $user->admin) print $langs->trans("PRINTIPP_PASSWORD").''; print ''; print ''; - + //$var=true; //print ''; //print ''.$langs->trans("OtherParameter").''; @@ -181,7 +181,7 @@ if ($mode == 'test' && $user->admin) print 'Media'; print 'Supported'; print "\n"; - + $list = $printer->getlist_available_printers(); $var = true; foreach ($list as $value) @@ -203,7 +203,7 @@ if ($mode == 'test' && $user->admin) print "\n"; } print ''; - + if (count($list) == 0) print $langs->trans("NoPrinterFound"); } @@ -212,4 +212,3 @@ dol_fiche_end(); llxFooter(); $db->close(); -?> diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 36abbb909ad..8771c0219c7 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -110,5 +110,3 @@ else { echo json_encode(array('nom'=>'ErrorBadParameter','label'=>'ErrorBadParameter','key'=>'ErrorBadParameter','value'=>'ErrorBadParameter')); } - -?> \ No newline at end of file diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 1ee163038bb..27630fa4dfe 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -705,5 +705,3 @@ abstract class ActionsCardCommon } } - -?> diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 2c83b4fdfc3..90c0d10e3fb 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -338,4 +338,3 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 451e886a761..8a2e3f57120 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -265,4 +265,3 @@ class CommandeTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index cbdde31e14d..a22146dfc2a 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -183,4 +183,3 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase return $result; } } -?> \ No newline at end of file diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 24d6ad03d80..a105bb37a53 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -233,4 +233,3 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase } } -?> diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index efd5f54008f..53788d71dab 100755 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -257,4 +257,3 @@ class EntrepotTest extends PHPUnit_Framework_TestCase return; } } -?> \ No newline at end of file diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index d5938fc4691..49695ab1946 100755 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -265,4 +265,3 @@ class ExportTest extends PHPUnit_Framework_TestCase return true; } } -?> diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 4adace8ef9a..8933b9a73e0 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -131,7 +131,7 @@ class FactureRecTest extends PHPUnit_Framework_TestCase $localobjectinv=new Facture($this->savdb); $localobjectinv->initAsSpecimen(); $localobjectinv->create($user); - + $localobject=new FactureRec($this->savdb); $localobject->initAsSpecimen(); $result=$localobject->create($user, $localobjectinv->id); @@ -141,11 +141,11 @@ class FactureRecTest extends PHPUnit_Framework_TestCase return $result; } - - - - - + + + + + /** * Edit an object to test updates * @@ -196,4 +196,3 @@ class FactureRecTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> \ No newline at end of file diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 9551c6ce02e..a16ddbbbf47 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -329,4 +329,3 @@ class FactureTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 2178ad6fb5a..8bf126e99c5 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -784,4 +784,3 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase } } -?> diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 3cac847a01f..20b6a5afa38 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -265,4 +265,3 @@ class PropalTest extends PHPUnit_Framework_TestCase } } -?> diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 162248f2e98..730d3d457a2 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -456,4 +456,3 @@ class SocieteTest extends PHPUnit_Framework_TestCase } } -?> diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index d161b3ce395..5df1549ea14 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -318,4 +318,3 @@ class UserTest extends PHPUnit_Framework_TestCase return $retAr; } } -?> \ No newline at end of file diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 12c01eeba70..20e01595375 100755 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -181,4 +181,3 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase } } -?> diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 8ef0c383955..64753dcc502 100755 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -181,4 +181,3 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase } } -?> From d7163fe5434d1efae6371b50adafffa869209178 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 15:34:33 +0200 Subject: [PATCH 10/23] Qual: Start to fight deprecated code use reported by https://scrutinizer-ci.com/g/eldy/dolibarr/issues/develop?orderField=path&order=asc --- htdocs/comm/action/listactions.php | 12 +----------- htdocs/comm/address.php | 4 ++-- htdocs/societe/class/societe.class.php | 8 +++++--- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index cdd81877d7b..055086bbdbb 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -195,16 +195,6 @@ if ($resql) if ($status == 'done') $title=$langs->trans("DoneActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions"); - /*if ($socid) - { - $societe = new Societe($db); - $societe->fetch($socid); - $newtitle=$langs->trans($title).' '.$langs->trans("For").' '.$societe->nom; - } - else - { - $newtitle=$langs->trans($title); - }*/ $newtitle=$langs->trans($title); $tabactive=''; @@ -298,7 +288,7 @@ if ($resql) { $societestatic->id=$obj->socid; $societestatic->client=$obj->client; - $societestatic->nom=$obj->societe; + $societestatic->name=$obj->societe; print $societestatic->getNomUrl(1,'',10); } else print ' '; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 86333a3996c..438f22d28c2 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -304,7 +304,7 @@ elseif ($action == 'edit') $societe->fetch($socid); $head = societe_prepare_head($societe); - dol_fiche_head($head, 'card', $societe->nom); + dol_fiche_head($head, 'card', $societe->name); print_titre($langs->trans("EditAddress")); print "
\n"; @@ -407,7 +407,7 @@ else $societe->fetch($object->socid); $head = societe_prepare_head($societe); - dol_fiche_head($head, 'customer', $societe->nom); + dol_fiche_head($head, 'customer', $societe->name); // Confirmation delete diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 814ed4832b3..96a9d89b9e0 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -58,6 +58,7 @@ class Societe extends CommonObject * @deprecated Use $name instead */ var $nom; + var $firstname; var $lastname; var $particulier; @@ -65,6 +66,7 @@ class Societe extends CommonObject var $address; var $zip; var $town; + /** * 0=activity ceased, 1= in activity * @var int @@ -443,7 +445,7 @@ class Societe extends CommonObject { // Call trigger $result=$this->call_trigger('COMPANY_CREATE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } else $error++; @@ -879,7 +881,7 @@ class Societe extends CommonObject { // Call trigger $result=$this->call_trigger('COMPANY_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -1245,7 +1247,7 @@ class Societe extends CommonObject // Call trigger $result=$this->call_trigger('COMPANY_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers if (! $error) From 0452c2d68e01f34fa17f4c10d6824a537a3f9281 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 15:39:38 +0200 Subject: [PATCH 11/23] Qual: Enhance PHPCS sheet. --- dev/codesniffer/ruleset.dtd | 3 ++- dev/codesniffer/ruleset.xml | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dev/codesniffer/ruleset.dtd b/dev/codesniffer/ruleset.dtd index 0d498bb033c..e307d564e12 100755 --- a/dev/codesniffer/ruleset.dtd +++ b/dev/codesniffer/ruleset.dtd @@ -1,7 +1,8 @@ - + + diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 24cc4b46e7b..9c4d5d4f09b 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -3,6 +3,10 @@ Dolibarr coding standard. + */conf.php + */includes/* + */documents/* + @@ -18,6 +22,9 @@ 0 + + + @@ -46,6 +53,9 @@ --> + + + From 85ccb094b41d82c542aacff0311201641c35f653 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 15:54:37 +0200 Subject: [PATCH 12/23] Fix: More complete exclusion list --- dev/codesniffer/ruleset.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 9c4d5d4f09b..38ea1310d22 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -6,7 +6,9 @@ */conf.php */includes/* */documents/* - + */custom/* + */nltechno* + From 8d46b02d672c5e4109258792bcf58cc8bdcf7e26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 15:58:05 +0200 Subject: [PATCH 13/23] Fix: missing property --- htdocs/adherents/class/adherent.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b03bff940dd..fd30c21486d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -90,6 +90,7 @@ class Adherent extends CommonObject var $user_login; var $fk_soc; + var $thirdparty; // Loaded by ->fetch_thirdparty() // Fields loaded by fetch_subscriptions() var $first_subscription_date; From 9eb54ffb4b95c9793d071ba54421513b6cec12b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 16:14:25 +0200 Subject: [PATCH 14/23] Fix: Bad merge --- dev/codesniffer/ruleset.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 68f1ef4bfe4..663dee5db38 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -25,11 +25,7 @@ -<<<<<<< HEAD -======= - ->>>>>>> refs/remotes/origin/3.6 From 8bc655b44f4e4f529571e9fec462ccbf8d3ee142 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 19:35:00 +0200 Subject: [PATCH 15/23] Fix: Bad alignement of cells --- htdocs/fourn/facture/fiche.php | 2 +- htdocs/fourn/facture/note.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 0d993a5dae1..4d351e3a238 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1634,7 +1634,7 @@ else */ $nbrows=9; $nbcols=2; if (! empty($conf->projet->enabled)) $nbrows++; - if (! empty($conf->banque->enabled)) $nbcols++; + if (! empty($conf->banque->enabled)) { $nbrows++; $nbcols++; } // Local taxes if ($societe->localtax1_assuj=="1") $nbrows++; diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index d5654c9215c..7d68a3c5a95 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -21,8 +21,8 @@ /** * \file htdocs/fourn/facture/note.php * \ingroup facture -* \brief Fiche de notes sur une facture fournisseur -*/ + * \brief Fiche de notes sur une facture fournisseur + */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; @@ -137,7 +137,7 @@ if ($object->id > 0) // Label print ''.$form->editfieldkey("Label",'label',$object->label,$object,0).''; print $form->editfieldval("Label",'label',$object->label,$object,0); - print ''; + print ''; print ""; From 7ac4a6f43ccd3197e07a48a0a087dbb9043fe57e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jul 2014 19:35:45 +0200 Subject: [PATCH 16/23] New: Show amount and status of supplier invoice also on document tab. --- htdocs/fourn/facture/contact.php | 49 +++++++++++++++++++++++++++++-- htdocs/fourn/facture/document.php | 30 ++++++++++++++++++- 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index c33b078886f..aaee42e9add 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Laurent Destailleur + * Copyright (C) 2005-2014 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -155,9 +155,54 @@ if ($id > 0 || ! empty($ref)) // Third party print "".$langs->trans("Supplier").""; print ''.$object->thirdparty->getNomUrl(1,'supplier').''; + + // Type + print ''.$langs->trans('Type').''; + print $object->getLibType(); + if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) + { + $facreplaced=new FactureFournisseur($db); + $facreplaced->fetch($object->fk_facture_source); + print ' ('.$langs->transnoentities("ReplaceInvoice",$facreplaced->getNomUrl(1)).')'; + } + if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE) + { + $facusing=new FactureFournisseur($db); + $facusing->fetch($object->fk_facture_source); + print ' ('.$langs->transnoentities("CorrectInvoice",$facusing->getNomUrl(1)).')'; + } + + $facidavoir=$object->getListIdAvoirFromInvoice(); + if (count($facidavoir) > 0) + { + print ' ('.$langs->transnoentities("InvoiceHasAvoir"); + $i=0; + foreach($facidavoir as $fid) + { + if ($i==0) print ' '; + else print ','; + $facavoir=new FactureFournisseur($db); + $facavoir->fetch($fid); + print $facavoir->getNomUrl(1); + } + print ')'; + } + if ($facidnext > 0) + { + $facthatreplace=new FactureFournisseur($db); + $facthatreplace->fetch($facidnext); + print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')'; + } + print ''; + + // Label + print ''.$form->editfieldkey("Label",'label',$object->label,$object,0).''; + print $form->editfieldval("Label",'label',$object->label,$object,0); + print ''; + print ""; - print ''; + dol_fiche_end(); print '
'; diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 79c826a85e9..d47433af4f5 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -168,8 +168,36 @@ if ($object->id > 0) print $form->editfieldval("Label",'label',$object->label,$object,0); print ''; + // Status + $alreadypaid=$object->getSommePaiement(); + print ''.$langs->trans('Status').''.$object->getLibStatut(4,$alreadypaid).''; + + // Amount + print ''.$langs->trans('AmountHT').''.price($object->total_ht,1,$langs,0,-1,-1,$conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($object->total_tva,1,$langs,0,-1,-1,$conf->currency).''; + + // Amount Local Taxes + //TODO: Place into a function to control showing by country or study better option + if ($societe->localtax1_assuj=="1") //Localtax1 + { + print ''.$langs->transcountry("AmountLT1",$societe->country_code).''; + print ''.price($object->total_localtax1,1,$langs,0,-1,-1,$conf->currency).''; + print ' '; + } + if ($societe->localtax2_assuj=="1") //Localtax2 + { + print ''.$langs->transcountry("AmountLT2",$societe->country_code).''; + print ''.price($object->total_localtax2,1,$langs,0,-1,-1,$conf->currency).''; + print ''; + } + print ''.$langs->trans('AmountTTC').''.price($object->total_ttc,1,$langs,0,-1,-1,$conf->currency).''; + + print '
'; + + print ''; + // Nb of files - print ''; + print ''; print ''; From 2fdda8cbfb828bd835bd2d8f27e6c818f7744624 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Sun, 20 Jul 2014 23:46:38 +0200 Subject: [PATCH 17/23] Scrutinizer Auto-Fixes This patch was automatically generated as part of the following inspection: https://scrutinizer-ci.com/g/eldy/dolibarr/inspections/128b4bb3-f689-4974-8fd7-a7b93d012d3f Enabled analysis tools: - PHP Analyzer --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/cashdesk/class/Facturation.class.php | 6 +-- htdocs/categories/categorie.php | 2 +- htdocs/categories/class/categorie.class.php | 4 +- .../comm/action/class/cactioncomm.class.php | 2 +- htdocs/comm/action/class/ical.class.php | 2 +- htdocs/comm/propal/class/propal.class.php | 16 +++---- htdocs/commande/class/commande.class.php | 20 ++++---- htdocs/compta/bank/class/account.class.php | 4 +- htdocs/compta/bank/class/bankcateg.class.php | 2 +- .../facture/class/facture-rec.class.php | 4 +- htdocs/compta/facture/class/facture.class.php | 18 +++---- .../facture/class/paymentterm.class.php | 2 +- .../compta/localtax/class/localtax.class.php | 2 +- .../cheque/class/remisecheque.class.php | 2 +- .../class/bonprelevement.class.php | 7 +-- .../class/ligneprelevement.class.php | 2 +- .../class/rejetprelevement.class.php | 2 +- .../salaries/class/paymentsalary.class.php | 4 +- .../sociales/class/chargesociales.class.php | 6 +-- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/tva/class/tva.class.php | 4 +- htdocs/contact/class/contact.class.php | 6 +-- htdocs/contrat/class/contrat.class.php | 8 ++-- htdocs/core/class/CMailFile.class.php | 10 ++-- .../core/class/commondocgenerator.class.php | 4 +- htdocs/core/class/commoninvoice.class.php | 6 +-- htdocs/core/class/commonobject.class.php | 20 ++++---- htdocs/core/class/cookie.class.php | 2 +- htdocs/core/class/cpays.class.php | 2 +- htdocs/core/class/ctypent.class.php | 2 +- htdocs/core/class/doleditor.class.php | 2 +- htdocs/core/class/dolgeoip.class.php | 2 +- htdocs/core/class/dolgraph.class.php | 10 ++-- htdocs/core/class/events.class.php | 4 +- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/fileupload.class.php | 14 +++--- htdocs/core/class/html.form.class.php | 36 +++++++------- htdocs/core/class/html.formactions.class.php | 6 +-- htdocs/core/class/html.formadmin.class.php | 6 +-- htdocs/core/class/html.formbank.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 6 +-- htdocs/core/class/html.formcron.class.php | 4 +- htdocs/core/class/html.formfile.class.php | 16 +++---- htdocs/core/class/html.formmailing.class.php | 2 +- htdocs/core/class/html.formorder.class.php | 2 +- htdocs/core/class/html.formother.class.php | 15 +++--- htdocs/core/class/ldap.class.php | 6 +-- htdocs/core/class/menu.class.php | 4 +- htdocs/core/class/menubase.class.php | 6 +-- htdocs/core/class/openid.class.php | 13 +++-- htdocs/core/class/rssparser.class.php | 2 +- htdocs/core/class/smtps.class.php | 26 +++++----- htdocs/core/class/translate.class.php | 8 ++-- htdocs/core/class/vcard.class.php | 2 +- htdocs/core/datepicker.php | 2 +- htdocs/core/db/Database.interface.php | 8 ++-- htdocs/core/db/DoliDB.class.php | 6 +-- htdocs/core/db/mssql.class.php | 16 +++---- htdocs/core/db/mysql.class.php | 6 +-- htdocs/core/db/mysqli.class.php | 8 ++-- htdocs/core/db/pgsql.class.php | 22 ++++----- htdocs/core/db/sqlite.class.php | 8 ++-- .../filemanagerdol/connectors/php/basexml.php | 5 +- .../connectors/php/commands.php | 12 +++++ .../core/filemanagerdol/connectors/php/io.php | 19 ++++++-- .../filemanagerdol/connectors/php/util.php | 4 +- htdocs/core/lib/ajax.lib.php | 4 +- htdocs/core/lib/bank.lib.php | 2 +- htdocs/core/lib/barcode.lib.php | 6 +-- htdocs/core/lib/company.lib.php | 20 ++++---- htdocs/core/lib/date.lib.php | 12 ++--- htdocs/core/lib/files.lib.php | 6 +-- htdocs/core/lib/functions.lib.php | 48 +++++++++---------- htdocs/core/lib/functions2.lib.php | 8 ++-- htdocs/core/lib/geturl.lib.php | 4 +- htdocs/core/lib/json.lib.php | 2 +- htdocs/core/lib/pdf.lib.php | 10 ++-- htdocs/core/lib/product.lib.php | 4 +- htdocs/core/lib/project.lib.php | 1 + htdocs/core/lib/treeview.lib.php | 2 +- htdocs/core/lib/ws.lib.php | 3 ++ htdocs/core/menus/standard/empty.php | 2 +- htdocs/core/modules/action/rapport.pdf.php | 2 +- .../barcode/doc/phpbarcode.modules.php | 4 +- .../barcode/mod_barcode_product_standard.php | 2 +- .../modules/barcode/modules_barcode.class.php | 2 +- .../cheque/pdf/modules_chequereceipts.php | 2 +- .../modules/cheque/pdf/pdf_blochet.class.php | 2 +- .../modules/commande/mod_commande_marbre.php | 2 +- .../modules/commande/mod_commande_saphir.php | 2 +- .../modules/commande/modules_commande.php | 4 +- .../contract/doc/pdf_strato.modules.php | 6 +-- .../modules/contract/modules_contract.php | 2 +- htdocs/core/modules/dons/modules_don.php | 2 +- .../expedition/doc/pdf_merou.modules.php | 2 +- .../expedition/doc/pdf_rouget.modules.php | 4 +- .../modules/expedition/modules_expedition.php | 2 +- .../modules/export/export_csv.modules.php | 2 +- .../modules/export/export_excel.modules.php | 2 +- .../modules/export/export_tsv.modules.php | 2 +- htdocs/core/modules/export/modules_export.php | 2 +- .../core/modules/facture/modules_facture.php | 4 +- .../fichinter/doc/pdf_soleil.modules.php | 6 +-- htdocs/core/modules/fichinter/mod_arctic.php | 2 +- htdocs/core/modules/fichinter/mod_pacific.php | 2 +- .../modules/fichinter/modules_fichinter.php | 2 +- .../modules/import/import_csv.modules.php | 4 +- htdocs/core/modules/import/modules_import.php | 2 +- .../modules/livraison/mod_livraison_jade.php | 2 +- .../livraison/mod_livraison_saphir.php | 2 +- .../modules/livraison/modules_livraison.php | 2 +- .../modules/mailings/contacts1.modules.php | 2 +- .../core/modules/mailings/example.modules.php | 2 +- .../core/modules/mailings/fraise.modules.php | 2 +- .../modules/mailings/modules_mailings.php | 2 +- .../core/modules/mailings/pomme.modules.php | 2 +- .../modules/mailings/xinputfile.modules.php | 2 +- .../modules/mailings/xinputuser.modules.php | 2 +- htdocs/core/modules/member/modules_cards.php | 2 +- .../modules/printsheet/modules_labels.php | 2 +- .../product/mod_codeproduct_elephant.php | 4 +- .../product/mod_codeproduct_leopard.php | 2 +- .../modules/product/modules_product.class.php | 4 +- .../modules/project/mod_project_simple.php | 2 +- .../modules/project/mod_project_universal.php | 2 +- .../core/modules/project/modules_project.php | 2 +- .../pdf/doc_generic_project_odt.modules.php | 2 +- .../project/pdf/pdf_baleine.modules.php | 6 +-- .../modules/project/task/mod_task_simple.php | 2 +- .../project/task/mod_task_universal.php | 2 +- .../modules/project/task/modules_task.php | 2 +- .../task/pdf/doc_generic_task_odt.modules.php | 2 +- .../core/modules/propale/modules_propale.php | 4 +- .../societe/mod_codeclient_elephant.php | 4 +- .../societe/mod_codeclient_leopard.php | 2 +- .../modules/societe/mod_codeclient_monkey.php | 4 +- .../societe/mod_codecompta_aquarium.php | 2 +- .../societe/mod_codecompta_panicum.php | 2 +- .../modules/societe/modules_societe.class.php | 8 ++-- .../mod_facture_fournisseur_cactus.php | 2 +- .../mod_facture_fournisseur_tulip.php | 2 +- .../modules_facturefournisseur.php | 2 +- .../pdf/pdf_canelle.modules.php | 6 +-- .../mod_commande_fournisseur_muguet.php | 4 +- .../mod_commande_fournisseur_orchidee.php | 4 +- .../modules_commandefournisseur.php | 2 +- .../pdf/pdf_muscadet.modules.php | 10 ++-- htdocs/core/modules/syslog/logHandler.php | 2 +- .../modules/syslog/logHandlerInterface.php | 2 +- .../modules/syslog/mod_syslog_chromephp.php | 4 +- .../core/modules/syslog/mod_syslog_file.php | 2 +- .../modules/syslog/mod_syslog_firephp.php | 4 +- .../core/modules/syslog/mod_syslog_syslog.php | 2 +- htdocs/cron/class/cronjob.class.php | 4 +- htdocs/ecm/class/ecmdirectory.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- .../class/fournisseur.commande.class.php | 14 +++--- .../fourn/class/fournisseur.facture.class.php | 16 +++---- .../fourn/class/fournisseur.product.class.php | 6 +-- htdocs/ftp/index.php | 2 +- htdocs/holiday/class/holiday.class.php | 14 +++--- htdocs/imports/import.php | 2 +- htdocs/install/etape1.php | 2 +- htdocs/install/inc.php | 4 +- htdocs/install/upgrade2.php | 2 +- htdocs/livraison/class/livraison.class.php | 8 ++-- .../mailmanspip/class/mailmanspip.class.php | 8 ++-- htdocs/main.inc.php | 4 +- .../class/opensurveysondage.class.php | 2 +- htdocs/opensurvey/fonctions.php | 2 +- htdocs/paypal/lib/paypal.lib.php | 10 ++++ .../product/actions_card_product.class.php | 2 +- .../service/actions_card_service.class.php | 2 +- .../product/class/html.formproduct.class.php | 2 +- htdocs/product/class/product.class.php | 26 +++++----- htdocs/product/class/productbatch.class.php | 2 +- .../class/productcustomerprice.class.php | 2 +- .../product/stock/lib/replenishment.lib.php | 2 +- htdocs/projet/class/project.class.php | 2 +- htdocs/projet/class/task.class.php | 12 ++--- htdocs/resource/class/resource.class.php | 4 +- .../canvas/actions_card_common.class.php | 2 +- .../company/actions_card_company.class.php | 2 +- .../actions_card_individual.class.php | 2 +- htdocs/societe/class/address.class.php | 4 +- htdocs/societe/class/societe.class.php | 12 ++--- htdocs/support/inc.php | 2 +- htdocs/user/class/user.class.php | 4 +- 189 files changed, 530 insertions(+), 479 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 38032741330..bc91f9bdeed 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1241,7 +1241,7 @@ class Adherent extends CommonObject * @param string $num_chq Numero cheque (if Id bank account provided) * @param string $emetteur_nom Name of cheque writer * @param string $emetteur_banque Name of bank of cheque - * @param timestamp $datesubend Date end subscription + * @param integer $datesubend Date end subscription * @return int rowid of record added, <0 if KO */ function cotisation($date, $montant, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0) diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 296ced0f172..0e6c2fdd2cb 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -266,7 +266,7 @@ class Facturation * Getter for id * * @param int $aId Id - * @return id + * @return null|integer */ public function id($aId=null) { @@ -390,7 +390,7 @@ class Facturation * Getter for montant_remise * * @param int $aMontantRemise Amount - * @return string Amount + * @return null|integer Amount */ public function montantRemise($aMontantRemise=null) { @@ -415,7 +415,7 @@ class Facturation * Getter for prix * * @param int $aPrix Price - * @return string Stock + * @return null|integer Stock */ public function prix ( $aPrix=null ) { diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index 7f8ceac853e..3e6dfffdddb 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -609,7 +609,7 @@ else if ($id || $ref) * @param Object $object Object we want to see categories it can be classified into * @param int $typeid Type of category (0, 1, 2, 3) * @param int $socid Id thirdparty - * @param string $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify' + * @param integer $showclassifyform 1=Add form to 'Classify', 0=Do not show form to 'Classify' * @return int 0 */ function formCategory($db,$object,$typeid,$socid=0,$showclassifyform=1) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 915a1410933..04f7fa0daca 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -327,7 +327,7 @@ class Categorie extends CommonObject * Delete a category from database * * @param User $user Object user that ask to delete - * @return void + * @return integer */ function delete($user) { @@ -980,7 +980,7 @@ class Categorie extends CommonObject /** * Check if no category with same label already exists for this cat's parent or root and for this cat's type * - * @return boolean 1 if already exist, 0 otherwise, -1 if error + * @return integer 1 if already exist, 0 otherwise, -1 if error */ function already_exists() { diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 8908b4e2a46..04ea49dc43e 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -100,7 +100,7 @@ class CActionComm * @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @param string $idorcode 'id' or 'code' * @param string $excludetype Type to exclude - * @param string $onlyautoornot Group list by auto events or not + * @param integer $onlyautoornot Group list by auto events or not * @return array Array of all event types if OK, <0 if KO */ function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 717d7269fa2..9bb1e8889f8 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -257,7 +257,7 @@ class ICal * Parse RRULE return array * * @param string $value string - * @return array + * @return string */ function ical_rrule($value) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 5a70aa99cbc..3bf4c639122 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -292,12 +292,12 @@ class Propal extends CommonObject * @param double $pu_ht Prix unitaire * @param double $qty Quantite * @param double $txtva Taux de tva - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param integer $txlocaltax1 Local tax 1 rate + * @param integer $txlocaltax2 Local tax 2 rate * @param int $fk_product Id du produit/service predefini - * @param double $remise_percent Pourcentage de remise de la ligne + * @param integer $remise_percent Pourcentage de remise de la ligne * @param string $price_base_type HT or TTC - * @param double $pu_ttc Prix unitaire TTC + * @param integer $pu_ttc Prix unitaire TTC * @param int $info_bits Bits de type de lignes * @param int $type Type of line (product, service) * @param int $rang Position of line @@ -308,7 +308,7 @@ class Propal extends CommonObject * @param string $label ??? * @param int $date_start Start date of the line * @param int $date_end End date of the line - * @param array $array_option extrafields array + * @param integer $array_option extrafields array * @return int >0 if OK, <0 if KO * * @see add_product @@ -466,8 +466,8 @@ class Propal extends CommonObject * @param double $qty Quantity * @param double $remise_percent Remise effectuee sur le produit * @param double $txtva Taux de TVA - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param integer $txlocaltax1 Local tax 1 rate + * @param integer $txlocaltax2 Local tax 2 rate * @param string $desc Description * @param double $price_base_type HT ou TTC * @param int $info_bits Miscellaneous informations @@ -480,7 +480,7 @@ class Propal extends CommonObject * @param int $type 0/1=Product/service * @param int $date_start Start date of the line * @param int $date_end End date of the line - * @param array $array_option extrafields array + * @param integer $array_option extrafields array * @return int 0 if OK, <0 if KO */ function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_option=0) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6c1b5eeed90..b13e4dae424 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1037,14 +1037,14 @@ class Commande extends CommonOrder * @param double $pu_ht Unit price (without tax) * @param double $qty Quantite * @param double $txtva Taux de tva force, sinon -1 - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param integer $txlocaltax1 Local tax 1 rate + * @param integer $txlocaltax2 Local tax 2 rate * @param int $fk_product Id du produit/service predefini - * @param double $remise_percent Pourcentage de remise de la ligne + * @param integer $remise_percent Pourcentage de remise de la ligne * @param int $info_bits Bits de type de lignes * @param int $fk_remise_except Id remise * @param string $price_base_type HT or TTC - * @param double $pu_ttc Prix unitaire TTC + * @param integer $pu_ttc Prix unitaire TTC * @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @param int $type Type of line (0=product, 1=service) @@ -1054,7 +1054,7 @@ class Commande extends CommonOrder * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price (without tax) * @param string $label Label - * @param array $array_option extrafields array + * @param integer $array_option extrafields array * @return int >0 if OK, <0 if KO * * @see add_product @@ -1233,7 +1233,7 @@ class Commande extends CommonOrder * * @param int $idproduct Product Id * @param double $qty Quantity - * @param double $remise_percent Product discount relative + * @param integer $remise_percent Product discount relative * @param timestamp $date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) * @return void @@ -2273,8 +2273,8 @@ class Commande extends CommonOrder * @param double $qty Quantity * @param double $remise_percent Pourcentage de remise de la ligne * @param double $txtva Taux TVA - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param integer $txlocaltax1 Local tax 1 rate + * @param integer $txlocaltax2 Local tax 2 rate * @param string $price_base_type HT or TTC * @param int $info_bits Miscellaneous informations on line * @param timestamp $date_start Start date of the line @@ -2286,7 +2286,7 @@ class Commande extends CommonOrder * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label Label * @param int $special_code Special code (also used by externals modules!) - * @param array $array_option extrafields array + * @param integer $array_option extrafields array * @return int < 0 if KO, > 0 if OK */ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) @@ -2932,7 +2932,7 @@ class Commande extends CommonOrder /** * Return an array of order lines * - * @return array Lines of order + * @return integer Lines of order */ function getLinesArray() { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e50c7bb34f6..663acd15f63 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1142,7 +1142,7 @@ class AccountLine extends CommonObject /** * Delete transaction bank line record * - * @param User $user User object that delete + * @param integer $user User object that delete * @return int <0 if KO, >0 if OK */ function delete($user=0) @@ -1191,7 +1191,7 @@ class AccountLine extends CommonObject /** * Delete bank line records * - * @param User $user User object that delete + * @param integer $user User object that delete * @return int <0 if KO, >0 if OK */ function delete_urls($user=0) diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index a1bc0191175..f6e6adf2a04 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -168,7 +168,7 @@ class BankCateg // extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f6c0ab1a481..6bef070b22d 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -401,11 +401,11 @@ class FactureRec extends Facture * @param double $qty Quantite * @param double $txtva Taux de tva force, sinon -1 * @param int $fk_product Id du produit/service predefini - * @param double $remise_percent Pourcentage de remise de la ligne + * @param integer $remise_percent Pourcentage de remise de la ligne * @param string $price_base_type HT or TTC * @param int $info_bits Bits de type de lignes * @param int $fk_remise_except Id remise - * @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note) + * @param integer $pu_ttc Prix unitaire TTC (> 0 even for credit note) * @param int $type Type of line (0=product, 1=service) * @param int $rang Position of line * @param int $special_code Special code diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7e5af441280..5f68e2a0263 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1018,7 +1018,7 @@ class Facture extends CommonInvoice /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ @@ -1885,17 +1885,17 @@ class Facture extends CommonInvoice * @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $qty Quantity * @param double $txtva Force vat rate, -1 for auto - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param integer $txlocaltax1 Local tax 1 rate + * @param integer $txlocaltax2 Local tax 2 rate * @param int $fk_product Id of predefined product/service - * @param double $remise_percent Percent of discount on line + * @param integer $remise_percent Percent of discount on line * @param timestamp $date_start Date start of service * @param timestamp $date_end Date end of service * @param int $ventil Code of dispatching into accountancy * @param int $info_bits Bits de type de lignes * @param int $fk_remise_except Id discount used * @param string $price_base_type 'HT' or 'TTC' - * @param double $pu_ttc Unit price with tax (> 0 even for credit note) + * @param integer $pu_ttc Unit price with tax (> 0 even for credit note) * @param int $type Type of line (0=product, 1=service) * @param int $rang Position of line * @param int $special_code Special code (also used by externals modules!) @@ -1905,7 +1905,7 @@ class Facture extends CommonInvoice * @param int $fk_fournprice Supplier price id (to calculate margin) or '' * @param int $pa_ht Buying price of line (to calculate margin) or '' * @param string $label Label of the line (deprecated, do not use) - * @param array $array_option extrafields array + * @param integer $array_option extrafields array * @return int <0 if KO, Id of line if OK */ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0) @@ -2068,8 +2068,8 @@ class Facture extends CommonInvoice * @param date $date_start Date de debut de validite du service * @param date $date_end Date de fin de validite du service * @param double $txtva VAT Rate - * @param double $txlocaltax1 Local tax 1 rate - * @param double $txlocaltax2 Local tax 2 rate + * @param integer $txlocaltax1 Local tax 1 rate + * @param integer $txlocaltax2 Local tax 2 rate * @param string $price_base_type HT or TTC * @param int $info_bits Miscellaneous informations * @param int $type Type of line (0=product, 1=service) @@ -2079,7 +2079,7 @@ class Facture extends CommonInvoice * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label Label of the line (deprecated, do not use) * @param int $special_code Special code (also used by externals modules!) - * @param array $array_option extrafields array + * @param integer $array_option extrafields array * @return int < 0 if KO, > 0 if OK */ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_option=0) diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index cdc935cde01..b86e1328736 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -257,7 +257,7 @@ class PaymentTerm // extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 72ce346abad..fde25befbae 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -123,7 +123,7 @@ class Localtax extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 39b8f209247..7f5b8e737a4 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -274,7 +274,7 @@ class RemiseCheque extends CommonObject * Supprime la remise en base * * @param User $user Utilisateur qui effectue l'operation - * @return void + * @return integer */ function delete($user='') { diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 60b056babf4..b9e82724eb8 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -172,6 +172,7 @@ class BonPrelevement extends CommonObject * @param string $code_guichet code of bank's office * @param string $number bank account number * @param string $number_key number key of account number + * @param integer $line_id * @return int >0 if OK, <0 if KO */ function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key) @@ -247,7 +248,7 @@ class BonPrelevement extends CommonObject * Read errors * * @param int $error id of error - * @return array Array of errors + * @return string Array of errors */ function ReadError($error) { @@ -1504,7 +1505,7 @@ class BonPrelevement extends CommonObject * @param string $row_bic rib.bic AS bic, * @param string $row_datec soc.datec, * @param string $row_drum soc.rowid AS drum - * @return void + * @return string */ function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) { @@ -1626,7 +1627,7 @@ class BonPrelevement extends CommonObject * @param int $nombre 0 or 1 * @param float $total Total * @param string $CrLf End of line character - * @return SEPA + * @return string */ function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') { // SEPA INITIALISATION diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 9c4bf96e8b3..1e078ac8c79 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -61,7 +61,7 @@ class LignePrelevement * Recupere l'objet prelevement * * @param int $rowid id de la facture a recuperer - * @return void + * @return integer */ function fetch($rowid) { diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 51f9a83ed3c..5ebd4542096 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -317,7 +317,7 @@ class RejetPrelevement * Retrieve withdrawal object * * @param int $rowid id of invoice to retrieve - * @return void + * @return integer */ function fetch($rowid) { diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 5e728b0cc64..9801c1d7cda 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -69,7 +69,7 @@ class PaymentSalary extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ @@ -141,7 +141,7 @@ class PaymentSalary extends CommonObject * Load object in memory from database * * @param int $id id object - * @param User $user User that load + * @param integer $user User that load * @return int <0 if KO, >0 if OK */ function fetch($id, $user=0) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 09e4ebaef0c..ad3833848d2 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -63,7 +63,7 @@ class ChargeSociales extends CommonObject * Retrouve et charge une charge sociale * * @param int $id 1 si trouve, 0 sinon - * @return void + * @return integer|null */ function fetch($id) { @@ -320,7 +320,7 @@ class ChargeSociales extends CommonObject * Retourne le libelle du statut d'une charge (impaye, payee) * * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function getLibStatut($mode=0,$alreadypaid=-1) @@ -333,7 +333,7 @@ class ChargeSociales extends CommonObject * * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function LibStatut($statut,$mode=0,$alreadypaid=-1) diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 972fa762b96..78d63fc2f71 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -216,7 +216,7 @@ class PaymentSocialContribution extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 312da55f138..f5a8c00b6d1 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -139,7 +139,7 @@ class Tva extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ @@ -202,7 +202,7 @@ class Tva extends CommonObject * Load object in memory from database * * @param int $id id object - * @param User $user User that load + * @param integer $user User that load * @return int <0 if KO, >0 if OK */ function fetch($id, $user=0) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 7858f81dcf9..24b33c3c7c8 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -215,7 +215,7 @@ class Contact extends CommonObject * Update informations into database * * @param int $id Id of contact/address to update - * @param User $user Objet user making change + * @param integer $user Objet user making change * @param int $notrigger 0=no, 1=yes * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK @@ -424,7 +424,7 @@ class Contact extends CommonObject * Update field alert birthday * * @param int $id Id of contact - * @param User $user User asking to change alert or birthday + * @param integer $user User asking to change alert or birthday * @return int <0 if KO, >=0 if OK */ function update_perso($id, $user=0) @@ -489,7 +489,7 @@ class Contact extends CommonObject * Load object contact * * @param int $id id du contact - * @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact + * @param integer $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact * @return int -1 if KO, 0 if OK but not found, 1 if OK */ function fetch($id, $user=0) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9c57ff9f570..1c0eeaa86b0 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -953,7 +953,7 @@ class Contrat extends CommonObject /** * Update object into database * - * @param User $user User that modifies + * @param integer $user User that modifies * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ @@ -1061,7 +1061,7 @@ class Contrat extends CommonObject * @param timestamp $date_start Date de debut prevue * @param timestamp $date_end Date de fin prevue * @param float $price_base_type HT or TTC - * @param float $pu_ttc Prix unitaire TTC + * @param integer $pu_ttc Prix unitaire TTC * @param int $info_bits Bits de type de lignes * @param int $fk_fournprice Fourn price id * @param int $pa_ht Buying price HT @@ -1218,8 +1218,8 @@ class Contrat extends CommonObject * @param timestamp $date_start Date de debut prevue * @param timestamp $date_end Date de fin prevue * @param float $tvatx Taux TVA - * @param float $localtax1tx Local tax 1 rate - * @param float $localtax2tx Local tax 2 rate + * @param integer $localtax1tx Local tax 1 rate + * @param integer $localtax2tx Local tax 2 rate * @param timestamp $date_debut_reel Date de debut reelle * @param timestamp $date_fin_reel Date de fin reelle * @param float $price_base_type HT or TTC diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index c16af4c5b24..072a2fa7bbe 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -356,7 +356,7 @@ class CMailFile /** * Send mail that was prepared by constructor * - * @return boolean True if mail sent, false otherwise + * @return string|boolean True if mail sent, false otherwise */ function sendfile() { @@ -518,6 +518,10 @@ class CMailFile // Encode subject according to RFC 2822 - http://en.wikipedia.org/wiki/MIME#Encoded-Word + + /** + * @param string $stringtoencode + */ function encodetorfc2822($stringtoencode) { global $conf; @@ -641,7 +645,7 @@ class CMailFile /** * Create SMTP headers (mode = 'mail') * - * @return smtp headers + * @return string headers */ function write_smtpheaders() { @@ -692,7 +696,7 @@ class CMailFile * * @param array $filename_list Array of filenames * @param array $mimefilename_list Array of mime types - * @return array mime headers + * @return string mime headers */ function write_mimeheaders($filename_list, $mimefilename_list) { diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 882e0780ed4..e6cfa7a3f55 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -207,7 +207,7 @@ abstract class CommonDocGenerator /** * Define array with couple subtitution key => subtitution value * - * @param Object $object contact + * @param Contact $object contact * @param Translate $outputlangs object for output * @param array_key $array_key Name of the key for return array * @return array of substitution key->code @@ -426,7 +426,7 @@ abstract class CommonDocGenerator /** * Define array with couple substitution key => substitution value * - * @param Object $object Main object to use as data source + * @param Expedition $object Main object to use as data source * @param Translate $outputlangs Lang object to use for output * @param array_key $array_key Name of the key for return array * @return array Array of substitution diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index fdc4a35a585..7563b71d9a4 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -155,7 +155,7 @@ abstract class CommonInvoice extends CommonObject * Return label of object status * * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ function getLibStatut($mode=0,$alreadypaid=-1) @@ -169,7 +169,7 @@ abstract class CommonInvoice extends CommonObject * @param int $paye Status field paye * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto - * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @param int $type Type facture * @return string Libelle du statut */ @@ -293,7 +293,7 @@ abstract class CommonInvoice extends CommonObject * Renvoi une date limite de reglement de facture en fonction des * conditions de reglements de la facture et date de facturation * - * @param string $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. + * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @return date Date limite de reglement si ok, <0 si ko */ function calculate_date_lim_reglement($cond_reglement=0) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 307164556c7..711152f79b4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -476,8 +476,8 @@ abstract class CommonObject * * @param string $source 'internal', 'external' or 'all' * @param string $order Sort order by : 'code' or 'rowid' - * @param string $option 0=Return array id->label, 1=Return array code->label - * @param string $activeonly 0=all type of contact, 1=only the active + * @param integer $option 0=Return array id->label, 1=Return array code->label + * @param integer $activeonly 0=all type of contact, 1=only the active * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) */ function liste_type_contact($source='internal', $order='code', $option=0, $activeonly=0) @@ -1117,7 +1117,7 @@ abstract class CommonObject * @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines. * @param string $rowidorder ASC or DESC * @param boolean $fk_parent_line Table with fk_parent_line field or not - * @return void + * @return integer|null */ function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true) { @@ -2293,7 +2293,7 @@ abstract class CommonObject * * @param object $extrafields Extrafield Object * @param string $mode Show output (view) or input (edit) for extrafield - * @param array $params Optionnal parameters + * @param integer $params Optionnal parameters * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) * * @return string @@ -2525,7 +2525,7 @@ abstract class CommonObject /** * Set extra parameters * - * @return void + * @return integer */ function setExtraParameters() { @@ -2612,7 +2612,7 @@ abstract class CommonObject * TODO Move this into html.class.php * But for the moment we don't know if it's possible as we keep a method available on overloaded objects. * - * @return void + * @return integer|null */ function showLinkedObjectBlock() { @@ -2731,7 +2731,7 @@ abstract class CommonObject * @param string $action Action code * @param string $seller Object of seller third party * @param string $buyer Object of buyer third party - * @param string $selected Object line selected + * @param integer $selected Object line selected * @param int $dateSelector 1=Show also date range input fields * @return void */ @@ -2829,8 +2829,8 @@ abstract class CommonObject * @param int $dateSelector 1=Show also date range input fields * @param string $seller Object of seller third party * @param string $buyer Object of buyer third party - * @param string $selected Object line selected - * @param object $extrafieldsline Object of extrafield line attribute + * @param integer $selected Object line selected + * @param integer $extrafieldsline Object of extrafield line attribute * @return void */ function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0) @@ -3105,7 +3105,7 @@ abstract class CommonObject * get Margin info * * @param string $force_price True of not - * @return mixed Array with info + * @return integer Array with info */ function getMarginInfos($force_price=false) { diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index bcca9fcfa73..150d52fae62 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -109,7 +109,7 @@ class DolCookie * * @param string $cookie Cookie name * @param string $value Cookie value - * @param string $expire Expiration + * @param integer $expire Expiration * @param string $path Path of cookie * @param string $domain Domain name * @param int $secure 0 or 1 diff --git a/htdocs/core/class/cpays.class.php b/htdocs/core/class/cpays.class.php index e75f8a75a1a..e75746f2f66 100644 --- a/htdocs/core/class/cpays.class.php +++ b/htdocs/core/class/cpays.class.php @@ -187,7 +187,7 @@ class Cpays // extends CommonObject /** * Update object into database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index eea64ed10ac..79a919658b6 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -194,7 +194,7 @@ class Ctypent // extends CommonObject /** * Update object into database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 6dc726b084e..17ea290137c 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -142,7 +142,7 @@ class DolEditor * * @param int $noprint 1=Return HTML string instead of printing it to output * @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });" - * @return void + * @return string|null */ function Create($noprint=0,$morejs='') { diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 9844e6b74c9..81c4b38510d 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -40,7 +40,7 @@ class DolGeoIP * * @param string $type 'country' or 'city' * @param string $datfile Data file - * @return GeoIP + * @return integer|null */ function __construct($type,$datfile) { diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 33888b057b7..afb42b82d82 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -115,7 +115,7 @@ class DolGraph * Set Y precision * * @param float $which_prec Precision - * @return string + * @return boolean */ function SetPrecisionY($which_prec) { @@ -187,7 +187,7 @@ class DolGraph * Set y label * * @param string $label Y label - * @return boolean True + * @return boolean|null True */ function SetYLabel($label) { @@ -198,7 +198,7 @@ class DolGraph * Set width * * @param int $w Width - * @return boolean True + * @return boolean|null True */ function SetWidth($w) { @@ -554,7 +554,7 @@ class DolGraph /** * Return min value of all data * - * @return int Max value of all data + * @return double Max value of all data */ function GetFloorMinValue() { @@ -578,7 +578,7 @@ class DolGraph * * @param string $file Image file name to use to save onto disk (also used as javascript unique id) * @param string $fileurl Url path to show image if saved onto disk - * @return void + * @return integer|null */ function draw($file,$fileurl='') { diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index ba4dcfb94f6..5fa639d1560 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -150,7 +150,7 @@ class Events // extends CommonObject /** * Update database * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ @@ -188,7 +188,7 @@ class Events // extends CommonObject * Load object in memory from database * * @param int $id Id object - * @param User $user User that load + * @param integer $user User that load * @return int <0 if KO, >0 if OK */ function fetch($id, $user=0) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c9aa1405ff7..34ca247a96f 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -102,7 +102,7 @@ class ExtraFields * @param int $unique Is field unique or not * @param int $required Is field required or not * @param string $default_value Defaulted value - * @param array $param Params for field + * @param integer $param Params for field * @return int <=0 if KO, >0 if OK */ function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0,$default_value='', $param=0) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 520ab7634be..b17bf166dd4 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -261,7 +261,7 @@ class FileUpload * * @param string $file_name Filename * @param string $options is array('max_width', 'max_height') - * @return void + * @return boolean */ protected function createScaledImage($file_name, $options) { @@ -296,7 +296,7 @@ class FileUpload * @param string $file File * @param string $error Error * @param string $index Index - * @return unknown|string + * @return boolean */ protected function validate($uploaded_file, $file, $error, $index) { @@ -378,10 +378,10 @@ class FileUpload /** * Enter description here ... * - * @param unknown_type $name Filename - * @param unknown_type $type ??? - * @param unknown_type $index ??? - * @return void + * @param string $name Filename + * @param string $type ??? + * @param string $index ??? + * @return string */ protected function trimFileName($name, $type, $index) { @@ -408,7 +408,7 @@ class FileUpload * Enter description here ... * * @param unknown_type $file_path ??? - * @return int Success or not + * @return boolean Success or not */ protected function orientImage($file_path) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 010e023b285..cf6ae5ed941 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -468,7 +468,7 @@ class Form * @param string $selected Id or Code or Label of preselected country * @param string $htmlname Name of html select object * @param string $htmloption Options html on select object - * @param string $maxlength Max length for labels (0=no limit) + * @param integer $maxlength Max length for labels (0=no limit) * @return string HTML string with select */ function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0) @@ -544,7 +544,7 @@ class Form * @param string $htmlname Name of field in html form * @param int $showempty Add an empty field * @param int $hidetext Do not show label 'Type' before combo box (used only if there is at least 2 choices to select) - * @param string $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service') + * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service') * @return void */ function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) @@ -947,9 +947,9 @@ class Form * @param int $showempty 0=no empty value, 1=add an empty value * @param string $exclude List of contacts id to exclude * @param string $limitto Disable answers that are not id in this array list - * @param string $showfunction Add function into label + * @param integer $showfunction Add function into label * @param string $moreclass Add more class to class style - * @param string $showsoc Add company into label + * @param integer $showsoc Add company into label * @param int $forcecombo Force to use combo box * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param bool $options_only Return options only (for ajax treatment) @@ -970,10 +970,10 @@ class Form * @param int $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit) * @param string $exclude List of contacts id to exclude * @param string $limitto Disable answers that are not id in this array list - * @param string $showfunction Add function into label + * @param integer $showfunction Add function into label * @param string $moreclass Add more class to class style * @param bool $options_only Return options only (for ajax treatment) - * @param string $showsoc Add company into label + * @param integer $showsoc Add company into label * @param int $forcecombo Force to use combo box * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @return int <0 if KO, Nb of contact in list if OK @@ -1907,7 +1907,7 @@ class Form * * @param int $productid Id of product * @param string $htmlname Name of HTML field - * @return void + * @return string|null */ function select_product_fourn_price($productid,$htmlname='productfournpriceid') { @@ -2001,7 +2001,7 @@ class Form * @param int $socid Id of company * @param string $htmlname Name of HTML field * @param int $showempty Add an empty field - * @return void + * @return integer|null */ function select_address($selected, $socid, $htmlname='address_id',$showempty=0) { @@ -2286,7 +2286,7 @@ class Form * * @param string $selected Id du type de paiement pre-selectionne * @param string $htmlname Nom de la zone select - * @param string $filtertype Pour filtre + * @param integer $filtertype Pour filtre * @param int $addempty Ajoute entree vide * @return void */ @@ -2389,7 +2389,7 @@ class Form * * @param string $selected Id pre-selectionne * @param string $htmlname Nom de la zone select - * @return void + * @return string */ function load_PriceBaseType($selected='',$htmlname='price_base_type') { @@ -2527,7 +2527,7 @@ class Form * @param string $htmlname HTML field name * @param int $maxlength Maximum length for labels * @param int $excludeafterid Exclude all categories after this leaf in category tree. - * @return void + * @return string */ function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0) { @@ -3299,7 +3299,7 @@ class Form * * @param string $selected preselected currency code * @param string $htmlname name of HTML select list - * @return void + * @return string */ function selectCurrency($selected='',$htmlname='currency_id') { @@ -3398,7 +3398,7 @@ class Form * Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle. * Sinon la TVA proposee par defaut=0. Fin de regle. * @param bool $options_only Return options only (for ajax treatment) - * @return void + * @return string */ function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false) { @@ -3550,7 +3550,7 @@ class Form * @param int $nooutput Do not output html string but return it * @param int $disabled Disable input fields * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 - * @return mixed Nothing or string if nooutput is 1 + * @return string|null Nothing or string if nooutput is 1 * @see form_date */ function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowbutton=0, $nooutput=0, $disabled=0, $fullday='') @@ -3777,7 +3777,7 @@ class Form * @param int $iSecond Default preselected duration (number of seconds) * @param int $disabled Disable the combo box * @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo - * @param string $minunderhours If 1, show minutes selection under the hours + * @param integer $minunderhours If 1, show minutes selection under the hours * @return void */ function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0) @@ -3977,7 +3977,7 @@ class Form * @param string $value Pre-selected value * @param int $option 0 return yes/no, 1 return 1/0 * @param bool $disabled true or false - * @return mixed See option + * @return string See option */ function selectyesno($htmlname,$value='',$option=0,$disabled=false) { @@ -4072,7 +4072,7 @@ class Form * @param string $morehtmlref Code html supplementaire a afficher apres ref * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name - * @return tring Portion HTML avec ref + boutons nav + * @return string Portion HTML avec ref + boutons nav */ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0) { @@ -4235,7 +4235,7 @@ class Form * @param string $include Array list of groups id to include * @param int $enableonly Array list of groups id to be enabled. All other must be disabled * @param int $force_entity 0 or Id of environment to force - * @return void + * @return string * @see select_dolusers */ function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index ed32fcc9f0d..b35e290e9d5 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -52,8 +52,8 @@ class FormActions * @param string $selected Preselected value (-1..100) * @param int $canedit 1=can edit, 0=read only * @param string $htmlname Name of html prefix for html fields (selectX and valX) - * @param string $showempty Show an empty line if select is used - * @param string $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) + * @param integer $showempty Show an empty line if select is used + * @param integer $onlyselect 0=Standard, 1=Hide percent of completion and force usage of a select list, 2=Same than 1 and add "Incomplete (Todo+Running) * @return void */ function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete',$showempty=0,$onlyselect=0) @@ -229,7 +229,7 @@ class FormActions * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx' * @param string $htmlname Nom champ formulaire * @param string $excludetype Type to exclude - * @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) + * @param integer $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) * @param int $hideinfohelp 1=Do not show info help * @return void */ diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index f7a6154706f..b632bda4b80 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -50,7 +50,7 @@ class FormAdmin * @param string $selected Langue pre-selectionnee * @param string $htmlname Nom de la zone select * @param int $showauto Affiche choix auto - * @param array $filter Array of keys to exclude in list + * @param integer $filter Array of keys to exclude in list * @param int $showempty Add empty value * @param int $showwarning Show a warning if language is not complete * @return string Return HTML select string with list of languages @@ -114,7 +114,7 @@ class FormAdmin * @param string $htmlname Name of html select * @param array $dirmenuarray Array of directories to scan * @param string $moreattrib More attributes on html select tag - * @return void + * @return integer|null */ function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') { @@ -324,7 +324,7 @@ class FormAdmin * * @param string $selected Paper format pre-selected * @param string $htmlname Name of HTML select field - * @param string $filter Value to filter on code + * @param integer $filter Value to filter on code * @param int $showempty Add empty value * @return string Return HTML output */ diff --git a/htdocs/core/class/html.formbank.class.php b/htdocs/core/class/html.formbank.class.php index 647688bb641..c666c759fad 100644 --- a/htdocs/core/class/html.formbank.class.php +++ b/htdocs/core/class/html.formbank.class.php @@ -44,7 +44,7 @@ class FormBank /** * Retourne la liste des types de comptes financiers * - * @param string $selected Type pre-selectionne + * @param integer $selected Type pre-selectionne * @param string $htmlname Nom champ formulaire * @return void */ diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index fd7db5fa94f..ad0064b0a98 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -207,7 +207,7 @@ class FormCompany * Ainsi les liens avec les departements se font sur un departement independemment de son nom. * * @param string $selected Code state preselected (mus be state id) - * @param string $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show + * @param integer $country_codeid Country code or id: 0=list for all countries, otherwise country code or country rowid to show * @param string $htmlname Id of department * @return string String with HTML select */ @@ -413,7 +413,7 @@ class FormCompany * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. * * @param string $selected Code forme juridique a pre-selectionne - * @param mixed $country_codeid 0=liste tous pays confondus, sinon code du pays a afficher + * @param integer $country_codeid 0=liste tous pays confondus, sinon code du pays a afficher * @param string $filter Add a SQL filter on list * @return void * @deprecated Use print xxx->select_juridicalstatus instead @@ -711,7 +711,7 @@ class FormCompany * @param string $fields Fields * @param int $fieldsize Field size * @param int $disableautocomplete 1 To disable autocomplete features - * @return void + * @return string */ function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0) { diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index bce8d9f041e..35ff7388293 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -46,8 +46,8 @@ class FormCron extends Form * Display On Off selector * * @param string $htmlname Html control name - * @param string $selected selected value - * @param string $readonly Select is read only or not + * @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) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 6e764941d31..28b0c1c4540 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -62,9 +62,9 @@ class FormFile * @param int $size Length of input file area * @param Object $object Object to use (when attachment is done on an element) * @param string $options Add an option column - * @param boolean $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. + * @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). 2 should never be used. * @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__' - * @param string $linkfiles 1=Also add form to link files, 0=Do not show form to link files + * @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files * @param string $htmlname Name and id of HTML form * @return int <0 if KO, >0 if OK */ @@ -215,11 +215,11 @@ class FormFile * @param int $genallowed Generation is allowed (1/0 or array of formats) * @param int $delallowed Remove is allowed (1/0) * @param string $modelselected Model to preselect by default - * @param string $allowgenifempty Show warning if no model activated - * @param string $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) + * @param integer $allowgenifempty Show warning if no model activated + * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) * @param int $iconPDF Show only PDF icon with link (1/0) * @param int $maxfilenamelength Max length for filename shown - * @param string $noform Do not output html form tags + * @param integer $noform Do not output html form tags * @param string $param More param on http links * @param string $title Title to show on top of form * @param string $buttonlabel Label on submit button @@ -244,11 +244,11 @@ class FormFile * @param int $genallowed Generation is allowed (1/0 or array list of templates) * @param int $delallowed Remove is allowed (1/0) * @param string $modelselected Model to preselect by default - * @param string $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) - * @param string $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) + * @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning) + * @param integer $forcenomultilang Do not show language option (even if MAIN_MULTILANGS defined) * @param int $iconPDF Obsolete, see getDocumentsLink * @param int $maxfilenamelength Max length for filename shown - * @param string $noform Do not output html form tags + * @param integer $noform Do not output html form tags * @param string $param More param on http links * @param string $title Title to show on top of form * @param string $buttonlabel Label on submit button diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index 98a76c84686..93fdac553a3 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -48,7 +48,7 @@ class FormMailing extends Form * * @param string $selectedid the selected id * @param string $htmlname name of controm - * @param number $show_empty show empty option + * @param integer $show_empty show empty option * @return string HTML select */ public function selectDestinariesStatus($selectedid='',$htmlname='dest_status', $show_empty=0) { diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 5ea5b33c1f4..b267e14b1dd 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -102,7 +102,7 @@ class FormOrder * @param string $selected Id of preselected input method * @param string $htmlname Name of HTML select list * @param int $addempty 0=list with no empty value, 1=list with empty value - * @return array Tableau des sources de commandes + * @return integer Tableau des sources de commandes */ function selectInputMethod($selected='',$htmlname='source_id',$addempty=0) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index ab924d482a7..9cbe4418bbe 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -157,7 +157,7 @@ class FormOther * * @param string $selected Preselected ecotaxes * @param string $htmlname Name of combo list - * @return void + * @return integer */ function select_ecotaxes($selected='',$htmlname='ecotaxe_id') { @@ -268,7 +268,7 @@ class FormOther /** * Return a HTML select list to select a percent * - * @param string $selected pourcentage pre-selectionne + * @param integer $selected pourcentage pre-selectionne * @param string $htmlname nom de la liste deroulante * @param int $disabled Disabled or not * @param int $increment increment value @@ -303,7 +303,7 @@ class FormOther * Return select list for categories (to use in form search selectors) * * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) - * @param string $selected Preselected value + * @param integer $selected Preselected value * @param string $htmlname Name of combo list * @param int $nocateg Show also an entry "Not categorized" * @return string Html combo list code @@ -469,6 +469,7 @@ class FormOther * @param int $selectedtask Id selected task * @param int $selectedproject Id selected project * @param int $disablechildoftaskid 1=Disable task that are child of the provided task id + * @param integer $inc * @return void */ private function _pLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selectedproject=0, $disablechildoftaskid=0) @@ -579,7 +580,7 @@ class FormOther * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @param string $morecss Add css style into input field - * @return void + * @return string */ function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='', $morecss='') { @@ -709,7 +710,7 @@ class FormOther * @param string $selected Preselected value * @param string $htmlname Nom de la zone select * @param int $useempty Affiche valeur vide dans liste - * @return void + * @return string */ function select_dayofweek($selected='',$htmlname='weekid',$useempty=0) { @@ -750,7 +751,7 @@ class FormOther * @param string $selected Preselected value * @param string $htmlname Nom de la zone select * @param int $useempty Affiche valeur vide dans liste - * @return void + * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0) { @@ -810,7 +811,7 @@ class FormOther * @param int $offset Offset * @param int $invert Invert * @param string $option Option - * @return void + * @return string */ function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='') { diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 30eeca5a486..03020d12f99 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -345,7 +345,7 @@ class Ldap /** * Change ldap protocol version to use. * - * @return string version + * @return boolean version */ function setVersion() { // LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17 @@ -356,7 +356,7 @@ class Ldap /** * changement du referrals. * - * @return string referrals + * @return boolean referrals */ function setReferrals() { // LDAP_OPT_REFERRALS est une constante qui vaut ? @@ -1308,7 +1308,7 @@ class Ldap * Convertit le temps ActiveDirectory en Unix timestamp * * @param string $value AD time to convert - * @return string Unix timestamp + * @return integer Unix timestamp */ function convert_time($value) { diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 411158dea84..dff357d8f91 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -53,7 +53,7 @@ class Menu * * @param string $url Url to follow on click * @param string $titre Label of menu to add - * @param string $level Level of menu to add + * @param integer $level Level of menu to add * @param int $enabled Menu active or not (0=Not active, 1=Active, 2=Active but grey) * @param string $target Target lien * @param string $mainmenu Main menu ('home', 'companies', 'products', ...) @@ -71,7 +71,7 @@ class Menu * @param int $idafter Array key after which inserting new entry * @param string $url Url to follow on click * @param string $titre Label of menu to add - * @param string $level Level of menu to add + * @param integer $level Level of menu to add * @param int $enabled Menu active or not * @param string $target Target lien * @param string $mainmenu Main menu ('home', 'companies', 'products', ...) diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index aa43c545c8d..256eec469c7 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -71,7 +71,7 @@ class Menubase /** * Create menu entry into database * - * @param User $user User that create + * @param integer $user User that create * @return int <0 if KO, Id of record if OK */ function create($user=0) @@ -181,7 +181,7 @@ class Menubase /** * Update menu entry into database. * - * @param User $user User that modify + * @param integer $user User that modify * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ @@ -247,7 +247,7 @@ class Menubase * Load object in memory from database * * @param int $id Id object - * @param User $user User that load + * @param integer $user User that load * @return int <0 if KO, >0 if OK */ function fetch($id, $user=0) diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php index 5165dcb4994..29ad98cc204 100644 --- a/htdocs/core/class/openid.class.php +++ b/htdocs/core/class/openid.class.php @@ -150,7 +150,7 @@ class SimpleOpenID /** * GetIdentity * - * @return void + * @return string */ function GetIdentity() { // Get Identity @@ -187,7 +187,7 @@ class SimpleOpenID /** * IsError * - * @return void + * @return boolean */ function IsError() { @@ -225,7 +225,7 @@ class SimpleOpenID * OpenID_Standarize * * @param string $openid_identity Server - * @return void + * @return string */ function OpenID_Standarize($openid_identity = null) { @@ -283,6 +283,9 @@ class SimpleOpenID } } + /** + * @param string $url + */ function CURL_Request($url, $method="GET", $params = "") { // Remember, SSL MUST BE SUPPORTED if (is_array($params)) $params = $this->array2url($params); @@ -356,7 +359,7 @@ class SimpleOpenID /** * GetRedirectURL * - * @return void + * @return string */ function GetRedirectURL() { @@ -400,7 +403,7 @@ class SimpleOpenID /** * ValidateWithServer * - * @return void + * @return boolean */ function ValidateWithServer() { diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 80ca1b155b7..c68cf4002f5 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -151,7 +151,7 @@ class RssParser /** * getLastFetchDate * - * @return string + * @return integer */ public function getLastFetchDate() { diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 61a098330c2..cfc502c4239 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -362,7 +362,7 @@ class SMTPs /** * Attempt mail server authentication for a secure connection * - * @return mixed $_retVal Boolean indicating success or failure of authentication + * @return boolean|null $_retVal Boolean indicating success or failure of authentication */ function _server_authenticate() { @@ -399,7 +399,7 @@ class SMTPs * * @param boolean $_bolTestMsg whether to run this method in 'Test' mode. * @param boolean $_bolDebug whether to log all communication between this Class and the Mail Server. - * @return mixed void + * @return boolean|null void * $_strMsg If this is run in 'Test' mode, the actual message structure will be returned */ function sendMsg($_bolTestMsg = false, $_bolDebug = false) @@ -499,7 +499,7 @@ class SMTPs * defined. * * @param mixed $_strConfigPath path to config file or VOID - * @return void + * @return boolean */ function setConfig ( $_strConfigPath = null ) { @@ -573,7 +573,7 @@ class SMTPs * Path to the sendmail execuable * * @param string $_path Path to the sendmail execuable - * @return void + * @return boolean * */ function setMailPath($_path) @@ -949,8 +949,8 @@ class SMTPs /** * Returns an array of addresses for a specific type; TO, CC or BCC * - * @param mixed $_which Which collection of adresses to return - * @return array Array of emaill address + * @param string $_which Which collection of adresses to return + * @return string|false Array of emaill address */ function get_email_list($_which = null) { @@ -1000,7 +1000,7 @@ class SMTPs /** * TO Address[es] inwhich to send mail to * - * @param mixed $_addrTo TO Address[es] inwhich to send mail to + * @param string $_addrTo TO Address[es] inwhich to send mail to * @return void */ function setTO($_addrTo) @@ -1370,7 +1370,7 @@ class SMTPs * - [2] Private * - [3] Company Confidential * - * @param string $_value Message Sensitivity + * @param integer $_value Message Sensitivity * @return void */ function setSensitivity($_value = 0) @@ -1405,7 +1405,7 @@ class SMTPs * - [4] 'Low' * - [5] 'Lowest' * - * @param string $_value Message Priority + * @param integer $_value Message Priority * @return void */ function setPriority ( $_value = 3 ) @@ -1425,7 +1425,7 @@ class SMTPs * - [4] 'Low' * - [5] 'Lowest' * - * @return void + * @return string */ function getPriority() { @@ -1448,7 +1448,7 @@ class SMTPs /** * Gets flag which determines whether to calculate message MD5 checksum. * - * @return string Message Priority + * @return boolean Message Priority */ function getMD5flag() { @@ -1472,7 +1472,7 @@ class SMTPs /** * Retrieves the Message X-Header Content * - * @return string $_msgContent Message X-Header Content + * @return string[] $_msgContent Message X-Header Content */ function getXheader() { @@ -1546,7 +1546,7 @@ class SMTPs * @param string $_strSend String to send * @param string $_returnCode Return code * @param string $CRLF CRLF - * @return boolean True or false + * @return boolean|null True or false */ function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) { diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index f86681f5c76..2b00c74568a 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -154,7 +154,7 @@ class Translate * If $domain is "file@module" instead of "file" then we look for module lang file * in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang * then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang - * @param string $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US or fr_FR or es_ES) + * @param integer $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US or fr_FR or es_ES) * @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed) * @param int $forcelangdir To force a different lang directory * @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK @@ -543,7 +543,7 @@ class Translate * Return list of all available languages * * @param string $langdir Directory to scan - * @param string $maxlength Max length for each value in combo box (will be truncated) + * @param integer $maxlength Max length for each value in combo box (will be truncated) * @param int $usecode Show code instead of country name for language variant * @return array List of languages */ @@ -578,7 +578,7 @@ class Translate * Return if a filename $filename exists for current language (or alternate language) * * @param string $filename Language filename to search - * @param string $searchalt Search also alernate language file + * @param integer $searchalt Search also alernate language file * @return boolean true if exists and readable */ function file_exists($filename,$searchalt=0) @@ -714,7 +714,7 @@ class Translate * Return a currency code into its symbol * * @param string $currency_code Currency code - * @param string $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. + * @param integer $forceloadall 1=Force to load all currencies into cache. We know we need to use all of them. By default read and cache only required currency. * @return string Currency symbol encoded into UTF8 */ function getCurrencySymbol($currency_code, $forceloadall=0) diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 512aa011d98..bc9f9081a49 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -306,7 +306,7 @@ class vCard /** * permet d'obtenir une vcard * - * @return void + * @return string */ function getVCard() { diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 7e0333bc5aa..0001bec0514 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -119,7 +119,7 @@ print ''."\n"; * Convert date to timestamp * * @param string $mysqldate Date YYYMMDD - * @return timestamp Timestamp + * @return integer Timestamp */ function xyzToUnixTimestamp($mysqldate) { diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 8b5f2c86810..cd607a72b58 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -137,8 +137,8 @@ interface Database /** * Define sort criteria of request * - * @param string $sortfield List of sort fields - * @param string $sortorder Sort order + * @param integer $sortfield List of sort fields + * @param integer $sortorder Sort order * @return string String to provide syntax of a sort sql string */ function order($sortfield = 0, $sortorder = 0); @@ -216,7 +216,7 @@ interface Database * @param string $login login * @param string $passwd password * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -421,7 +421,7 @@ interface Database /** * Free last resultset used. * - * @param resource $resultset Curseur de la requete voulue + * @param integer $resultset Curseur de la requete voulue * @return void */ function free($resultset = 0); diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index aa0792c5970..179eb81fefc 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -223,8 +223,8 @@ abstract class DoliDB implements Database /** * Define sort criteria of request * - * @param string $sortfield List of sort fields - * @param string $sortorder Sort order + * @param integer $sortfield List of sort fields + * @param integer $sortorder Sort order * @return string String to provide syntax of a sort sql string */ function order($sortfield=0,$sortorder=0) @@ -266,7 +266,7 @@ abstract class DoliDB implements Database * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ - * @return date Date TMS + * @return integer Date TMS */ function jdate($string, $gm=false) { diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index d0b454168df..c03baa2b04c 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -155,7 +155,7 @@ class DoliDBMssql extends DoliDB * @param string $login login * @param string $passwd password * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -399,7 +399,7 @@ class DoliDBMssql extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_array($resultset) @@ -413,7 +413,7 @@ class DoliDBMssql extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_row($resultset) @@ -441,7 +441,7 @@ class DoliDBMssql extends DoliDB * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * * @param resultset $resultset Curseur de la requete voulue - * @return int Nombre de lignes + * @return string Nombre de lignes * @see num_rows */ function affected_rows($resultset) @@ -459,7 +459,7 @@ class DoliDBMssql extends DoliDB /** * Free last resultset used. * - * @param resultset $resultset Curseur de la requete voulue + * @param integer $resultset Curseur de la requete voulue * @return void */ function free($resultset=0) @@ -588,7 +588,7 @@ class DoliDBMssql extends DoliDB * * @param string $fieldorvalue Field name or value to encrypt * @param int $withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * @return string XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -903,7 +903,7 @@ class DoliDBMssql extends DoliDB /** * Return list of available charset that can be used to store data in database * - * @return array List of Charset + * @return string List of Charset */ function getListOfCharacterSet() { @@ -932,7 +932,7 @@ class DoliDBMssql extends DoliDB /** * Return list of available collation that can be used for database * - * @return array Liste of Collation + * @return string Liste of Collation */ function getListOfCollation() { diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index bfa2d39b093..2b5ecd6c32a 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -182,7 +182,7 @@ class DoliDBMysql extends DoliDB * @param string $login login * @param string $passwd password * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -314,7 +314,7 @@ class DoliDBMysql extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_row($resultset) @@ -358,7 +358,7 @@ class DoliDBMysql extends DoliDB /** * Free last resultset used. * - * @param resultset $resultset Curseur de la requete voulue + * @param integer $resultset Curseur de la requete voulue * @return void */ function free($resultset=0) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index da16c1a7971..89ed3cbc1d7 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -185,7 +185,7 @@ class DoliDBMysqli extends DoliDB * @param string $login login * @param string $passwd password * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -316,7 +316,7 @@ class DoliDBMysqli extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_row($resultset) @@ -369,7 +369,7 @@ class DoliDBMysqli extends DoliDB /** * Libere le dernier resultset utilise sur cette connexion * - * @param resultset $resultset Curseur de la requete voulue + * @param integer $resultset Curseur de la requete voulue * @return void */ function free($resultset=0) @@ -716,7 +716,7 @@ class DoliDBMysqli extends DoliDB * * @param string $table Name of table * @param string $field Optionnel : Name of field if we want description of field - * @return resultset Resultset x (x->Field, x->Type, ...) + * @return resource Resultset x (x->Field, x->Type, ...) */ function DDLDescTable($table,$field="") { diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index f6759e087c8..d2f17427d42 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -145,7 +145,7 @@ class DoliDBPgsql extends DoliDB * * @param string $line SQL request line to convert * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) - * @param string $unescapeslashquot Unescape slash quote with quote quote + * @param integer $unescapeslashquot Unescape slash quote with quote quote * @return string SQL request line converted */ static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=0) @@ -361,7 +361,7 @@ class DoliDBPgsql extends DoliDB * @param string $login Login * @param string $passwd Password * @param string $name Name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -539,7 +539,7 @@ class DoliDBPgsql extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_array($resultset) @@ -552,7 +552,7 @@ class DoliDBPgsql extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_row($resultset) @@ -596,7 +596,7 @@ class DoliDBPgsql extends DoliDB /** * Libere le dernier resultset utilise sur cette connexion * - * @param Resultset $resultset Result set of request + * @param integer $resultset Result set of request * @return void */ function free($resultset=0) @@ -664,7 +664,7 @@ class DoliDBPgsql extends DoliDB /** * Renvoie le code erreur generique de l'operation precedente. * - * @return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * @return string (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ function errno() { @@ -730,7 +730,7 @@ class DoliDBPgsql extends DoliDB /** * Renvoie le texte de l'erreur pgsql de l'operation precedente * - * @return error_text + * @return string */ function error() { @@ -742,7 +742,7 @@ class DoliDBPgsql extends DoliDB * * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql * @param string $fieldid Field name - * @return int Id of row + * @return null|string Id of row */ function last_insert_id($tab,$fieldid='rowid') { @@ -764,7 +764,7 @@ class DoliDBPgsql extends DoliDB * * @param string $fieldorvalue Field name or value to encrypt * @param int $withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * @return string XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { @@ -785,7 +785,7 @@ class DoliDBPgsql extends DoliDB * Decrypt sensitive data in database * * @param int $value Value to decrypt - * @return string Decrypted value if used + * @return integer Decrypted value if used */ function decrypt($value) { @@ -1002,7 +1002,7 @@ class DoliDBPgsql extends DoliDB * * @param string $table Name of table * @param string $field Optionnel : Name of field if we want description of field - * @return resultset Resultset x (x->attname) + * @return resource Resultset x (x->attname) */ function DDLDescTable($table,$field="") { diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php index 34ee2a41b6d..8bc030ecae7 100644 --- a/htdocs/core/db/sqlite.class.php +++ b/htdocs/core/db/sqlite.class.php @@ -294,7 +294,7 @@ class DoliDBSqlite extends DoliDB * @param string $login login * @param string $passwd password * @param string $name name of database (not used for mysql, used for pgsql) - * @param string $port Port of database server + * @param integer $port Port of database server * @return resource Database access handler * @see close */ @@ -457,7 +457,7 @@ class DoliDBSqlite extends DoliDB /** * Return datas as an array * - * @param Resultset $resultset Resultset of request + * @param resource $resultset Resultset of request * @return array Array */ function fetch_row($resultset) @@ -509,7 +509,7 @@ class DoliDBSqlite extends DoliDB /** * Free last resultset used. * - * @param resultset $resultset Curseur de la requete voulue + * @param integer $resultset Curseur de la requete voulue * @return void */ function free($resultset=0) @@ -627,7 +627,7 @@ class DoliDBSqlite extends DoliDB * * @param string $fieldorvalue Field name or value to encrypt * @param int $withQuotes Return string with quotes - * @return return XXX(field) or XXX('value') or field or 'value' + * @return string XXX(field) or XXX('value') or field or 'value' */ function encrypt($fieldorvalue, $withQuotes=0) { diff --git a/htdocs/core/filemanagerdol/connectors/php/basexml.php b/htdocs/core/filemanagerdol/connectors/php/basexml.php index 439353b4e26..715ac667448 100644 --- a/htdocs/core/filemanagerdol/connectors/php/basexml.php +++ b/htdocs/core/filemanagerdol/connectors/php/basexml.php @@ -47,6 +47,9 @@ function SetXmlHeaders() header('Content-Type: text/xml; charset=utf-8'); } +/** + * @param string $currentFolder + */ function CreateXmlHeader( $command, $resourceType, $currentFolder ) { SetXmlHeaders(); @@ -71,7 +74,7 @@ function CreateXmlFooter() /** * SendError * - * @param unknown_type $number Number + * @param integer $number Number * @param unknown_type $text Text * @return void */ diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 6369ac9d3ae..f0b7fc0798b 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -22,6 +22,9 @@ * This is the File Manager Connector for PHP. */ +/** + * @param string $currentFolder + */ function GetFolders( $resourceType, $currentFolder ) { // Map the virtual path to the local server path. @@ -53,6 +56,9 @@ function GetFolders( $resourceType, $currentFolder ) echo "" ; } +/** + * @param string $currentFolder + */ function GetFoldersAndFiles( $resourceType, $currentFolder ) { // Map the virtual path to the local server path. @@ -111,6 +117,9 @@ function GetFoldersAndFiles( $resourceType, $currentFolder ) echo '' ; } +/** + * @param string $currentFolder + */ function CreateFolder( $resourceType, $currentFolder ) { if (!isset($_GET)) { @@ -164,6 +173,9 @@ function CreateFolder( $resourceType, $currentFolder ) // DOL_CHANGE //function FileUpload( $resourceType, $currentFolder, $sCommand ) +/** + * @param string $currentFolder + */ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '') { if (!isset($_FILES)) { diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php index 50ce4a33f05..08e31491898 100644 --- a/htdocs/core/filemanagerdol/connectors/php/io.php +++ b/htdocs/core/filemanagerdol/connectors/php/io.php @@ -21,6 +21,9 @@ * * This is the File Manager Connector for PHP. */ +/** + * @param string $sBasePath + */ function CombinePaths( $sBasePath, $sFolder ) { return RemoveFromEnd($sBasePath, '/') . '/' . RemoveFromStart($sFolder, '/'); @@ -45,8 +48,8 @@ function GetResourceTypePath($resourceType, $sCommand) /** * GetResourceTypeDirectory * - * @param unknown_type $resourceType Resource type - * @param unknown_type $sCommand Command + * @param string $resourceType Resource type + * @param string $sCommand Command * @return string */ function GetResourceTypeDirectory($resourceType, $sCommand) @@ -91,7 +94,7 @@ function RemoveExtension($fileName) * @param string $resourceType Resource type * @param string $folderPath Folder * @param string $sCommand Command - * @return void + * @return string */ function ServerMapFolder($resourceType, $folderPath, $sCommand) { @@ -107,6 +110,9 @@ function ServerMapFolder($resourceType, $folderPath, $sCommand) return CombinePaths($sResourceTypePath, $folderPath); } +/** + * @param string $folderPath + */ function GetParentFolder( $folderPath ) { $sPattern = "-[/\\\\][^/\\\\]+[/\\\\]?$-" ; @@ -221,6 +227,9 @@ function Server_MapPath( $path ) return GetRootPath() . $path ; } +/** + * @param string $sExtension + */ function IsAllowedExt($sExtension, $resourceType) { global $Config ; @@ -348,6 +357,10 @@ EOF; // DOL_CHANGE // This is the function that sends the results of the uploading process to CKE. +/** + * @param string $callback + * @param string $sFileUrl + */ function SendCKEditorResults ($callback, $sFileUrl, $customMsg = '') { echo '
'.$langs->trans('NbOfAttachedFiles').''.count($filearray).'
'.$langs->trans('NbOfAttachedFiles').''.count($filearray).'
'.$langs->trans('TotalSizeOfAttachedFiles').''.$totalsize.' '.$langs->trans('bytes').'