Переглянути джерело

Merge branch 'develop' into toomanylines

Laurent Destailleur 6 роки тому
батько
коміт
f30a3d59ba
100 змінених файлів з 475 додано та 464 видалено
  1. 1 1
      dev/examples/code/create_user.php
  2. 13 0
      dev/setup/codesniffer/ruleset.xml
  3. 6 6
      dev/translation/autotranslator.class.php
  4. 2 2
      dev/translation/sanity_check_en_langfiles.php
  5. 1 1
      dev/translation/strip_language_file.php
  6. 1 1
      htdocs/accountancy/admin/account.php
  7. 8 8
      htdocs/accountancy/admin/accountmodel.php
  8. 3 3
      htdocs/accountancy/admin/card.php
  9. 9 9
      htdocs/accountancy/admin/categories_list.php
  10. 3 3
      htdocs/accountancy/admin/fiscalyear_card.php
  11. 7 7
      htdocs/accountancy/admin/journals_list.php
  12. 3 3
      htdocs/accountancy/bookkeeping/card.php
  13. 7 7
      htdocs/accountancy/class/accountancycategory.class.php
  14. 3 3
      htdocs/accountancy/class/accountingaccount.class.php
  15. 3 3
      htdocs/accountancy/class/accountingjournal.class.php
  16. 11 11
      htdocs/accountancy/class/bookkeeping.class.php
  17. 2 2
      htdocs/accountancy/customer/lines.php
  18. 2 2
      htdocs/accountancy/customer/list.php
  19. 2 2
      htdocs/accountancy/expensereport/lines.php
  20. 2 2
      htdocs/accountancy/expensereport/list.php
  21. 25 25
      htdocs/accountancy/journal/bankjournal.php
  22. 2 2
      htdocs/accountancy/supplier/lines.php
  23. 2 2
      htdocs/accountancy/supplier/list.php
  24. 18 18
      htdocs/adherents/class/adherent.class.php
  25. 5 5
      htdocs/adherents/class/adherent_type.class.php
  26. 3 3
      htdocs/adherents/class/adherentstats.class.php
  27. 2 2
      htdocs/adherents/class/api_members.class.php
  28. 4 4
      htdocs/adherents/class/subscription.class.php
  29. 3 3
      htdocs/adherents/stats/geo.php
  30. 2 2
      htdocs/adherents/subscription.php
  31. 5 5
      htdocs/adherents/type.php
  32. 4 4
      htdocs/admin/agenda_other.php
  33. 4 4
      htdocs/admin/agenda_reminder.php
  34. 2 2
      htdocs/admin/bank.php
  35. 3 3
      htdocs/admin/boxes.php
  36. 10 10
      htdocs/admin/commande.php
  37. 6 6
      htdocs/admin/company.php
  38. 1 1
      htdocs/admin/confexped.php
  39. 1 1
      htdocs/admin/const.php
  40. 6 6
      htdocs/admin/contract.php
  41. 41 41
      htdocs/admin/dict.php
  42. 1 1
      htdocs/admin/dolistore/ajax/image.php
  43. 2 2
      htdocs/admin/dolistore/class/dolistore.class.php
  44. 1 1
      htdocs/admin/ecm.php
  45. 6 6
      htdocs/admin/expedition.php
  46. 6 6
      htdocs/admin/expensereport.php
  47. 4 4
      htdocs/admin/facture.php
  48. 1 1
      htdocs/admin/fckeditor.php
  49. 7 7
      htdocs/admin/fichinter.php
  50. 6 6
      htdocs/admin/holiday.php
  51. 1 1
      htdocs/admin/ihm.php
  52. 2 2
      htdocs/admin/mails.php
  53. 3 3
      htdocs/admin/mails_templates.php
  54. 1 1
      htdocs/admin/menus/other.php
  55. 4 4
      htdocs/admin/modules.php
  56. 1 1
      htdocs/admin/notification.php
  57. 1 1
      htdocs/admin/pdf.php
  58. 1 3
      htdocs/admin/prelevement.php
  59. 3 3
      htdocs/admin/propal.php
  60. 6 6
      htdocs/admin/reception_setup.php
  61. 3 3
      htdocs/admin/security.php
  62. 1 1
      htdocs/admin/security_file.php
  63. 2 2
      htdocs/admin/security_other.php
  64. 4 4
      htdocs/admin/supplier_invoice.php
  65. 8 8
      htdocs/admin/supplier_order.php
  66. 5 5
      htdocs/admin/supplier_payment.php
  67. 3 3
      htdocs/admin/supplier_proposal.php
  68. 1 1
      htdocs/admin/syslog.php
  69. 1 1
      htdocs/admin/system/constall.php
  70. 3 3
      htdocs/admin/system/database-tables.php
  71. 1 1
      htdocs/admin/system/dbtable.php
  72. 2 2
      htdocs/admin/system/dolibarr.php
  73. 1 1
      htdocs/admin/tools/dolibarr_export.php
  74. 2 2
      htdocs/admin/tools/dolibarr_import.php
  75. 6 6
      htdocs/admin/tools/eaccelerator.php
  76. 1 1
      htdocs/admin/tools/listsessions.php
  77. 1 1
      htdocs/admin/translation.php
  78. 1 1
      htdocs/admin/website.php
  79. 3 3
      htdocs/api/class/api.class.php
  80. 1 1
      htdocs/api/class/api_login.class.php
  81. 1 1
      htdocs/api/class/api_setup.class.php
  82. 3 3
      htdocs/asset/class/asset.class.php
  83. 4 4
      htdocs/asset/class/asset_type.class.php
  84. 1 1
      htdocs/blockedlog/admin/blockedlog_list.php
  85. 2 2
      htdocs/blockedlog/class/authority.class.php
  86. 18 18
      htdocs/blockedlog/class/blockedlog.class.php
  87. 31 31
      htdocs/cashdesk/class/Facturation.class.php
  88. 1 1
      htdocs/cashdesk/facturation.php
  89. 2 2
      htdocs/cashdesk/facturation_verif.php
  90. 12 12
      htdocs/categories/card.php
  91. 16 16
      htdocs/categories/class/categorie.class.php
  92. 1 1
      htdocs/categories/traduction.php
  93. 6 6
      htdocs/categories/viewcat.php
  94. 2 2
      htdocs/comm/action/card.php
  95. 10 10
      htdocs/comm/action/class/actioncomm.class.php
  96. 2 2
      htdocs/comm/action/class/actioncommreminder.class.php
  97. 2 2
      htdocs/comm/action/class/cactioncomm.class.php
  98. 6 6
      htdocs/comm/action/index.php
  99. 5 5
      htdocs/comm/action/pertype.php
  100. 5 5
      htdocs/comm/action/peruser.php

+ 1 - 1
dev/examples/code/create_user.php

@@ -80,7 +80,7 @@ if ($idobject > 0)
 		dol_print_error($db,$obj->error);
 	}
 }
-else if ($obj->error == 'ErrorLoginAlreadyExists')
+elseif ($obj->error == 'ErrorLoginAlreadyExists')
 {
      print "User with login ".$obj->login." already exists\n";
 }

+ 13 - 0
dev/setup/codesniffer/ruleset.xml

@@ -191,6 +191,15 @@
     <rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
 
     <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
+    <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
+        <properties>
+            <property name="equalsSpacing" value="1"/>
+        </properties>
+    </rule>
+    <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
+        <severity>0</severity>
+    </rule>
+
 
     <!-- Rules from PEAR Standard -->
 
@@ -390,6 +399,10 @@
 	</rule>
 	<rule ref="PEAR.NamingConventions.ValidVariableName" />
 
+    <rule ref="PSR2.Classes.ClassDeclaration" />
+    <rule ref="PSR2.Methods.FunctionClosingBrace" />
+    <rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
+
 	<!-- This is not in PSR2 -->
 	<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
         <severity>0</severity>

+ 6 - 6
dev/translation/autotranslator.class.php

@@ -50,7 +50,7 @@ class autoTranslator
      * @param   string $_apikey         Api key
      * @return void
      */
-    function __construct($_destlang,$_refLang,$_langDir,$_limittofile,$_apikey)
+    function __construct($_destlang, $_refLang, $_langDir, $_limittofile, $_apikey)
     {
 
 		// Set enviorment variables
@@ -156,7 +156,7 @@ class autoTranslator
 	 * @param 	string	$my_destlang		Target language code
 	 * @return	void
 	 */
-	private function updateTranslationFile($destPath,$file,$my_destlang)
+	private function updateTranslationFile($destPath, $file, $my_destlang)
 	{
 		$this->_time_end = date('Y-m-d H:i:s');
 
@@ -183,7 +183,7 @@ class autoTranslator
 	 * @param 	string	$my_destlang		Target language code
 	 * @return	void
 	 */
-	private function createTranslationFile($path,$my_destlang)
+	private function createTranslationFile($path, $my_destlang)
 	{
 		$fp = fopen($path, 'w+');
 		fwrite($fp, "/*\n");
@@ -205,7 +205,7 @@ class autoTranslator
 	 * @param	string	$my_destlang	Language code (ie: fr_FR)
 	 * @return	int						0=Nothing translated, 1=Record translated
 	 */
-	private function translateFileLine($content,$file,$key,$value,$my_destlang)
+	private function translateFileLine($content, $file, $key, $value, $my_destlang)
 	{
 
 		//print "key    =".$key."\n";
@@ -221,8 +221,8 @@ class autoTranslator
 		}
 
 		if ($key == 'CHARSET') $val=$this->_outputpagecode;
-		else if (preg_match('/^Format/',$key)) $val=$value;
-		else if ($value=='-') $val=$value;
+		elseif (preg_match('/^Format/',$key)) $val=$value;
+		elseif ($value=='-') $val=$value;
 		else
 		{
 			// If not translated then translate

+ 2 - 2
dev/translation/sanity_check_en_langfiles.php

@@ -215,8 +215,8 @@ foreach ($dups as $string => $pages)
 	$s.="\n";
 
 	if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
-	else if ($inmain) $sinmainandother .= $s;
-	else if ($inadmin) $sininstallandadmin .= $s;
+	elseif ($inmain) $sinmainandother .= $s;
+	elseif ($inadmin) $sininstallandadmin .= $s;
 	else $sother .= $s;
 }
 

+ 1 - 1
dev/translation/strip_language_file.php

@@ -310,7 +310,7 @@ foreach($filesToProcess as $fileToProcess)
 			{
 				//print "Key $key is a key we always want to see into secondary file (line: $cnt).\n";
 			}
-			else if ( ! array_key_exists($key, $aSecondary))
+			elseif ( ! array_key_exists($key, $aSecondary))
 			{
 				//print "Key $key does NOT exist in secondary language (line: $cnt).\n";
 				continue;

+ 1 - 1
htdocs/accountancy/admin/account.php

@@ -162,7 +162,7 @@ if (empty($reshook))
     	if ($result < 0) {
     		setEventMessages($accounting->error, $accounting->errors, 'errors');
     	}
-    } else if ($action == 'enable') {
+    } elseif ($action == 'enable') {
     	if ($accounting->fetch($id)) {
     		$result = $accounting->account_activate($id);
     	}

+ 8 - 8
htdocs/accountancy/admin/accountmodel.php

@@ -270,7 +270,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
 			if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
 				$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
 			}
-			else if ($value == 'entity') {
+			elseif ($value == 'entity') {
 				$_POST[$listfieldvalue[$i]] = $conf->entity;
 			}
 			if ($i) $sql.=",";
@@ -318,7 +318,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
 			if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
 				$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
 			}
-			else if ($field == 'entity') {
+			elseif ($field == 'entity') {
 				$_POST[$listfieldvalue[$i]] = $conf->entity;
 			}
 			if ($i) $sql.=",";
@@ -535,7 +535,7 @@ if ($id)
 			{
 				print '<td align="'.$align.'">';
 				if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
-				else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+				elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
 				else print $valuetoshow;
 				print '</td>';
 			 }
@@ -729,14 +729,14 @@ if ($id)
 							{
 								$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
 							}
-							else if ($value == 'source')
+							elseif ($value == 'source')
 							{
 								$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
 							}
-							else if ($valuetoshow=='all') {
+							elseif ($valuetoshow=='all') {
 								$valuetoshow=$langs->trans('All');
 							}
-							else if ($fieldlist[$field]=='country') {
+							elseif ($fieldlist[$field]=='country') {
 								if (empty($obj->country_code))
 								{
 									$valuetoshow='-';
@@ -747,7 +747,7 @@ if ($id)
 									$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
 								}
 							}
-							else if ($fieldlist[$field]=='country_id') {
+							elseif ($fieldlist[$field]=='country_id') {
 								$showfield=0;
 							}
 
@@ -811,7 +811,7 @@ $db->close();
  *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
  *	@return		void
  */
-function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
+function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '')
 {
 	global $conf,$langs,$db;
 	global $form;

+ 3 - 3
htdocs/accountancy/admin/card.php

@@ -124,7 +124,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
 		    exit;
 		}
 	}
-} else if ($action == 'edit' && $user->rights->accounting->chartofaccount) {
+} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
 	if (! $cancel) {
 		$result = $object->fetch($id);
 
@@ -177,7 +177,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
 	    header("Location: " . $urltogo);
 		exit();
 	}
-} else if ($action == 'delete' && $user->rights->accounting->chartofaccount) {
+} elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) {
 	$result = $object->fetch($id);
 
 	if (! empty($object->id)) {
@@ -272,7 +272,7 @@ if ($action == 'create') {
 
 	print '</form>';
 }
-else if ($id > 0 || $ref) {
+elseif ($id > 0 || $ref) {
 
 	$result = $object->fetch($id, $ref, 1);
 

+ 9 - 9
htdocs/accountancy/admin/categories_list.php

@@ -268,7 +268,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
             if ($field == 'fk_country' && $_POST['country'] > 0) {
             	$_POST[$listfieldvalue[$i]] = $_POST['country'];
             }
-            else if ($field == 'entity') {
+            elseif ($field == 'entity') {
             	$_POST[$listfieldvalue[$i]] = $conf->entity;
             }
             if ($i) $sql.=",";
@@ -492,7 +492,7 @@ if ($id)
             {
                 print '<td align="'.$align.'">';
             	if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
-            	else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+            	elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
             	else print $valuetoshow;
                 print '</td>';
              }
@@ -699,10 +699,10 @@ if ($id)
                             {
                                 $valuetoshow = yn($valuetoshow);
                             }
-                            else if ($valuetoshow=='all') {
+                            elseif ($valuetoshow=='all') {
                                 $valuetoshow=$langs->trans('All');
                             }
-                            else if ($fieldlist[$field]=='country') {
+                            elseif ($fieldlist[$field]=='country') {
                                 if (empty($obj->country_code))
                                 {
                                     $valuetoshow='-';
@@ -713,20 +713,20 @@ if ($id)
                                     $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
                                 }
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
                                 $key=$langs->trans("Country".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
                                 $langs->loadLangs(array("propal"));
                                 $key=$langs->trans("AvailabilityType".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
                                 $key=$langs->trans("Action".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
+                            elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
                                 $showfield=0;
                             }
 
@@ -813,7 +813,7 @@ $db->close();
  *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
  *	@return		void
  */
-function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $context='')
+function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $context = '')
 {
 	global $conf,$langs,$db;
 	global $form, $mysoc;

+ 3 - 3
htdocs/accountancy/admin/fiscalyear_card.php

@@ -73,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
 	}
 }
 
-else if ($action == 'add') {
+elseif ($action == 'add') {
 	if (! GETPOST('cancel', 'alpha')) {
 		$error = 0;
 
@@ -118,7 +118,7 @@ else if ($action == 'add') {
 }
 
 // Update record
-else if ($action == 'update') {
+elseif ($action == 'update') {
 	if (! GETPOST('cancel', 'alpha')) {
 		$result = $object->fetch($id);
 
@@ -198,7 +198,7 @@ if ($action == 'create')
 	print '</div>';
 
 	print '</form>';
-} else if ($id) {
+} elseif ($id) {
 	$result = $object->fetch($id);
 	if ($result > 0) {
 		$head = fiscalyear_prepare_head($object);

+ 7 - 7
htdocs/accountancy/admin/journals_list.php

@@ -270,7 +270,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
 			if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
 				$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
 			}
-			else if ($field == 'entity') {
+			elseif ($field == 'entity') {
 				$_POST[$listfieldvalue[$i]] = $conf->entity;
 			}
 			if ($i) $sql.=",";
@@ -441,7 +441,7 @@ if ($id)
 			{
 				print '<td align="'.$align.'">';
 				if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
-				else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+				elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
 				else print $valuetoshow;
 				print '</td>';
 			 }
@@ -611,11 +611,11 @@ if ($id)
 							if ($valuetoshow=='all') {
 								$valuetoshow=$langs->trans('All');
 							}
-							else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
+							elseif ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
 								$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
 								$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]});
 							}
-							else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
+							elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
 								$valuetoshow=$langs->trans($obj->label);
                             }
 
@@ -630,8 +630,8 @@ if ($id)
 					if (isset($obj->code) && $id != 10)
 					{
 						if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
-						else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
-						else if ($obj->code == 'EF0')   { $iserasable = 0; $canbedisabled = 0; }
+						elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
+						elseif ($obj->code == 'EF0')   { $iserasable = 0; $canbedisabled = 0; }
 					}
 
 					$canbemodified=$iserasable;
@@ -696,7 +696,7 @@ $db->close();
  *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
  *	@return		void
  */
-function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
+function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
 {
 	global $conf,$langs,$db;
 	global $form, $mysoc;

+ 3 - 3
htdocs/accountancy/bookkeeping/card.php

@@ -140,7 +140,7 @@ if ($action == "confirm_update") {
 	}
 }
 
-else if ($action == "add") {
+elseif ($action == "add") {
 	$error = 0;
 
 	if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
@@ -201,7 +201,7 @@ else if ($action == "add") {
 	}
 }
 
-else if ($action == "confirm_delete") {
+elseif ($action == "confirm_delete") {
 	$object = new BookKeeping($db);
 
 	$result = $object->fetch($id, null, $mode);
@@ -218,7 +218,7 @@ else if ($action == "confirm_delete") {
 	$action = '';
 }
 
-else if ($action == "confirm_create") {
+elseif ($action == "confirm_create") {
 	$error = 0;
 
 	$object = new BookKeeping($db);

+ 7 - 7
htdocs/accountancy/class/accountancycategory.class.php

@@ -142,7 +142,7 @@ class AccountancyCategory // extends CommonObject
 	 *  @param      int		$notrigger   0=launch triggers after, 1=disable triggers
 	 *  @return     int      		   	 <0 if KO, Id of created object if OK
 	 */
-	function create($user, $notrigger=0)
+	function create($user, $notrigger = 0)
 	{
 		global $conf, $langs;
 		$error=0;
@@ -239,7 +239,7 @@ class AccountancyCategory // extends CommonObject
 	 *  @param		string	$label	Label
 	 *  @return     int          	<0 if KO, >0 if OK
 	 */
-	function fetch($id, $code='', $label='')
+	function fetch($id, $code = '', $label = '')
 	{
 		$sql = "SELECT";
 		$sql.= " t.rowid,";
@@ -299,7 +299,7 @@ class AccountancyCategory // extends CommonObject
 	 *  @param      int		$notrigger	 0=launch triggers after, 1=disable triggers
 	 *  @return     int     		   	 <0 if KO, >0 if OK
 	 */
-	function update($user=null, $notrigger=0)
+	function update($user = null, $notrigger = 0)
 	{
 		global $conf, $langs;
 		$error=0;
@@ -379,7 +379,7 @@ class AccountancyCategory // extends CommonObject
 	 *  @param	int		$notrigger	 0=launch triggers after, 1=disable triggers
 	 *  @return	int					 <0 if KO, >0 if OK
 	 */
-	function delete($user, $notrigger=0)
+	function delete($user, $notrigger = 0)
 	{
 		global $conf, $langs;
 		$error=0;
@@ -726,7 +726,7 @@ class AccountancyCategory // extends CommonObject
 	 * @param int       $year 				Specifig year - Can be empty
 	 * @return integer 						<0 if KO, >= 0 if OK
 	 */
-	public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code='nofilter', $month=0, $year=0)
+	public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code = 'nofilter', $month = 0, $year = 0)
 	{
 		global $conf;
 
@@ -796,7 +796,7 @@ class AccountancyCategory // extends CommonObject
 	 * @param	int			$categorytype		-1=All, 0=Only non computed groups, 1=Only computed groups
 	 * @return	array|int						Array of groups or -1 if error
 	 */
-	public function getCats($categorytype=-1)
+	public function getCats($categorytype = -1)
 	{
 		global $conf, $mysoc;
 
@@ -853,7 +853,7 @@ class AccountancyCategory // extends CommonObject
 	 * @param 	string 		$predefinedgroupwhere 	Sql criteria filter to select accounting accounts
 	 * @return 	array|int							Array of accounting accounts or -1 if error
 	 */
-	public function getCptsCat($cat_id, $predefinedgroupwhere='')
+	public function getCptsCat($cat_id, $predefinedgroupwhere = '')
 	{
 		global $conf, $mysoc;
 		$sql = '';

+ 3 - 3
htdocs/accountancy/class/accountingaccount.class.php

@@ -466,7 +466,7 @@ class AccountingAccount extends CommonObject
      * @param	int     $save_lastsearch_value		-1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
 	 * @return  string	String with URL
 	 */
-	function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1)
+	function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
 	{
 		global $langs, $conf, $user;
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@@ -632,7 +632,7 @@ class AccountingAccount extends CommonObject
 	 *  @param  int     $mode       0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return string              Label of status
 	 */
-	function getLibStatut($mode=0)
+	function getLibStatut($mode = 0)
 	{
 		return $this->LibStatut($this->status,$mode);
 	}
@@ -645,7 +645,7 @@ class AccountingAccount extends CommonObject
 	 *  @param  int     $mode       0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return string              Label of status
 	 */
-	function LibStatut($statut,$mode=0)
+	function LibStatut($statut, $mode = 0)
 	{
         // phpcs:enable
 		global $langs;

+ 3 - 3
htdocs/accountancy/class/accountingjournal.class.php

@@ -213,7 +213,7 @@ class AccountingJournal extends CommonObject
 	 * @param	int  	$notooltip		1=Disable tooltip
 	 * @return	string	String with URL
 	 */
-	function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0)
+	function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0)
 	{
 		global $langs, $conf, $user;
 
@@ -270,7 +270,7 @@ class AccountingJournal extends CommonObject
 	 *  @param	int		$mode		  0=libelle long, 1=libelle court
 	 *  @return	string 				   Label of type
 	 */
-	function getLibType($mode=0)
+	function getLibType($mode = 0)
 	{
 		return $this->LibType($this->nature,$mode);
 	}
@@ -283,7 +283,7 @@ class AccountingJournal extends CommonObject
 	 *  @param  int		$mode		  	0=libelle long, 1=libelle court
 	 *  @return string 				   	Label of type
 	 */
-	function LibType($nature,$mode=0)
+	function LibType($nature, $mode = 0)
 	{
         // phpcs:enable
 		global $langs;

+ 11 - 11
htdocs/accountancy/class/bookkeeping.class.php

@@ -411,7 +411,7 @@ class BookKeeping extends CommonObject
 	 *  @param  int     $save_lastsearch_value    	-1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
 	 *	@return	string								String with URL
 	 */
-	function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
+	function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
 	{
 		global $db, $conf, $langs;
 		global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -470,7 +470,7 @@ class BookKeeping extends CommonObject
 	 * @param  string  $mode 	   Mode
 	 * @return int				 <0 if KO, Id of created object if OK
 	 */
-    public function createStd(User $user, $notrigger = false, $mode='')
+    public function createStd(User $user, $notrigger = false, $mode = '')
     {
 		global $conf;
 
@@ -641,7 +641,7 @@ class BookKeeping extends CommonObject
 	 *
 	 * @return int <0 if KO, 0 if not found, >0 if OK
 	 */
-    public function fetch($id, $ref = null, $mode='')
+    public function fetch($id, $ref = null, $mode = '')
     {
 		global $conf;
 
@@ -1090,7 +1090,7 @@ class BookKeeping extends CommonObject
 	 * @param  string  $mode       Mode
 	 * @return int                 <0 if KO, >0 if OK
 	 */
-    public function update(User $user, $notrigger = false, $mode='')
+    public function update(User $user, $notrigger = false, $mode = '')
     {
 		$error = 0;
 
@@ -1225,7 +1225,7 @@ class BookKeeping extends CommonObject
 	 * @param  string  $mode           Mode
 	 * @return number                  <0 if KO, >0 if OK
 	 */
-	public function updateByMvt($piece_num='', $field='', $value='', $mode='')
+	public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
 	{
 		$error=0;
 
@@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject
 	 * @param string $mode Mode
 	 * @return int <0 if KO, >0 if OK
 	 */
-    public function delete(User $user, $notrigger = false, $mode='')
+    public function delete(User $user, $notrigger = false, $mode = '')
     {
 		dol_syslog(__METHOD__, LOG_DEBUG);
 
@@ -1338,7 +1338,7 @@ class BookKeeping extends CommonObject
 	 * @param  string $mode 		Mode
 	 * @return int					<0 if KO, >0 if OK
 	 */
-    function deleteByYearAndJournal($delyear='', $journal='', $mode='')
+    function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
     {
 		global $conf;
 
@@ -1500,7 +1500,7 @@ class BookKeeping extends CommonObject
 	 * @param string $mode Mode
 	 * @return int <0 if KO, >0 if OK
 	 */
-    public function fetchPerMvt($piecenum, $mode='')
+    public function fetchPerMvt($piecenum, $mode = '')
     {
 		global $conf;
 
@@ -1536,7 +1536,7 @@ class BookKeeping extends CommonObject
 	 * @param	string	$mode	Mode
 	 * @return	string			Next numero to use
 	 */
-	public function getNextNumMvt($mode='')
+	public function getNextNumMvt($mode = '')
 	{
 		global $conf;
 
@@ -1565,7 +1565,7 @@ class BookKeeping extends CommonObject
 	 * @param  string  $mode       Mode
 	 * @return int                 <0 if KO, >0 if OK
 	 */
-    function fetchAllPerMvt($piecenum, $mode='')
+    function fetchAllPerMvt($piecenum, $mode = '')
     {
 		global $conf;
 
@@ -1687,7 +1687,7 @@ class BookKeeping extends CommonObject
 	 * @param  string   $piece_num      Piece num
 	 * @return int                      int <0 if KO, >0 if OK
 	 */
-	public function transformTransaction($direction=0,$piece_num='')
+	public function transformTransaction($direction = 0, $piece_num = '')
 	{
 		$error = 0;
 

+ 2 - 2
htdocs/accountancy/customer/lines.php

@@ -219,12 +219,12 @@ if ($search_month > 0)
 {
 	if ($search_year > 0 && empty($search_day))
 		$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
-		else if ($search_year > 0 && ! empty($search_day))
+		elseif ($search_year > 0 && ! empty($search_day))
 			$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
 			else
 				$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
 }
-else if ($search_year > 0)
+elseif ($search_year > 0)
 {
 	$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
 }

+ 2 - 2
htdocs/accountancy/customer/list.php

@@ -257,12 +257,12 @@ if ($search_month > 0)
 {
 	if ($search_year > 0 && empty($search_day))
 		$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
-		else if ($search_year > 0 && ! empty($search_day))
+		elseif ($search_year > 0 && ! empty($search_day))
 			$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
 			else
 				$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
 }
-else if ($search_year > 0)
+elseif ($search_year > 0)
 {
 	$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
 }

+ 2 - 2
htdocs/accountancy/expensereport/lines.php

@@ -190,12 +190,12 @@ if ($search_month > 0)
 {
 	if ($search_year > 0 && empty($search_day))
 		$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
-		else if ($search_year > 0 && ! empty($search_day))
+		elseif ($search_year > 0 && ! empty($search_day))
 			$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
 			else
 				$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
 }
-else if ($search_year > 0)
+elseif ($search_year > 0)
 {
 	$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
 }

+ 2 - 2
htdocs/accountancy/expensereport/list.php

@@ -219,12 +219,12 @@ if ($search_month > 0)
 {
 	if ($search_year > 0 && empty($search_day))
 		$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
-		else if ($search_year > 0 && ! empty($search_day))
+		elseif ($search_year > 0 && ! empty($search_day))
 			$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
 			else
 				$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
 }
-else if ($search_year > 0)
+elseif ($search_year > 0)
 {
 	$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
 }

+ 25 - 25
htdocs/accountancy/journal/bankjournal.php

@@ -290,18 +290,18 @@ if ($result) {
 					$paymentstatic->ref = $links[$key]['url_id'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', '');		// TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
 					$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
-				} else if ($links[$key]['type'] == 'payment_supplier') {
+				} elseif ($links[$key]['type'] == 'payment_supplier') {
 					$paymentsupplierstatic->id = $links[$key]['url_id'];
 					$paymentsupplierstatic->ref = $links[$key]['url_id'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
 					$tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id;
-				} else if ($links[$key]['type'] == 'company') {
+				} elseif ($links[$key]['type'] == 'company') {
 					$societestatic->id = $links[$key]['url_id'];
 					$societestatic->name = $links[$key]['label'];
 					$societestatic->email = $tabcompany[$obj->rowid]['email'];
 					$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
 					if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
-				} else if ($links[$key]['type'] == 'user') {
+				} elseif ($links[$key]['type'] == 'user') {
 					$userstatic->id = $links[$key]['url_id'];
 					$userstatic->name = $links[$key]['label'];
 					$userstatic->email = $tabuser[$obj->rowid]['email'];
@@ -310,7 +310,7 @@ if ($result) {
 					if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
 					else $tabpay[$obj->rowid]["soclib"] = '???';	// Should not happen, but happens with old data when id of user was not saved on expense report payment.
 					if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
-				} else if ($links[$key]['type'] == 'sc') {
+				} elseif ($links[$key]['type'] == 'sc') {
 					$chargestatic->id = $links[$key]['url_id'];
 					$chargestatic->ref = $links[$key]['url_id'];
 
@@ -339,14 +339,14 @@ if ($result) {
 						$objmid = $db->fetch_object($resultmid);
 						$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
 					}
-				} else if ($links[$key]['type'] == 'payment_donation') {
+				} elseif ($links[$key]['type'] == 'payment_donation') {
 					$paymentdonstatic->id = $links[$key]['url_id'];
 					$paymentdonstatic->ref = $links[$key]['url_id'];
 					$paymentdonstatic->fk_donation = $links[$key]['url_id'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
 					$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
 					$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
-				} else if ($links[$key]['type'] == 'member') {
+				} elseif ($links[$key]['type'] == 'member') {
 					$paymentsubscriptionstatic->id = $links[$key]['url_id'];
 					$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
 					$paymentsubscriptionstatic->label = $links[$key]['label'];
@@ -354,24 +354,24 @@ if ($result) {
 					$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
 					$paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id);
 					$tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount;
-				} else if ($links[$key]['type'] == 'payment_vat') {				// Payment VAT
+				} elseif ($links[$key]['type'] == 'payment_vat') {				// Payment VAT
 					$paymentvatstatic->id = $links[$key]['url_id'];
 					$paymentvatstatic->ref = $links[$key]['url_id'];
 					$paymentvatstatic->label = $links[$key]['label'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
 					$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
 					$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
-				} else if ($links[$key]['type'] == 'payment_salary') {
+				} elseif ($links[$key]['type'] == 'payment_salary') {
 					$paymentsalstatic->id = $links[$key]['url_id'];
 					$paymentsalstatic->ref = $links[$key]['url_id'];
 					$paymentsalstatic->label = $links[$key]['label'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
 					$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
-				} else if ($links[$key]['type'] == 'payment_expensereport') {
+				} elseif ($links[$key]['type'] == 'payment_expensereport') {
 					$paymentexpensereportstatic->id = $links[$key]['url_id'];
 					$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
 					$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
-				} else if ($links[$key]['type'] == 'payment_various') {
+				} elseif ($links[$key]['type'] == 'payment_various') {
 					$paymentvariousstatic->id = $links[$key]['url_id'];
 					$paymentvariousstatic->ref = $links[$key]['url_id'];
 					$paymentvariousstatic->label = $links[$key]['label'];
@@ -380,7 +380,7 @@ if ($result) {
 					$paymentvariousstatic->fetch($paymentvariousstatic->id);
 					$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined');	// NotDefined is a reserved word
 					$tabtp[$obj->rowid][$account_various] += $obj->amount;
-				} else if ($links[$key]['type'] == 'payment_loan') {
+				} elseif ($links[$key]['type'] == 'payment_loan') {
 					$paymentloanstatic->id = $links[$key]['url_id'];
 					$paymentloanstatic->ref = $links[$key]['url_id'];
 					$paymentloanstatic->fk_loan = $links[$key]['url_id'];
@@ -399,7 +399,7 @@ if ($result) {
 						$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
 						$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
 					}
-				} else if ($links[$key]['type'] == 'banktransfert') {
+				} elseif ($links[$key]['type'] == 'banktransfert') {
 					$accountLinestatic->fetch($links[$key]['url_id']);
 					$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
 					$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
@@ -567,68 +567,68 @@ if (! $error && $action == 'writebookkeeping') {
 
 							$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'payment_supplier') {		   // If payment is payment of supplier invoice, we get ref of invoice
+						} elseif ($tabtype[$key] == 'payment_supplier') {		   // If payment is payment of supplier invoice, we get ref of invoice
 							$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
 							$bookkeeping->subledger_label = $tabcompany[$key]['name'];
 							$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
 
 							$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'payment_expensereport') {
+						} elseif ($tabtype[$key] == 'payment_expensereport') {
 							$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
 							$bookkeeping->subledger_label = $tabuser[$key]['name'];
 							$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
 
 							$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'payment_salary') {
+						} elseif ($tabtype[$key] == 'payment_salary') {
 							$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
 							$bookkeeping->subledger_label = $tabuser[$key]['name'];
 							$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
 
 							$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) {   // If payment is payment of social contribution
+						} elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) {   // If payment is payment of social contribution
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
 							$bookkeeping->label_compte = $objmid->labelc;
-						} else if ($tabtype[$key] == 'payment_vat') {
+						} elseif ($tabtype[$key] == 'payment_vat') {
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
 
 							$accountingaccount->fetch(null, $k, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'payment_donation') {
+						} elseif ($tabtype[$key] == 'payment_donation') {
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
 
 							$accountingaccount->fetch(null, $k, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'member') {
+						} elseif ($tabtype[$key] == 'member') {
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
 
 							$accountingaccount->fetch(null, $k, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'payment_loan') {
+						} elseif ($tabtype[$key] == 'payment_loan') {
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
 
 							$accountingaccount->fetch(null, $k, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'payment_various') {
+						} elseif ($tabtype[$key] == 'payment_various') {
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
 
 							$accountingaccount->fetch(null, $k, true);
 							$bookkeeping->label_compte = $accountingaccount->label;
-						} else if ($tabtype[$key] == 'banktransfert') {
+						} elseif ($tabtype[$key] == 'banktransfert') {
 							$bookkeeping->subledger_account = '';
 							$bookkeeping->subledger_label = '';
 							$bookkeeping->numero_compte = $k;
@@ -845,11 +845,11 @@ if ($action == 'exportcsv') {		// ISO and not UTF8 !
 					print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
 					if ($tabtype[$key] == 'payment_supplier') {
 						print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
-					} else if($tabtype[$key] == 'payment') {
+					} elseif($tabtype[$key] == 'payment') {
 						print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
-					} else if($tabtype[$key] == 'payment_expensereport') {
+					} elseif($tabtype[$key] == 'payment_expensereport') {
 						print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
-					} else if($tabtype[$key] == 'payment_salary') {
+					} elseif($tabtype[$key] == 'payment_salary') {
 						print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
 					} else {
 						print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;

+ 2 - 2
htdocs/accountancy/supplier/lines.php

@@ -214,12 +214,12 @@ if ($search_month > 0)
 {
 	if ($search_year > 0 && empty($search_day))
 		$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
-		else if ($search_year > 0 && ! empty($search_day))
+		elseif ($search_year > 0 && ! empty($search_day))
 			$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
 			else
 				$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
 }
-else if ($search_year > 0)
+elseif ($search_year > 0)
 {
 	$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
 }

+ 2 - 2
htdocs/accountancy/supplier/list.php

@@ -256,12 +256,12 @@ if ($search_month > 0)
 {
 	if ($search_year > 0 && empty($search_day))
 		$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
-		else if ($search_year > 0 && ! empty($search_day))
+		elseif ($search_year > 0 && ! empty($search_day))
 			$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
 			else
 				$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
 }
-else if ($search_year > 0)
+elseif ($search_year > 0)
 {
 	$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
 }

+ 18 - 18
htdocs/adherents/class/adherent.class.php

@@ -246,7 +246,7 @@ class Adherent extends CommonObject
 	 *  @param	string	$moreinheader		Add more html headers
 	 *  @return	int							<0 if KO, >0 if OK
 	 */
-	function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='', $moreinheader='')
+	function send_an_email($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '')
 	{
         // phpcs:enable
 		global $conf,$langs;
@@ -358,7 +358,7 @@ class Adherent extends CommonObject
 	 *	@param	string		$morphy		Nature of the adherent (physical or moral)
 	 *	@return	string					Label
 	 */
-	function getmorphylib($morphy='')
+	function getmorphylib($morphy = '')
 	{
 		global $langs;
 		if (! $morphy) { $morphy=$this->morphy; }
@@ -374,7 +374,7 @@ class Adherent extends CommonObject
 	 *	@param  int		$notrigger		1 ne declenche pas les triggers, 0 sinon
 	 *	@return	int						<0 if KO, >0 if OK
 	 */
-	function create($user,$notrigger=0)
+	function create($user, $notrigger = 0)
 	{
 		global $conf,$langs;
 
@@ -500,7 +500,7 @@ class Adherent extends CommonObject
 	 * 	@param	string	$action				Current action for hookmanager
 	 * 	@return	int							<0 if KO, >0 if OK
 	 */
-	function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update')
+	function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update')
 	{
 		global $conf, $langs, $hookmanager;
 
@@ -817,7 +817,7 @@ class Adherent extends CommonObject
 	 *	@param	int		$notrigger	1=Does not execute triggers, 0= execute triggers
 	 *  @return	int					<0 if KO, 0=nothing to do, >0 if OK
 	 */
-	function delete($rowid, $user, $notrigger=0)
+	function delete($rowid, $user, $notrigger = 0)
 	{
 		global $conf, $langs;
 
@@ -927,7 +927,7 @@ class Adherent extends CommonObject
 	 *    @param	int		$nosyncuser		Do not synchronize linked user
 	 *    @return   string           		If OK return clear password, 0 if no change, < 0 if error
 	 */
-	function setPassword($user, $password='', $isencrypted=0, $notrigger=0, $nosyncuser=0)
+	function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0)
 	{
 		global $conf, $langs;
 
@@ -1147,7 +1147,7 @@ class Adherent extends CommonObject
 	 *	@param	string	$lastname	Lastname
 	 *	@return	void
 	 */
-	function fetch_name($firstname,$lastname)
+	function fetch_name($firstname, $lastname)
 	{
         // phpcs:enable
 		global $conf;
@@ -1183,7 +1183,7 @@ class Adherent extends CommonObject
 	 *  @param	bool	$fetch_subscriptions	To load member subscriptions
 	 *	@return int								>0 if OK, 0 if not found, <0 if KO
 	 */
-	function fetch($rowid,$ref='',$fk_soc='',$ref_ext='',$fetch_optionals=true,$fetch_subscriptions=true)
+	function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
 	{
 		global $langs;
 
@@ -1400,7 +1400,7 @@ class Adherent extends CommonObject
 	 *	@param	int     	$datesubend			Date end subscription
 	 *	@return int         					rowid of record added, <0 if KO
 	 */
-	function subscription($date, $amount, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0)
+	function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0)
 	{
 		global $conf,$langs,$user;
 
@@ -1486,7 +1486,7 @@ class Adherent extends CommonObject
 	 *  @param	string		$autocreatethirdparty	Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
 	 *	@return int									<0 if KO, >0 if OK
 	 */
-	function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0)
+	function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0)
 	{
 		global $conf, $langs, $user, $mysoc;
 
@@ -2018,7 +2018,7 @@ class Adherent extends CommonObject
 	 *  @param  int     $save_lastsearch_value    	-1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
 	 *	@return	string								Chaine avec URL
 	 */
-	function getNomUrl($withpictoimg=0, $maxlen=0, $option='card', $mode='', $morecss='', $save_lastsearch_value=-1)
+	function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1)
 	{
 		global $conf, $langs;
 
@@ -2109,7 +2109,7 @@ class Adherent extends CommonObject
 	 *  @param	int		$mode       0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return string				Label
 	 */
-	function getLibStatut($mode=0)
+	function getLibStatut($mode = 0)
 	{
 		return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
 	}
@@ -2124,7 +2124,7 @@ class Adherent extends CommonObject
 	 *  @param  int			$mode        			0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return string      						Label
 	 */
-	function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
+	function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
 	{
         // phpcs:enable
 		global $langs;
@@ -2307,7 +2307,7 @@ class Adherent extends CommonObject
          *  @param   null|array  $moreparams     Array to provide more information
 	 *  @return     int         				0 if KO, 1 if OK
 	 */
-	public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
+	public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
 	{
 		global $conf,$langs;
 
@@ -2400,7 +2400,7 @@ class Adherent extends CommonObject
 	 *								2=Return key only (uid=qqq)
 	 *	@return	string				DN
 	 */
-	function _load_ldap_dn($info,$mode=0)
+	function _load_ldap_dn($info, $mode = 0)
 	{
         // phpcs:enable
 		global $conf;
@@ -2487,7 +2487,7 @@ class Adherent extends CommonObject
 			if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED))		$info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
 		}
 		// Set LDAP password if possible
-		else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
+		elseif ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
 		{
 			if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
 			{
@@ -2502,7 +2502,7 @@ class Adherent extends CommonObject
 				}
 			}
 			// Use $this->pass_indatabase value if exists
-			else if (! empty($this->pass_indatabase))
+			elseif (! empty($this->pass_indatabase))
 			{
 				if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD))				$info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass_indatabase;	// $this->pass_indatabase = mot de passe non crypte
 				if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED))		$info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
@@ -2694,7 +2694,7 @@ class Adherent extends CommonObject
 	 * @param	string		$daysbeforeendlist		Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
 	 * @return	int									0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
 	 */
-	public function sendReminderForExpiredSubscription($daysbeforeendlist='10')
+	public function sendReminderForExpiredSubscription($daysbeforeendlist = '10')
 	{
 		global $conf, $langs, $mysoc, $user;
 

+ 5 - 5
htdocs/adherents/class/adherent_type.class.php

@@ -103,7 +103,7 @@ class AdherentType extends CommonObject
 	 *  @param	int		$notrigger		1=do not execute triggers, 0 otherwise
 	 *  @return	int						>0 if OK, < 0 if KO
 	 */
-	function create($user,$notrigger=0)
+	function create($user, $notrigger = 0)
 	{
 		global $conf;
 
@@ -170,7 +170,7 @@ class AdherentType extends CommonObject
 	 *  @param	int		$notrigger		1=do not execute triggers, 0 otherwise
 	 *  @return	int						>0 if OK, < 0 if KO
 	 */
-	function update($user,$notrigger=0)
+	function update($user, $notrigger = 0)
 	{
 		global $conf, $hookmanager;
 
@@ -356,7 +356,7 @@ class AdherentType extends CommonObject
 	 *  									2=Return array of members id only
 	 * 	@return	mixed						Array of members or -1 on error
 	 */
-	function listMembersForMemberType($excludefilter='', $mode=0)
+	function listMembersForMemberType($excludefilter = '', $mode = 0)
 	{
 		global $conf, $user;
 
@@ -411,7 +411,7 @@ class AdherentType extends CommonObject
      *  	@param		int  	$notooltip		1=Disable tooltip
      *		@return		string					String with URL
      */
-    function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
+    function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
     {
         global $langs;
 
@@ -449,7 +449,7 @@ class AdherentType extends CommonObject
 	 *									2=Return key only (uid=qqq)
 	 *	@return		string				DN
 	 */
-	function _load_ldap_dn($info,$mode=0)
+	function _load_ldap_dn($info, $mode = 0)
 	{
         // phpcs:enable
 		global $conf;

+ 3 - 3
htdocs/adherents/class/adherentstats.class.php

@@ -52,7 +52,7 @@ class AdherentStats extends Stats
 	 * 	@param 		int			$socid	   	Id third party
      * 	@param   	int			$userid    	Id user for filter
 	 */
-	function __construct($db, $socid=0, $userid=0)
+	function __construct($db, $socid = 0, $userid = 0)
 	{
 		global $user, $conf;
 
@@ -85,7 +85,7 @@ class AdherentStats extends Stats
      *	@param	int		$format		0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
      * @return	array				Array of nb each month
 	 */
-	function getNbByMonth($year, $format=0)
+	function getNbByMonth($year, $format = 0)
 	{
 		global $user;
 
@@ -126,7 +126,7 @@ class AdherentStats extends Stats
      * @param	int		$format		0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
      * @return	array				Array of amount each month
 	 */
-	function getAmountByMonth($year, $format=0)
+	function getAmountByMonth($year, $format = 0)
 	{
 		global $user;
 

+ 2 - 2
htdocs/adherents/class/api_members.class.php

@@ -213,7 +213,7 @@ class Members extends DolibarrApi
                     if ($result < 0) {
                         throw new RestException(500, 'Error when resiliating member: '.$member->error);
                     }
-                } else if ($value == '1') {
+                } elseif ($value == '1') {
                     $result = $member->validate(DolibarrApiAccess::$user);
                     if ($result < 0) {
                         throw new RestException(500, 'Error when validating member: '.$member->error);
@@ -361,7 +361,7 @@ class Members extends DolibarrApi
      *
      * @url POST {id}/subscriptions
      */
-    function createSubscription($id, $start_date, $end_date, $amount, $label='')
+    function createSubscription($id, $start_date, $end_date, $amount, $label = '')
     {
         if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
             throw new RestException(401);

+ 4 - 4
htdocs/adherents/class/subscription.class.php

@@ -207,7 +207,7 @@ $type=$this->fk_type;
 	 *	@param 	int		$notrigger		0=Disable triggers
 	 *	@return	int						<0 if KO, >0 if OK
 	 */
-	function update($user, $notrigger=0)
+	function update($user, $notrigger = 0)
 	{
 		$error = 0;
 
@@ -263,7 +263,7 @@ $type=$this->fk_type;
 	 *	@param 	bool 	$notrigger  false=launch triggers after, true=disable triggers
 	 *	@return	int					<0 if KO, 0 if not found, >0 if OK
 	 */
-	function delete($user, $notrigger=false)
+	function delete($user, $notrigger = false)
 	{
 		$error = 0;
 
@@ -356,7 +356,7 @@ $type=$this->fk_type;
 	 *  @param  int     $save_lastsearch_value    	-1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
 	 *	@return	string								Chaine avec URL
 	 */
-	function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1)
+	function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
 	{
 		global $langs;
 
@@ -395,7 +395,7 @@ $type=$this->fk_type;
 	 *  @param	int		$mode       0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return string				Label
 	 */
-	function getLibStatut($mode=0)
+	function getLibStatut($mode = 0)
 	{
 	    return '';
 	}

+ 3 - 3
htdocs/adherents/stats/geo.php

@@ -210,9 +210,9 @@ if ($mode && ! count($data))
 else
 {
     if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'<br>';
-    else if ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
-    else if ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
-    else if ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>';//+
+    elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
+    elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
+    elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>';//+
     else
     {
         print $langs->trans("MembersStatisticsDesc").'<br>';

+ 2 - 2
htdocs/adherents/subscription.php

@@ -793,8 +793,8 @@ if ($rowid > 0)
         else
         {
         	if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $bankviainvoice=1;
-        	else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
-        	else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
+        	elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
+        	elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
         }
 
         print "\n\n<!-- Form add subscription -->\n";

+ 5 - 5
htdocs/adherents/type.php

@@ -538,11 +538,11 @@ if ($rowid > 0)
 		    if ($status != '')
 		    {
 		        if ($status == '-1,1')								{ $titre=$langs->trans("MembersListQualified"); }
-		        else if ($status == '-1')							{ $titre=$langs->trans("MembersListToValid"); }
-		        else if ($status == '1' && ! $filter)				{ $titre=$langs->trans("MembersListValid"); }
-		        else if ($status == '1' && $filter=='uptodate')		{ $titre=$langs->trans("MembersListUpToDate"); }
-		        else if ($status == '1' && $filter=='outofdate')	{ $titre=$langs->trans("MembersListNotUpToDate"); }
-		        else if ($status == '0')							{ $titre=$langs->trans("MembersListResiliated"); }
+		        elseif ($status == '-1')							{ $titre=$langs->trans("MembersListToValid"); }
+		        elseif ($status == '1' && ! $filter)				{ $titre=$langs->trans("MembersListValid"); }
+		        elseif ($status == '1' && $filter=='uptodate')		{ $titre=$langs->trans("MembersListUpToDate"); }
+		        elseif ($status == '1' && $filter=='outofdate')	{ $titre=$langs->trans("MembersListNotUpToDate"); }
+		        elseif ($status == '0')							{ $titre=$langs->trans("MembersListResiliated"); }
 		    }
 		    elseif ($action == 'search')
 		    {

+ 4 - 4
htdocs/admin/agenda_other.php

@@ -86,7 +86,7 @@ if ($action == 'set')
     dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
 	dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
 }
-else if ($action == 'specimen')  // For orders
+elseif ($action == 'specimen')  // For orders
 {
     $modele=GETPOST('module','alpha');
 
@@ -133,13 +133,13 @@ else if ($action == 'specimen')  // For orders
 }
 
 // Activate a model
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
 {
 	//print "sssd".$value;
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -149,7 +149,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{

+ 4 - 4
htdocs/admin/agenda_reminder.php

@@ -81,7 +81,7 @@ if ($action == 'set')
     dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
 	dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
 }
-else if ($action == 'specimen')  // For orders
+elseif ($action == 'specimen')  // For orders
 {
     $modele=GETPOST('module','alpha');
 
@@ -128,13 +128,13 @@ else if ($action == 'specimen')  // For orders
 }
 
 // Activate a model
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
 {
 	//print "sssd".$value;
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -144,7 +144,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{

+ 2 - 2
htdocs/admin/bank.php

@@ -133,7 +133,7 @@ if ($action == 'specimen') {
 if ($action == 'set') {
     $ret = addDocumentModel($value, $type, $label, $scandir);
 }
-else if ($action == 'del') {
+elseif ($action == 'del') {
     $ret = delDocumentModel($value, $type);
     if ($ret > 0) {
         if ($conf->global->BANKADDON_PDF == "$value")
@@ -141,7 +141,7 @@ else if ($action == 'del') {
     }
 }
 // Set default model
-else if ($action == 'setdoc') {
+elseif ($action == 'setdoc') {
     if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
                     $conf->entity)) {
         // The constant that was read before the new set

+ 3 - 3
htdocs/admin/boxes.php

@@ -289,14 +289,14 @@ if ($resql)
 						$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
 						$resql = $db->query($sql);
 					}
-					else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
+					elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
 					{
 						$box_order = "B0".$record['box_order'];
 						$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
 						$resql = $db->query($sql);
 					}
 				}
-				else if (dol_strlen($record['box_order']) == 2)
+				elseif (dol_strlen($record['box_order']) == 2)
 				{
 					if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
 					{
@@ -304,7 +304,7 @@ if ($resql)
 						$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
 						$resql = $db->query($sql);
 					}
-					else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
+					elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
 					{
 						$box_order = "B".$record['box_order'];
 						$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";

+ 10 - 10
htdocs/admin/commande.php

@@ -73,7 +73,7 @@ if ($action == 'updateMask')
     }
 }
 
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
 {
 	$modele=GETPOST('module','alpha');
 
@@ -119,12 +119,12 @@ else if ($action == 'specimen')
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -134,7 +134,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -151,7 +151,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Check if numbering module chosen can be activated
 	// by calling method canBeActivated
@@ -159,7 +159,7 @@ else if ($action == 'setmod')
 	dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
 }
 
-else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
+elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
 {
 	$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
 	$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
@@ -176,7 +176,7 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
     }
 }
 
-else if ($action == 'set_ORDER_FREE_TEXT')
+elseif ($action == 'set_ORDER_FREE_TEXT')
 {
 	$freetext = GETPOST("ORDER_FREE_TEXT",'none');	// No alpha here, we want exact string
 
@@ -195,7 +195,7 @@ else if ($action == 'set_ORDER_FREE_TEXT')
 }
 
 // Activate Set Shippable Icon In List
-else if ($action=="setshippableiconinlist") {
+elseif ($action=="setshippableiconinlist") {
     $setshippableiconinlist = GETPOST('value','int');
     $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
     if (! $res > 0) $error++;
@@ -207,7 +207,7 @@ else if ($action=="setshippableiconinlist") {
 }
 
 // Activate ask for payment bank
-else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
+elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
 {
     $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
 
@@ -224,7 +224,7 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
 }
 
 // Activate ask for warehouse
-else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
+elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
 {
     $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
 

+ 6 - 6
htdocs/admin/company.php

@@ -137,7 +137,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
 					}
 					else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING);
 				}
-				else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
+				elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
 				{
 					$error++;
 					$langs->load("errors");
@@ -821,7 +821,7 @@ else
 	{
 		print '<a class="img_logo" href="'.$_SERVER["PHP_SELF"].'?action=addthumb&amp;file='.urlencode($mysoc->logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'</a>&nbsp;&nbsp;';
 	}
-	else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
+	elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
 	{
 		print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
 	}
@@ -1097,11 +1097,11 @@ else
 		{
 			print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
 		}
-		else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
+		elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
 		{
 			print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
 		}
-		else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
+		elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
 			print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
 		}
 
@@ -1151,11 +1151,11 @@ else
 		{
 			print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
 		}
-		else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
+		elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
 		{
 			print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
 		}
-		else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
+		elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
 		{
 			print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
 		}

+ 1 - 1
htdocs/admin/confexped.php

@@ -71,7 +71,7 @@ if ($action == 'activate_delivery')
 	header("Location: confexped.php");
 	exit;
 }
-else if ($action == 'disable_delivery')
+elseif ($action == 'disable_delivery')
 {
 	dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity);
     header("Location: confexped.php");

+ 1 - 1
htdocs/admin/const.php

@@ -233,7 +233,7 @@ $sql.= ", entity";
 $sql.= " FROM ".MAIN_DB_PREFIX."const";
 $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
 if ((empty($user->entity) || $user->admin) && $debug) {} 										// to force for superadmin to debug
-else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1";		// We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
+elseif (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1";		// We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
 if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
 $sql.= " ORDER BY entity, name ASC";
 

+ 6 - 6
htdocs/admin/contract.php

@@ -69,7 +69,7 @@ if ($action == 'updateMask')
     }
 }
 
-else if ($action == 'specimen') // For contract
+elseif ($action == 'specimen') // For contract
 {
 	$modele= GETPOST('module','alpha');
 
@@ -115,12 +115,12 @@ else if ($action == 'specimen') // For contract
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -130,7 +130,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -147,7 +147,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Verifier si module numerotation choisi peut etre active
 	// par appel methode canBeActivated
@@ -155,7 +155,7 @@ else if ($action == 'setmod')
 	dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
 }
 
-else if ($action == 'set_other')
+elseif ($action == 'set_other')
 {
 	$freetext= GETPOST('CONTRACT_FREE_TEXT','none');	// No alpha here, we want exact string
 	$res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);

+ 41 - 41
htdocs/admin/dict.php

@@ -728,7 +728,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
             if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
             	$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
             }
-            else if ($value == 'entity') {
+            elseif ($value == 'entity') {
             	$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
             }
             if ($i) $sql.=",";
@@ -780,7 +780,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
             if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
             	$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
             }
-            else if ($field == 'entity') {
+            elseif ($field == 'entity') {
             	$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
             }
             if ($i) $sql.=",";
@@ -1125,7 +1125,7 @@ if ($id)
             {
                 print '<td'.($class?' class="'.$class.'"':'').'>';
             	if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
-            	else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+            	elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
             	else print $valuetoshow;
                 print '</td>';
              }
@@ -1409,14 +1409,14 @@ if ($id)
                             {
                                 $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
                             }
-                            else if ($value == 'source')
+                            elseif ($value == 'source')
                             {
                                 $valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
                             }
-                            else if ($valuetoshow=='all') {
+                            elseif ($valuetoshow=='all') {
                                 $valuetoshow=$langs->trans('All');
                             }
-                            else if ($fieldlist[$field]=='country') {
+                            elseif ($fieldlist[$field]=='country') {
                                 if (empty($obj->country_code))
                                 {
                                     $valuetoshow='-';
@@ -1427,143 +1427,143 @@ if ($id)
                                     $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
                                 }
                             }
-                            else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
+                            elseif ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
                                 $valuetoshow=yn($valuetoshow);
                                 $align="center";
                             }
-                            else if ($fieldlist[$field]=='type_cdr') {
+                            elseif ($fieldlist[$field]=='type_cdr') {
                 				if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
                 				elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
                 				elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
                                 $align="center";
                             }
-                            else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
+                            elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
                                 $valuetoshow=price($valuetoshow);
                             }
                             if ($value == 'private')
                             {
                                 $valuetoshow = yn($elementList[$valuetoshow]);
                             }
-                            else if ($fieldlist[$field]=='libelle_facture') {
+                            elseif ($fieldlist[$field]=='libelle_facture') {
                                 $langs->load("bills");
                                 $key=$langs->trans("PaymentCondition".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                                 $valuetoshow=nl2br($valuetoshow);
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
                                 $key=$langs->trans("Country".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
                                 $langs->load("propal");
                                 $key=$langs->trans("AvailabilityType".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
                                 $key=$langs->trans("Action".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
+                            elseif (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
                                 $key=$langs->trans("Currency".strtoupper($obj->code_iso));
                                 $valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
                                 $key=$langs->trans(strtoupper($obj->code));
                                 $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
                                 $key=$langs->trans(strtoupper($obj->code));
                                 $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
                                 $key=$langs->trans("Civility".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
                             	$langs->load('agenda');
                                 $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
                                 $langs->load("bills");
                                 $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
                                 $langs->load("bills");
                                 $key=$langs->trans("PaymentType".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
                                 $key=$langs->trans("DemandReasonType".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
                                 $langs->load("orders");
                                 $key=$langs->trans($obj->code);
                                 $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
                             }
-                            else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
+                            elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
                                 $langs->load("sendings");
                                 $key=$langs->trans("SendingMethod".strtoupper($obj->code));
                                 $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
+                            elseif ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
                             {
                                 $key = $langs->trans('PaperFormat'.strtoupper($obj->code));
                                 $valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
+                            elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
                             {
                                 $langs->load('trips');
                                 $key = $langs->trans(strtoupper($obj->code));
                                 $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
+                            elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
                                 $showfield=0;
                             }
-                            else if ($fieldlist[$field]=='unicode') {
+                            elseif ($fieldlist[$field]=='unicode') {
                             	$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
                             }
-                            else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
+                            elseif ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
 	                            $langs->load("products");
 	                            $valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
                             }
-                            else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
+                            elseif ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
 	                            $langs->load("products");
 	                            $valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
                             }
-                            else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
+                            elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
                             {
                             	$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
                                 $valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
                             }
-							else if ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
+							elseif ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
 							    $align="center";
 							}
-							else if ($fieldlist[$field]=='localtax1_type') {
+							elseif ($fieldlist[$field]=='localtax1_type') {
                               if ($obj->localtax1 != 0)
 							    $valuetoshow=$localtax_typeList[$valuetoshow];
 							  else
 							    $valuetoshow = '';
 							  $align="center";
 							}
-							else if ($fieldlist[$field]=='localtax2_type') {
+							elseif ($fieldlist[$field]=='localtax2_type') {
 							 if ($obj->localtax2 != 0)
 							    $valuetoshow=$localtax_typeList[$valuetoshow];
 							  else
 							    $valuetoshow = '';
 							  $align="center";
 							}
-							else if ($fieldlist[$field]=='taux') {
+							elseif ($fieldlist[$field]=='taux') {
                                 $valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
 							    $align="center";
 							}
-							else if (in_array($fieldlist[$field],array('recuperableonly')))
+							elseif (in_array($fieldlist[$field],array('recuperableonly')))
 							{
 								$align="center";
 							}
-							else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
+							elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
                                 $valuetoshow = length_accountg($valuetoshow);
                             }
 							elseif ($fieldlist[$field] == 'fk_tva')
@@ -1604,8 +1604,8 @@ if ($id)
                     if (isset($obj->code) && $id != 10)
                     {
                     	if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
-                    	else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
-                    	else if ($obj->code == 'EF0')   { $iserasable = 0; $canbedisabled = 0; }
+                    	elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
+                    	elseif ($obj->code == 'EF0')   { $iserasable = 0; $canbedisabled = 0; }
                     }
 
                     if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
@@ -1639,8 +1639,8 @@ if ($id)
                     else
                  	{
                  		if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
-                 		else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
-                  		else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
+                 		elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
+                  		elseif (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
                     	else print $langs->trans("AlwaysActive");
                     }
                     print "</td>";
@@ -1755,7 +1755,7 @@ $db->close();
  *  @param		string		$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
  *	@return		string						'' or value of entity into table
  */
-function fieldList($fieldlist, $obj='', $tabname='', $context='')
+function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
 {
 	global $conf,$langs,$db,$mysoc;
 	global $form;

+ 1 - 1
htdocs/admin/dolistore/ajax/image.php

@@ -53,6 +53,6 @@ try {
     // Here we are dealing with errors
     $trace = $e->getTrace();
     if ($trace[0]['args'][0] == 404) die('Bad ID');
-    else if ($trace[0]['args'][0] == 401) die('Bad auth key');
+    elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
     else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
 }

+ 2 - 2
htdocs/admin/dolistore/class/dolistore.class.php

@@ -54,7 +54,7 @@ class Dolistore
 	 *
 	 * @param	boolean		$debug		Enable debug of request on screen
 	 */
-	function __construct($debug=false)
+	function __construct($debug = false)
 	{
 		global $conf, $langs;
 
@@ -154,7 +154,7 @@ class Dolistore
 			// Here we are dealing with errors
 			$trace = $e->getTrace();
 			if ($trace[0]['args'][0] == 404) die('Bad ID');
-			else if ($trace[0]['args'][0] == 401) die('Bad auth key');
+			elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
 			else
 			{
 				print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>';

+ 1 - 1
htdocs/admin/ecm.php

@@ -100,7 +100,7 @@ else
 	{
 		print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"),'off').'</a>';
 	}
-	else if(! empty($conf->global->USER_MAIL_REQUIRED))
+	elseif(! empty($conf->global->USER_MAIL_REQUIRED))
 	{
 		print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"),'on').'</a>';
 	}

+ 6 - 6
htdocs/admin/expedition.php

@@ -74,7 +74,7 @@ if ($action == 'updateMask')
 	}
 }
 
-else if ($action == 'set_param')
+elseif ($action == 'set_param')
 {
 	$freetext=GETPOST('SHIPPING_FREE_TEXT','none');	// No alpha here, we want exact string
 	$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
@@ -98,7 +98,7 @@ else if ($action == 'set_param')
 	}
 }
 
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
 {
 	$modele=GETPOST('module','alpha');
 
@@ -144,12 +144,12 @@ else if ($action == 'specimen')
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -159,7 +159,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -176,7 +176,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
 {
 	dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
 }

+ 6 - 6
htdocs/admin/expensereport.php

@@ -70,7 +70,7 @@ if ($action == 'updateMask')
     }
 }
 
-else if ($action == 'specimen') // For fiche inter
+elseif ($action == 'specimen') // For fiche inter
 {
 	$modele= GETPOST('module','alpha');
 
@@ -118,7 +118,7 @@ else if ($action == 'specimen') // For fiche inter
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 	if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF))
@@ -127,7 +127,7 @@ else if ($action == 'set')
 	}
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -137,7 +137,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -154,7 +154,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Verifier si module numerotation choisi peut etre active
 	// par appel methode canBeActivated
@@ -162,7 +162,7 @@ else if ($action == 'setmod')
 	dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity);
 }
 
-else if ($action == 'setoptions')
+elseif ($action == 'setoptions')
 {
     $db->begin();
 

+ 4 - 4
htdocs/admin/facture.php

@@ -124,12 +124,12 @@ if ($action == 'specimen')
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -139,7 +139,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -156,7 +156,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
     // TODO Verifier si module numerotation choisi peut etre active
     // par appel methode canBeActivated

+ 1 - 1
htdocs/admin/fckeditor.php

@@ -167,7 +167,7 @@ else
         {
             print '<a href="'.$_SERVER['PHP_SELF'].'?action=activate_'.strtolower($const).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
         }
-        else if ($value == 1)
+        elseif ($value == 1)
         {
             print '<a href="'.$_SERVER['PHP_SELF'].'?action=disable_'.strtolower($const).'">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
         }

+ 7 - 7
htdocs/admin/fichinter.php

@@ -70,7 +70,7 @@ if ($action == 'updateMask')
     }
 }
 
-else if ($action == 'specimen') // For fiche inter
+elseif ($action == 'specimen') // For fiche inter
 {
 	$modele= GETPOST('module','alpha');
 
@@ -116,12 +116,12 @@ else if ($action == 'specimen') // For fiche inter
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -131,7 +131,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -148,7 +148,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Verifier si module numerotation choisi peut etre active
 	// par appel methode canBeActivated
@@ -156,7 +156,7 @@ else if ($action == 'setmod')
 	dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
 }
 
-else if ($action == 'set_FICHINTER_FREE_TEXT')
+elseif ($action == 'set_FICHINTER_FREE_TEXT')
 {
 	$freetext= GETPOST('FICHINTER_FREE_TEXT','none');	// No alpha here, we want exact string
 	$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
@@ -173,7 +173,7 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
     }
 }
 
-else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
+elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
 {
 	$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
 	$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);

+ 6 - 6
htdocs/admin/holiday.php

@@ -71,7 +71,7 @@ if ($action == 'updateMask')
     }
 }
 
-else if ($action == 'specimen') // For contract
+elseif ($action == 'specimen') // For contract
 {
 	$modele= GETPOST('module','alpha');
 
@@ -117,12 +117,12 @@ else if ($action == 'specimen') // For contract
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -132,7 +132,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -149,7 +149,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Verifier si module numerotation choisi peut etre active
 	// par appel methode canBeActivated
@@ -157,7 +157,7 @@ else if ($action == 'setmod')
 	dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity);
 }
 
-else if ($action == 'set_other')
+elseif ($action == 'set_other')
 {
 	$freetext= GETPOST('HOLIDAY_FREE_TEXT','none');	// No alpha here, we want exact string
 	$res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);

+ 1 - 1
htdocs/admin/ihm.php

@@ -173,7 +173,7 @@ if ($action == 'update')
 				{
 					dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
 				}
-				else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
+				elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
 				{
 					$error++;
 					$langs->load("errors");

+ 2 - 2
htdocs/admin/mails.php

@@ -673,11 +673,11 @@ else
 	{
 		print $langs->trans('RobotEmail');
 	}
-	else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
+	elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
 	{
 		print $langs->trans('UserEmail');
 	}
-	else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
+	elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
 	{
 		print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
 	}

+ 3 - 3
htdocs/admin/mails_templates.php

@@ -479,7 +479,7 @@ foreach ($fieldlist as $field => $value)
 	{
 		print '<td align="'.$align.'">';
 		if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
-		else if (! empty($tabhelp[$id][$value]))
+		elseif (! empty($tabhelp[$id][$value]))
 		{
 			if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value);   // Tooltip on click
 			else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2);                             // Tooltip on hover
@@ -552,7 +552,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
 	if ($tmpfieldlist == 'topic') {
 		print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
 	}
-	else if ($tmpfieldlist == 'joinfiles') {
+	elseif ($tmpfieldlist == 'joinfiles') {
 		print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="' . (isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1') . '">';
 	}
 	else
@@ -947,7 +947,7 @@ $db->close();
  *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
  *	@return		void
  */
-function fieldList($fieldlist, $obj='', $tabname='', $context='')
+function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
 {
 	global $conf, $langs, $user, $db;
 	global $form;

+ 1 - 1
htdocs/admin/menus/other.php

@@ -42,7 +42,7 @@ if ($action == 'activate_hidemenu')
 	header("Location: ".$_SERVER["PHP_SELF"]);
 	exit;
 }
-else if ($action == 'disable_hidemenu')
+elseif ($action == 'disable_hidemenu')
 {
 	dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
 	header("Location: ".$_SERVER["PHP_SELF"]);

+ 4 - 4
htdocs/admin/modules.php

@@ -244,7 +244,7 @@ if ($action == 'set' && $user->admin)
     header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
 	exit;
 }
-else if ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
+elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
 {
     $result=unActivateModule($value);
     if ($result) setEventMessages($result, null, 'errors');
@@ -698,7 +698,7 @@ if ($mode == 'common')
         	{
         		print $langs->trans("Disabled");
         	}
-        	else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
+        	elseif (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
         	{
         		if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
         		else {
@@ -761,7 +761,7 @@ if ($mode == 'common')
         			}
         			print "</td>\n";
         		}
-        		else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
+        		elseif (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
         		{
         			print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>';
         		}
@@ -783,7 +783,7 @@ if ($mode == 'common')
         	{
         		// Should never happened
         	}
-        	else if (! empty($objMod->disabled))
+        	elseif (! empty($objMod->disabled))
         	{
         		print $langs->trans("Disabled");
         	}

+ 1 - 1
htdocs/admin/notification.php

@@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
 				$newval=GETPOST($shortkey.'_key');
 				//print $newkey.' - '.$newval.'<br>';
 	    	}
-	    	else if (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
+	    	elseif (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
 	    	{
 		    	// Add a new entry
 	    		$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));

+ 1 - 1
htdocs/admin/pdf.php

@@ -86,7 +86,7 @@ if ($action == 'activate_pdfsecurity')
 	header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
 	exit;
 }
-else if ($action == 'disable_pdfsecurity')
+elseif ($action == 'disable_pdfsecurity')
 {
 	dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity);
 	header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");

+ 1 - 3
htdocs/admin/prelevement.php

@@ -96,9 +96,7 @@ if ($action == "set")
     {
         $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
         if (! $res > 0) $error++;
-    } else
-
-    if (! $error)
+    } elseif (! $error)
 	{
 		$db->commit();
 		setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');

+ 3 - 3
htdocs/admin/propal.php

@@ -188,7 +188,7 @@ if ($action == 'set')
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -197,7 +197,7 @@ else if ($action == 'del')
 	}
 }
 
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
     if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -212,7 +212,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Verifier si module numerotation choisi peut etre active
 	// par appel methode canBeActivated

+ 6 - 6
htdocs/admin/reception_setup.php

@@ -80,7 +80,7 @@ if ($action == 'updateMask')
 	}
 }
 
-else if ($action == 'set_param')
+elseif ($action == 'set_param')
 {
 	$freetext=GETPOST('RECEPTION_FREE_TEXT','none');	// No alpha here, we want exact string
 	$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
@@ -104,7 +104,7 @@ else if ($action == 'set_param')
 	}
 }
 
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
 {
 	$modele=GETPOST('module','alpha');
 
@@ -150,12 +150,12 @@ else if ($action == 'specimen')
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -165,7 +165,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -182,7 +182,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
 {
 	dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
 }

+ 3 - 3
htdocs/admin/security.php

@@ -108,7 +108,7 @@ if ($action == 'activate_encrypt')
 		dol_print_error($db,'');
 	}
 }
-else if ($action == 'disable_encrypt')
+elseif ($action == 'disable_encrypt')
 {
 	//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
 	//Do not allow "disable encryption" as passwords cannot be decrypted
@@ -137,7 +137,7 @@ if ($action == 'activate_encryptdbpassconf')
 		setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
 	}
 }
-else if ($action == 'disable_encryptdbpassconf')
+elseif ($action == 'disable_encryptdbpassconf')
 {
 	$result = encodedecode_dbpassconf(0);
 	if ($result > 0)
@@ -161,7 +161,7 @@ if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK')
 	header("Location: security.php");
 	exit;
 }
-else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
+elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
 {
 	dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK",$conf->entity);
 	header("Location: security.php");

+ 1 - 1
htdocs/admin/security_file.php

@@ -67,7 +67,7 @@ if ($action == 'updateform')
 
 
 // Delete file
-else if ($action == 'delete')
+elseif ($action == 'delete')
 {
 	$langs->load("other");
 	$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha');	// Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).

+ 2 - 2
htdocs/admin/security_other.php

@@ -57,7 +57,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
 	}
 }
 
-else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
+elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
 {
 	$code=$reg[1];
 	if (dolibarr_del_const($db, $code, $conf->entity) > 0)
@@ -71,7 +71,7 @@ else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
 	}
 }
 
-else if ($action == 'updateform')
+elseif ($action == 'updateform')
 {
 	$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
     $res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);

+ 4 - 4
htdocs/admin/supplier_invoice.php

@@ -122,12 +122,12 @@ if ($action == 'specimen')  // For invoices
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -137,7 +137,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
     if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
     {
@@ -153,7 +153,7 @@ else if ($action == 'setdoc')
         $ret = addDocumentModel($value, $type, $label, $scandir);
     }
 }
-else if ($action == 'unsetdoc')
+elseif ($action == 'unsetdoc')
 {
     dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
 }

+ 8 - 8
htdocs/admin/supplier_order.php

@@ -73,7 +73,7 @@ if ($action == 'updateMask')
 	}
 }
 
-else if ($action == 'specimen')  // For orders
+elseif ($action == 'specimen')  // For orders
 {
     $modele=GETPOST('module','alpha');
 
@@ -120,12 +120,12 @@ else if ($action == 'specimen')  // For orders
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -135,7 +135,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -152,7 +152,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
     // TODO Verifier si module numerotation choisi peut etre active
     // par appel methode canBeActivated
@@ -160,13 +160,13 @@ else if ($action == 'setmod')
     dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
 }
 
-else if ($action == 'addcat')
+elseif ($action == 'addcat')
 {
     $fourn = new Fournisseur($db);
     $fourn->CreateCategory($user,$_POST["cat"]);
 }
 
-else if ($action == 'set_SUPPLIER_ORDER_OTHER')
+elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
 {
     $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT','none');	// No alpha here, we want exact string
 	$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED','alpha');
@@ -206,7 +206,7 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
 }
 
 // Activate ask for payment bank
-else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
+elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
 {
     $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER",$value,'chaine',0,'',$conf->entity);
 

+ 5 - 5
htdocs/admin/supplier_payment.php

@@ -61,18 +61,18 @@ if ($action == 'updateMask')
     {
         setEventMessages($langs->trans("Error"), null, 'errors');
     }
-}else  if ($action == 'setmod')
+}elseif ($action == 'setmod')
 {
     dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
 }
 
 // Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
 {
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -82,7 +82,7 @@ else if ($action == 'del')
 }
 
 // Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
 	if (dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -99,7 +99,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
 {
     $modele=GETPOST('module','alpha');
 

+ 3 - 3
htdocs/admin/supplier_proposal.php

@@ -169,7 +169,7 @@ if ($action == 'set')
 	$ret = addDocumentModel($value, $type, $label, $scandir);
 }
 
-else if ($action == 'del')
+elseif ($action == 'del')
 {
 	$ret = delDocumentModel($value, $type);
 	if ($ret > 0)
@@ -178,7 +178,7 @@ else if ($action == 'del')
 	}
 }
 
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
 {
     if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
 	{
@@ -193,7 +193,7 @@ else if ($action == 'setdoc')
 	}
 }
 
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
 {
 	// TODO Verifier si module numerotation choisi peut etre active
 	// par appel methode canBeActivated

+ 1 - 1
htdocs/admin/syslog.php

@@ -230,7 +230,7 @@ foreach ($syslogModules as $moduleName)
 		    if (! empty($tmpoption))
 		    {
     			if (isset($_POST[$tmpoption])) $value=$_POST[$tmpoption];
-    			else if (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
+    			elseif (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
 		    }
 			else $value = (isset($option['default']) ? $option['default'] : '');
 

+ 1 - 1
htdocs/admin/system/constall.php

@@ -183,7 +183,7 @@ foreach($configfileparameters as $key)
 			// Value
 			print "<td>";
 			if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
-			else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
+			elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
 			else print ${$newkey};
 			if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
 			print "</td>";

+ 3 - 3
htdocs/admin/system/database-tables.php

@@ -56,17 +56,17 @@ if (preg_match('/mysql/i',$conf->db->type))
 	$sql = "SHOW TABLE STATUS";
 	$base=1;
 }
-else if ($conf->db->type == 'pgsql')
+elseif ($conf->db->type == 'pgsql')
 {
 	$sql = "SELECT conname, contype FROM pg_constraint;";
 	$base=2;
 }
-else if ($conf->db->type == 'mssql')
+elseif ($conf->db->type == 'mssql')
 {
 	//$sqls[0] = "";
 	//$base=3;
 }
-else if ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
+elseif ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
 {
 	//$sql = "SELECT name, type FROM sqlite_master";
 	$base = 4;

+ 1 - 1
htdocs/admin/system/dbtable.php

@@ -50,7 +50,7 @@ if (preg_match('/mysql/i',$conf->db->type))
 	$sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'";
 	$base=1;
 }
-else if ($conf->db->type == 'pgsql')
+elseif ($conf->db->type == 'pgsql')
 {
 	$sql = "SELECT conname,contype FROM pg_constraint";
 	$base=2;

+ 2 - 2
htdocs/admin/system/dolibarr.php

@@ -374,8 +374,8 @@ foreach($configfileparameters as $key => $value)
 			// Value
 			print "<td>";
 			if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
-			else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
-			else if ($newkey == 'dolibarr_main_document_root_alt')
+			elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
+			elseif ($newkey == 'dolibarr_main_document_root_alt')
 			{
 				$tmparray=explode(',',${$newkey});
 				$i=0;

+ 1 - 1
htdocs/admin/tools/dolibarr_export.php

@@ -166,7 +166,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
 			</div>
 			<?php
 		}
-		else if (in_array($type, array('pgsql')))
+		elseif (in_array($type, array('pgsql')))
 		{
 			?>
 			<div class="formelementrow"><input type="radio" name="what"	value="postgresql" id="radio_dump_postgresql" />

+ 2 - 2
htdocs/admin/tools/dolibarr_import.php

@@ -106,7 +106,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).'<br><br>';
     </div>
     <?php
     }
-    else if (in_array($type, array('pgsql')))
+    elseif (in_array($type, array('pgsql')))
     {
     ?>
     <div class="formelementrow">
@@ -164,7 +164,7 @@ if (in_array($type, array('mysql', 'mysqli')))
     </fieldset>
 <?php
 }
-else if (in_array($type, array('pgsql')))
+elseif (in_array($type, array('pgsql')))
 {
 ?>
     <fieldset id="postgresql_options">

+ 6 - 6
htdocs/admin/tools/eaccelerator.php

@@ -48,17 +48,17 @@ if (isset($_POST['caching'])) {
     } else {
         eaccelerator_caching(true);
     }
-} else if (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
+} elseif (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
     if ($info['optimizer']) {
         eaccelerator_optimizer(false);
     } else {
         eaccelerator_optimizer(true);
     }
-} else if (isset($_POST['clear'])) {
+} elseif (isset($_POST['clear'])) {
     eaccelerator_clear();
-} else if (isset($_POST['clean'])) {
+} elseif (isset($_POST['clean'])) {
     eaccelerator_clean();
-} else if (isset($_POST['purge'])) {
+} elseif (isset($_POST['purge'])) {
     eaccelerator_purge();
 }
 $info = eaccelerator_info();
@@ -81,7 +81,7 @@ function compare($x, $y)
 
     if ( $x[$sortby] == $y[$sortby] ) {
         return 0;
-    } else if ($x[$sortby] < $y[$sortby]) {
+    } elseif ($x[$sortby] < $y[$sortby]) {
         return -1;
     } else {
         return 1;
@@ -101,7 +101,7 @@ function revcompare($x, $y)
 
     if ($x[$sortby] == $y[$sortby]) {
         return 0;
-    } else if ($x[$sortby] < $y[$sortby]) {
+    } elseif ($x[$sortby] < $y[$sortby]) {
         return 1;
     } else {
         return -1;

+ 1 - 1
htdocs/admin/tools/listsessions.php

@@ -115,7 +115,7 @@ if ($action == 'purge')
 	$formquestion=array();
 	print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2);
 }
-else if ($action == 'lock')
+elseif ($action == 'lock')
 {
 	$formquestion=array();
 	print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1);

+ 1 - 1
htdocs/admin/translation.php

@@ -543,7 +543,7 @@ if ($mode == 'searchkey')
                 $htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
                 print $form->textwithpicto('', $htmltext, 1, 'info');
             }
-            else if (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
+            elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
             {
             	//print $key.'-'.$val;
                 print '<a href="' . $_SERVER['PHP_SELF'] . '?mode=overwrite&amp;langcode=' . $langcode . '&amp;transkey=' . $key . '">' . img_edit_add($langs->trans("Overwrite")) . '</a>';

+ 1 - 1
htdocs/admin/website.php

@@ -659,7 +659,7 @@ $db->close();
  *  @param		string	$context		'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
  *	@return		void
  */
-function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='')
+function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
 {
 	global $conf,$langs,$db;
 	global $form;

+ 3 - 3
htdocs/api/class/api.class.php

@@ -46,7 +46,7 @@ class DolibarrApi
      * @param   string  $cachedir       Cache dir
      * @param   boolean $refreshCache   Update cache
      */
-    function __construct($db, $cachedir='', $refreshCache=false)
+    function __construct($db, $cachedir = '', $refreshCache = false)
     {
         global $conf, $dolibarr_main_url_root;
 
@@ -222,7 +222,7 @@ class DolibarrApi
      * @return bool
 	 * @throws RestException
 	 */
-    static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
+    static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
     {
 
 		// Features/modules to check
@@ -230,7 +230,7 @@ class DolibarrApi
 		if (preg_match('/&/', $resource)) {
 			$featuresarray = explode("&", $resource);
 		}
-		else if (preg_match('/\|/', $resource)) {
+		elseif (preg_match('/\|/', $resource)) {
 			$featuresarray = explode("|", $resource);
 		}
 

+ 1 - 1
htdocs/api/class/api_login.class.php

@@ -55,7 +55,7 @@ class Login
 	 * @url GET /
 	 * @url POST /
 	 */
-    public function index($login, $password, $entity='', $reset=0)
+    public function index($login, $password, $entity = '', $reset = 0)
     {
 
 	    global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;

+ 1 - 1
htdocs/api/class/api_setup.class.php

@@ -202,7 +202,7 @@ class Setup extends DolibarrApi
         if ($country->fetch($id) < 0) {
             throw new RestException(503, 'Error when retrieving country : '.$country->error);
         }
-        else if ($country->fetch($id) == 0) {
+        elseif ($country->fetch($id) == 0) {
             throw new RestException(404, 'country not found');
         }
 

+ 3 - 3
htdocs/asset/class/asset.class.php

@@ -312,7 +312,7 @@ class Asset extends CommonObject
 	 *  @param  int     $save_lastsearch_value      -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
 	 *  @return string                              String with URL
 	 */
-	function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
+	function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
 	{
 		global $db, $conf, $langs;
 		global $dolibarr_main_authentication, $dolibarr_main_demo;
@@ -369,7 +369,7 @@ class Asset extends CommonObject
 	 *  @param  int     $mode          0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return string                 Label of status
 	 */
-	function getLibStatut($mode=0)
+	function getLibStatut($mode = 0)
 	{
 		return $this->LibStatut($this->status,$mode);
 	}
@@ -382,7 +382,7 @@ class Asset extends CommonObject
 	 *  @param  int     $mode           0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
 	 *  @return string                  Label of status
 	 */
-	static function LibStatut($status,$mode=0)
+	static function LibStatut($status, $mode = 0)
 	{
         // phpcs:enable
 		global $langs;

+ 4 - 4
htdocs/asset/class/asset_type.class.php

@@ -89,7 +89,7 @@ class AssetType extends CommonObject
 	 *  @param	int			$notrigger		1=do not execute triggers, 0 otherwise
 	 *  @return	int							>0 if OK, < 0 if KO
 	 */
-	function create($user,$notrigger=0)
+	function create($user, $notrigger = 0)
 	{
 		global $conf;
 
@@ -166,7 +166,7 @@ class AssetType extends CommonObject
 	 *  @param	int			$notrigger		1=do not execute triggers, 0 otherwise
 	 *  @return	int							>0 if OK, < 0 if KO
 	 */
-	function update($user,$notrigger=0)
+	function update($user, $notrigger = 0)
 	{
 		global $conf, $hookmanager;
 
@@ -350,7 +350,7 @@ class AssetType extends CommonObject
 	 *  									2=Return array of asset id only
 	 * 	@return	mixed						Array of asset or -1 on error
 	 */
-	function listAssetForAssetType($excludefilter='', $mode=0)
+	function listAssetForAssetType($excludefilter = '', $mode = 0)
 	{
 		global $conf, $user;
 
@@ -405,7 +405,7 @@ class AssetType extends CommonObject
 	 *  	@param		int  	$notooltip		1=Disable tooltip
 	 *		@return		string					String with URL
 	 */
-	function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
+	function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
 	{
 		global $langs;
 

+ 1 - 1
htdocs/blockedlog/admin/blockedlog_list.php

@@ -105,7 +105,7 @@ if ($action === 'downloadblockchain') {
 
 	exit;
 }
-else if (GETPOST('downloadcsv','alpha'))
+elseif (GETPOST('downloadcsv','alpha'))
 {
 	$error = 0;
 

+ 2 - 2
htdocs/blockedlog/class/authority.class.php

@@ -142,7 +142,7 @@ class BlockedLogAuthority
 	 *	@param      string		$signature		Signature of object to load
 	 *	@return     int         				>0 if OK, <0 if KO, 0 if not found
 	 */
-    public function fetch($id, $signature='')
+    public function fetch($id, $signature = '')
     {
 
 		global $langs;
@@ -161,7 +161,7 @@ class BlockedLogAuthority
 		$sql.= " FROM ".MAIN_DB_PREFIX."blockedlog_authority as b";
 
 		if ($id) $sql.= " WHERE b.rowid = ". $id;
-		else if($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ;
+		elseif($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ;
 
 		$resql=$this->db->query($sql);
 		if ($resql)

+ 18 - 18
htdocs/blockedlog/class/blockedlog.class.php

@@ -208,7 +208,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'payment') {
+		elseif($this->element === 'payment') {
 			require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
 
 			$object = new Paiement($this->db);
@@ -219,7 +219,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'payment_supplier') {
+		elseif($this->element === 'payment_supplier') {
 			require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
 
 			$object = new PaiementFourn($this->db);
@@ -230,7 +230,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'payment_donation') {
+		elseif($this->element === 'payment_donation') {
 			require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
 
 			$object = new PaymentDonation($this->db);
@@ -241,7 +241,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'payment_various') {
+		elseif($this->element === 'payment_various') {
 			require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
 
 			$object = new PaymentVarious($this->db);
@@ -252,7 +252,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'don' || $this->element === 'donation') {
+		elseif($this->element === 'don' || $this->element === 'donation') {
 			require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
 
 			$object = new Don($this->db);
@@ -263,7 +263,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'subscription') {
+		elseif($this->element === 'subscription') {
 			require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
 
 			$object = new Subscription($this->db);
@@ -274,7 +274,7 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if($this->element === 'cashcontrol') {
+		elseif($this->element === 'cashcontrol') {
 			require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
 
 			$object = new CashControl($this->db);
@@ -285,11 +285,11 @@ class BlockedLog
 				$this->error++;
 			}
 		}
-		else if ($this->action == 'MODULE_SET')
+		elseif ($this->action == 'MODULE_SET')
 		{
 			return '<i class="opacitymedium">System to track events into unalterable logs were enabled</i>';
 		}
-		else if ($this->action == 'MODULE_RESET')
+		elseif ($this->action == 'MODULE_RESET')
 		{
 			if ($this->signature == '0000000000')
 			{
@@ -469,7 +469,7 @@ class BlockedLog
 						}
 					}
 				}
-				else if (!is_object($value)) $this->object_data->{$key} = $value;
+				elseif (!is_object($value)) $this->object_data->{$key} = $value;
 			}
 
 			if (! empty($object->newref)) $this->object_data->ref = $object->newref;
@@ -725,7 +725,7 @@ class BlockedLog
 	 * @param	string	$mode	0=unserialize, 1=json_decode
 	 * @return 	string			Value unserialized
 	 */
-	public function dolDecodeBlockedData($data, $mode=0)
+	public function dolDecodeBlockedData($data, $mode = 0)
 	{
 		try
 		{
@@ -763,7 +763,7 @@ class BlockedLog
 	 *  @param	int		$forcesignature		Force signature (for example '0000000000' when we disabled the module)
 	 *	@return	int							<0 if KO, >0 if OK
 	 */
-    public function create($user, $forcesignature='')
+    public function create($user, $forcesignature = '')
     {
 
 		global $conf,$langs,$hookmanager;
@@ -878,7 +878,7 @@ class BlockedLog
 	 *	@param	string		$previoushash		If previous signature hash is known, we can provide it to avoid to make a search of it in database.
 	 *	@return	boolean							True if OK, False if KO
 	 */
-	public function checkSignature($previoushash='')
+	public function checkSignature($previoushash = '')
 	{
 		if (empty($previoushash))
 		{
@@ -921,7 +921,7 @@ class BlockedLog
 	 *	@param int	$beforeid		ID of a record
 	 *  @return	string				Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0)
 	 */
-	 public function getPreviousHash($withlock=0, $beforeid=0)
+	 public function getPreviousHash($withlock = 0, $beforeid = 0)
 	 {
 		global $conf;
 
@@ -972,7 +972,7 @@ class BlockedLog
 	 *  @param	string	$search_code	search code
 	 *	@return	array|int				Array of object log or <0 if error
 	 */
-	public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref='', $search_amount='', $search_code='')
+	public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '')
 	{
 		global $conf, $cachedlogs;
 
@@ -984,11 +984,11 @@ class BlockedLog
 	 		$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
 	         WHERE entity=".$conf->entity;
 		}
-		else if ($element=='not_certified') {
+		elseif ($element=='not_certified') {
 			$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
 	         WHERE entity=".$conf->entity." AND certified = 0";
 		}
-		else if ($element=='just_certified') {
+		elseif ($element=='just_certified') {
 			$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
 	         WHERE entity=".$conf->entity." AND certified = 1";
 		}
@@ -1070,7 +1070,7 @@ class BlockedLog
 	 * @param	int		$ignoresystem		Ignore system events for the test
      * @return bool
 	 */
-	function alreadyUsed($ignoresystem=0)
+	function alreadyUsed($ignoresystem = 0)
 	{
 		global $conf;
 

+ 31 - 31
htdocs/cashdesk/class/Facturation.class.php

@@ -283,14 +283,14 @@ class Facturation
      * @param	int		$aId	Id
      * @return  id
      */
-    public function id($aId=null)
+    public function id($aId = null)
     {
 
         if ( !$aId )
         {
             return $this->id;
         }
-        else if ( $aId == 'RESET' )
+        elseif ( $aId == 'RESET' )
         {
 
             $this->id = null;
@@ -308,14 +308,14 @@ class Facturation
      * @param	string	$aRef	Ref
      * @return	string			Ref
      */
-    public function ref($aRef=null)
+    public function ref($aRef = null)
     {
 
         if (is_null($aRef))
         {
             return $this->ref;
         }
-        else if ( $aRef == 'RESET' )
+        elseif ( $aRef == 'RESET' )
         {
             $this->ref = null;
         }
@@ -331,13 +331,13 @@ class Facturation
      * @param	int		$aQte		Qty
      * @return	int					Qty
      */
-    public function qte($aQte=null)
+    public function qte($aQte = null)
     {
         if (is_null($aQte))
         {
             return $this->qte;
         }
-        else if ( $aQte == 'RESET' )
+        elseif ( $aQte == 'RESET' )
         {
 
             $this->qte = null;
@@ -354,14 +354,14 @@ class Facturation
      * @param   string	$aStock		Stock
      * @return	string				Stock
      */
-    public function stock($aStock=null)
+    public function stock($aStock = null)
     {
 
         if (is_null($aStock))
         {
             return $this->stock;
         }
-        else if ( $aStock == 'RESET' )
+        elseif ( $aStock == 'RESET' )
         {
             $this->stock = null;
         }
@@ -377,14 +377,14 @@ class Facturation
      * @param	string	$aRemisePercent		Discount
      * @return	string						Discount
      */
-    public function remisePercent($aRemisePercent=null)
+    public function remisePercent($aRemisePercent = null)
     {
 
         if (is_null($aRemisePercent))
         {
             return $this->remise_percent;
         }
-        else if ($aRemisePercent == 'RESET')
+        elseif ($aRemisePercent == 'RESET')
         {
             $this->remise_percent = null;
         }
@@ -400,13 +400,13 @@ class Facturation
      * @param	int		$aMontantRemise		Amount
      * @return	string						Amount
      */
-    public function montantRemise($aMontantRemise=null)
+    public function montantRemise($aMontantRemise = null)
     {
 
         if (is_null($aMontantRemise)) {
 
             return $this->montant_remise;
-        } else if ( $aMontantRemise == 'RESET' ) {
+        } elseif ( $aMontantRemise == 'RESET' ) {
 
             $this->montant_remise = null;
         } else {
@@ -421,13 +421,13 @@ class Facturation
      * @param	int		$aPrix		Price
      * @return	string				Stock
      */
-    public function prix($aPrix=null)
+    public function prix($aPrix = null)
     {
 
         if (is_null($aPrix)) {
 
             return $this->prix;
-        } else if ( $aPrix == 'RESET' ) {
+        } elseif ( $aPrix == 'RESET' ) {
 
             $this->prix = null;
         } else {
@@ -442,12 +442,12 @@ class Facturation
      * @param	int		$aTva		Vat
      * @return	int					Vat
      */
-    public function tva($aTva=null)
+    public function tva($aTva = null)
     {
         if (is_null($aTva)) {
 
             return $this->tva;
-        } else if ( $aTva == 'RESET' ) {
+        } elseif ( $aTva == 'RESET' ) {
 
             $this->tva = null;
         } else {
@@ -462,12 +462,12 @@ class Facturation
      * @param string	$aNumFacture		Invoice ref
      * @return	string						Invoice ref
      */
-    public function numInvoice($aNumFacture=null)
+    public function numInvoice($aNumFacture = null)
     {
         if (is_null($aNumFacture)) {
 
             return $this->num_facture;
-        } else if ( $aNumFacture == 'RESET' ) {
+        } elseif ( $aNumFacture == 'RESET' ) {
 
             $this->num_facture = null;
         } else {
@@ -482,13 +482,13 @@ class Facturation
      * @param	int		$aModeReglement		Payment mode
      * @return	int							Payment mode
      */
-    public function getSetPaymentMode($aModeReglement=null)
+    public function getSetPaymentMode($aModeReglement = null)
     {
 
         if (is_null($aModeReglement)) {
 
             return $this->mode_reglement;
-        } else if ( $aModeReglement == 'RESET' ) {
+        } elseif ( $aModeReglement == 'RESET' ) {
 
             $this->mode_reglement = null;
         } else {
@@ -503,13 +503,13 @@ class Facturation
      * @param	int		$aMontantEncaisse		Amount
      * @return	int								Amount
      */
-    public function montantEncaisse($aMontantEncaisse=null)
+    public function montantEncaisse($aMontantEncaisse = null)
     {
 
         if (is_null($aMontantEncaisse)) {
 
             return $this->montant_encaisse;
-        } else if ( $aMontantEncaisse == 'RESET' ) {
+        } elseif ( $aMontantEncaisse == 'RESET' ) {
 
             $this->montant_encaisse = null;
         } else {
@@ -524,13 +524,13 @@ class Facturation
      * @param	int			$aMontantRendu		Amount
      * @return	int								Amount
      */
-    public function montantRendu($aMontantRendu=null)
+    public function montantRendu($aMontantRendu = null)
     {
 
         if (is_null($aMontantRendu)) {
 
             return $this->montant_rendu;
-        } else if ( $aMontantRendu == 'RESET' ) {
+        } elseif ( $aMontantRendu == 'RESET' ) {
 
             $this->montant_rendu = null;
         } else {
@@ -545,12 +545,12 @@ class Facturation
      * @param	date		$aPaiementLe		Date
      * @return	date							Date
      */
-    public function paiementLe($aPaiementLe=null)
+    public function paiementLe($aPaiementLe = null)
     {
         if (is_null($aPaiementLe)) {
 
             return $this->paiement_le;
-        } else if ( $aPaiementLe == 'RESET' ) {
+        } elseif ( $aPaiementLe == 'RESET' ) {
 
             $this->paiement_le = null;
         } else {
@@ -565,12 +565,12 @@ class Facturation
      * @param	int		$aTotalHt		Total amount
      * @return	int						Total amount
      */
-    public function prixTotalHt($aTotalHt=null)
+    public function prixTotalHt($aTotalHt = null)
     {
         if (is_null($aTotalHt)) {
 
             return $this->prix_total_ht;
-        } else if ( $aTotalHt == 'RESET' ) {
+        } elseif ( $aTotalHt == 'RESET' ) {
 
             $this->prix_total_ht = null;
         } else {
@@ -585,12 +585,12 @@ class Facturation
      * @param	int		$aMontantTva	Amount vat
      * @return	int						Amount vat
      */
-    public function montantTva($aMontantTva=null)
+    public function montantTva($aMontantTva = null)
     {
         if (is_null($aMontantTva)) {
 
             return $this->montant_tva;
-        } else if ( $aMontantTva == 'RESET' ) {
+        } elseif ( $aMontantTva == 'RESET' ) {
 
             $this->montant_tva = null;
         } else {
@@ -605,7 +605,7 @@ class Facturation
      * @param	int		$aTotalTtc		Amount ttc
      * @return	int						Amount ttc
      */
-    public function prixTotalTtc($aTotalTtc=null)
+    public function prixTotalTtc($aTotalTtc = null)
     {
         if (is_null($aTotalTtc))
         {

+ 1 - 1
htdocs/cashdesk/facturation.php

@@ -138,7 +138,7 @@ if ( $nbr_enreg > 1 )
 		$top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';
 	}
 }
-else if ( $nbr_enreg == 1 )
+elseif ( $nbr_enreg == 1 )
 {
 	$top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----';
 }

+ 2 - 2
htdocs/cashdesk/facturation_verif.php

@@ -51,7 +51,7 @@ switch($action)
 			{
 				$sql.= " AND p.rowid = ".$_POST['selProduit'];
 			}
-			else if ( $_POST['hdnSource'] == 'REF' )
+			elseif ( $_POST['hdnSource'] == 'REF' )
 			{
 				$sql.= " AND p.ref = '".$_POST['txtRef']."'";
 			}
@@ -163,7 +163,7 @@ switch($action)
 					{
 						$filtre = $ret['ref'];
 					}
-					else if ( $_POST['hdnSource'] == 'REF' )
+					elseif ( $_POST['hdnSource'] == 'REF' )
 					{
 						$filtre = $_POST['txtRef'];
 					}

+ 12 - 12
htdocs/categories/card.php

@@ -89,32 +89,32 @@ if ($action == 'add' && $user->rights->categorie->creer)
 			header("Location: ".$urlfrom);
 			exit;
 		}
-		else if ($idProdOrigin)
+		elseif ($idProdOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type);
 			exit;
 		}
-		else if ($idCompanyOrigin)
+		elseif ($idCompanyOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type);
 			exit;
 		}
-		else if ($idSupplierOrigin)
+		elseif ($idSupplierOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type);
 			exit;
 		}
-		else if ($idMemberOrigin)
+		elseif ($idMemberOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type);
 			exit;
 		}
-		else if ($idContactOrigin)
+		elseif ($idContactOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type);
 			exit;
 		}
-		else if ($idProjectOrigin)
+		elseif ($idProjectOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type);
 			exit;
@@ -179,32 +179,32 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
 			header("Location: ".$backtopage);
 			exit;
 		}
-		else if ($idProdOrigin)
+		elseif ($idProdOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
 			exit;
 		}
-		else if ($idCompanyOrigin)
+		elseif ($idCompanyOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
 			exit;
 		}
-		else if ($idSupplierOrigin)
+		elseif ($idSupplierOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
 			exit;
 		}
-		else if ($idMemberOrigin)
+		elseif ($idMemberOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
 			exit;
 		}
-		else if ($idContactOrigin)
+		elseif ($idContactOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
 			exit;
 		}
-		else if ($idProjectOrigin)
+		elseif ($idProjectOrigin)
 		{
 			header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
 			exit;

+ 16 - 16
htdocs/categories/class/categorie.class.php

@@ -234,7 +234,7 @@ class Categorie extends CommonObject
 	 *  @param		string	$type	Type of category ('product', '...') or (0, 1, ...)
 	 * 	@return		int				<0 if KO, >0 if OK
 	 */
-	function fetch($id, $label='', $type=null)
+	function fetch($id, $label = '', $type = null)
 	{
 		global $conf;
 
@@ -501,7 +501,7 @@ class Categorie extends CommonObject
      *	@param	int		$notrigger	1=Does not execute triggers, 0= execute triggers
 	 *	@return	int                 <0 KO >0 OK
 	 */
-	function delete($user, $notrigger=0)
+	function delete($user, $notrigger = 0)
 	{
 		global $conf,$langs;
 
@@ -691,7 +691,7 @@ class Categorie extends CommonObject
 	 *
 	 * @return  int          1 if OK, -1 if KO
 	 */
-	function del_type($obj,$type)
+	function del_type($obj, $type)
 	{
         // phpcs:enable
 		global $user,$langs,$conf;
@@ -749,7 +749,7 @@ class Categorie extends CommonObject
 	 * @return  array|int              -1 if KO, array of instance of object if OK
 	 * @see containsObject
 	 */
-	function getObjectsInCateg($type, $onlyids=0)
+	function getObjectsInCateg($type, $onlyids = 0)
 	{
 		$objs = array();
 
@@ -821,7 +821,7 @@ class Categorie extends CommonObject
 	 * @param	int		$page		Page number
 	 * @return	array|int			Array of categories, 0 if no cat, -1 on error
 	 */
-	function getListForItem($id, $type='customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
+	function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
 	{
 		global $conf;
 
@@ -990,7 +990,7 @@ class Categorie extends CommonObject
 	 *
 	 * @return  array|int               Array of categories. this->cats and this->motherof are set, -1 on error
 	 */
-	function get_full_arbo($type, $markafterid=0)
+	function get_full_arbo($type, $markafterid = 0)
 	{
         // phpcs:enable
 	    global $conf, $langs;
@@ -1076,7 +1076,7 @@ class Categorie extends CommonObject
 	 * 	@param		int		$protection		Deep counter to avoid infinite loop
 	 *	@return		void
 	 */
-	function build_path_from_id_categ($id_categ,$protection=1000)
+	function build_path_from_id_categ($id_categ, $protection = 1000)
 	{
         // phpcs:enable
 		dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
@@ -1143,7 +1143,7 @@ class Categorie extends CommonObject
 	 *	@param	boolean		$parent		Just parent categories if true
 	 *	@return	array|int				Table of Object Category, -1 on error
 	 */
-	function get_all_categories($type=null, $parent=false)
+	function get_all_categories($type = null, $parent = false)
 	{
         // phpcs:enable
 		if (! is_numeric($type)) $type = $this->MAP_ID[$type];
@@ -1232,7 +1232,7 @@ class Categorie extends CommonObject
 	 *	@param		int		$type		Type of category (0, 1, ...)
 	 *	@return		array
 	 */
-	function get_main_categories($type=null)
+	function get_main_categories($type = null)
 	{
         // phpcs:enable
 		return $this->get_all_categories($type, true);
@@ -1248,7 +1248,7 @@ class Categorie extends CommonObject
 	 * @param   int     $nocolor     0
 	 * @return	array
 	 */
-	function print_all_ways($sep = " &gt;&gt; ", $url='', $nocolor=0)
+	function print_all_ways($sep = " &gt;&gt; ", $url = '', $nocolor = 0)
 	{
         // phpcs:enable
 		$ways = array();
@@ -1376,7 +1376,7 @@ class Categorie extends CommonObject
 	 *                      	    labels, 'id'= Get array of category IDs
 	 * @return  array|int           Array of category objects or < 0 if KO
 	 */
-	function containing($id, $type, $mode='object')
+	function containing($id, $type, $mode = 'object')
 	{
 		$cats = array();
 
@@ -1397,7 +1397,7 @@ class Categorie extends CommonObject
 		        {
     				if ($mode == 'id') {
     				    $cats[] = $obj->rowid;
-    				} else if ($mode == 'label') {
+    				} elseif ($mode == 'label') {
     				    $cats[] = $obj->label;
     				} else {
     				    $cat = new Categorie($this->db);
@@ -1427,7 +1427,7 @@ class Categorie extends CommonObject
     			{
     				if ($mode == 'id') {
     					$cats[] = $obj->rowid;
-    				} else if ($mode == 'label') {
+    				} elseif ($mode == 'label') {
     					$cats[] = $obj->label;
     				} else {
     					$cat = new Categorie($this->db);
@@ -1522,7 +1522,7 @@ class Categorie extends CommonObject
 	 * 	@param		int		$maxlength		Max length of text
 	 *	@return		string					Chaine avec URL
 	 */
-	function getNomUrl($withpicto=0,$option='',$maxlength=0)
+	function getNomUrl($withpicto = 0, $option = '', $maxlength = 0)
 	{
 		global $langs;
 
@@ -1608,7 +1608,7 @@ class Categorie extends CommonObject
 	 *    @param      int		$nbmax      Nombre maximum de photos (0=pas de max)
 	 *    @return     array       			Tableau de photos
 	 */
-	function liste_photos($dir,$nbmax=0)
+	function liste_photos($dir, $nbmax = 0)
 	{
         // phpcs:enable
 		include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
@@ -1747,7 +1747,7 @@ class Categorie extends CommonObject
 	                return -1;
 	            }
 	        }
-	        else if (isset($this->multilangs["$key"]))
+	        elseif (isset($this->multilangs["$key"]))
 	        {
 	            if ($this->db->num_rows($result)) // si aucune ligne dans la base
 	            {

+ 1 - 1
htdocs/categories/traduction.php

@@ -270,7 +270,7 @@ if ($action == 'edit')
 
 	print '</form>';
 }
-else if ($action != 'add')
+elseif ($action != 'add')
 {
     if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
 

+ 6 - 6
htdocs/categories/viewcat.php

@@ -86,40 +86,40 @@ if ($id > 0 && $removeelem > 0)
 		$result = $tmpobject->fetch($removeelem);
 		$elementtype = 'product';
 	}
-	else if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
+	elseif ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
 	{
 		$tmpobject = new Societe($db);
 		$result = $tmpobject->fetch($removeelem);
 		$elementtype = 'supplier';
 	}
-	else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
+	elseif ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
 	{
 		$tmpobject = new Societe($db);
 		$result = $tmpobject->fetch($removeelem);
 		$elementtype = 'customer';
 	}
-	else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
+	elseif ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
 	{
 		require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
 		$tmpobject = new Adherent($db);
 		$result = $tmpobject->fetch($removeelem);
 		$elementtype = 'member';
 	}
-	else if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
+	elseif ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
 
 		require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
 		$tmpobject = new Contact($db);
 		$result = $tmpobject->fetch($removeelem);
 		$elementtype = 'contact';
     }
-    else if ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
+    elseif ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
     {
         require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
         $tmpobject = new Account($db);
         $result = $tmpobject->fetch($removeelem);
         $elementtype = 'account';
     }
-    else if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
+    elseif ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
     {
         require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
         $tmpobject = new Project($db);

+ 2 - 2
htdocs/comm/action/card.php

@@ -791,11 +791,11 @@ if ($action == 'create')
 	print '<td>';
 	$percent=-1;
 	if (isset($_GET['status']) || isset($_POST['status'])) $percent=GETPOST('status');
-	else if (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent=GETPOST('percentage');
+	elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent=GETPOST('percentage');
 	else
 	{
 		if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent='0';
-		else if (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100;
+		elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100;
 	}
 	$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
 	print '</td></tr>';

+ 10 - 10
htdocs/comm/action/class/actioncomm.class.php

@@ -293,7 +293,7 @@ class ActionComm extends CommonObject
                 $this->type_id=$cactioncomm->id;
                 $this->type_code=$cactioncomm->code;
             }
-            else if ($result == 0)
+            elseif ($result == 0)
             {
                 $this->error='Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
                 return -1;
@@ -566,7 +566,7 @@ class ActionComm extends CommonObject
      *    @param	string	$ref_ext	Ref ext to get
      *    @return	int					<0 if KO, >0 if OK
      */
-    function fetch($id, $ref='',$ref_ext='')
+    function fetch($id, $ref = '', $ref_ext = '')
     {
         global $langs;
 
@@ -761,7 +761,7 @@ class ActionComm extends CommonObject
      *    @param    int		$notrigger		1 = disable triggers, 0 = enable triggers
      *    @return   int 					<0 if KO, >0 if OK
      */
-    function delete($notrigger=0)
+    function delete($notrigger = 0)
     {
         global $user,$langs,$conf;
 
@@ -838,7 +838,7 @@ class ActionComm extends CommonObject
      *    @param    int		$notrigger		1 = disable triggers, 0 = enable triggers
      *    @return   int     				<0 if KO, >0 if OK
      */
-    function update($user,$notrigger=0)
+    function update($user, $notrigger = 0)
     {
         global $langs,$conf,$hookmanager;
 
@@ -999,7 +999,7 @@ class ActionComm extends CommonObject
      *   @param		string	$limit			Limit number of answers
      *   @return	array or string			Error string if KO, array with actions if OK
      */
-    static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='a.datep', $sortorder='DESC', $limit=0)
+    static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
     {
         global $conf, $langs;
 
@@ -1051,7 +1051,7 @@ class ActionComm extends CommonObject
      * @param	int		$load_state_board	Charge indicateurs this->nb de tableau de bord
      * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
      */
-    function load_board($user, $load_state_board=0)
+    function load_board($user, $load_state_board = 0)
     {
         // phpcs:enable
         global $conf, $langs;
@@ -1164,7 +1164,7 @@ class ActionComm extends CommonObject
      *      @param  int		$hidenastatus   1=Show nothing if status is "Not applicable"
      *    	@return string          		String with status
      */
-    function getLibStatut($mode,$hidenastatus=0)
+    function getLibStatut($mode, $hidenastatus = 0)
     {
         return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
     }
@@ -1179,7 +1179,7 @@ class ActionComm extends CommonObject
      *      @param  int     $datestart      Date start of event
      *    	@return string		    		Label
      */
-    function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
+    function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '')
     {
         // phpcs:enable
         global $langs;
@@ -1257,7 +1257,7 @@ class ActionComm extends CommonObject
      *  	@param  int     $save_lastsearch_value  -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
      *		@return	string							Chaine avec URL
      */
-    function getNomUrl($withpicto=0, $maxlength=0, $classname='', $option='', $overwritepicto=0, $notooltip=0, $save_lastsearch_value=-1)
+    function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1)
     {
 		global $conf, $langs, $user, $hookmanager, $action;
 
@@ -1391,7 +1391,7 @@ class ActionComm extends CommonObject
      *		@param	array		$filters		Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
      *		@return int     					<0 if error, nb of events in new file if ok
      */
-    function build_exportfile($format,$type,$cachedelay,$filename,$filters)
+    function build_exportfile($format, $type, $cachedelay, $filename, $filters)
     {
         // phpcs:enable
         global $conf,$langs,$dolibarr_main_url_root,$mysoc;

+ 2 - 2
htdocs/comm/action/class/actioncommreminder.class.php

@@ -178,7 +178,7 @@ class ActionCommReminder extends CommonObject
 	 *  @param	int		$mode          0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
 	 *  @return	string 			       Label of status
 	 */
-	function getLibStatut($mode=0)
+	function getLibStatut($mode = 0)
 	{
 		return $this->LibStatut($this->status,$mode);
 	}
@@ -191,7 +191,7 @@ class ActionCommReminder extends CommonObject
 	 *  @param  int		$mode          	0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
 	 *  @return string 			       	Label of status
 	 */
-	static function LibStatut($status,$mode=0)
+	static function LibStatut($status, $mode = 0)
 	{
         // phpcs:enable
 		global $langs;

+ 2 - 2
htdocs/comm/action/class/cactioncomm.class.php

@@ -130,7 +130,7 @@ class CActionComm
      *  @param	int			$shortlabel		1=Get short label instead of long label
      *  @return mixed      					Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode.
      */
-    function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0)
+    function liste_array($active = '', $idorcode = 'id', $excludetype = '', $onlyautoornot = 0, $morefilter = '', $shortlabel = 0)
     {
         // phpcs:enable
         global $langs,$conf;
@@ -223,7 +223,7 @@ class CActionComm
      *	@param	int		$withpicto		0=No picto, 1=Include picto into link, 2=Picto only
      *  @return string			      	Label of action type
      */
-    function getNomUrl($withpicto=0)
+    function getNomUrl($withpicto = 0)
     {
         global $langs;
 

+ 6 - 6
htdocs/comm/action/index.php

@@ -779,7 +779,7 @@ if (count($listofextcals))
                         $datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
                         $datecurend=dol_stringtotime($icalevent['DTEND;VALUE=DATE'],1)-1;  // We remove one second to get last second of day
                     }
-                    else if (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
+                    elseif (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
                     {
                         $datecurstart=$icalevent['DTSTART']['unixtime'];
                         $datecurend=$icalevent['DTEND']['unixtime'];
@@ -1277,7 +1277,7 @@ $db->close();
  * @param	string	$nonew			 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button"
  * @return	void
  */
-function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0)
+function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $nonew = 0)
 {
     global $user, $conf, $langs;
     global $action, $filter, $filtert, $status, $actioncode, $usergroup;	// Filters used into search form
@@ -1365,7 +1365,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
 	                    // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
 	                    if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
                     }
-                    else if ($event->type_code == 'ICALEVENT')      // Event come from external ical file
+                    elseif ($event->type_code == 'ICALEVENT')      // Event come from external ical file
                     {
                     	$numical++;
                     	if (! empty($event->icalname)) {
@@ -1378,7 +1378,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
                     	$color=($event->icalcolor?$event->icalcolor:-1);
                     	$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
                     }
-                    else if ($event->type_code == 'BIRTHDAY')
+                    elseif ($event->type_code == 'BIRTHDAY')
                     {
                     	$numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
                     }
@@ -1425,11 +1425,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
                     {
                         $cssclass.= " unmovable";
                     }
-                    else if ($event->type_code == 'ICALEVENT')
+                    elseif ($event->type_code == 'ICALEVENT')
                     {
                         $cssclass.= " unmovable";
                     }
-                    else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
+                    elseif ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
                     {
                         $tmpyearend    = date('Y',$event->date_end_in_calendar);
                         $tmpmonthend   = date('m',$event->date_end_in_calendar);

+ 5 - 5
htdocs/comm/action/pertype.php

@@ -757,7 +757,7 @@ $db->close();
  * @param	bool	$var			true or false for alternat style on tr/td
  * @return	void
  */
-function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
+function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $showheader = false, $colorsbytype = array(), $var = false)
 {
 	global $db;
 	global $user, $conf, $langs, $hookmanager, $action;
@@ -809,7 +809,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
 					$nummytasks++; $cssclass='family_mytasks';
 					if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color=$event->type_color;
 				}
-				else if ($event->type_code == 'ICALEVENT')
+				elseif ($event->type_code == 'ICALEVENT')
 				{
 					$numical++;
 					if (! empty($event->icalname))
@@ -823,7 +823,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
 					$color=$event->icalcolor;
 					$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
 				}
-				else if ($event->type_code == 'BIRTHDAY')
+				elseif ($event->type_code == 'BIRTHDAY')
 				{
 					$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
 				}
@@ -1026,7 +1026,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
 			if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
 			if ($output[0]['color']) $color1 = $output[0]['color'];
 		}
-		else if (count($cases1[$h]) > 1)
+		elseif (count($cases1[$h]) > 1)
 		{
 			$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
 			$color1='222222';
@@ -1039,7 +1039,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
 			if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
 			if ($output[0]['color']) $color2 = $output[0]['color'];
 		}
-		else if (count($cases2[$h]) > 1)
+		elseif (count($cases2[$h]) > 1)
 		{
 			$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
 			$color2='222222';

+ 5 - 5
htdocs/comm/action/peruser.php

@@ -905,7 +905,7 @@ $db->close();
  * @param	bool	$var			true or false for alternat style on tr/td
  * @return	void
  */
-function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $showheader=false, $colorsbytype=array(), $var=false)
+function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam = '', $showinfo = 0, $minheight = 60, $showheader = false, $colorsbytype = array(), $var = false)
 {
 	global $db;
 	global $user, $conf, $langs, $hookmanager, $action;
@@ -970,7 +970,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
 
 					if (! empty($conf->global->AGENDA_USE_COLOR_PER_EVENT_TYPE)) $color=$event->type_color;
 				}
-				else if ($event->type_code == 'ICALEVENT')
+				elseif ($event->type_code == 'ICALEVENT')
 				{
 					$numical++;
 					if (! empty($event->icalname))
@@ -984,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
 					$color=$event->icalcolor;
 					$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
 				}
-				else if ($event->type_code == 'BIRTHDAY')
+				elseif ($event->type_code == 'BIRTHDAY')
 				{
 					$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
 				}
@@ -1201,7 +1201,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
 			if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
 			if ($output[0]['color']) $color1 = $output[0]['color'];
 		}
-		else if (count($cases1[$h]) > 1)
+		elseif (count($cases1[$h]) > 1)
 		{
 			$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
 			$color1='222222';
@@ -1214,7 +1214,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
 			if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
 			if ($output[0]['color']) $color2 = $output[0]['color'];
 		}
-		else if (count($cases2[$h]) > 1)
+		elseif (count($cases2[$h]) > 1)
 		{
 			$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
 			$color2='222222';

Деякі файли не було показано, через те що забагато файлів було змінено