diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl index c46827f889e..18068087804 100644 --- a/build/exe/doliwamp/Languages/MyEnglish.isl +++ b/build/exe/doliwamp/Languages/MyEnglish.isl @@ -11,9 +11,9 @@ LaunchProgram=Launch %1 AssocFileExtension=&Associate %1 with the %2 file extension AssocingFileExtension=Associating %1 with the %2 file extension... -YouWillInstallDoliWamp=You will install or upgrade DoliWamp (Apache+Mysql+PHP+Dolibarr) on your computer. -ThisAssistantInstallOrUpgrade=This assistant installs or upgrades Dolibarr ERP-CRM and all required third party softwares (Apache, Mysql and PHP) optimized for a Dolibarr usage. -IfYouHaveTechnicalKnowledge=If you are looking for a hosted version in the Cloud, you should look at https://saas.dolibarr.org. If you have technical knowledge and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing Apache, Mysql and PHP installation. +YouWillInstallDoliWamp=You will install or upgrade DoliWamp (so Dolibarr + all required third party softwares like Apache, Mysql and PHP) on your computer. +ThisAssistantInstallOrUpgrade=WARNING: Using an ERP CRM installed on a local computer can be dangerous: if your computer break down, you can lose all your data. Do this if you are ready to manage backup yourself seriously. If not, use an installation in Saas instead (see https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=Moreover, if you have technical knowledges and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing server with Apache, Mysql and PHP. ButIfYouLook=But if you look for an automatic setup on your local computer, you''re on the good way... DoYouWantToStart=Do you want to start installation/upgrade process ? @@ -32,7 +32,7 @@ PortAlreadyInUse=Port %1 seems to be already in use. You should cancel to go bac FirefoxDetected=Firefox has been detected on your computer. Would you like to use it as the default browser for Dolibarr ? ChromeDetected=Chrome has been detected on your computer. Would you like to use it as the default browser for Dolibarr ? -ChooseDefaultBrowser=Please choose your default browser. If you are not sure, just click Open : +ChooseDefaultBrowser=Please choose your default browser (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). If you are not sure, just click Open : LaunchNow=Launch Dolibarr now diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl index f3966334247..2e93a44081e 100644 --- a/build/exe/doliwamp/Languages/MyFrench.isl +++ b/build/exe/doliwamp/Languages/MyFrench.isl @@ -2,47 +2,47 @@ [CustomMessages] NameAndVersion=%1 version %2 -Additionalcons=Ic�nes suppl�mentaires : -CreateDesktopIcon=Cr�er une ic�ne sur le &Bureau -CreateQuickLaunchIcon=Cr�er une ic�ne dans la barre de &Lancement rapide +AdditionalIcons=Icônes supplémentaires : +CreateDesktopIcon=Créer une icône sur le &Bureau +CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide ProgramOnTheWeb=Page d'accueil de %1 -UninstallProgram=D�sinstaller %1 -LaunchProgram=Ex�cuter %1 +UninstallProgram=Désinstaller %1 +LaunchProgram=Exécuter %1 AssocFileExtension=&Associer %1 avec l'extension de fichier %2 AssocingFileExtension=Associe %1 avec l'extension de fichier %2... -YouWillInstallDoliWamp=Vous allez installer ou mettre � jour DoliWamp (Apache+Mysql+PHP+Dolibarr) sur votre ordinateur. -ThisAssistantInstallOrUpgrade=Cet assistant installe ou met � jour Dolibarr ERP-CRM et tous ses composants pr�requis (Apache, Mysql et PHP) optimis�s pour une utilisation de Dolibarr. -IfYouHaveTechnicalKnowledge=Si vous cherchez un h�bergement dans le Cloud, aller voir sur https://saas.dolibarr.org. Si vous avez des comp�tences techniques et voulez g�rer vous m�me Apache, Mysql et PHP, vous ne devriez pas utiliser cet assistant mais faire plut�t une installation manuelle de Dolibarr sur votre socle Apache, Mysql et PHP existant. -ButIfYouLook=Mais si vous recherchez une installation automatis�e locale sur votre ordinateur, cl� en main, vous �tes sur la bonne voie... -DoYouWantToStart=Voulez-vous d�marrer le processus d'installation/mise � jour ? +YouWillInstallDoliWamp=Vous allez installer ou mettre à jour DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP). +ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP. +ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie... +DoYouWantToStart=Voulez-vous démarrer le processus d'installation/mise à jour ? -TechnicalParameters=Param�tres techniques -IfFirstInstall=S'il s'agit de la premi�re installation, merci de sp�cifier ces quelques param�tres techniques. Si vous ne les comprennez pas, �tes non s�r, ou proc�dez � une mise � jour, laissez les champs avec les valeurs propos�es par d�faut. +TechnicalParameters=Paramètres techniques +IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut. ; WARNING !!! STRINGS FOR THIS 4 STRINGS MUST BE LOWER THAN 70 CHARACTERS -SMTPServer=Serveur SMTP (le votre ou de votre FAI, premi�re installation uniquement): -ApachePort=Port Apache (premi�re installation uniquement, le choix standard est 80): -MySqlPort=Port Mysql (premi�re installation uniquement, le choix standard est 3306): -MySqlPassword=Mot de passe serveur+base MySql de root (premi�re installation uniquement): +SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement): +ApachePort=Port Apache (première installation uniquement, le choix standard est 80): +MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306): +MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement): -FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signal�. Cliquez sur OK pour continuer... +FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer... -PortAlreadyInUse=Le port %1 semble d�j� utilis�. Il est recommand� d'annuler pour revenir en arri�re et sp�cifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? +PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ? -FirefoxDetected=Firefox a �t� d�tect� sur votre ordinateur. Voulez-vous en faire votre navigateur par d�faut pour Dolibarr ? -ChromeDetected=Chrome a �t� d�tect� sur votre ordinateur. Voulez-vous en faire votre navigateur par d�faut pour Dolibarr ? -ChooseDefaultBrowser=Merci de choisir votre navigateur par d�faut. Si vous n'�tes pas s�r, cliquez simplement sur Ouvrir : +FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ? +ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir : LaunchNow=Lancer Dolibarr maintenant -ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont �t� supprim�s. Toutefois, tous vos fichiers de donn�es sont toujours dans le r�pertoire %1. Vous devez supprimer ce r�pertoire manuellement pour avoir une d�sinstallation compl�te. +ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète. -DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant d�marrer ou red�marrer Apache et Mysql, ceci peut durer de quelques secondes � une minute apr�s cette confirmation. D�marrer l'installation ou mise � jour du serveur web et base de donn�es requis par Dolibarr ? +DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ? -OldVersionFoundAndMoveInNew=Une ancienne version de base a �t� trouv�e et d�plac�e pour fonctionner avec la nouvelle version de Dolibarr. -OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a �t� trouv�e mais ne peut �tre d�plac�e pour �tre utilis�e avec la nouvelle version de Dolibarr. +OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr. +OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr. -DLLMissing=L'installation de votre Windows est incompl�te. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2012". Installer la version 32-bit version (vcredist_x86.exe) d'abord (vous pourrez le trouver � https://www.microsoft.com/en-us/download/) puis relancer l'installation de DoliWamp après. -ContinueAnyway=Continuer malgr� tout (le process d'installaton échouera) +DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2012". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après. +ContinueAnyway=Continuer malgré tout (le process d'installaton échouera) diff --git a/build/exe/doliwamp/rundoliadmin.bat.install b/build/exe/doliwamp/rundoliadmin.bat.install index aa882b2335c..dcd113f4ab5 100644 --- a/build/exe/doliwamp/rundoliadmin.bat.install +++ b/build/exe/doliwamp/rundoliadmin.bat.install @@ -3,4 +3,4 @@ REM Launch Dolibarr Admin center REM ---------------------------- REM Go to admin center page -start "DoliWamp admin" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/ +start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/ diff --git a/build/exe/doliwamp/rundolihelp.bat.install b/build/exe/doliwamp/rundolihelp.bat.install index d0adbe3b4d7..eed5346de9f 100644 --- a/build/exe/doliwamp/rundolihelp.bat.install +++ b/build/exe/doliwamp/rundolihelp.bat.install @@ -4,4 +4,4 @@ REM --------------------------- REM Go to help center page echo Please wait... -start "Dolibarr Help center" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/support/ +start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/support/ diff --git a/build/exe/doliwamp/rundoliwamp.bat.install b/build/exe/doliwamp/rundoliwamp.bat.install index cbda6c86aba..c576c5d240b 100644 --- a/build/exe/doliwamp/rundoliwamp.bat.install +++ b/build/exe/doliwamp/rundoliwamp.bat.install @@ -3,7 +3,7 @@ REM Launch Dolibarr REM --------------- REM If no lock file, we call install process -IF NOT EXIST dolibarr_documents\install.lock start "Dolibarr" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/install/ +IF NOT EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/install/ REM If lock file exists, we call home page -IF EXIST dolibarr_documents\install.lock start "Dolibarr" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/ +IF EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/ diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index e154b0ef6bb..2fed1a51972 100755 --- a/dev/examples/code/create_user.php +++ b/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"; } diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 19b32753940..55cef25b651 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -188,6 +188,15 @@ + + + + + + + 0 + + @@ -389,6 +398,7 @@ + diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index eddae7502d7..0e0e0ea8787 100644 --- a/dev/translation/autotranslator.class.php +++ b/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"; @@ -220,11 +220,13 @@ class autoTranslator } } - if ($key == 'CHARSET') $val=$this->_outputpagecode; - else if (preg_match('/^Format/', $key)) $val=$value; - else if ($value=='-') $val=$value; - else - { + if ($key == 'CHARSET') { + $val=$this->_outputpagecode; + } elseif (preg_match('/^Format/', $key)) { + $val=$value; + } elseif ($value=='-') { + $val=$value; + } else { // If not translated then translate if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)); else $val=utf8_decode($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2))); diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 6ea80d492ca..e2700420a0a 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/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; } diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index 422533417c9..d439397a512 100755 --- a/dev/translation/strip_language_file.php +++ b/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; diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 490f98e8a58..9e163bd0541 100644 --- a/htdocs/accountancy/admin/account.php +++ b/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); } diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 3f3725ec90e..b3017d93b42 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/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.=","; @@ -531,12 +531,15 @@ if ($id) if ($fieldlist[$field]=='country_id') { $valuetoshow=''; } if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); } - if ($valuetoshow != '') - { + if ($valuetoshow != '') { print ''; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); - else print $valuetoshow; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { + print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; + } elseif (! empty($tabhelp[$id][$value])) { + print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); + } else { + print $valuetoshow; + } print ''; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1; @@ -729,14 +732,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 +750,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 +814,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; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 13c15ae508c..bcea246706d 100644 --- a/htdocs/accountancy/admin/card.php +++ b/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 ''; } -else if ($id > 0 || $ref) { +elseif ($id > 0 || $ref) { $result = $object->fetch($id, $ref, 1); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 3dc17f01284..9aea3045b40 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/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 ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - 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 ''; } @@ -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; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 6a9ba369fe1..febb4cecadd 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/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 ''; print ''; -} else if ($id) { +} elseif ($id) { $result = $object->fetch($id); if ($result > 0) { $head = fiscalyear_prepare_head($object); diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 6ee3cc7d7cd..080a23d6aca 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/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 ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - 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 ''; } @@ -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); } @@ -627,11 +627,17 @@ if ($id) // Can an entry be erased or disabled ? $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default - 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; } + if (isset($obj->code) && $id != 10) { + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { + $iserasable = 0; + $canbedisabled = 0; + } elseif ($obj->code == 'RECEP') { + $iserasable = 0; + $canbedisabled = 0; + } elseif ($obj->code == 'EF0') { + $iserasable = 0; + $canbedisabled = 0; + } } $canbemodified=$iserasable; @@ -696,7 +702,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; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 09be3906884..6a763f74e04 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/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); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5b3282a3b29..70752f6d268 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/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 = ''; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 5db31704ba4..e6c6a672634 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/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; diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index f433873394e..b8a823a5b8e 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/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; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d34bc4d58af..d398d2ebfad 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/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; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 85b74918ac4..267a0778131 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/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))."'"; } diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4e24e582601..42705d343da 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -212,7 +212,8 @@ if (empty($chartaccountcode)) $sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,"; $sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,"; -$sql.= " aa.rowid as aarowid,"; +$sql.= " p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,"; +$sql.= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,"; $sql.= " co.code as country_code, co.label as country,"; $sql.= " s.tva_intra"; $parameters=array(); @@ -257,12 +258,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))."'"; } @@ -437,7 +438,9 @@ if ($result) { $code_sell_p_notset = ''; $objp->aarowid_suggest = $objp->aarowid; - if ($objp->type_l == 1) { + $isinEEC = isInEEC($objp->country_code); + + if ($objp->type_l == 1) { $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : ''); if ($objp->aarowid == '') { $objp->aarowid_suggest = $aarowid_s; @@ -450,8 +453,19 @@ if ($result) { } if ($objp->code_sell_l == -1) $objp->code_sell_l=''; + if ($objp->country_sell == '1') { + $objp->code_sell_p = $objp->code_sell; + $objp->aarowid_suggest = $objp->aarowid; + } elseif ($isinEEC == true) { + $objp->code_sell_p = $objp->code_sell_intra; + $objp->aarowid_suggest = $objp->aarowid_intra; + } else { + $objp->code_sell_p = $objp->code_sell_export; + $objp->aarowid_suggest = $objp->aarowid_export; + } + if (! empty($objp->code_sell)) { - $objp->code_sell_p = $objp->code_sell; // Code on product + //$objp->code_sell_p = $objp->code_sell; // Code on product } else { $code_sell_p_notset = 'color:orange'; } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 37982398d18..e1f43f010ba 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/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))."'"; } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index e8ee566e659..49096d8a2f5 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/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))."'"; } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 37ecfdb17ba..56e2baef9dd 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/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; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 9535de303d0..0638b4f0e30 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/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))."'"; } diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 1900924a630..221cd480c18 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/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))."'"; } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 894c4784a45..1d854a0d8ec 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/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; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 31d725718c4..5bf09ae4b6d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/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; diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 134f4f3b95f..7468ddb92a9 100644 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/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; diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 8f925cbeb46..7e43e17fd6f 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/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); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 330ce003854..4b0d02b5567 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/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 ''; } diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index abf3bec4c79..593855b48d8 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -210,9 +210,9 @@ if ($mode && ! count($data)) else { if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'
'; - else if ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'
'; - else if ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'
'; - else if ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'
';//+ + elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'
'; + elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'
'; + elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'
';//+ else { print $langs->trans("MembersStatisticsDesc").'
'; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index ef94603cf01..0539162ab7b 100644 --- a/htdocs/adherents/subscription.php +++ b/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\n"; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 7ec628f5d21..80701f776bd 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -95,18 +95,16 @@ if ($cancel) { $action=''; - if (! empty($backtopage)) - { + if (! empty($backtopage)) { header("Location: ".$backtopage); exit; } } -if ($action == 'add' && $user->rights->adherent->configurer) -{ +if ($action == 'add' && $user->rights->adherent->configurer) { $object->label = trim($label); - $object->statut = trim($statut); - $object->subscription = (int) trim($subscription); + $object->statut = (int) $statut; + $object->subscription = (int) $subscription; $object->note = trim($comment); $object->mail_valid = trim($mail_valid); $object->vote = (boolean) trim($vote); @@ -159,8 +157,8 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object->oldcopy = clone $object; $object->label = trim($label); - $object->statut = trim($statut); - $object->subscription = (int) trim($subscription); + $object->statut = (int) $statut; + $object->subscription = (int) $subscription; $object->note = trim($comment); $object->mail_valid = trim($mail_valid); $object->vote = (boolean) trim($vote); @@ -266,8 +264,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') $membertype = new AdherentType($db); - while ($i < $num) - { + while ($i < $num) { $objp = $db->fetch_object($result); $membertype->id = $objp->rowid; @@ -283,9 +280,12 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''.yn($objp->subscription).''; print ''.yn($objp->vote).''; print ''; -if ( !empty($objp->statut) ) print img_picto($langs->trans("InActivity"), 'statut4'); -else print img_picto($langs->trans("ActivityCeased"), 'statut5'); - print ''; + if ( !empty($objp->statut) ) { + print img_picto($langs->trans("InActivity"), 'statut4'); + } else { + print img_picto($langs->trans("ActivityCeased"), 'statut5'); + } + print ''; if ($user->rights->adherent->configurer) print 'rowid.'">'.img_edit().''; else @@ -330,7 +330,7 @@ if ($action == 'create') print ''.$langs->trans("Status").''; print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1); print ''; - + print ''.$langs->trans("SubscriptionRequired").''; print $form->selectyesno("subscription", 1, 1); print ''; @@ -350,8 +350,13 @@ if ($action == 'create') // Other attributes $parameters=array(); +<<<<<<< HEAD $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; +======= + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; +>>>>>>> upstream/develop if (empty($reshook)) { print $object->showOptionals($extrafields, 'edit'); @@ -405,8 +410,16 @@ if ($rowid > 0) print ''; print ''; print ''; print "\n"; @@ -746,11 +759,16 @@ if ($rowid > 0) print ''; print ''; - + print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut); + print ''; + +<<<<<<< HEAD print ''; print ''; } @@ -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,140 @@ 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') @@ -1600,12 +1597,15 @@ if ($id) } // Can an entry be erased or disabled ? - $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default + // all true by default + $iserasable=1; + $canbedisabled=1; + $canbemodified=1; 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 ""; @@ -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; diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index c1bb4e997dc..1fac509705c 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/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); } diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index 553ce2e54e0..a21eb56cb2c 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/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.'
'; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 87350681754..205f7e7cb1a 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -100,7 +100,7 @@ else { print ''.img_picto($langs->trans("Disabled"), 'off').''; } - else if(! empty($conf->global->USER_MAIL_REQUIRED)) + elseif(! empty($conf->global->USER_MAIL_REQUIRED)) { print ''.img_picto($langs->trans("Enabled"), 'on').''; } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 020c61688c0..d8398f610ba 100644 --- a/htdocs/admin/expedition.php +++ b/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); } diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 00b582096f0..687e3fdf1e2 100644 --- a/htdocs/admin/expensereport.php +++ b/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(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 4c9d2d41773..3312b44aba2 100644 --- a/htdocs/admin/facture.php +++ b/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 diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 9902caffae0..5b695066c58 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -167,7 +167,7 @@ else { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } - else if ($value == 1) + elseif ($value == 1) { print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 0fdae9f6032..a66f3d8e4ef 100644 --- a/htdocs/admin/fichinter.php +++ b/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); diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index f02f85b4bee..d67451812c6 100644 --- a/htdocs/admin/holiday.php +++ b/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); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index f5ad4bcfb9f..d903c592bfe 100644 --- a/htdocs/admin/ihm.php +++ b/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"); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 1f72b084d1e..d74f10ca58c 100644 --- a/htdocs/admin/mails.php +++ b/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.'>'); } diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 62134a954d3..d33c87522b1 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -479,7 +479,7 @@ foreach ($fieldlist as $field => $value) { print '\n"; } - else if (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs)) + elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url,$regs)) { print ''; } @@ -783,7 +790,7 @@ if ($mode == 'common') { // Should never happened } - else if (! empty($objMod->disabled)) + elseif (! empty($objMod->disabled)) { print $langs->trans("Disabled"); } @@ -1012,6 +1019,7 @@ if ($mode == 'deploy') print '
'; print ''; + print ''; print ''; print ''; @@ -1047,6 +1055,20 @@ if ($mode == 'deploy') print ''; + if (! empty($conf->global->MAIN_UPLOAD_DOC)) + { + if ($user->admin) + { + $langs->load('other'); + print ' '; + print info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1); + } + } + else + { + print ' ('.$langs->trans("UploadDisabled").')'; + } + print ''; print '
'; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 8303cafb6ad..3c7ce730d03 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin) $newval=GETPOST($shortkey.'_key'); //print $newkey.' - '.$newval.'
'; } - 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')); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index cd273fb701d..3c9611ca7f0 100644 --- a/htdocs/admin/pdf.php +++ b/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"); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 81674926104..34e407bd863 100644 --- a/htdocs/admin/prelevement.php +++ b/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'); diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index fe8906fcdc0..9442d449974 100644 --- a/htdocs/admin/propal.php +++ b/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 diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 049b895a4df..a32d95e9c5e 100644 --- a/htdocs/admin/reception_setup.php +++ b/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); } diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index bdf7e2c85ff..f54fe886561 100644 --- a/htdocs/admin/security.php +++ b/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"); diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index c713a8ed1bb..8149a5af8d0 100644 --- a/htdocs/admin/security_file.php +++ b/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). diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 49f54337a92..dfc16c4bd45 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -55,10 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { dol_print_error($db); } -} - -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 +68,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); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index a14e43f442e..e6611503b32 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/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); } diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 406defd134d..261ff283102 100644 --- a/htdocs/admin/supplier_order.php +++ b/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); diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index badc33320d5..4cf53e6d82f 100644 --- a/htdocs/admin/supplier_payment.php +++ b/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'); diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 752ee2497a3..1f2ce987016 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/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 diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index 20cdfb63324..e07ed924f2b 100644 --- a/htdocs/admin/syslog.php +++ b/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'] : ''); diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index ca17fc4d2c2..d1bf993bc43 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -182,8 +182,8 @@ foreach($configfileparameters as $key) print ''; // Value print ""; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 320d6f7cd4b..8e018bc2255 100644 --- a/htdocs/admin/system/database-tables.php +++ b/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; diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index dfda66d471b..e01581eee3d 100644 --- a/htdocs/admin/system/dbtable.php +++ b/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; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index a088767fc0b..da27efd9dc6 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -374,8 +374,8 @@ foreach($configfileparameters as $key => $value) // Value print "'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 1ac8922bd40..2824d991af2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/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; diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index 68654f4fb8d..02de73eeb0a 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/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; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index d81e0ae748c..f69030e806c 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/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; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 19f8aedb2f6..d47f1709b28 100644 --- a/htdocs/comm/action/index.php +++ b/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,12 +1425,10 @@ 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); $tmpdayend = date('d', $event->date_end_in_calendar); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 6ff2ecacc03..e93f263bc30 100644 --- a/htdocs/comm/action/pertype.php +++ b/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'; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 83ebfa34c44..45134dc707c 100644 --- a/htdocs/comm/action/peruser.php +++ b/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'; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index aa44fc000b8..878968478b8 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -83,7 +83,7 @@ if ($action == 'add' || $action == 'update') header("Location: ".$backtopage); exit; } - else if ($origin == 'commande') + elseif ($origin == 'commande') { header("Location: ../commande/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); exit; @@ -112,7 +112,7 @@ if ($action == 'add' || $action == 'update') } // Update address - else if ($action == 'update') + elseif ($action == 'update') { $result = $object->update($id, $socid, $user); @@ -123,7 +123,7 @@ if ($action == 'add' || $action == 'update') header("Location: ".$backtopage); exit; } - else if ($origin == 'commande') + elseif ($origin == 'commande') { header("Location: ../commande/contact.php?id=".$originid); exit; @@ -153,7 +153,7 @@ if ($action == 'add' || $action == 'update') } } -else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer) +elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer) { $result = $object->delete($id, $socid); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 358d513a37d..f64e1328e5c 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -496,7 +496,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) print ''; print ''; print ''; @@ -759,7 +759,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { print '"; } - else if ($total>0) + elseif ($total>0) { print '"; } @@ -863,7 +863,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { print '"; } - else if ($total>0) + elseif ($total>0) { print '"; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 59bc75e2498..3b892c47a79 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -122,7 +122,7 @@ if (empty($reshook)) setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings'); $action=''; } - else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) + elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings'); $action=''; @@ -524,15 +524,15 @@ if (empty($reshook)) { $upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id, 2, 0, 1, $object, 'mailing'); - if ($action == 'settitre') $object->titre = trim(GETPOST('titre', 'alpha')); - else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha')); - else if ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha')); - else if ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha')); - else if ($action == 'settitre' && empty($object->titre)) { - $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle")); - } - else if ($action == 'setfrom' && empty($object->email_from)) { - $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")); + if ($action == 'settitre') $object->titre = trim(GETPOST('titre', 'alpha')); + elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha')); + elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha')); + elseif ($action == 'setemail_errorsto') { + $object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha')); + } elseif ($action == 'settitre' && empty($object->titre)) { + $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle")); + } elseif ($action == 'setfrom' && empty($object->email_from)) { + $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom")); } if (! $mesg) @@ -803,12 +803,12 @@ else print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ValidMailing"), $langs->trans("ConfirmValidMailing"), "confirm_valid", '', '', 1); } // Confirm reset - else if ($action == 'reset') + elseif ($action == 'reset') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ResetMailing"), $langs->trans("ConfirmResetMailing", $object->ref), "confirm_reset", '', '', 2); } // Confirm delete - else if ($action == 'delete') + elseif ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''), $langs->trans("DeleteAMailing"), $langs->trans("ConfirmDeleteMailing"), "confirm_delete", '', '', 1); } @@ -842,7 +842,7 @@ else if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings'); $_GET["action"]=''; } - else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) + elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings'); if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings'); @@ -1008,7 +1008,7 @@ else { print ''.$langs->trans("ValidMailing").''; } - else if (empty($user->rights->mailing->valider)) + elseif (empty($user->rights->mailing->valider)) { print ''.$langs->trans("ValidMailing").''; } @@ -1024,7 +1024,7 @@ else { print ''.$langs->trans("SendMailing").''; } - else if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) + elseif (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) { print ''.$langs->trans("SendMailing").''; } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 31b8462a553..32199a162e1 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -557,7 +557,7 @@ if ($object->fetch($id) >= 0) $objectstatic->fetch($obj->source_id); print $objectstatic->getNomUrl(1); } - else if ($obj->source_type == 'user') + elseif ($obj->source_type == 'user') { include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $objectstatic=new User($db); @@ -565,14 +565,14 @@ if ($object->fetch($id) >= 0) $objectstatic->id=$obj->source_id; print $objectstatic->getNomUrl(1); } - else if ($obj->source_type == 'thirdparty') + elseif ($obj->source_type == 'thirdparty') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $objectstatic=new Societe($db); $objectstatic->fetch($obj->source_id); print $objectstatic->getNomUrl(1); } - else if ($obj->source_type == 'contact') + elseif ($obj->source_type == 'contact') { include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $objectstatic=new Contact($db); diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 29c577900da..e29cb63ab3f 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -108,7 +108,7 @@ class AdvanceTargetingMailing 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; @@ -260,7 +260,7 @@ class AdvanceTargetingMailing extends CommonObject * @param int $id Id object * @return int <0 if KO, >0 if OK */ - function fetch_by_mailing($id=0) + function fetch_by_mailing($id = 0) { // phpcs:enable global $langs; @@ -327,7 +327,7 @@ class AdvanceTargetingMailing extends CommonObject * @param string $type_element Type target * @return int <0 if KO, >0 if OK */ - function fetch_by_element($id=0, $type_element='mailing') + function fetch_by_element($id = 0, $type_element = 'mailing') { // phpcs:enable global $langs; @@ -390,7 +390,7 @@ class AdvanceTargetingMailing extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user, $notrigger=0) + function update($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -466,7 +466,7 @@ class AdvanceTargetingMailing 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; @@ -525,7 +525,7 @@ class AdvanceTargetingMailing extends CommonObject * @param array $arrayquery All element to Query * @return int <0 if KO, >0 if OK */ - function savequery($user,$arrayquery) + function savequery($user, $arrayquery) { global $langs,$conf; @@ -785,12 +785,12 @@ class AdvanceTargetingMailing extends CommonObject if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) { $sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")"; } - } else if (($extrafields->attribute_type[$key] == 'date') || + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){ $sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')"; } - }else if ($extrafields->attribute_type[$key] == 'boolean') { + }elseif ($extrafields->attribute_type[$key] == 'boolean') { if ($arrayquery['options_'.$key.'_cnct']!=''){ if ($arrayquery['options_'.$key.'_cnct']==0) { $sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))"; @@ -885,12 +885,12 @@ class AdvanceTargetingMailing extends CommonObject if (!empty($arrayquery['options_'.$key.'_max'])) { $sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")"; } - } else if (($extrafields->attribute_type[$key] == 'date') || + } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) { if (!empty($arrayquery['options_'.$key.'_end_dt'])){ $sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')"; } - }else if ($extrafields->attribute_type[$key] == 'boolean') { + }elseif ($extrafields->attribute_type[$key] == 'boolean') { if ($arrayquery['options_'.$key]!=''){ $sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")"; } @@ -946,7 +946,7 @@ class AdvanceTargetingMailing extends CommonObject * For exemple jean;joe;jim%%;!jimo;!jima%> will target all jean, joe, start with jim but not jimo and not everythnig taht start by jima * @return string Sql to use for the where condition */ - public function transformToSQL($column_to_test,$criteria) + public function transformToSQL($column_to_test, $criteria) { $return_sql_criteria = '('; diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 2f6c43d471b..a69af815595 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -92,7 +92,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array or Code or Label of preselected country * @return string HTML string with select */ - function multiselectCountry($htmlname = 'country_id', $selected_array=array()) + function multiselectCountry($htmlname = 'country_id', $selected_array = array()) { global $conf, $langs; @@ -194,7 +194,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array selected array * @return string combo list code */ - function multiselectselectLanguage($htmlname='', $selected_array=array()) + function multiselectselectLanguage($htmlname = '', $selected_array = array()) { global $conf,$langs; @@ -290,7 +290,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array Array * @return string HTML combo */ - function multiselectCivility($htmlname='civilite_id',$selected_array = array()) + function multiselectCivility($htmlname = 'civilite_id', $selected_array = array()) { global $conf,$langs,$user; $langs->load("dict"); @@ -356,7 +356,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array value selected * @return string HTML combo */ - function multiselectCustomerCategories($htmlname='cust_cat',$selected_array = array()) + function multiselectCustomerCategories($htmlname = 'cust_cat', $selected_array = array()) { return $this->multiselectCategories($htmlname, $selected_array, 2); } @@ -368,7 +368,7 @@ class FormAdvTargetEmailing extends Form * @param array $selected_array value selected * @return string HTML combo */ - function multiselectContactCategories($htmlname='contact_cat',$selected_array = array()) + function multiselectContactCategories($htmlname = 'contact_cat', $selected_array = array()) { return $this->multiselectCategories($htmlname, $selected_array, 4); } @@ -381,7 +381,7 @@ class FormAdvTargetEmailing extends Form * @param int $type Type * @return string HTML combo */ - public function multiselectCategories($htmlname='',$selected_array = array(), $type=0) + public function multiselectCategories($htmlname = '', $selected_array = array(), $type = 0) { global $conf,$langs,$user; $langs->load("dict"); @@ -427,7 +427,7 @@ class FormAdvTargetEmailing extends Form * @param string $type_element Type element. Example: 'mailing' * @return string HTML combo */ - public function selectAdvtargetemailingTemplate($htmlname='template_id', $selected=0, $showempty=0, $type_element='mailing') + public function selectAdvtargetemailingTemplate($htmlname = 'template_id', $selected = 0, $showempty = 0, $type_element = 'mailing') { global $conf, $user, $langs; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 775aa6b99a2..832e0c3d012 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -271,7 +271,7 @@ class Mailing extends CommonObject * @param int $option2 Not used * @return int New id of clone */ - function createFromClone($fromid,$option1,$option2) + function createFromClone($fromid, $option1, $option2) { global $user,$langs; @@ -536,7 +536,7 @@ class Mailing 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, $hookmanager; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -607,7 +607,7 @@ class Mailing extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -620,7 +620,7 @@ class Mailing 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,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -670,7 +670,7 @@ class Mailing extends CommonObject * @param strin $desc Desc error * @return string Label */ - public static function libStatutDest($statut,$mode=0,$desc='') + public static function libStatutDest($statut, $mode = 0, $desc = '') { global $langs; $langs->load('mails'); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6d1957dedd4..5a0993a08d1 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -205,7 +205,7 @@ if (empty($reshook)) } // Delete proposal - else if ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) + elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) { $result = $object->delete($user); if ($result > 0) { @@ -218,7 +218,7 @@ if (empty($reshook)) } // Remove line - else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) + elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) { $result = $object->deleteline($lineid); // reorder lines @@ -242,7 +242,7 @@ if (empty($reshook)) } // Validation - else if ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) + elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { $result = $object->valid($user); if ($result >= 0) @@ -269,7 +269,7 @@ if (empty($reshook)) } } - else if ($action == 'setdate' && $usercancreate) + elseif ($action == 'setdate' && $usercancreate) { $datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); @@ -284,13 +284,13 @@ if (empty($reshook)) dol_print_error($db, $object->error); } } - else if ($action == 'setecheance' && $usercancreate) + elseif ($action == 'setecheance' && $usercancreate) { $result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); if ($result < 0) dol_print_error($db, $object->error); } - else if ($action == 'setdate_livraison' && $usercancreate) + elseif ($action == 'setdate_livraison' && $usercancreate) { $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear'])); if ($result < 0) @@ -298,7 +298,7 @@ if (empty($reshook)) } // Positionne ref client - else if ($action == 'setref_client' && $usercancreate) + elseif ($action == 'setref_client' && $usercancreate) { $result = $object->set_ref_client($user, GETPOST('ref_client')); if ($result < 0) @@ -314,7 +314,7 @@ if (empty($reshook)) } // Create proposal - else if ($action == 'add' && $usercancreate) + elseif ($action == 'add' && $usercancreate) { $object->socid = $socid; $object->fetch_thirdparty(); @@ -619,7 +619,7 @@ if (empty($reshook)) } // Classify billed - else if ($action == 'classifybilled' && $usercanclose) + elseif ($action == 'classifybilled' && $usercanclose) { $db->begin(); @@ -641,8 +641,7 @@ if (empty($reshook)) } // Close proposal - else if ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel', 'alpha')) - { + elseif ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel', 'alpha')) { if (! (GETPOST('statut', 'int') > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'statut'; @@ -672,8 +671,7 @@ if (empty($reshook)) } // Reopen proposal - else if ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel', 'alpha')) - { + elseif ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel', 'alpha')) { // prevent browser refresh from reopening proposal several times if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { @@ -808,7 +806,7 @@ if (empty($reshook)) } } - else if ($action == "setabsolutediscount" && $usercancreate) { + elseif ($action == "setabsolutediscount" && $usercancreate) { if ($_POST["remise_id"]) { if ($object->id > 0) { $result = $object->insert_discount($_POST["remise_id"]); @@ -820,7 +818,7 @@ if (empty($reshook)) } // Add line - else if ($action == 'addline' && $usercancreate) { + elseif ($action == 'addline' && $usercancreate) { // Set if we used free entry or predefined product $predef=''; @@ -1184,7 +1182,7 @@ if (empty($reshook)) } // Update a line within proposal - else if ($action == 'updateline' && $usercancreate && GETPOST('save')) + elseif ($action == 'updateline' && $usercancreate && GETPOST('save')) { // Define info_bits $info_bits = 0; @@ -1318,68 +1316,65 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - } - - else if ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) - { + } elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) { header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } - // Set project - else if ($action == 'classin' && $usercancreate) { - $object->setProject(GETPOST('projectid', 'int')); + elseif ($action == 'classin' && $usercancreate) { + // Set project + $object->setProject(GETPOST('projectid', 'int')); } // Delai de livraison - else if ($action == 'setavailability' && $usercancreate) { + elseif ($action == 'setavailability' && $usercancreate) { $result = $object->set_availability($user, GETPOST('availability_id', 'int')); } // Origine de la propale - else if ($action == 'setdemandreason' && $usercancreate) { + elseif ($action == 'setdemandreason' && $usercancreate) { $result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int')); } // Conditions de reglement - else if ($action == 'setconditions' && $usercancreate) { + elseif ($action == 'setconditions' && $usercancreate) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); } - else if ($action == 'setremisepercent' && $usercancreate) { + elseif ($action == 'setremisepercent' && $usercancreate) { $result = $object->set_remise_percent($user, $_POST['remise_percent']); } - else if ($action == 'setremiseabsolue' && $usercancreate) { + elseif ($action == 'setremiseabsolue' && $usercancreate) { $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); } // Mode de reglement - else if ($action == 'setmode' && $usercancreate) { + elseif ($action == 'setmode' && $usercancreate) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); } // Multicurrency Code - else if ($action == 'setmulticurrencycode' && $usercancreate) { + elseif ($action == 'setmulticurrencycode' && $usercancreate) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - else if ($action == 'setmulticurrencyrate' && $usercancreate) { + elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } // bank account - else if ($action == 'setbankaccount' && $usercancreate) { + elseif ($action == 'setbankaccount' && $usercancreate) { $result=$object->setBankAccount(GETPOST('fk_account', 'int')); } // shipping method - else if ($action == 'setshippingmethod' && $usercancreate) { + elseif ($action == 'setshippingmethod' && $usercancreate) { $result=$object->setShippingMethod(GETPOST('shipping_method_id', 'int')); } - else if ($action == 'update_extras') { + elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); // Fill array 'array_options' with data from update form @@ -1421,7 +1416,7 @@ if (empty($reshook)) } // Bascule du statut d'un contact - else if ($action == 'swapstatut') { + elseif ($action == 'swapstatut') { if ($object->fetch($id) > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); } else { @@ -1430,7 +1425,7 @@ if (empty($reshook)) } // Efface un contact - else if ($action == 'deletecontact') { + elseif ($action == 'deletecontact') { $object->fetch($id); $result = $object->delete_contact($lineid); @@ -1909,22 +1904,22 @@ if ($action == 'create') } // Confirm delete - else if ($action == 'delete') { + elseif ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1); } // Confirm reopen - else if ($action == 'reopen') { + elseif ($action == 'reopen') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1); } // Confirmation delete product/service line - else if ($action == 'ask_deleteline') { + elseif ($action == 'ask_deleteline') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); } // Confirm validate proposal - else if ($action == 'validate') { + elseif ($action == 'validate') { $error = 0; // We verifie whether the object is provisionally numbering diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 759c258957e..77ee4ef1b9b 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -559,7 +559,7 @@ class Proposals extends DolibarrApi * * @return array */ - function validate($id, $notrigger=0) + function validate($id, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); @@ -607,7 +607,7 @@ class Proposals extends DolibarrApi * * @return array */ - function close($id, $status, $note_private='', $notrigger=0) + function close($id, $status, $note_private = '', $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 51b7c7616db..14b831a5526 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -239,7 +239,7 @@ class Propal extends CommonObject * @param int $socid Id third party * @param int $propalid Id proposal */ - function __construct($db, $socid="", $propalid=0) + function __construct($db, $socid = "", $propalid = 0) { global $conf,$langs; @@ -267,7 +267,7 @@ class Propal extends CommonObject * TODO Replace calls to this function by generation objet Ligne * inserted into table $this->products */ - function add_product($idproduct, $qty, $remise_percent=0) + function add_product($idproduct, $qty, $remise_percent = 0) { // phpcs:enable global $conf, $mysoc; @@ -434,7 +434,7 @@ class Propal extends CommonObject * @return int >0 if OK, <0 if KO * @see add_product */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=0, $pa_ht=0, $label='',$date_start='', $date_end='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise=0, $fk_remise_except=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0) { global $mysoc, $conf, $langs; @@ -663,7 +663,7 @@ class Propal extends CommonObject * @param int $notrigger disable line update trigger * @return int 0 if OK, <0 if KO */ - function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $desc='', $price_base_type='HT', $info_bits=0, $special_code=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=0, $pa_ht=0, $label='', $type=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0) + function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $desc = '', $price_base_type = 'HT', $info_bits = 0, $special_code = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $type = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) { global $mysoc; @@ -869,7 +869,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >=0 if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf,$hookmanager; $error=0; @@ -1216,7 +1216,7 @@ class Propal extends CommonObject * @param int $socid Id of thirdparty * @return int New id of clone */ - function createFromClone($socid=0) + function createFromClone($socid = 0) { global $user,$conf,$hookmanager; @@ -1340,7 +1340,7 @@ class Propal extends CommonObject * @param string $ref Ref of proposal * @return int >0 if OK, <0 if KO */ - function fetch($rowid,$ref='') + function fetch($rowid, $ref = '') { $sql = "SELECT p.rowid, p.ref, p.entity, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc"; @@ -1504,7 +1504,7 @@ class Propal extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; @@ -1599,7 +1599,7 @@ class Propal extends CommonObject * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - function fetch_lines($only_product=0) + function fetch_lines($only_product = 0) { // phpcs:enable $this->lines=array(); @@ -1718,7 +1718,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0=execute triggers * @return int <0 if KO, 0=Nothing done, >=0 if OK */ - function valid($user, $notrigger=0) + function valid($user, $notrigger = 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1842,7 +1842,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_date($user, $date, $notrigger=0) + function set_date($user, $date, $notrigger = 0) { // phpcs:enable if (empty($date)) @@ -1911,7 +1911,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_echeance($user, $date_fin_validite, $notrigger=0) + function set_echeance($user, $date_fin_validite, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer)) @@ -1973,7 +1973,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_date_livraison($user, $date_livraison, $notrigger=0) + function set_date_livraison($user, $date_livraison, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer)) @@ -2035,7 +2035,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_availability($user, $id, $notrigger=0) + function set_availability($user, $id, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) @@ -2106,7 +2106,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_demand_reason($user, $id, $notrigger=0) + function set_demand_reason($user, $id, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) @@ -2179,7 +2179,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_ref_client($user, $ref_client, $notrigger=0) + function set_ref_client($user, $ref_client, $notrigger = 0) { // phpcs:enable if (! empty($user->rights->propal->creer)) @@ -2244,7 +2244,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_remise_percent($user, $remise, $notrigger=0) + function set_remise_percent($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2311,7 +2311,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_remise_absolue($user, $remise, $notrigger=0) + function set_remise_absolue($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2380,7 +2380,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function reopen($user, $statut, $note='', $notrigger=0) + function reopen($user, $statut, $note = '', $notrigger = 0) { $this->statut = $statut; @@ -2441,7 +2441,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - function cloture($user, $statut, $note="", $notrigger=0) + function cloture($user, $statut, $note = "", $notrigger = 0) { global $langs,$conf; @@ -2544,7 +2544,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - function classifyBilled(User $user, $notrigger=0) + function classifyBilled(User $user, $notrigger = 0) { $error=0; @@ -2600,7 +2600,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_draft($user, $notrigger=0) + function set_draft($user, $notrigger = 0) { // phpcs:enable $error=0; @@ -2665,7 +2665,7 @@ class Propal extends CommonObject * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC') + function liste_array($shortlist = 0, $draft = 0, $notcurrentuser = 0, $socid = 0, $limit = 0, $offset = 0, $sortfield = 'p.datep', $sortorder = 'DESC') { // phpcs:enable global $user; @@ -2706,7 +2706,7 @@ class Propal extends CommonObject { $ga[$obj->propalid] = $obj->ref; } - else if ($shortlist == 2) + elseif ($shortlist == 2) { $ga[$obj->propalid] = $obj->ref.' ('.$obj->name.')'; } @@ -2833,7 +2833,7 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int 1 if ok, otherwise if error */ - function delete($user, $notrigger=0) + function delete($user, $notrigger = 0) { global $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -2957,7 +2957,7 @@ class Propal extends CommonObject * @return int >0 if OK, <0 if KO * @deprecated use set_availability */ - function availability($availability_id, $notrigger=0) + function availability($availability_id, $notrigger = 0) { global $user; @@ -3028,7 +3028,7 @@ class Propal extends CommonObject * @return int >0 si ok, <0 si ko * @deprecated use set_demand_reason */ - function demand_reason($demand_reason_id, $notrigger=0) + function demand_reason($demand_reason_id, $notrigger = 0) { // phpcs:enable global $user; @@ -3153,7 +3153,7 @@ class Propal 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -3166,7 +3166,7 @@ class Propal 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 */ - function LibStatut($statut,$mode=1) + function LibStatut($statut, $mode = 1) { // phpcs:enable global $conf; @@ -3213,7 +3213,7 @@ class Propal extends CommonObject * @param int $mode "opened" for proposal to close, "signed" for proposal to invoice * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - function load_board($user,$mode) + function load_board($user, $mode) { // phpcs:enable global $conf, $langs; @@ -3495,7 +3495,7 @@ class Propal 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='', $get_params='', $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $get_params = '', $notooltip = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user; @@ -3585,7 +3585,7 @@ class Propal 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; @@ -3854,7 +3854,7 @@ class PropaleLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function insert($notrigger=0) + function insert($notrigger = 0) { global $conf,$user; @@ -3997,7 +3997,7 @@ class PropaleLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function delete(User $user, $notrigger=0) + function delete(User $user, $notrigger = 0) { global $conf; @@ -4051,7 +4051,7 @@ class PropaleLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function update($notrigger=0) + function update($notrigger = 0) { global $conf,$user; diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 8938989ed14..6fd9d36f54b 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -56,7 +56,7 @@ class PropaleStats extends Stats * @param int $userid Id user for filter (creation user) * @param string $mode Option ('customer', 'supplier') */ - function __construct($db, $socid=0, $userid=0, $mode='customer') + function __construct($db, $socid = 0, $userid = 0, $mode = 'customer') { global $user, $conf; @@ -106,7 +106,7 @@ class PropaleStats 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 with number by month */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { global $user; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 1286fd22b3d..24bd5fb1abb 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -56,7 +56,7 @@ if ($id > 0 || ! empty($ref)) setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors'); $error++; } - else if ($ret < 0) + elseif ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -105,7 +105,7 @@ if ($action == 'addcontact' && $user->rights->propale->creer) } // Toggle the status of a contact -else if ($action == 'swapstatut' && $user->rights->propale->creer) +elseif ($action == 'swapstatut' && $user->rights->propale->creer) { if ($object->id > 0) { @@ -114,7 +114,7 @@ else if ($action == 'swapstatut' && $user->rights->propale->creer) } // Deletes a contact -else if ($action == 'deletecontact' && $user->rights->propale->creer) +elseif ($action == 'deletecontact' && $user->rights->propale->creer) { $result = $object->delete_contact($lineid); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 0cad7a6ae3e..fcea4ee05a6 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -367,7 +367,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { print '"; } - else if ($total>0) + elseif ($total>0) { print '"; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 03407252a48..64c126d7e8f 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -940,7 +940,7 @@ if ($resql) print $nbofsalesrepresentative; print ''; } - else if ($nbofsalesrepresentative > 0) + elseif ($nbofsalesrepresentative > 0) { $userstatic=new User($db); $j=0; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2fd8dd5ffd8..8f6c3fa84f5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -159,7 +159,7 @@ if (empty($reshook)) } // Reopen a closed order - else if ($action == 'reopen' && $user->rights->commande->creer) + elseif ($action == 'reopen' && $user->rights->commande->creer) { if ($object->statut == Commande::STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED) { @@ -176,7 +176,7 @@ if (empty($reshook)) } // Remove order - else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer) + elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer) { $result = $object->delete($user); if ($result > 0) @@ -191,7 +191,7 @@ if (empty($reshook)) } // Remove a product line - else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->commande->creer) + elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->commande->creer) { $result = $object->deleteline($user, $lineid); if ($result > 0) @@ -222,13 +222,13 @@ if (empty($reshook)) } // Link to a project - else if ($action == 'classin' && $user->rights->commande->creer) + elseif ($action == 'classin' && $user->rights->commande->creer) { $object->setProject(GETPOST('projectid', 'int')); } // Add order - else if ($action == 'add' && $user->rights->commande->creer) + elseif ($action == 'add' && $user->rights->commande->creer) { $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); @@ -481,7 +481,7 @@ if (empty($reshook)) } } - else if ($action == 'classifybilled' && $user->rights->commande->creer) + elseif ($action == 'classifybilled' && $user->rights->commande->creer) { $ret=$object->classifyBilled($user); @@ -489,7 +489,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - else if ($action == 'classifyunbilled' && $user->rights->commande->creer) + elseif ($action == 'classifyunbilled' && $user->rights->commande->creer) { $ret=$object->classifyUnBilled(); if ($ret < 0) { @@ -498,7 +498,7 @@ if (empty($reshook)) } // Positionne ref commande client - else if ($action == 'setref_client' && $user->rights->commande->creer) { + elseif ($action == 'setref_client' && $user->rights->commande->creer) { $result = $object->set_ref_client($user, GETPOST('ref_client')); if ($result < 0) { @@ -506,7 +506,7 @@ if (empty($reshook)) } } - else if ($action == 'setremise' && $user->rights->commande->creer) { + elseif ($action == 'setremise' && $user->rights->commande->creer) { $result = $object->set_remise($user, GETPOST('remise')); if ($result < 0) { @@ -514,7 +514,7 @@ if (empty($reshook)) } } - else if ($action == 'setabsolutediscount' && $user->rights->commande->creer) { + elseif ($action == 'setabsolutediscount' && $user->rights->commande->creer) { if (GETPOST('remise_id')) { if ($object->id > 0) { $object->insert_discount(GETPOST('remise_id')); @@ -524,7 +524,7 @@ if (empty($reshook)) } } - else if ($action == 'setdate' && $user->rights->commande->creer) { + elseif ($action == 'setdate' && $user->rights->commande->creer) { // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; $date = dol_mktime(0, 0, 0, GETPOST('order_month'), GETPOST('order_day'), GETPOST('order_year')); @@ -534,7 +534,7 @@ if (empty($reshook)) } } - else if ($action == 'setdate_livraison' && $user->rights->commande->creer) { + elseif ($action == 'setdate_livraison' && $user->rights->commande->creer) { // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); @@ -544,35 +544,35 @@ if (empty($reshook)) } } - else if ($action == 'setmode' && $user->rights->commande->creer) { + elseif ($action == 'setmode' && $user->rights->commande->creer) { $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } // Multicurrency Code - else if ($action == 'setmulticurrencycode' && $user->rights->commande->creer) { + elseif ($action == 'setmulticurrencycode' && $user->rights->commande->creer) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - else if ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) { + elseif ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx'))); } - else if ($action == 'setavailability' && $user->rights->commande->creer) { + elseif ($action == 'setavailability' && $user->rights->commande->creer) { $result = $object->availability(GETPOST('availability_id')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - else if ($action == 'setdemandreason' && $user->rights->commande->creer) { + elseif ($action == 'setdemandreason' && $user->rights->commande->creer) { $result = $object->demand_reason(GETPOST('demand_reason_id')); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } - else if ($action == 'setconditions' && $user->rights->commande->creer) { + elseif ($action == 'setconditions' && $user->rights->commande->creer) { $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); if ($result < 0) { dol_print_error($db, $object->error); @@ -604,7 +604,7 @@ if (empty($reshook)) } // bank account - else if ($action == 'setbankaccount' && $user->rights->commande->creer) { + elseif ($action == 'setbankaccount' && $user->rights->commande->creer) { $result=$object->setBankAccount(GETPOST('fk_account', 'int')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -612,7 +612,7 @@ if (empty($reshook)) } // shipping method - else if ($action == 'setshippingmethod' && $user->rights->commande->creer) { + elseif ($action == 'setshippingmethod' && $user->rights->commande->creer) { $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -620,23 +620,23 @@ if (empty($reshook)) } // warehouse - else if ($action == 'setwarehouse' && $user->rights->commande->creer) { + elseif ($action == 'setwarehouse' && $user->rights->commande->creer) { $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } - else if ($action == 'setremisepercent' && $user->rights->commande->creer) { + elseif ($action == 'setremisepercent' && $user->rights->commande->creer) { $result = $object->set_remise($user, GETPOST('remise_percent')); } - else if ($action == 'setremiseabsolue' && $user->rights->commande->creer) { + elseif ($action == 'setremiseabsolue' && $user->rights->commande->creer) { $result = $object->set_remise_absolue($user, GETPOST('remise_absolue')); } // Add a new line - else if ($action == 'addline' && $user->rights->commande->creer) + elseif ($action == 'addline' && $user->rights->commande->creer) { $langs->load('errors'); $error = 0; @@ -998,7 +998,7 @@ if (empty($reshook)) /* * Update a line */ - else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('save')) + elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('save')) { // Clean parameters $date_start=''; @@ -1132,14 +1132,12 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); } } - } - - else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { + } elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel', 'alpha') == $langs->trans('Cancel')) { header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } - else if ($action == 'confirm_validate' && $confirm == 'yes' && + elseif ($action == 'confirm_validate' && $confirm == 'yes' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) ) @@ -1196,7 +1194,7 @@ if (empty($reshook)) } // Go back to draft status - else if ($action == 'confirm_modif' && $user->rights->commande->creer) { + elseif ($action == 'confirm_modif' && $user->rights->commande->creer) { $idwarehouse = GETPOST('idwarehouse'); $qualified_for_stock_change=0; @@ -1244,14 +1242,14 @@ if (empty($reshook)) } } - else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) { + elseif ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) { $result = $object->cloture($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } - else if ($action == 'confirm_cancel' && $confirm == 'yes' && + elseif ($action == 'confirm_cancel' && $confirm == 'yes' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer)) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate))) ) @@ -1441,7 +1439,7 @@ if (empty($reshook)) } // bascule du statut d'un contact - else if ($action == 'swapstatut') + elseif ($action == 'swapstatut') { if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); @@ -1451,7 +1449,7 @@ if (empty($reshook)) } // Efface un contact - else if ($action == 'deletecontact') + elseif ($action == 'deletecontact') { $result = $object->delete_contact($lineid); diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index d8397cb09ba..dc0c645183a 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -496,7 +496,7 @@ class Orders extends DolibarrApi * * @return array */ - function validate($id, $idwarehouse=0, $notrigger=0) + function validate($id, $idwarehouse = 0, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); @@ -565,7 +565,7 @@ class Orders extends DolibarrApi $result = $this->commande->set_reopen(DolibarrApiAccess::$user); if( $result < 0) { throw new RestException(405, $this->commande->error); - }else if( $result == 0) { + }elseif( $result == 0) { throw new RestException(304); } @@ -629,7 +629,7 @@ class Orders extends DolibarrApi * * @return int */ - function close($id, $notrigger=0) + function close($id, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); @@ -675,7 +675,7 @@ class Orders extends DolibarrApi * * @return array */ - function settodraft($id, $idwarehouse=-1) + function settodraft($id, $idwarehouse = -1) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6d26a940168..faad0e8f4d0 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -313,7 +313,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <=0 if OK, 0=Nothing done, >0 if KO */ - function valid($user, $idwarehouse=0, $notrigger=0) + function valid($user, $idwarehouse = 0, $notrigger = 0) { global $conf,$langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -474,7 +474,7 @@ class Commande extends CommonOrder * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) * @return int <0 if KO, >0 if OK */ - function set_draft($user, $idwarehouse=-1) + function set_draft($user, $idwarehouse = -1) { //phpcs:enable global $conf,$langs; @@ -617,7 +617,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - function cloture($user, $notrigger=0) + function cloture($user, $notrigger = 0) { global $conf; @@ -677,7 +677,7 @@ class Commande extends CommonOrder * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function cancel($idwarehouse=-1) + function cancel($idwarehouse = -1) { global $conf,$user,$langs; @@ -758,7 +758,7 @@ class Commande extends CommonOrder * @param int $notrigger Disable all triggers * @return int <0 if KO, >0 if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf,$langs; $error=0; @@ -1060,7 +1060,7 @@ class Commande extends CommonOrder * @param int $socid Id of thirdparty * @return int New id of clone */ - function createFromClone($socid=0) + function createFromClone($socid = 0) { global $user,$hookmanager; @@ -1302,7 +1302,7 @@ class Commande extends CommonOrder * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='', $type=0, $rang=-1, $special_code=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='',$array_options=0, $fk_unit=null, $origin='', $origin_id=0, $pu_ht_devise = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0) { global $mysoc, $conf, $langs, $user; @@ -1531,7 +1531,7 @@ class Commande extends CommonOrder * TODO Remplacer les appels a cette fonction par generation objet Ligne * insere dans tableau $this->products */ - function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='') + function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '') { // phpcs:enable global $conf, $mysoc; @@ -1616,7 +1616,7 @@ class Commande extends CommonOrder * @param string $ref_int Internal reference of other object * @return int >0 if OK, <0 if KO, 0 if not found */ - function fetch($id, $ref='', $ref_ext='', $ref_int='') + function fetch($id, $ref = '', $ref_ext = '', $ref_int = '') { // Check parameters @@ -1845,7 +1845,7 @@ class Commande extends CommonOrder * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - function fetch_lines($only_product=0) + function fetch_lines($only_product = 0) { // phpcs:enable $this->lines=array(); @@ -2027,7 +2027,7 @@ class Commande extends CommonOrder * @param int $filtre_statut Filter on shipment status * @return int <0 if KO, Nb of lines found if OK */ - function loadExpeditions($filtre_statut=-1) + function loadExpeditions($filtre_statut = -1) { $this->expeditions = array(); @@ -2103,7 +2103,7 @@ class Commande extends CommonOrder * * TODO FONCTION NON FINIE A FINIR */ - function stock_array($filtre_statut=self::STATUS_CANCELED) + function stock_array($filtre_statut = self::STATUS_CANCELED) { // phpcs:enable $this->stocks = array(); @@ -2143,7 +2143,7 @@ class Commande extends CommonOrder * @param int $lineid Id of line to delete * @return int >0 if OK, 0 if nothing to do, <0 if KO */ - function deleteline($user=null, $lineid=0) + function deleteline($user = null, $lineid = 0) { if ($this->statut == self::STATUS_DRAFT) { @@ -2221,7 +2221,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_remise($user, $remise, $notrigger=0) + function set_remise($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2289,7 +2289,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_remise_absolue($user, $remise, $notrigger=0) + function set_remise_absolue($user, $remise, $notrigger = 0) { // phpcs:enable $remise=trim($remise)?trim($remise):0; @@ -2357,7 +2357,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_date($user, $date, $notrigger=0) + function set_date($user, $date, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2423,7 +2423,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - function set_date_livraison($user, $date_livraison, $notrigger=0) + function set_date_livraison($user, $date_livraison, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2494,7 +2494,7 @@ class Commande extends CommonOrder * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC') + function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'c.date_commande', $sortorder = 'DESC') { // phpcs:enable global $user; @@ -2533,7 +2533,7 @@ class Commande extends CommonOrder { $ga[$obj->cid] = $obj->ref; } - else if ($shortlist == 2) + elseif ($shortlist == 2) { $ga[$obj->cid] = $obj->ref.' ('.$obj->name.')'; } @@ -2562,7 +2562,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >0 if OK, <0 if KO */ - function availability($availability_id, $notrigger=0) + function availability($availability_id, $notrigger = 0) { global $user; @@ -2633,7 +2633,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >0 if ok, <0 if ko */ - function demand_reason($demand_reason_id, $notrigger=0) + function demand_reason($demand_reason_id, $notrigger = 0) { // phpcs:enable global $user; @@ -2706,7 +2706,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_ref_client($user, $ref_client, $notrigger=0) + function set_ref_client($user, $ref_client, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2769,7 +2769,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function classifyBilled(User $user, $notrigger=0) + function classifyBilled(User $user, $notrigger = 0) { $error = 0; @@ -2904,7 +2904,7 @@ class Commande extends CommonOrder * @param int $notrigger disable line update trigger * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null, $pu_ht_devise = 0, $notrigger=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) { global $conf, $mysoc, $langs, $user; @@ -3094,7 +3094,7 @@ class Commande extends CommonOrder * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; @@ -3189,7 +3189,7 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <=0 if KO, >0 if OK */ - function delete($user, $notrigger=0) + function delete($user, $notrigger = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -3408,7 +3408,7 @@ class Commande extends CommonOrder * @param int $donotshowbilled Do not show billed status after order status * @return string Label of status */ - function LibStatut($statut,$billed,$mode,$donotshowbilled=0) + function LibStatut($statut, $billed, $mode, $donotshowbilled = 0) { // phpcs:enable global $langs, $conf; @@ -3501,7 +3501,7 @@ class Commande extends CommonOrder * @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='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1) { global $conf, $langs, $user; @@ -3782,7 +3782,7 @@ class Commande extends CommonOrder * @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; @@ -4022,7 +4022,7 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 si ko, >0 si ok */ - function delete(User $user, $notrigger=0) + function delete(User $user, $notrigger = 0) { global $conf, $langs; @@ -4083,7 +4083,7 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 1 = disable triggers * @return int <0 if KO, >0 if OK */ - function insert($user=null, $notrigger=0) + function insert($user = null, $notrigger = 0) { global $langs, $conf; @@ -4228,7 +4228,7 @@ class OrderLine extends CommonOrderLine * @param int $notrigger 1 = disable triggers * @return int <0 si ko, >0 si ok */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf,$langs; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 53b48fcdd80..114ea186f74 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -55,7 +55,7 @@ class CommandeStats extends Stats * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ - function __construct($db, $socid, $mode, $userid=0) + function __construct($db, $socid, $mode, $userid = 0) { global $user, $conf; @@ -101,7 +101,7 @@ class CommandeStats 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 with number by month */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { global $user; @@ -144,7 +144,7 @@ class CommandeStats 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 with amount by month */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { global $user; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index a47d0929abc..73da3525a14 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -79,7 +79,7 @@ if ($action == 'addcontact' && $user->rights->commande->creer) } // bascule du statut d'un contact -else if ($action == 'swapstatut' && $user->rights->commande->creer) +elseif ($action == 'swapstatut' && $user->rights->commande->creer) { if ($object->fetch($id)) { @@ -92,7 +92,7 @@ else if ($action == 'swapstatut' && $user->rights->commande->creer) } // Efface un contact -else if ($action == 'deletecontact' && $user->rights->commande->creer) +elseif ($action == 'deletecontact' && $user->rights->commande->creer) { $object->fetch($id); $result = $object->delete_contact($_GET["lineid"]); diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 159c7d95c2e..d517ad0dfc9 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -364,7 +364,7 @@ if ($action == 'create') { $selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$object->country_code; } - else if (empty($selectedcode)) $selectedcode=$mysoc->country_code; + elseif (empty($selectedcode)) $selectedcode=$mysoc->country_code; $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''; @@ -610,7 +610,7 @@ else print ''; @@ -846,7 +846,7 @@ else $object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; $selectedcode=$object->country_code; if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"]; - else if (empty($selectedcode)) $selectedcode=$mysoc->country_code; + elseif (empty($selectedcode)) $selectedcode=$mysoc->country_code; $object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules print ''; @@ -872,7 +872,7 @@ else print ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ede82d5a550..9787e995141 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -352,7 +352,7 @@ class Account extends CommonObject * @param string $type To search using type * @return array|int Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error */ - function get_url($fk_bank='', $url_id='', $type='') + function get_url($fk_bank = '', $url_id = '', $type = '') { // phpcs:enable $lines = array(); @@ -417,7 +417,7 @@ class Account extends CommonObject * @param int $datev Date value * @return int Rowid of added entry, <0 if KO */ - function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur='',$banque='', $accountancycode='', $datev=null) + function addline($date, $oper, $label, $amount, $num_chq, $categorie, User $user, $emetteur = '', $banque = '', $accountancycode = '', $datev = null) { // Deprecation warning if (is_numeric($oper)) { @@ -525,7 +525,7 @@ class Account extends CommonObject * @param int $notrigger 1=Disable triggers * @return int < 0 if KO, > 0 if OK */ - function create(User $user, $notrigger=0) + function create(User $user, $notrigger = 0) { global $langs,$conf, $hookmanager; @@ -860,7 +860,7 @@ class Account extends CommonObject * @param string $ref Ref of bank account to get * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { global $conf; @@ -1076,7 +1076,7 @@ class Account 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 */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->clos, $mode); } @@ -1163,7 +1163,7 @@ class Account extends CommonObject * @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) * @return int Current sold (value date <= today) */ - function solde($option=0) + function solde($option = 0) { $solde=0; @@ -1329,7 +1329,7 @@ class Account extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $mode='', $option='', $save_lastsearch_value=-1, $notooltip=0) + function getNomUrl($withpicto = 0, $mode = '', $option = '', $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs, $user; @@ -1358,7 +1358,7 @@ class Account extends CommonObject { $url = DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$this->id; } - else if ($mode == 'receipts') + elseif ($mode == 'receipts') { $url = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id; } @@ -1549,7 +1549,7 @@ class Account extends CommonObject * @return array * @see useDetailedBBAN */ - public function getFieldsToShow($includeibanbic=0) + public function getFieldsToShow($includeibanbic = 0) { //Get the required properties depending on the country $detailedBBAN = $this->useDetailedBBAN(); @@ -1765,7 +1765,7 @@ class AccountLine extends CommonObject * @param string $num External num to load (ex: num of transaction for paypal fee) * @return int <0 if KO, 0 if OK but not found, >0 if OK and found */ - function fetch($rowid,$ref='',$num='') + function fetch($rowid, $ref = '', $num = '') { global $conf; @@ -1783,7 +1783,7 @@ class AccountLine extends CommonObject $sql.= " WHERE b.fk_account = ba.rowid"; $sql.= " AND ba.entity IN (".getEntity('bank_account').")"; if ($num) $sql.= " AND b.num_chq='".$this->db->escape($num)."'"; - else if ($ref) $sql.= " AND b.rowid='".$this->db->escape($ref)."'"; + elseif ($ref) $sql.= " AND b.rowid='".$this->db->escape($ref)."'"; else $sql.= " AND b.rowid=".$rowid; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -2011,7 +2011,7 @@ class AccountLine extends CommonObject * @param int $conciliated 1=Set transaction to conciliated, 0=Keep transaction non conciliated * @return int <0 if KO, >0 if OK */ - function update_conciliation(User $user, $cat, $conciliated=1) + function update_conciliation(User $user, $cat, $conciliated = 1) { // phpcs:enable global $conf,$langs; @@ -2075,7 +2075,7 @@ class AccountLine extends CommonObject * @param int $sign 1 or -1 * @return int >0 if OK, 0 if KO */ - function datev_change($rowid,$sign=1) + function datev_change($rowid, $sign = 1) { // phpcs:enable $sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; @@ -2142,7 +2142,7 @@ class AccountLine extends CommonObject * @param int $sign 1 or -1 * @return int >0 if OK, 0 if KO */ - function dateo_change($rowid,$sign=1) + function dateo_change($rowid, $sign = 1) { // phpcs:enable $sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; @@ -2257,7 +2257,7 @@ class AccountLine extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$maxlen=0,$option='',$notooltip=0) + function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip = 0) { global $langs; @@ -2298,7 +2298,7 @@ class AccountLine extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long * @return string Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->status, $mode); } @@ -2311,7 +2311,7 @@ class AccountLine 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 Libelle du statut */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index ffe01f41e7a..feaaccaa50f 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -325,7 +325,7 @@ class BankAccounts extends DolibarrApi * * @url POST {id}/lines */ - function addLine($id, $date, $type, $label, $amount, $category=0, $cheque_number='', $cheque_writer='', $cheque_bank='') + function addLine($id, $date, $type, $label, $amount, $category = 0, $cheque_number = '', $cheque_writer = '', $cheque_bank = '') { if (! DolibarrApiAccess::$user->rights->banque->modifier) { throw new RestException(401); diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index a142e349545..fc9365f7508 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -111,7 +111,7 @@ class PaymentVarious extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -181,7 +181,7 @@ class PaymentVarious extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; $sql = "SELECT"; @@ -505,7 +505,7 @@ class PaymentVarious 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 * @return string Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -518,7 +518,7 @@ class PaymentVarious 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 * @return string Libelle */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -567,7 +567,7 @@ class PaymentVarious extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $save_lastsearch_value=-1, $notooltip=0) + function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0) { global $db, $conf, $langs, $hookmanager; global $langs; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 00dd159c4d7..99b2a813149 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -351,7 +351,7 @@ if ($result) print '';*/ print $paymenttmp->getNomUrl(1); } - else if ($links[$key]['type']=='payment_supplier') { + elseif ($links[$key]['type']=='payment_supplier') { require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; $paymenttmp=new PaiementFourn($db); $paymenttmp->fetch($links[$key]['url_id']); @@ -362,72 +362,72 @@ if ($result) print '';*/ print $paymenttmp->getNomUrl(1); } - else if ($links[$key]['type']=='company') { + elseif ($links[$key]['type']=='company') { $societe=new Societe($db); $societe->fetch($links[$key]['url_id']); print $societe->getNomUrl(1); } - else if ($links[$key]['type']=='sc') { + elseif ($links[$key]['type']=='sc') { print ''; print img_object($langs->trans('ShowSocialContribution'), 'bill').' '; print $langs->trans("SocialContribution").($links[$key]['label']?' - '.$links[$key]['label']:''); print ''; } - else if ($links[$key]['type']=='payment_sc') { + elseif ($links[$key]['type']=='payment_sc') { print ''; print img_object($langs->trans('ShowPayment'), 'payment').' '; print $langs->trans("SocialContributionPayment"); print ''; } - else if ($links[$key]['type']=='payment_vat') { + elseif ($links[$key]['type']=='payment_vat') { print ''; print img_object($langs->trans('ShowVAT'), 'payment').' '; print $langs->trans("VATPayment"); print ''; } - else if ($links[$key]['type']=='payment_salary') { + elseif ($links[$key]['type']=='payment_salary') { print ''; print img_object($langs->trans('ShowPaymentSalary'), 'payment').' '; print $langs->trans("SalaryPayment"); print ''; } - else if ($links[$key]['type']=='payment_loan') { + elseif ($links[$key]['type']=='payment_loan') { print ''; print img_object($langs->trans('ShowLoanPayment'), 'payment').' '; print $langs->trans("PaymentLoan"); print ''; } - else if ($links[$key]['type']=='loan') { + elseif ($links[$key]['type']=='loan') { print ''; print img_object($langs->trans('ShowLoan'), 'bill').' '; print $langs->trans("Loan"); print ''; } - else if ($links[$key]['type']=='member') { + elseif ($links[$key]['type']=='member') { print ''; print img_object($langs->trans('ShowMember'), 'user').' '; print $links[$key]['label']; print ''; } - else if ($links[$key]['type']=='payment_donation') { + elseif ($links[$key]['type']=='payment_donation') { print ''; print img_object($langs->trans('ShowDonation'), 'payment').' '; print $langs->trans("DonationPayment"); print ''; } - else if ($links[$key]['type']=='banktransfert') { + elseif ($links[$key]['type']=='banktransfert') { print ''; print img_object($langs->trans('ShowTransaction'), 'payment').' '; print $langs->trans("TransactionOnTheOtherAccount"); print ''; } - else if ($links[$key]['type']=='user') { + elseif ($links[$key]['type']=='user') { print ''; print img_object($langs->trans('ShowUser'), 'user').' '; print $langs->trans("User"); print ''; } - else if ($links[$key]['type']=='payment_various') { + elseif ($links[$key]['type']=='payment_various') { print ''; print img_object($langs->trans('ShowVariousPayment'), 'payment').' '; print $langs->trans("VariousPayment"); diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index a3ad683a902..3428593b4fe 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -295,7 +295,7 @@ class CashControl 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 */ - public function getLibStatut($mode=0) + public function getLibStatut($mode = 0) { return $this->LibStatut($this->status, $mode); } @@ -308,7 +308,7 @@ class CashControl 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 */ - public function LibStatut($status, $mode=0) + public function LibStatut($status, $mode = 0) { // phpcs:enable if (empty($this->labelstatus)) @@ -364,7 +364,7 @@ class CashControl extends CommonObject * @param int $notooltip No tooltip * @return string String with URL */ - public function getNomUrl($withpicto=0, $option='', $maxlength=0, $save_lastsearch_value=-1, $notooltip=0) + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs, $hookmanager; include_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 63addb3a114..60eb007e26a 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -78,7 +78,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) } } -else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer) +elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer) { $object->fetch($id); if ($object->statut == 1) @@ -96,7 +96,7 @@ else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer) } } -else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) +elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer) { $result=$object->delete($id); if ($result >= 0) @@ -110,7 +110,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl } } -else if ($action == 'add' && $user->rights->deplacement->creer) +elseif ($action == 'add' && $user->rights->deplacement->creer) { if (! GETPOST('cancel', 'alpha')) { @@ -169,7 +169,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer) } // Update record -else if ($action == 'update' && $user->rights->deplacement->creer) +elseif ($action == 'update' && $user->rights->deplacement->creer) { if (! GETPOST('cancel', 'alpha')) { @@ -203,7 +203,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer) } // Set into a project -else if ($action == 'classin' && $user->rights->deplacement->creer) +elseif ($action == 'classin' && $user->rights->deplacement->creer) { $object->fetch($id); $result=$object->setProject(GETPOST('projectid', 'int')); @@ -211,14 +211,14 @@ else if ($action == 'classin' && $user->rights->deplacement->creer) } // Set fields -else if ($action == 'setdated' && $user->rights->deplacement->creer) +elseif ($action == 'setdated' && $user->rights->deplacement->creer) { $dated=dol_mktime(GETPOST('datedhour', 'int'), GETPOST('datedmin', 'int'), GETPOST('datedsec', 'int'), GETPOST('datedmonth', 'int'), GETPOST('datedday', 'int'), GETPOST('datedyear', 'int')); $object->fetch($id); $result=$object->setValueFrom('dated', $dated, '', '', 'date', '', $user, 'DEPLACEMENT_MODIFY'); if ($result < 0) dol_print_error($db, $object->error); } -else if ($action == 'setkm' && $user->rights->deplacement->creer) +elseif ($action == 'setkm' && $user->rights->deplacement->creer) { $object->fetch($id); $result=$object->setValueFrom('km', GETPOST('km', 'int'), '', null, 'text', '', $user, 'DEPLACEMENT_MODIFY'); @@ -314,7 +314,7 @@ if ($action == 'create') print ''; } -else if ($id) +elseif ($id) { $result = $object->fetch($id); if ($result > 0) diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 0c990269abd..518b505efc5 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -245,7 +245,7 @@ class Deplacement extends CommonObject * @param string $ref Ref of record * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { $sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement"; @@ -316,7 +316,7 @@ class Deplacement 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 * @return string Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -329,7 +329,7 @@ class Deplacement 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 * @return string Libelle */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; @@ -374,7 +374,7 @@ class Deplacement extends CommonObject * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @return string Chaine avec URL */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto = 0) { global $langs; @@ -400,7 +400,7 @@ class Deplacement extends CommonObject * @param int $active Active or not * @return array */ - function listOfTypes($active=1) + function listOfTypes($active = 1) { global $langs; diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 876f815137a..b36b280d899 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -50,7 +50,7 @@ class DeplacementStats extends Stats * @param mixed $userid Id user for filter or array of user ids * @return void */ - function __construct($db, $socid=0, $userid=0) + function __construct($db, $socid = 0, $userid = 0) { global $conf; @@ -69,7 +69,7 @@ class DeplacementStats extends Stats $this->where.=" AND fk_soc = ".$this->socid; } if (is_array($this->userid) && count($this->userid) > 0) $this->where.=' AND fk_user IN ('.join(',', $this->userid).')'; - else if ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid; + elseif ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid; } @@ -96,7 +96,7 @@ class DeplacementStats 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 values */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { $sql = "SELECT MONTH(dated) as dm, count(*)"; $sql.= " FROM ".$this->from; @@ -118,7 +118,7 @@ class DeplacementStats 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 values */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { $sql = "SELECT date_format(dated,'%m') as dm, sum(".$this->field.")"; $sql.= " FROM ".$this->from; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d1cc6eb98b6..00f28b30aff 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -178,7 +178,7 @@ if (empty($reshook)) } // Change status of invoice - else if ($action == 'reopen' && $usercancreate) { + elseif ($action == 'reopen' && $usercancreate) { $result = $object->fetch($id); if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced') || ($object->statut == 1 && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted $result = $object->set_unpaid($user); @@ -192,7 +192,7 @@ if (empty($reshook)) } // Delete invoice - else if ($action == 'confirm_delete' && $confirm == 'yes') { + elseif ($action == 'confirm_delete' && $confirm == 'yes') { $result = $object->fetch($id); $object->fetch_thirdparty(); @@ -222,7 +222,7 @@ if (empty($reshook)) } // Delete line - else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) + elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) { $object->fetch($id); $object->fetch_thirdparty(); @@ -256,7 +256,7 @@ if (empty($reshook)) } // Delete link of credit note to invoice - else if ($action == 'unlinkdiscount' && $usercancreate) + elseif ($action == 'unlinkdiscount' && $usercancreate) { $discount = new DiscountAbsolute($db); $result = $discount->fetch(GETPOST("discountid")); @@ -264,7 +264,7 @@ if (empty($reshook)) } // Validation - else if ($action == 'valid' && $usercancreate) + elseif ($action == 'valid' && $usercancreate) { $object->fetch($id); @@ -284,7 +284,7 @@ if (empty($reshook)) } } - else if ($action == 'set_thirdparty' && $usercancreate) + elseif ($action == 'set_thirdparty' && $usercancreate) { $object->fetch($id); $object->setValueFrom('fk_soc', $socid, '', null, 'int', '', $user, 'BILL_MODIFY'); @@ -293,13 +293,13 @@ if (empty($reshook)) exit(); } - else if ($action == 'classin' && $usercancreate) + elseif ($action == 'classin' && $usercancreate) { $object->fetch($id); $object->setProject($_POST['projectid']); } - else if ($action == 'setmode' && $usercancreate) + elseif ($action == 'setmode' && $usercancreate) { $object->fetch($id); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); @@ -308,16 +308,16 @@ if (empty($reshook)) } // Multicurrency Code - else if ($action == 'setmulticurrencycode' && $usercancreate) { + elseif ($action == 'setmulticurrencycode' && $usercancreate) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } // Multicurrency rate - else if ($action == 'setmulticurrencyrate' && $usercancreate) { + elseif ($action == 'setmulticurrencyrate' && $usercancreate) { $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int')); } - else if ($action == 'setinvoicedate' && $usercancreate) + elseif ($action == 'setinvoicedate' && $usercancreate) { $object->fetch($id); $old_date_lim_reglement = $object->date_lim_reglement; @@ -336,7 +336,7 @@ if (empty($reshook)) if ($result < 0) dol_print_error($db, $object->error); } - else if ($action == 'setdate_pointoftax' && $usercancreate) + elseif ($action == 'setdate_pointoftax' && $usercancreate) { $object->fetch($id); $date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']); @@ -345,7 +345,7 @@ if (empty($reshook)) if ($result < 0) dol_print_error($db, $object->error); } - else if ($action == 'setconditions' && $usercancreate) + elseif ($action == 'setconditions' && $usercancreate) { $object->fetch($id); $object->cond_reglement_code = 0; // To clean property @@ -361,7 +361,7 @@ if (empty($reshook)) if ($result < 0) dol_print_error($db, $object->error); } - else if ($action == 'setpaymentterm' && $usercancreate) + elseif ($action == 'setpaymentterm' && $usercancreate) { $object->fetch($id); $object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']); @@ -374,7 +374,7 @@ if (empty($reshook)) dol_print_error($db, $object->error); } - else if ($action == 'setrevenuestamp' && $usercancreate) + elseif ($action == 'setrevenuestamp' && $usercancreate) { $object->fetch($id); $object->revenuestamp = GETPOST('revenuestamp'); @@ -391,18 +391,18 @@ if (empty($reshook)) } // bank account - else if ($action == 'setbankaccount' && $usercancreate) + elseif ($action == 'setbankaccount' && $usercancreate) { $result=$object->setBankAccount(GETPOST('fk_account', 'int')); } - else if ($action == 'setremisepercent' && $usercancreate) + elseif ($action == 'setremisepercent' && $usercancreate) { $object->fetch($id); $result = $object->set_remise($user, $_POST['remise_percent']); } - else if ($action == "setabsolutediscount" && $usercancreate) + elseif ($action == "setabsolutediscount" && $usercancreate) { // POST[remise_id] or POST[remise_id_for_payment] @@ -460,14 +460,14 @@ if (empty($reshook)) } } - else if ($action == 'setref_client' && $usercancreate) + elseif ($action == 'setref_client' && $usercancreate) { $object->fetch($id); $object->set_ref_client(GETPOST('ref_client')); } // Classify to validated - else if ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) + elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) { $idwarehouse = GETPOST('idwarehouse', 'int'); @@ -567,7 +567,7 @@ if (empty($reshook)) } // Go back to draft status (unvalidate) - else if ($action == 'confirm_modif' && $usercanunvalidate) + elseif ($action == 'confirm_modif' && $usercanunvalidate) { $idwarehouse = GETPOST('idwarehouse', 'int'); @@ -647,13 +647,13 @@ if (empty($reshook)) } // Classify "paid" - else if ($action == 'confirm_paid' && $confirm == 'yes' && $usercanissuepayment) + elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercanissuepayment) { $object->fetch($id); $result = $object->set_paid($user); if ($result<0) setEventMessages($object->error, $object->errors, 'errors'); } // Classif "paid partialy" - else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $usercanissuepayment) + elseif ($action == 'confirm_paid_partially' && $confirm == 'yes' && $usercanissuepayment) { $object->fetch($id); $close_code = GETPOST("close_code", 'none'); @@ -665,7 +665,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); } } // Classify "abandoned" - else if ($action == 'confirm_canceled' && $confirm == 'yes') { + elseif ($action == 'confirm_canceled' && $confirm == 'yes') { $object->fetch($id); $close_code = GETPOST("close_code", 'none'); $close_note = GETPOST("close_note", 'none'); @@ -678,7 +678,7 @@ if (empty($reshook)) } // Convertir en reduc - else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $usercancreate) + elseif ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $usercancreate) { $object->fetch($id); $object->fetch_thirdparty(); @@ -733,20 +733,31 @@ if (empty($reshook)) { // If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT + // Total payments $sql = 'SELECT SUM(pf.amount) as total_paiements'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id'; $sql.= ' WHERE pf.fk_facture = '.$object->id; $sql.= ' AND pf.fk_paiement = p.rowid'; - $sql.= ' AND p.entity IN (' . getEntity('invoice').')'; - + $sql.= ' AND p.entity IN ('.getEntity('invoice').')'; $resql = $db->query($sql); if (! $resql) dol_print_error($db); $res = $db->fetch_object($resql); $total_paiements = $res->total_paiements; - $discount->amount_ht = $discount->amount_ttc = $total_paiements - $object->total_ttc; + // Total credit note and deposit + $total_creditnote_and_deposit = 0; + $sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,"; + $sql .= " re.description, re.fk_facture_source"; + $sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re"; + $sql .= " WHERE fk_facture = " . $object->id; + $resql = $db->query($sql); + if (!empty($resql)) { + while ($obj = $db->fetch_object($resql)) $total_creditnote_and_deposit += $obj->amount_ttc; + } else dol_print_error($db); + + $discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc; $discount->amount_tva = 0; $discount->tva_tx = 0; @@ -824,7 +835,7 @@ if (empty($reshook)) /* * Insert new invoice in database */ - else if ($action == 'add' && $usercancreate) + elseif ($action == 'add' && $usercancreate) { if ($socid > 0) $object->socid = GETPOST('socid', 'int'); @@ -1648,7 +1659,7 @@ if (empty($reshook)) } // Add a new line - else if ($action == 'addline' && $usercancreate) + elseif ($action == 'addline' && $usercancreate) { $langs->load('errors'); $error = 0; @@ -1777,16 +1788,16 @@ if (empty($reshook)) // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. $pqp = (GETPOST('pbq', 'int') ? GETPOST('pbq', 'int') : 0); - + $datapriceofproduct = $prod->getSellPrice($mysoc, $object->thirdparty, $pqp); - + $pu_ht = $datapriceofproduct['pu_ht']; $pu_ttc = $datapriceofproduct['pu_ttc']; $price_min = $datapriceofproduct['price_min']; $price_base_type = $datapriceofproduct['price_base_type']; $tva_tx = $datapriceofproduct['tva_tx']; $tva_npr = $datapriceofproduct['tva_npr']; - + $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)); $tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx)); @@ -2172,7 +2183,7 @@ if (empty($reshook)) } } - else if ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) + elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) { if (!$object->fetch($id) > 0) dol_print_error($db); if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "") @@ -2189,7 +2200,7 @@ if (empty($reshook)) } } - else if ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) { + elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) { header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -3283,7 +3294,7 @@ if ($action == 'create') print '
'; } -else if ($id > 0 || ! empty($ref)) +elseif ($id > 0 || ! empty($ref)) { /* * Show object in view mode @@ -4540,7 +4551,7 @@ else if ($id > 0 || ! empty($ref)) } else { print '
' . $langs->trans('Modify') . '
'; } - } else if (!$object->is_last_in_cycle()) { + } elseif (!$object->is_last_in_cycle()) { print '
' . $langs->trans('Modify') . '
'; } else { print '
' . $langs->trans('Modify') . '
'; @@ -4758,7 +4769,7 @@ else if ($id > 0 || ! empty($ref)) if ($usercancreate && ($object->type == 5) && ($object->statut == 1 || $object->statut == 2)) { if ($object->is_last_in_cycle() && $object->situation_final != 1) { print '
'; - } else if (!$object->is_last_in_cycle()) { + } elseif (!$object->is_last_in_cycle()) { print ''; } else { print ''; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 43e4d10ac9d..555b6179677 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -104,7 +104,7 @@ class Invoices extends DolibarrApi * * @throws RestException */ - function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $status = '', $sqlfilters = '') { global $db, $conf; @@ -600,7 +600,7 @@ class Invoices extends DolibarrApi * @throws 500 * */ - function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger=0) + function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -650,7 +650,7 @@ class Invoices extends DolibarrApi * @throws 500 * */ - function settodraft($id, $idwarehouse=-1) + function settodraft($id, $idwarehouse = -1) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -702,7 +702,7 @@ class Invoices extends DolibarrApi * * @return array */ - function validate($id, $idwarehouse=0, $notrigger=0) + function validate($id, $idwarehouse = 0, $notrigger = 0) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -753,7 +753,7 @@ class Invoices extends DolibarrApi * @throws 404 * @throws 500 */ - function settopaid($id, $close_code='', $close_note='') + function settopaid($id, $close_code = '', $close_note = '') { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -994,7 +994,7 @@ class Invoices extends DolibarrApi * @throws 401 * @throws 404 */ - function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') + function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement = '', $comment = '', $chqemetteur = '', $chqbank = '') { global $conf; @@ -1114,7 +1114,7 @@ class Invoices extends DolibarrApi * @throws 403 * @throws 404 */ - function addPaymentDistributed($arrayofamounts, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') + function addPaymentDistributed($arrayofamounts, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement = '', $comment = '', $chqemetteur = '', $chqbank = '') { global $conf; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 557ce0635b7..3ee1a5fd977 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -321,7 +321,7 @@ class FactureRec extends CommonInvoice * @param int $ref_int Internal reference of other object * @return int >0 if OK, <0 if KO, 0 if not found */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='') + function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '') { $sql = 'SELECT f.rowid, f.entity, f.titre, f.suspended, f.fk_soc, f.amount, f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc'; $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; @@ -573,7 +573,7 @@ class FactureRec extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function delete(User $user, $notrigger=0, $idwarehouse=-1) + function delete(User $user, $notrigger = 0, $idwarehouse = -1) { $rowid=$this->id; @@ -644,7 +644,7 @@ class FactureRec extends CommonInvoice * @param int $date_end_fill 1=Flag to fill end date when generating invoice * @return int <0 if KO, Id of line if OK */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null, $pu_ht_devise=0, $date_start_fill=0, $date_end_fill=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $date_start_fill = 0, $date_end_fill = 0) { global $mysoc; @@ -826,7 +826,7 @@ class FactureRec extends CommonInvoice * @param int $date_end_fill 1=Flag to fill end date when generating invoice * @return int <0 if KO, Id of line if OK */ - function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null, $pu_ht_devise = 0, $notrigger=0, $date_start_fill=0, $date_end_fill=0) + function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0) { global $mysoc; @@ -1002,7 +1002,7 @@ class FactureRec extends CommonInvoice * @param int $forcevalidation 1=Force validation of invoice whatever is template auto_validate flag. * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - function createRecurringInvoices($restrictioninvoiceid=0, $forcevalidation=0) + function createRecurringInvoices($restrictioninvoiceid = 0, $forcevalidation = 0) { global $conf, $langs, $db, $user, $hookmanager; @@ -1159,7 +1159,7 @@ class FactureRec extends CommonInvoice * @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='',$max=0,$short=0,$moretitle='',$notooltip='',$save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = '', $save_lastsearch_value = -1) { global $langs; @@ -1210,7 +1210,7 @@ class FactureRec extends CommonInvoice * @param integer $alreadypaid Not used on recurring invoices * @return string Label of status */ - function getLibStatut($mode=0, $alreadypaid=-1) + function getLibStatut($mode = 0, $alreadypaid = -1) { return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, empty($this->type)?0:$this->type); @@ -1227,7 +1227,7 @@ class FactureRec extends CommonInvoice * @param int $type Type invoice * @return string Label of status */ - function LibStatut($recur, $status, $mode=0, $alreadypaid=-1, $type=0) + function LibStatut($recur, $status, $mode = 0, $alreadypaid = -1, $type = 0) { // phpcs:enable global $langs; @@ -1328,7 +1328,7 @@ class FactureRec extends CommonInvoice * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $user,$langs,$conf; @@ -1398,7 +1398,7 @@ class FactureRec extends CommonInvoice $line->total_ttc=-119.6; $line->total_tva=-19.6; } - else if ($xnbp == 2) // UP is negative (free line) + elseif ($xnbp == 2) // UP is negative (free line) { $line->subprice=-100; $line->total_ht=-100; @@ -1406,7 +1406,7 @@ class FactureRec extends CommonInvoice $line->total_tva=-19.6; $line->remise_percent=0; } - else if ($xnbp == 3) // Discount is 50% (product line) + elseif ($xnbp == 3) // Discount is 50% (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product=$prodids[$prodid]; @@ -1480,7 +1480,7 @@ class FactureRec extends CommonInvoice * @param string $unit unit of frequency (d, m, y) * @return int <0 if KO, >0 if OK */ - function setFrequencyAndUnit($frequency,$unit) + function setFrequencyAndUnit($frequency, $unit) { if (! $this->table_element) { @@ -1523,7 +1523,7 @@ class FactureRec extends CommonInvoice * @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done * @return int <0 if KO, >0 if OK */ - function setNextDate($date, $increment_nb_gen_done=0) + function setNextDate($date, $increment_nb_gen_done = 0) { if (! $this->table_element) { @@ -1823,7 +1823,7 @@ class FactureLigneRec extends CommonInvoiceLine * @param int $notrigger No trigger * @return int <0 if KO, Id of line if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7ce4d4b968e..9ff69004444 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -289,7 +289,7 @@ class Facture extends CommonInvoice * @param int $forceduedate 1=Do not recalculate due date from payment condition but force it with value * @return int <0 if KO, >0 if OK */ - function create(User $user, $notrigger=0, $forceduedate=0) + function create(User $user, $notrigger = 0, $forceduedate = 0) { global $langs,$conf,$mysoc,$hookmanager; $error=0; @@ -854,7 +854,7 @@ class Facture extends CommonInvoice * @param int $invertdetail Reverse sign of amounts for lines * @return int <0 if KO, >0 if OK */ - function createFromCurrent(User $user, $invertdetail=0) + function createFromCurrent(User $user, $invertdetail = 0) { global $conf; @@ -945,7 +945,7 @@ class Facture extends CommonInvoice * @param int $socid Id of thirdparty * @return int New id of clone */ - function createFromClone($socid=0) + function createFromClone($socid = 0) { global $user,$hookmanager, $conf; @@ -1162,7 +1162,7 @@ class Facture extends CommonInvoice * @param int $withpicto Add download picto into link * @return string HTML link to file */ - function getDirectExternalLink($withpicto=0) + function getDirectExternalLink($withpicto = 0) { global $dolibarr_main_url_root; @@ -1193,7 +1193,7 @@ class Facture extends CommonInvoice * @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='', $max=0, $short=0, $moretitle='', $notooltip=0, $addlinktonotes=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $addlinktonotes = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user, $form; @@ -1301,7 +1301,7 @@ class Facture extends CommonInvoice * @param bool $fetch_situation Fetch the previous and next situation in $tab_previous_situation_invoice and $tab_next_situation_invoice * @return int >0 if OK, <0 if KO, 0 if not found */ - function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $fetch_situation=false) + function fetch($rowid, $ref = '', $ref_ext = '', $ref_int = '', $fetch_situation = false) { global $conf; @@ -1604,7 +1604,7 @@ class Facture extends CommonInvoice * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf; @@ -1819,7 +1819,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_ref_client($ref_client, $notrigger=0) + function set_ref_client($ref_client, $notrigger = 0) { // phpcs:enable global $user; @@ -1884,7 +1884,7 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, 0=Refused, >0 if OK */ - function delete($user, $notrigger=0, $idwarehouse=-1) + function delete($user, $notrigger = 0, $idwarehouse = -1) { global $langs,$conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -2058,7 +2058,7 @@ class Facture extends CommonInvoice * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) * @return int <0 if KO, >0 if OK */ - function set_paid($user, $close_code='', $close_note='') + function set_paid($user, $close_code = '', $close_note = '') { // phpcs:enable $error=0; @@ -2168,7 +2168,7 @@ class Facture extends CommonInvoice * @param string $close_note Comment * @return int <0 if KO, >0 if OK */ - function set_canceled($user, $close_code='', $close_note='') + function set_canceled($user, $close_code = '', $close_note = '') { // phpcs:enable @@ -2231,7 +2231,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK */ - function validate($user, $force_number='', $idwarehouse=0, $notrigger=0) + function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0) { global $conf,$langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -2313,7 +2313,7 @@ class Facture extends CommonInvoice { $num = $force_number; } - else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life + elseif (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date { @@ -2529,7 +2529,7 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - function set_draft($user,$idwarehouse=-1) + function set_draft($user, $idwarehouse = -1) { // phpcs:enable global $conf,$langs; @@ -2649,7 +2649,7 @@ class Facture extends CommonInvoice * @param double $pu_ht_devise Unit price in currency * @return int <0 if KO, Id of line if OK */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_options=0, $situation_percent=100, $fk_prev_id=0, $fk_unit = null, $pu_ht_devise = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = 0, $fk_remise_except = '', $price_base_type = 'HT', $pu_ttc = 0, $type = self::TYPE_STANDARD, $rang = -1, $special_code = 0, $origin = '', $origin_id = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $situation_percent = 100, $fk_prev_id = 0, $fk_unit = null, $pu_ht_devise = 0) { // Deprecation warning if ($label) { @@ -2879,7 +2879,7 @@ class Facture extends CommonInvoice * @param int $notrigger disable line update trigger * @return int < 0 if KO, > 0 if OK */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type= self::TYPE_STANDARD, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $situation_percent=100, $fk_unit = null, $pu_ht_devise = 0, $notrigger=0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = self::TYPE_STANDARD, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $situation_percent = 100, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0) { global $conf,$user; // Deprecation warning @@ -3197,7 +3197,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - function set_remise($user, $remise, $notrigger=0) + function set_remise($user, $remise, $notrigger = 0) { // phpcs:enable // Clean parameters @@ -3263,7 +3263,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function set_remise_absolue($user, $remise, $notrigger=0) + function set_remise_absolue($user, $remise, $notrigger = 0) { // phpcs:enable if (empty($remise)) $remise=0; @@ -3330,15 +3330,15 @@ class Facture extends CommonInvoice * @param string $mode 'next' for next value or 'last' for last value * @return string free ref or last ref */ - function getNextNumRef($soc,$mode='next') + function getNextNumRef($soc, $mode = 'next') { global $conf, $langs; $langs->load("bills"); // Clean parameters (if not defined or using deprecated value) if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON='mod_facture_terre'; - else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre'; - else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure'; + elseif ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre'; + elseif ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure'; if (! empty($conf->global->FACTURE_ADDON)) { @@ -3472,7 +3472,7 @@ class Facture extends CommonInvoice * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') + function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'f.datef,f.rowid', $sortorder = 'DESC') { // phpcs:enable global $conf,$user; @@ -3511,7 +3511,7 @@ class Facture extends CommonInvoice { $ga[$obj->fid] = $obj->ref; } - else if ($shortlist == 2) + elseif ($shortlist == 2) { $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; } @@ -3543,7 +3543,7 @@ class Facture extends CommonInvoice * @param int $socid Id thirdparty * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ - function list_replacable_invoices($socid=0) + function list_replacable_invoices($socid = 0) { // phpcs:enable global $conf; @@ -3593,7 +3593,7 @@ class Facture extends CommonInvoice * @param int $socid Id thirdparty * @return array Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) */ - function list_qualified_avoir_invoices($socid=0) + function list_qualified_avoir_invoices($socid = 0) { // phpcs:enable global $conf; @@ -3668,7 +3668,7 @@ class Facture extends CommonInvoice * @param float $amount Amount we request direct debit for * @return int <0 if KO, >0 if OK */ - function demande_prelevement($fuser, $amount=0) + function demande_prelevement($fuser, $amount = 0) { // phpcs:enable @@ -3894,7 +3894,7 @@ class Facture extends CommonInvoice * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $langs; @@ -3971,7 +3971,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_ttc=-239.2; $line->multicurrency_total_tva=-39.2; } - else if ($xnbp == 2) // UP is negative (free line) + elseif ($xnbp == 2) // UP is negative (free line) { $line->subprice=-100; $line->total_ht=-100; @@ -3982,7 +3982,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_ttc=-239.2; $line->multicurrency_total_tva=-39.2; } - else if ($xnbp == 3) // Discount is 50% (product line) + elseif ($xnbp == 3) // Discount is 50% (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product=$prodids[$prodid]; @@ -4110,7 +4110,7 @@ class Facture extends CommonInvoice * @param null|array $moreparams Array to provide more information * @return int <0 if KO, >0 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; @@ -4215,7 +4215,7 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function setFinal(User $user, $notrigger=0) + function setFinal(User $user, $notrigger = 0) { $error=0; @@ -4512,7 +4512,7 @@ class FactureLigne extends CommonInvoiceLine * @param int $noerrorifdiscountalreadylinked 1=Do not make error if lines is linked to a discount and discount already linked to another * @return int <0 if KO, >0 if OK */ - function insert($notrigger=0, $noerrorifdiscountalreadylinked=0) + function insert($notrigger = 0, $noerrorifdiscountalreadylinked = 0) { global $langs,$user,$conf; @@ -4729,7 +4729,7 @@ class FactureLigne extends CommonInvoiceLine * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function update($user='',$notrigger=0) + function update($user = '', $notrigger = 0) { global $user,$conf; @@ -4945,7 +4945,7 @@ class FactureLigne extends CommonInvoiceLine * @param bool $include_credit_note Include credit note or not * @return int >= 0 */ - function get_prev_progress($invoiceid, $include_credit_note=true) + function get_prev_progress($invoiceid, $include_credit_note = true) { // phpcs:enable if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 5a2aaa3e931..45bb258f292 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -53,7 +53,7 @@ class FactureStats extends Stats * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ - function __construct($db, $socid, $mode, $userid=0) + function __construct($db, $socid, $mode, $userid = 0) { global $user, $conf; @@ -100,7 +100,7 @@ class FactureStats 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 values */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { global $user; @@ -145,7 +145,7 @@ class FactureStats 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 with amount by month */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { global $user; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 55a3e40b55f..3d4f0881de2 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -82,7 +82,7 @@ class PaymentTerm // 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; @@ -268,7 +268,7 @@ class PaymentTerm // 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; @@ -345,7 +345,7 @@ class PaymentTerm // 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; diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index cd4c243cb34..64145158052 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -85,7 +85,7 @@ if ($action == 'addcontact' && $user->rights->facture->creer) } // Toggle the status of a contact -else if ($action == 'swapstatut' && $user->rights->facture->creer) +elseif ($action == 'swapstatut' && $user->rights->facture->creer) { if ($object->fetch($id)) { @@ -98,7 +98,7 @@ else if ($action == 'swapstatut' && $user->rights->facture->creer) } // Deletes a contact -else if ($action == 'deletecontact' && $user->rights->facture->creer) +elseif ($action == 'deletecontact' && $user->rights->facture->creer) { $object->fetch($id); $result = $object->delete_contact($lineid); diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index f3bfa41d91e..674b63fe18d 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -405,7 +405,7 @@ if (empty($reshook)) setEventMessages($line->error, $line->errors, 'errors'); } } - else if ($action == 'update_extras') + elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); @@ -1145,7 +1145,7 @@ if ($action == 'create') $title = $langs->trans("ProductsAndServices"); if (empty($conf->service->enabled)) $title = $langs->trans("Products"); - else if (empty($conf->product->enabled)) + elseif (empty($conf->product->enabled)) $title = $langs->trans("Services"); print load_fiche_titre($title, '', ''); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 04d3e6c4f5b..76a7641f327 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -247,12 +247,12 @@ if ($search_month > 0) { if ($search_year > 0 && empty($search_day)) $sql.= " AND f.date_last_gen 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.date_last_gen 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.date_last_gen, '%m') = '".$db->escape($search_month)."'"; } -else if ($search_year > 0) +elseif ($search_year > 0) { $sql.= " AND f.date_last_gen BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'"; } @@ -260,12 +260,12 @@ if ($search_month_date_when > 0) { if ($search_year_date_when > 0 && empty($search_day_date_when)) $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when, $search_month_date_when, false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when, $search_month_date_when, false))."'"; - else if ($search_year_date_when > 0 && ! empty($search_day_date_when)) + elseif ($search_year_date_when > 0 && ! empty($search_day_date_when)) $sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; else $sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'"; } -else if ($search_year_date_when > 0) +elseif ($search_year_date_when > 0) { $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when, 12, false))."'"; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 81379052974..575471fda0e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -273,7 +273,7 @@ if ($massaction == 'withdrawrequest') if($objecttmp->paye || $objecttmp->resteapayer==0){ $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("AlreadyPaid"), $objecttmp->errors, 'errors'); - } else if($objecttmp->resteapayer<0){ + } elseif($objecttmp->resteapayer<0){ $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("AmountMustBePositive"), $objecttmp->errors, 'errors'); } @@ -303,7 +303,7 @@ if ($massaction == 'withdrawrequest') $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings'); } - else if (!empty($objecttmp->mode_reglement_code ) && $objecttmp->mode_reglement_code != 'PRE'){ + elseif (!empty($objecttmp->mode_reglement_code ) && $objecttmp->mode_reglement_code != 'PRE'){ $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); } diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index a3c1c49e26a..686e72c46a7 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -163,7 +163,7 @@ class Localtax extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf, $langs; @@ -628,7 +628,7 @@ class Localtax extends CommonObject * @param string $option Sur quoi pointe le lien * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $option='') + function getNomUrl($withpicto = 0, $option = '') { global $langs; @@ -652,7 +652,7 @@ class Localtax 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 Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -665,7 +665,7 @@ class Localtax 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 Libelle du statut */ - function LibStatut($status, $mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 20ff14aa390..8c6bdb0717b 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -58,8 +58,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; } } else @@ -229,7 +229,7 @@ if($calc ==0 || $calc == 2) $langs->load("errors"); if ($coll_list == -1) print ''; - else if ($coll_list == -2) + elseif ($coll_list == -2) print ''; else print ''; @@ -305,7 +305,7 @@ if($calc ==0 || $calc == 1){ $langs->load("errors"); if ($coll_list == -1) print ''; - else if ($coll_list == -2) + elseif ($coll_list == -2) print ''; else print ''; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index f10cae31114..07fd53ffbad 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -68,8 +68,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; } } else diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 31fd4defb36..f1bd327f1d7 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -270,7 +270,7 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) } // Remove file in doc form -else if ($action == 'remove_file' && $user->rights->banque->cheque) +elseif ($action == 'remove_file' && $user->rights->banque->cheque) { if ($object->fetch($id) > 0) { diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index a6f3f6a9dc3..2c4180c3858 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -84,7 +84,7 @@ class RemiseCheque extends CommonObject * @param string $ref Ref record * @return int <0 if KO, > 0 if OK */ - function fetch($id,$ref='') + function fetch($id, $ref = '') { global $conf; @@ -299,7 +299,7 @@ class RemiseCheque extends CommonObject * @param User $user Utilisateur qui effectue l'operation * @return int */ - function delete($user='') + function delete($user = '') { global $conf; @@ -416,15 +416,15 @@ class RemiseCheque extends CommonObject * @param string $mode 'next' for next value or 'last' for last value * @return string free ref or last ref */ - function getNextNumRef($mode='next') + function getNextNumRef($mode = 'next') { global $conf, $db, $langs, $mysoc; $langs->load("bills"); // Clean parameters (if not defined or using deprecated value) if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_mint'; - else if ($conf->global->CHEQUERECEIPTS_ADDON=='thyme') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_thyme'; - else if ($conf->global->CHEQUERECEIPTS_ADDON=='mint') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_mint'; + elseif ($conf->global->CHEQUERECEIPTS_ADDON=='thyme') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_thyme'; + elseif ($conf->global->CHEQUERECEIPTS_ADDON=='mint') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_mint'; if (! empty($conf->global->CHEQUERECEIPTS_ADDON)) { @@ -988,7 +988,7 @@ class RemiseCheque extends CommonObject * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $user,$langs,$conf; @@ -1013,7 +1013,7 @@ class RemiseCheque 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, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $conf, $langs; @@ -1064,7 +1064,7 @@ class RemiseCheque 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 Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -1077,7 +1077,7 @@ class RemiseCheque 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 Libelle du statut */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 4e5d686b2ea..19c59356226 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -100,12 +100,12 @@ if ($month > 0) { if ($year > 0 && empty($day)) $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'"; - else if ($year > 0 && ! empty($day)) + elseif ($year > 0 && ! empty($day)) $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; else $sql.= " AND date_format(bc.date_bordereau, '%m') = '".$month."'"; } -else if ($year > 0) +elseif ($year > 0) { $sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index a07ceb1a0ac..b5571c29b94 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -157,7 +157,7 @@ class Paiement extends CommonObject * @param int $fk_bank Id of bank line associated to payment * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id, $ref='', $fk_bank='') + public function fetch($id, $ref = '', $fk_bank = '') { $sql = 'SELECT p.rowid, p.ref, p.datep as dp, p.amount, p.statut, p.ext_payment_id, p.ext_payment_site, p.fk_bank,'; $sql.= ' c.code as type_code, c.libelle as type_libelle,'; @@ -168,9 +168,9 @@ class Paiement extends CommonObject $sql.= ' WHERE p.entity IN (' . getEntity('invoice').')'; if ($id > 0) $sql.= ' AND p.rowid = '.$id; - else if ($ref) + elseif ($ref) $sql.= " AND p.ref = '".$ref."'"; - else if ($fk_bank) + elseif ($fk_bank) $sql.= ' AND p.fk_bank = '.$fk_bank; $resql = $this->db->query($sql); @@ -224,7 +224,7 @@ class Paiement extends CommonObject * @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more * @return int id of created payment, < 0 if error */ - function create($user, $closepaidinvoices=0) + function create($user, $closepaidinvoices = 0) { global $conf, $langs; @@ -357,7 +357,7 @@ class Paiement extends CommonObject ); if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice, nor situation invoice. We do nothing more."); - else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); + elseif ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); //else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); else { @@ -488,7 +488,7 @@ class Paiement extends CommonObject * @param int $notrigger No trigger * @return int <0 si ko, >0 si ok */ - function delete($notrigger=0) + function delete($notrigger = 0) { global $conf, $user, $langs; @@ -598,7 +598,7 @@ class Paiement extends CommonObject * @param int $notrigger No trigger * @return int <0 if KO, bank_line_id if OK */ - function addPaymentToBank($user,$mode,$label,$accountid,$emetteur_nom,$emetteur_banque,$notrigger=0) + function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) { global $conf,$langs,$user; @@ -897,7 +897,7 @@ class Paiement extends CommonObject * @param User $user User making validation * @return int <0 if KO, >0 if OK */ - function valide(User $user=null) + function valide(User $user = null) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 1 WHERE rowid = '.$this->id; @@ -921,7 +921,7 @@ class Paiement extends CommonObject * @param User $user User making reject * @return int <0 if KO, >0 if OK */ - function reject(User $user=null) + function reject(User $user = null) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 2 WHERE rowid = '.$this->id; @@ -989,7 +989,7 @@ class Paiement extends CommonObject * @param string $filter Critere de filtre * @return array Tableau des id de factures */ - function getBillsArray($filter='') + function getBillsArray($filter = '') { $sql = 'SELECT fk_facture'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'facture as f'; @@ -1027,15 +1027,15 @@ class Paiement extends CommonObject * @param string $mode 'next' for next value or 'last' for last value * @return string free ref or last ref */ - function getNextNumRef($soc,$mode='next') + function getNextNumRef($soc, $mode = 'next') { global $conf, $db, $langs; $langs->load("bills"); // Clean parameters (if not defined or using deprecated value) if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON='mod_payment_cicada'; - else if ($conf->global->PAYMENT_ADDON=='ant') $conf->global->PAYMENT_ADDON='mod_payment_ant'; - else if ($conf->global->PAYMENT_ADDON=='cicada') $conf->global->PAYMENT_ADDON='mod_payment_cicada'; + elseif ($conf->global->PAYMENT_ADDON=='ant') $conf->global->PAYMENT_ADDON='mod_payment_ant'; + elseif ($conf->global->PAYMENT_ADDON=='cicada') $conf->global->PAYMENT_ADDON='mod_payment_cicada'; if (! empty($conf->global->PAYMENT_ADDON)) { @@ -1138,7 +1138,7 @@ class Paiement extends CommonObject * @param string $option ''=Create a specimen invoice with lines, 'nolines'=No lines * @return void */ - function initAsSpecimen($option='') + function initAsSpecimen($option = '') { global $user,$langs,$conf; @@ -1164,7 +1164,7 @@ class Paiement extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0, $option='', $mode='withlistofinvoices', $notooltip=0) + function getNomUrl($withpicto = 0, $option = '', $mode = 'withlistofinvoices', $notooltip = 0) { global $conf, $langs; @@ -1222,7 +1222,7 @@ class Paiement 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 Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -1235,7 +1235,7 @@ class Paiement 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 Libelle du statut */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage @@ -1286,7 +1286,7 @@ class Paiement extends CommonObject * @param int $force_thirdparty_id Force thirdparty id * @return int <0 if KO, >0 if OK */ - function fetch_thirdparty($force_thirdparty_id=0) + function fetch_thirdparty($force_thirdparty_id = 0) { // phpcs:enable include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index eb190d7d466..16c7c2f3f52 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -81,7 +81,7 @@ class BonPrelevement extends CommonObject * @param DoliDB $db Database handler * @param string $filename Filename of withdraw receipt */ - function __construct($db, $filename='') + function __construct($db, $filename = '') { global $conf,$langs; @@ -276,7 +276,7 @@ class BonPrelevement extends CommonObject * @param string $ref Ref of direct debit * @return int >0 if OK, <0 if KO */ - function fetch($rowid, $ref='') + function fetch($rowid, $ref = '') { global $conf; @@ -630,7 +630,7 @@ class BonPrelevement extends CommonObject * @param int $amounts If you want to get the amount of the order for each invoice * @return array Id of invoices */ - private function getListInvoices($amounts=0) + private function getListInvoices($amounts = 0) { global $conf; @@ -731,7 +731,7 @@ class BonPrelevement extends CommonObject * @param int $agence dolibarr mysoc agence * @return int 0 if OK, <0 if KO */ - function delete($user=null) + function delete($user = null) { $this->db->begin(); @@ -1178,7 +1178,7 @@ class BonPrelevement extends CommonObject * @param string $option link target * @return string URL of target */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto = 0, $option = '') { global $langs; @@ -1299,7 +1299,7 @@ class BonPrelevement extends CommonObject * @param string $executiondate Date to execute transfer * @return int 0 if OK, <0 if KO */ - function generate($format='ALL',$executiondate='') + function generate($format = 'ALL', $executiondate = '') { global $conf,$langs,$mysoc; @@ -1493,7 +1493,7 @@ class BonPrelevement extends CommonObject * @param string $rib_dom rib domiciliation * @return void */ - function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom='') + function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $ref, $facid, $rib_dom = '') { // phpcs:enable fputs($this->file, "06"); @@ -1726,7 +1726,7 @@ class BonPrelevement extends CommonObject * @param string $format FRST or RCUR or ALL * @return string String with SEPA Sender */ - function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST') + function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf = '\n', $format = 'FRST') { // phpcs:enable // SEPA INITIALISATION @@ -1905,7 +1905,7 @@ class BonPrelevement extends CommonObject * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -1918,7 +1918,7 @@ class BonPrelevement 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 */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable if (empty($this->labelstatut)) diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index a7cc44aa4ae..6f9d50ceb07 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -123,7 +123,7 @@ class LignePrelevement * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -136,7 +136,7 @@ class LignePrelevement * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index d25ef8ef7ff..f0df56fbec1 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -82,7 +82,7 @@ class RejetPrelevement * @param int $facturation Facturation * @return void */ - function create($user, $id, $motif, $date_rejet, $bonid, $facturation=0) + function create($user, $id, $motif, $date_rejet, $bonid, $facturation = 0) { global $langs,$conf; @@ -282,7 +282,7 @@ class RejetPrelevement * @return array Array List of invoices related to the withdrawal line * @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? */ - private function getListInvoices($amounts=0) + private function getListInvoices($amounts = 0) { global $conf; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 0d4a2e6806a..5181ae02667 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -134,7 +134,7 @@ if ($modecompta == 'CREANCES-DETTES') $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="RECETTES-DEPENSES") { +elseif ($modecompta=="RECETTES-DEPENSES") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); $calcmode=$langs->trans("CalcModeEngagement"); $calcmode.='
('.$langs->trans("SeeReportInDueDebtMode", '', '').')'; @@ -146,7 +146,7 @@ else if ($modecompta=="RECETTES-DEPENSES") { $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { $name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear"); $calcmode=$langs->trans("CalcModeBookkeeping"); @@ -191,7 +191,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo if (! empty($date_start) && ! empty($date_end)) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - else if ($modecompta=="RECETTES-DEPENSES") + elseif ($modecompta=="RECETTES-DEPENSES") { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -232,7 +232,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo dol_print_error($db); } } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { // Nothing from this table } @@ -278,12 +278,12 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo dol_print_error($db); } } - else if ($modecompta=="RECETTES-DEPENSES") + elseif ($modecompta=="RECETTES-DEPENSES") { // Nothing from this table } } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { // Nothing from this table } @@ -307,7 +307,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo if (! empty($date_start) && ! empty($date_end)) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } - else if ($modecompta=="RECETTES-DEPENSES") + elseif ($modecompta=="RECETTES-DEPENSES") { $sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p"; @@ -347,7 +347,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo dol_print_error($db); } } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { // Nothing from this table } @@ -429,7 +429,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco dol_print_error($db); } } - else if ($modecompta=="RECETTES-DEPENSES") + elseif ($modecompta=="RECETTES-DEPENSES") { // TVA reellement deja payee $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; @@ -493,7 +493,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco } } } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { // Nothing from this table } @@ -516,7 +516,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco if (! empty($date_start) && ! empty($date_end)) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } - else if ($modecompta=="RECETTES-DEPENSES") + elseif ($modecompta=="RECETTES-DEPENSES") { $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; @@ -554,7 +554,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco dol_print_error($db); } } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { // Nothing from this table } @@ -578,7 +578,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco if (! empty($date_start) && ! empty($date_end)) $sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'"; } - else if ($modecompta=="RECETTES-DEPENSES") + elseif ($modecompta=="RECETTES-DEPENSES") { $sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; @@ -616,7 +616,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco dol_print_error($db); } } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { // Nothing from this table } diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index b18ade786ae..2f4c7623bd3 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -108,7 +108,7 @@ class PaymentSalary extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -189,7 +189,7 @@ class PaymentSalary extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; $sql = "SELECT"; @@ -544,7 +544,7 @@ class PaymentSalary 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 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, $hookmanager; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -652,7 +652,7 @@ class PaymentSalary 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 Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -665,7 +665,7 @@ class PaymentSalary 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 Libelle du statut */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/salaries/class/salariesstats.class.php b/htdocs/compta/salaries/class/salariesstats.class.php index 0b660e73d6f..8dd602cd3e9 100644 --- a/htdocs/compta/salaries/class/salariesstats.class.php +++ b/htdocs/compta/salaries/class/salariesstats.class.php @@ -49,7 +49,7 @@ class SalariesStats extends Stats * @param mixed $userid Id user for filter or array of user ids * @return void */ - function __construct($db, $socid=0, $userid=0) + function __construct($db, $socid = 0, $userid = 0) { global $conf; @@ -67,7 +67,7 @@ class SalariesStats extends Stats $this->where.=" AND fk_soc = ".$this->socid; } if (is_array($this->userid) && count($this->userid) > 0) $this->where.=' AND fk_user IN ('.join(',', $this->userid).')'; - else if ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid; + elseif ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid; } @@ -94,7 +94,7 @@ class SalariesStats 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 values */ - function getNbByMonth($year, $format=0) + function getNbByMonth($year, $format = 0) { $sql = "SELECT MONTH(datep) as dm, count(*)"; $sql.= " FROM ".$this->from; @@ -116,7 +116,7 @@ class SalariesStats 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 values */ - function getAmountByMonth($year, $format=0) + function getAmountByMonth($year, $format = 0) { $sql = "SELECT date_format(datep,'%m') as dm, sum(".$this->field.")"; $sql.= " FROM ".$this->from; diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index 9d3967d140e..49cf2ec4560 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -404,7 +404,7 @@ class Cchargesociales * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -438,7 +438,7 @@ class Cchargesociales * @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); } @@ -451,7 +451,7 @@ class Cchargesociales * @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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 84d00b19128..687553a7bf2 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -93,7 +93,7 @@ class ChargeSociales extends CommonObject * @param string $ref Ref * @return int <0 KO >0 OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { $sql = "SELECT cs.rowid, cs.date_ech"; $sql.= ", cs.libelle as lib, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; @@ -419,7 +419,7 @@ class ChargeSociales extends CommonObject * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ - function getLibStatut($mode=0,$alreadypaid=-1) + function getLibStatut($mode = 0, $alreadypaid = -1) { return $this->LibStatut($this->paye, $mode, $alreadypaid); } @@ -433,7 +433,7 @@ class ChargeSociales extends CommonObject * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ - function LibStatut($statut,$mode=0,$alreadypaid=-1) + function LibStatut($statut, $mode = 0, $alreadypaid = -1) { // phpcs:enable global $langs; @@ -491,7 +491,7 @@ class ChargeSociales 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 link */ - function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0, $short=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $short = 0, $save_lastsearch_value = -1) { global $langs, $conf, $user, $form; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index d416701bcdf..4969b8f9b79 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -104,7 +104,7 @@ class PaymentSocialContribution extends CommonObject * @param int $closepaidcontrib 1=Also close payed contributions to paid, 0=Do nothing more * @return int <0 if KO, id of payment if OK */ - function create($user, $closepaidcontrib=0) + function create($user, $closepaidcontrib = 0) { global $conf, $langs; @@ -292,7 +292,7 @@ class PaymentSocialContribution 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 PaymentSocialContribution 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; @@ -540,7 +540,7 @@ class PaymentSocialContribution extends CommonObject * @param string $emetteur_banque Name of bank * @return int <0 if KO, >0 if OK */ - function addPaymentToBank($user,$mode,$label,$accountid,$emetteur_nom,$emetteur_banque) + function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque) { global $conf; @@ -656,7 +656,7 @@ class PaymentSocialContribution 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 Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -669,7 +669,7 @@ class PaymentSocialContribution 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 Libelle du statut */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage @@ -720,7 +720,7 @@ class PaymentSocialContribution extends CommonObject * @param int $maxlen Longueur max libelle * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$maxlen=0) + function getNomUrl($withpicto = 0, $maxlen = 0) { global $langs; diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 03f9c63c523..dd14f175432 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -210,7 +210,7 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=dol_now(); } -else if ($modecompta=="RECETTES-DEPENSES") +elseif ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate"); $calcmode=$langs->trans("CalcModeEngagement"); @@ -221,12 +221,12 @@ else if ($modecompta=="RECETTES-DEPENSES") $builddate=dol_now(); } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { } -else if ($modecompta=="BOOKKEEPINGCOLLECTED") +elseif ($modecompta=="BOOKKEEPINGCOLLECTED") { diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 6e7cb01528a..675783ba107 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -178,7 +178,7 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=dol_now(); } -else if ($modecompta=="RECETTES-DEPENSES") +elseif ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices"); $calcmode=$langs->trans("CalcModeEngagement"); @@ -189,12 +189,12 @@ else if ($modecompta=="RECETTES-DEPENSES") $builddate=dol_now(); } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { } -else if ($modecompta=="BOOKKEEPINGCOLLECTED") +elseif ($modecompta=="BOOKKEEPINGCOLLECTED") { @@ -231,7 +231,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; } - else if ($selected_cat) // Into a specific category + elseif ($selected_cat) // Into a specific category { $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp"; } @@ -253,7 +253,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql.=" AND cp.fk_product is null"; } - else if ($selected_cat) { // Into a specific category + elseif ($selected_cat) { // Into a specific category $sql.= " AND (c.rowid = ".$selected_cat; if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; $sql.= ")"; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index cc64fd0b0ee..0615c2b6a52 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -158,7 +158,7 @@ if ($modecompta=="CREANCES-DETTES") { $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="RECETTES-DEPENSES") +elseif ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice"); $calcmode=$langs->trans("CalcModeEngagement"); @@ -168,12 +168,12 @@ else if ($modecompta=="RECETTES-DEPENSES") $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { } -else if ($modecompta=="BOOKKEEPINGCOLLECTED") +elseif ($modecompta=="BOOKKEEPINGCOLLECTED") { diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 53e9890cd88..bd009c3b055 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -184,7 +184,7 @@ if ($modecompta=="CREANCES-DETTES") $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="RECETTES-DEPENSES") +elseif ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByThirdParties"); $calcmode=$langs->trans("CalcModeEngagement"); @@ -194,12 +194,12 @@ else if ($modecompta=="RECETTES-DEPENSES") $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { } -else if ($modecompta=="BOOKKEEPINGCOLLECTED") +elseif ($modecompta=="BOOKKEEPINGCOLLECTED") { @@ -228,7 +228,7 @@ if ($modecompta == 'CREANCES-DETTES') { { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; } - else if ($selected_cat) // Into a specific category + elseif ($selected_cat) // Into a specific category { $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } @@ -246,7 +246,7 @@ if ($modecompta == 'CREANCES-DETTES') { { $sql.=" AND cs.fk_soc is null"; } - else if ($selected_cat) { // Into a specific category + elseif ($selected_cat) { // Into a specific category $sql.= " AND (c.rowid = ".$db->escape($selected_cat); if ($subcat) $sql.=" OR c.fk_parent = " . $db->escape($selected_cat); $sql.= ")"; @@ -266,7 +266,7 @@ if ($modecompta == 'CREANCES-DETTES') { { $sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; } - else if ($selected_cat) // Into a specific category + elseif ($selected_cat) // Into a specific category { $sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs"; } @@ -280,7 +280,7 @@ if ($modecompta == 'CREANCES-DETTES') { { $sql.=" AND cs.fk_soc is null"; } - else if ($selected_cat) { // Into a specific category + elseif ($selected_cat) { // Into a specific category $sql.= " AND (c.rowid = ".$selected_cat; if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat; $sql.= ")"; diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 4804dd74a7b..67a3a111790 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -128,7 +128,7 @@ if ($modecompta=="CREANCES-DETTES") $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="RECETTES-DEPENSES") +elseif ($modecompta=="RECETTES-DEPENSES") { $name=$langs->trans("TurnoverCollected"); $calcmode=$langs->trans("CalcModeEngagement"); @@ -141,7 +141,7 @@ else if ($modecompta=="RECETTES-DEPENSES") $builddate=dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { $name=$langs->trans("Turnover"); $calcmode=$langs->trans("CalcModeBookkeeping"); @@ -174,7 +174,7 @@ if ($modecompta == 'CREANCES-DETTES') $sql.= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; } -else if ($modecompta=="RECETTES-DEPENSES") +elseif ($modecompta=="RECETTES-DEPENSES") { /* * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les @@ -189,7 +189,7 @@ else if ($modecompta=="RECETTES-DEPENSES") $sql.= " AND f.entity IN (".getEntity('invoice').")"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; } -else if ($modecompta=="BOOKKEEPING") +elseif ($modecompta=="BOOKKEEPING") { $sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 1adbd00a2cb..a498ebf3ab7 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -173,7 +173,7 @@ class Tva extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user, $notrigger=0) + function update($user, $notrigger = 0) { global $conf, $langs; @@ -241,7 +241,7 @@ class Tva extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; $sql = "SELECT"; @@ -687,7 +687,7 @@ class Tva extends CommonObject * @param string $morecss More CSS * @return string Chaine with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '') { global $langs, $conf; @@ -813,7 +813,7 @@ class Tva 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 Libelle */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -826,7 +826,7 @@ class Tva 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 Libelle du statut */ - function LibStatut($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 3bf0f82a91b..a53f77a7021 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -66,8 +66,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; } } else @@ -217,7 +217,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) $langs->load("errors"); if ($x_coll == -1) { print '
'; - } else if ($x_coll == -2) { + } elseif ($x_coll == -2) { print ''; } else { print ''; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 6a27d49008e..17d041decf7 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -115,7 +115,7 @@ if ($month > 0) else $sql.= " AND date_format(t.datev, '%m') = '$month'"; } -else if ($year > 0) +elseif ($year > 0) { $sql.= " AND t.datev BETWEEN '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 532d7161d46..f749df2b548 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -66,8 +66,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $date_start=dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; - else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1; + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1; } } else @@ -209,7 +209,7 @@ if (! is_array($x_coll) || ! is_array($x_paye)) $langs->load("errors"); if ($x_coll == -1) { print ''; - } else if ($x_coll == -2) { + } elseif ($x_coll == -2) { print ''; } else { print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 463b671c64d..49354ea8806 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -313,7 +313,7 @@ class Contact extends CommonObject * @param int $nosyncuser No sync linked user (external users and contacts are linked) * @return int <0 if KO, >0 if OK */ - function update($id, $user=null, $notrigger=0, $action='update', $nosyncuser=0) + function update($id, $user = null, $notrigger = 0, $action = 'update', $nosyncuser = 0) { global $conf, $langs, $hookmanager; @@ -344,7 +344,7 @@ class Contact extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET "; if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',"; - else if ($this->socid == -1) $sql .= " fk_soc=null,"; + elseif ($this->socid == -1) $sql .= " fk_soc=null,"; $sql .= " civility='".$this->db->escape($this->civility_id)."'"; $sql .= ", lastname='".$this->db->escape($this->lastname)."'"; $sql .= ", firstname='".$this->db->escape($this->firstname)."'"; @@ -501,7 +501,7 @@ class Contact 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; @@ -597,7 +597,7 @@ class Contact extends CommonObject * @param int $notrigger 0=no, 1=yes * @return int <0 if KO, >=0 if OK */ - function update_perso($id, $user=null, $notrigger=0) + function update_perso($id, $user = null, $notrigger = 0) { // phpcs:enable $error=0; @@ -686,7 +686,7 @@ class Contact extends CommonObject * @param string $email Email * @return int -1 if KO, 0 if OK but not found, 1 if OK */ - function fetch($id, $user=null, $ref_ext='', $email='') + function fetch($id, $user = null, $ref_ext = '', $email = '') { global $langs; @@ -874,7 +874,7 @@ class Contact extends CommonObject unset($this->gender); if (in_array($this->civility_id, array('MR'))) { $this->gender = 'man'; - } else if(in_array($this->civility_id, array('MME','MLE'))) { + } elseif(in_array($this->civility_id, array('MME','MLE'))) { $this->gender = 'woman'; } } @@ -931,7 +931,7 @@ class Contact extends CommonObject * @param int $notrigger Disable all trigger * @return int <0 if KO, >0 if OK */ - function delete($notrigger=0) + function delete($notrigger = 0) { global $conf, $langs, $user; @@ -1124,7 +1124,7 @@ class Contact extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $maxlen=0, $moreparam='', $save_lastsearch_value=-1, $notooltip=0) + function getNomUrl($withpicto = 0, $option = '', $maxlen = 0, $moreparam = '', $save_lastsearch_value = -1, $notooltip = 0) { global $conf, $langs, $hookmanager; @@ -1231,7 +1231,7 @@ class Contact 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 Libelle */ - function LibStatut($statut,$mode) + function LibStatut($statut, $mode) { // phpcs:enable global $langs; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9f5ca26bc39..e75d4a3231e 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -113,13 +113,13 @@ if ($type == "c") $titre.=' ('.$langs->trans("ThirdPartyCustomers").')'; $urlfiche="card.php"; } -else if ($type == "f") +elseif ($type == "f") { if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactsupplierlist'; $titre.=' ('.$langs->trans("ThirdPartySuppliers").')'; $urlfiche="card.php"; } -else if ($type == "o") +elseif ($type == "o") { if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactotherlist'; $titre.=' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; @@ -330,15 +330,15 @@ if ($type == "o") // filtre sur type { $sql .= " AND p.fk_soc IS NULL"; } -else if ($type == "f") // filtre sur type +elseif ($type == "f") // filtre sur type { $sql .= " AND s.fournisseur = 1"; } -else if ($type == "c") // filtre sur type +elseif ($type == "c") // filtre sur type { $sql .= " AND s.client IN (1, 3)"; } -else if ($type == "p") // filtre sur type +elseif ($type == "p") // filtre sur type { $sql .= " AND s.client IN (2, 3)"; } @@ -487,7 +487,7 @@ if (! empty($conf->categorie->enabled)) { $moreforfilter.='
'; if ($type == 'c') $moreforfilter.=$langs->trans('CustomersCategoriesShort'). ': '; - else if ($type == 'p') $moreforfilter.=$langs->trans('ProspectsCategoriesShort'). ': '; + elseif ($type == 'p') $moreforfilter.=$langs->trans('ProspectsCategoriesShort'). ': '; else $moreforfilter.=$langs->trans('CustomersProspectsCategoriesShort'). ': '; $moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty, 'search_categ_thirdparty', 1); $moreforfilter.='
'; diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index b829332f484..6114f49930c 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -293,7 +293,7 @@ else $ageyear=convertSecondToTime($now-$object->birthday, 'year')-1970; $agemonth=convertSecondToTime($now-$object->birthday, 'month')-1; if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')'; - else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; + elseif ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; else print '('.$agemonth.' '.$langs->trans("DurationMonth").')'; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index efefc3e9b28..7212132f2c5 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -119,7 +119,7 @@ if (empty($reshook)) } } - else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) + elseif ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) { if (! GETPOST('dateend')) { @@ -408,13 +408,13 @@ if (empty($reshook)) } } - else if ($action == 'classin' && $user->rights->contrat->creer) + elseif ($action == 'classin' && $user->rights->contrat->creer) { $object->setProject(GETPOST('projectid')); } // Add a new line - else if ($action == 'addline' && $user->rights->contrat->creer) + elseif ($action == 'addline' && $user->rights->contrat->creer) { // Set if we used free entry or predefined product $predef=''; @@ -653,8 +653,7 @@ if (empty($reshook)) } } - else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel', 'alpha')) - { + elseif ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel', 'alpha')) { $error = 0; if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update) @@ -761,7 +760,7 @@ if (empty($reshook)) } } - else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) + elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->deleteline(GETPOST('lineid'), $user); @@ -776,7 +775,7 @@ if (empty($reshook)) } } - else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) + elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->validate($user); @@ -805,7 +804,7 @@ if (empty($reshook)) } } - else if ($action == 'reopen' && $user->rights->contrat->creer) + elseif ($action == 'reopen' && $user->rights->contrat->creer) { $result = $object->reopen($user); if ($result < 0) @@ -815,7 +814,7 @@ if (empty($reshook)) } // Close all lines - else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) + elseif ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->closeAll($user); if ($result < 0) @@ -825,7 +824,7 @@ if (empty($reshook)) } // Close all lines - else if ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer) + elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->activateAll($user); if ($result < 0) @@ -834,7 +833,7 @@ if (empty($reshook)) } } - else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) + elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer) { $result=$object->delete($user); if ($result >= 0) @@ -848,7 +847,7 @@ if (empty($reshook)) } } - else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) + elseif ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer) { if (GETPOST('newcid') > 0) { @@ -871,7 +870,7 @@ if (empty($reshook)) setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } } - else if ($action == 'update_extras') + elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object); @@ -1042,13 +1041,13 @@ if (empty($reshook)) } // bascule du statut d'un contact - else if ($action == 'swapstatut') + elseif ($action == 'swapstatut') { $result=$object->swapContactStatus(GETPOST('ligne')); } // Efface un contact - else if ($action == 'deletecontact') + elseif ($action == 'deletecontact') { $result = $object->delete_contact(GETPOST('lineid')); diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 014e65d2e27..0e975b18e9e 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -555,7 +555,7 @@ class Contracts extends DolibarrApi * "notrigger": 0 * } */ - function validate($id, $notrigger=0) + function validate($id, $notrigger = 0) { if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); @@ -601,7 +601,7 @@ class Contracts extends DolibarrApi * "notrigger": 0 * } */ - function close($id, $notrigger=0) + function close($id, $notrigger = 0) { if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 525c20bf91e..bc783d2d8d3 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -261,7 +261,7 @@ class Contrat extends CommonObject * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ - function active_line($user, $line_id, $date, $date_end='', $comment='') + function active_line($user, $line_id, $date, $date_end = '', $comment = '') { // phpcs:enable $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); @@ -284,7 +284,7 @@ class Contrat extends CommonObject * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ - function close_line($user, $line_id, $date_end, $comment='') + function close_line($user, $line_id, $date_end, $comment = '') { // phpcs:enable $result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); @@ -307,7 +307,7 @@ class Contrat extends CommonObject * @return int <0 if KO, >0 if OK * @see closeAll */ - function activateAll($user, $date_start='', $notrigger=0, $comment='') + function activateAll($user, $date_start = '', $notrigger = 0, $comment = '') { if (empty($date_start)) $date_start = dol_now(); @@ -363,7 +363,7 @@ class Contrat extends CommonObject * @return int <0 if KO, >0 if OK * @see activateAll */ - function closeAll(User $user, $notrigger=0, $comment='') + function closeAll(User $user, $notrigger = 0, $comment = '') { $this->db->begin(); @@ -419,7 +419,7 @@ class Contrat extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - function validate(User $user, $force_number='', $notrigger=0) + function validate(User $user, $force_number = '', $notrigger = 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; global $langs, $conf; @@ -445,7 +445,7 @@ class Contrat extends CommonObject { $num = $force_number; } - else if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life + elseif (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life { $num = $this->getNextNumRef($this->thirdparty); } @@ -547,7 +547,7 @@ class Contrat extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0=execute triggers * @return int <0 if KO, >0 if OK */ - function reopen($user, $notrigger=0) + function reopen($user, $notrigger = 0) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; global $langs, $conf; @@ -614,7 +614,7 @@ class Contrat extends CommonObject * @param string $ref_supplier Supplier ref * @return int <0 if KO, 0 if not found, Id of contract if OK */ - function fetch($id, $ref='', $ref_customer='', $ref_supplier='') + function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '') { $sql = "SELECT rowid, statut, ref, fk_soc, mise_en_service as datemise,"; $sql.= " ref_supplier, ref_customer,"; @@ -1242,7 +1242,7 @@ class Contrat extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user, $notrigger=0) + function update($user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -1360,7 +1360,7 @@ class Contrat extends CommonObject * @param string $rang Position * @return int <0 if KO, >0 if OK */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0,$array_options=0, $fk_unit = null, $rang=0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null, $rang = 0) { global $user, $langs, $conf, $mysoc; $error=0; @@ -1570,7 +1570,7 @@ class Contrat extends CommonObject * @param string $fk_unit Code of the unit to use. Null to use the default one * @return int < 0 si erreur, > 0 si ok */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0,$array_options=0, $fk_unit = null) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx = 0.0, $localtax2tx = 0.0, $date_debut_reel = '', $date_fin_reel = '', $price_base_type = 'HT', $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null) { global $user, $conf, $langs, $mysoc; @@ -1840,7 +1840,7 @@ class Contrat extends CommonObject * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @return string Label */ - function LibStatut($statut,$mode) + function LibStatut($statut, $mode) { // phpcs:enable global $langs; @@ -1909,7 +1909,7 @@ class Contrat 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, $notooltip=0, $save_lastsearch_value=-1) + function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1) { global $conf, $langs, $user; @@ -2022,7 +2022,7 @@ class Contrat extends CommonObject * @param int $statut Status of lines to get * @return array Array of line's rowid */ - function array_detail($statut=-1) + function array_detail($statut = -1) { // phpcs:enable $tab=array(); @@ -2059,7 +2059,7 @@ class Contrat extends CommonObject * @param string $option 'all' or 'others' * @return array Array of contracts id */ - function getListOfContracts($option='all') + function getListOfContracts($option = 'all') { $tab=array(); @@ -2100,7 +2100,7 @@ class Contrat extends CommonObject * @param string $mode "inactive" pour services a activer, "expired" pour services expires * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - function load_board($user,$mode) + function load_board($user, $mode) { // phpcs:enable global $conf, $langs; @@ -2336,7 +2336,7 @@ class Contrat 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; @@ -2382,7 +2382,7 @@ class Contrat extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int New id of clone */ - function createFromClone($socid = 0, $notrigger=0) + function createFromClone($socid = 0, $notrigger = 0) { global $db, $user, $langs, $conf, $hookmanager, $extrafields; @@ -2658,7 +2658,7 @@ class ContratLigne extends CommonObjectLine * @param string $moreatt More attribute * @return string Libelle */ - static function LibStatut($statut,$mode,$expired=-1,$moreatt='') + static function LibStatut($statut, $mode, $expired = -1, $moreatt = '') { // phpcs:enable global $langs; @@ -2720,7 +2720,7 @@ class ContratLigne extends CommonObjectLine * @param int $maxlength Max length * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$maxlength=0) + function getNomUrl($withpicto = 0, $maxlength = 0) { global $langs; @@ -2747,7 +2747,7 @@ class ContratLigne extends CommonObjectLine * @param string $ref Ref of contract * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { // Check parameters @@ -2879,7 +2879,7 @@ class ContratLigne extends CommonObjectLine * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user, $notrigger=0) + function update($user, $notrigger = 0) { global $conf, $langs, $mysoc; @@ -3257,7 +3257,7 @@ class ContratLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - function close_line($user, $date_end, $comment = '', $notrigger=0) + function close_line($user, $date_end, $comment = '', $notrigger = 0) { // phpcs:enable global $langs, $conf; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 9c87397776a..24dccaae25d 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -240,13 +240,13 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc. if ($month > 0) { if ($year > 0 && empty($day)) - $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'"; - else if ($year > 0 && ! empty($day)) - $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; + $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year, $month, false))."' AND '".$db->idate(dol_get_last_day($year, $month, false))."'"; + elseif ($year > 0 && ! empty($day)) + $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; else - $sql.= " AND date_format(c.date_contrat, '%m') = '".$month."'"; + $sql.= " AND date_format(c.date_contrat, '%m') = '".$month."'"; } -else if ($year > 0) +elseif ($year > 0) { $sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'"; } @@ -711,7 +711,7 @@ while ($i < min($num, $limit)) print $nbofsalesrepresentative; print ''; } - else if ($nbofsalesrepresentative > 0) + elseif ($nbofsalesrepresentative > 0) { $userstatic=new User($db); $j=0; diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index fff5cf6fe82..686133931ae 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -58,9 +58,10 @@ if ($action == 'builddoc' && $permissioncreate) // Special case to force bank account //if (property_exists($object, 'fk_bank')) //{ - if (GETPOST('fk_bank', 'int')) { // this field may come from an external module + if (GETPOST('fk_bank', 'int')) { + // this field may come from an external module $object->fk_bank = GETPOST('fk_bank', 'int'); - } else if (! empty($object->fk_account)) { + } elseif (! empty($object->fk_account)) { $object->fk_bank = $object->fk_account; } //} diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 5f5a91130a0..af2093481c3 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -121,17 +121,17 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $thirdparty=$object->thirdparty; $sendtosocid=$thirdparty->id; } - else if ($object->element == 'member' || $object->element == 'user') + elseif ($object->element == 'member' || $object->element == 'user') { $thirdparty=$object; if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; } - else if ($object->element == 'societe') + elseif ($object->element == 'societe') { $thirdparty=$object; if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id; } - else if ($object->element == 'contact') + elseif ($object->element == 'contact') { $contact=$object; if ($contact->id > 0) $sendtosocid=$contact->fetch_thirdparty()->id; diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 041a9dd9322..21bd34468e0 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -32,7 +32,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel { if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($object->id)) $object->fetch($id); // Fetch may not be already done - + $result_update=$object->update_note(dol_html_entity_decode(GETPOST('note_public', 'none'), ENT_QUOTES), '_public'); if ($result_update < 0) setEventMessages($object->error, $object->errors, 'errors'); @@ -55,15 +55,13 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); - + if ($result < 0) dol_print_error($db, $result); } } -} -// Set public note -else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) -{ - if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); +} elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) { + // Set public note + if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($object->id)) $object->fetch($id); // Fetch may not be already done $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 521717f97c5..7848257073a 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -185,33 +185,33 @@ if ($type == 'directory') // Auto area for suppliers invoices if ($module == 'company') $upload_dir = $conf->societe->dir_output; // Auto area for suppliers invoices - else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output; + elseif ($module == 'invoice') $upload_dir = $conf->facture->dir_output; // Auto area for suppliers invoices - else if ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output; + elseif ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output; // Auto area for customers proposal - else if ($module == 'propal') $upload_dir = $conf->propal->dir_output; + elseif ($module == 'propal') $upload_dir = $conf->propal->dir_output; // Auto area for suppliers proposal - else if ($module == 'supplier_proposal') $upload_dir = $conf->supplier_proposal->dir_output; + elseif ($module == 'supplier_proposal') $upload_dir = $conf->supplier_proposal->dir_output; // Auto area for customers orders - else if ($module == 'order') $upload_dir = $conf->commande->dir_output; + elseif ($module == 'order') $upload_dir = $conf->commande->dir_output; // Auto area for suppliers orders - else if ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output; + elseif ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output; // Auto area for suppliers invoices - else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output; + elseif ($module == 'contract') $upload_dir = $conf->contrat->dir_output; // Auto area for products - else if ($module == 'product') $upload_dir = $conf->product->dir_output; + elseif ($module == 'product') $upload_dir = $conf->product->dir_output; // Auto area for suppliers invoices - else if ($module == 'tax') $upload_dir = $conf->tax->dir_output; + elseif ($module == 'tax') $upload_dir = $conf->tax->dir_output; // Auto area for projects - else if ($module == 'project') $upload_dir = $conf->projet->dir_output; + elseif ($module == 'project') $upload_dir = $conf->projet->dir_output; // Auto area for interventions - else if ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output; + elseif ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output; // Auto area for users - else if ($module == 'user') $upload_dir = $conf->user->dir_output; + elseif ($module == 'user') $upload_dir = $conf->user->dir_output; // Auto area for expense report - else if ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output; + elseif ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output; // Auto area for holiday - else if ($module == 'holiday') $upload_dir = $conf->holiday->dir_output; + elseif ($module == 'holiday') $upload_dir = $conf->holiday->dir_output; // Automatic list if (in_array($module, $automodules)) @@ -280,7 +280,7 @@ if ($type == 'directory') $textifempty = $langs->trans('NoFileFound'); } - else if ($section === '0') + elseif ($section === '0') { if ($module == 'ecm') $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; else $textifempty = $langs->trans('NoFileFound'); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 1ea6fa482ab..93a7bb79a8d 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -337,7 +337,7 @@ if ((! isset($mode) || $mode != 'noajax') && is_object($db)) $db->close(); * @param int $depth Depth * @return void */ -function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth=0) +function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, $modulepart, $websitekey, $pageid, $preopened, $fullpathpreopened, $depth = 0) { global $conf, $db, $langs, $form; global $dolibarr_main_data_root; diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index 6c43edbcb90..b6fe582fcff 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -58,7 +58,7 @@ if (! empty($action) && ! empty($name)) { dolibarr_set_const($db, $name, $value, 'chaine', 0, '', $entity); } - else if ($action == 'del') + elseif ($action == 'del') { dolibarr_del_const($db, $name, $entity); } diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index 9a52c46479b..63c80c46170 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.php @@ -52,18 +52,18 @@ if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type)) // For compatibility if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; } - else if ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; } - else if ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; } - else if ($element == 'contract') { $classpath = $subelement = 'contrat'; } - else if ($element == 'shipping') { $classpath = $subelement = 'expedition'; } - else if ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; } - else if ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; } - else if ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; } + elseif ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; } + elseif ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; } + elseif ($element == 'contract') { $classpath = $subelement = 'contrat'; } + elseif ($element == 'shipping') { $classpath = $subelement = 'expedition'; } + elseif ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; } + elseif ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; } + elseif ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; } dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php'); if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; } - else if ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; } + elseif ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; } else $classname = ucfirst($subelement); $object = new $classname($db); diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index f43c7f7ba05..ac3295ae5e7 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -56,14 +56,14 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ } if ($element == 'propal') $element = 'propale'; - else if ($element == 'fichinter') $element = 'ficheinter'; - else if ($element == 'product') $element = 'produit'; - else if ($element == 'member') $element = 'adherent'; - else if ($element == 'order_supplier') { + elseif ($element == 'fichinter') $element = 'ficheinter'; + elseif ($element == 'product') $element = 'produit'; + elseif ($element == 'member') $element = 'adherent'; + elseif ($element == 'order_supplier') { $element = 'fournisseur'; $subelement = 'commande'; } - else if ($element == 'invoice_supplier') { + elseif ($element == 'invoice_supplier') { $element = 'fournisseur'; $subelement = 'facture'; } @@ -84,7 +84,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ $ret = $form->$methodname(); if ($ret > 0) echo json_encode($form->$cachename); } - else if (! empty($ext_element)) + elseif (! empty($ext_element)) { $module = $subelement = $ext_element; if (preg_match('/^([^_]+)_([^_]+)/i', $ext_element, $regs)) diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index 139a778cc0b..2ac3bbba0c3 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -53,7 +53,7 @@ if (! empty($output) && isset($amount) && isset($tva_tx)) $return['price_ht'] = $amount; $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : ''); } - else if ($output == 'price_ht') { + elseif ($output == 'price_ht') { $price = price2num($amount / (1 + ($tva_tx/100)), 'MU'); $return['price_ht'] = (isset($price) && $price != '' ? price($price) : ''); diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index cd864c16c3b..b5f07ee10fa 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -79,14 +79,14 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ } if ($element == 'propal') $newelement = 'propale'; - else if ($element == 'fichinter') $newelement = 'ficheinter'; - else if ($element == 'product') $newelement = 'produit'; - else if ($element == 'member') $newelement = 'adherent'; - else if ($element == 'order_supplier') { + elseif ($element == 'fichinter') $newelement = 'ficheinter'; + elseif ($element == 'product') $newelement = 'produit'; + elseif ($element == 'member') $newelement = 'adherent'; + elseif ($element == 'order_supplier') { $newelement = 'fournisseur'; $subelement = 'commande'; } - else if ($element == 'invoice_supplier') { + elseif ($element == 'invoice_supplier') { $newelement = 'fournisseur'; $subelement = 'facture'; } @@ -131,13 +131,13 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ $return['error'] = $langs->trans('ErrorBadValue'); } } - else if ($type == 'datepicker') + elseif ($type == 'datepicker') { $timestamp = GETPOST('timestamp', 'int', 2); $format = 'date'; $newvalue = ($timestamp / 1000); } - else if ($type == 'select') + elseif ($type == 'select') { $loadmethodname = 'load_cache_'.$loadmethod; $loadcachename = 'cache_'.$loadmethod; @@ -211,7 +211,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ if ($ret > 0) { if ($type == 'numeric') $value = price($newvalue); - else if ($type == 'textarea') $value = dol_nl2br($newvalue); + elseif ($type == 'textarea') $value = dol_nl2br($newvalue); $return['value'] = $value; $return['view'] = (! empty($view) ? $view : $value); diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 735d6b11888..dd4f46bcd1c 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -54,7 +54,7 @@ class box_actions extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $user; @@ -69,7 +69,7 @@ class box_actions extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -189,7 +189,7 @@ class box_actions extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { global $langs, $conf; $out = parent::showBox($this->info_box_head, $this->info_box_contents); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index d1303289d8d..0b51d6bda38 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -53,7 +53,7 @@ class box_activity extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $conf, $user; @@ -74,7 +74,7 @@ class box_activity extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -457,7 +457,7 @@ class box_activity extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index edd32d4a579..e1b67fb31b5 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -50,7 +50,7 @@ class box_bookmarks extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -65,7 +65,7 @@ class box_bookmarks extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -157,7 +157,7 @@ class box_bookmarks extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index ed5f20e04d5..c1718d0651f 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -54,7 +54,7 @@ class box_clients extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -72,7 +72,7 @@ class box_clients extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -173,7 +173,7 @@ class box_clients extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index f4343548d2a..0825605298d 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -54,7 +54,7 @@ class box_commandes extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -69,7 +69,7 @@ class box_commandes extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -198,7 +198,7 @@ class box_commandes extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 64338035453..a1234ad8c86 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -56,7 +56,7 @@ class box_comptes extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -75,7 +75,7 @@ class box_comptes extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -184,7 +184,7 @@ class box_comptes extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 693720faad4..63812fc6808 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -56,7 +56,7 @@ class box_contacts extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -71,7 +71,7 @@ class box_contacts extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -185,7 +185,7 @@ class box_contacts extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 6a0cb7eef67..0491a7066ef 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -53,7 +53,7 @@ class box_contracts extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_contracts extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -189,7 +189,7 @@ class box_contracts extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 4f8c76fd360..f37461d0573 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -56,7 +56,7 @@ class box_external_rss extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { $this->db=$db; $this->paramdef=$param; @@ -69,7 +69,7 @@ class box_external_rss extends ModeleBoxes * @param int $cachedelay Delay we accept for cache file * @return void */ - function loadBox($max=5, $cachedelay=3600) + function loadBox($max = 5, $cachedelay = 3600) { global $user, $langs, $conf; $langs->load("boxes"); @@ -195,7 +195,7 @@ class box_external_rss extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 842c4596be0..9a344dec2fc 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -52,7 +52,7 @@ class box_factures extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -67,7 +67,7 @@ class box_factures extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -209,7 +209,7 @@ class box_factures extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index df369067452..81f21130a08 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -53,7 +53,7 @@ class box_factures_fourn extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_factures_fourn extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -214,7 +214,7 @@ class box_factures_fourn extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index c80c8546ebb..7adb8ed3227 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -52,7 +52,7 @@ class box_factures_fourn_imp extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -67,7 +67,7 @@ class box_factures_fourn_imp extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -201,7 +201,7 @@ class box_factures_fourn_imp extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 75069eba0a5..168d10ad612 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -55,7 +55,7 @@ class box_factures_imp extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -70,7 +70,7 @@ class box_factures_imp extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -207,7 +207,7 @@ class box_factures_imp extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 02795d87c53..13ded024b2e 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -53,7 +53,7 @@ class box_ficheinter extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_ficheinter extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=10) + function loadBox($max = 10) { global $user, $langs, $db, $conf; @@ -166,7 +166,7 @@ class box_ficheinter extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 89872249fc4..d9d250956c4 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -53,7 +53,7 @@ class box_fournisseurs extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -68,7 +68,7 @@ class box_fournisseurs extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; $langs->load("boxes"); @@ -160,7 +160,7 @@ class box_fournisseurs extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 98b21952d07..6e091fadd82 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -55,7 +55,7 @@ class box_goodcustomers extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -74,7 +74,7 @@ class box_goodcustomers extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -169,7 +169,7 @@ class box_goodcustomers extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 0c434b413f9..8ca14970503 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -48,7 +48,7 @@ class box_graph_invoices_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_invoices_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -275,7 +275,7 @@ class box_graph_invoices_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index fc8d5ca7193..c596b0563cf 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -48,7 +48,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -274,7 +274,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index f8891d96478..4bf7ddccb5c 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -48,7 +48,7 @@ class box_graph_orders_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_orders_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -273,7 +273,7 @@ class box_graph_orders_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 1b0d34b9407..5cf836de5c7 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -48,7 +48,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -272,7 +272,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 72a5066d7fa..868d25de0c7 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -51,7 +51,7 @@ class box_graph_product_distribution extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user, $conf; @@ -70,7 +70,7 @@ class box_graph_product_distribution extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -368,17 +368,17 @@ class box_graph_product_distribution extends ModeleBoxes if ($nbofgraph == 1) { if ($showinvoicenb) $stringtoshow.=$px1->show(); - else if ($showpropalnb) $stringtoshow.=$px2->show(); + elseif ($showpropalnb) $stringtoshow.=$px2->show(); else $stringtoshow.=$px3->show(); } if ($nbofgraph == 2) { $stringtoshow.='
'; if ($showinvoicenb) $stringtoshow.=$px1->show(); - else if ($showpropalnb) $stringtoshow.=$px2->show(); + elseif ($showpropalnb) $stringtoshow.=$px2->show(); $stringtoshow.='
'; if ($showordernb) $stringtoshow.=$px3->show(); - else if ($showpropalnb) $stringtoshow.=$px2->show(); + elseif ($showpropalnb) $stringtoshow.=$px2->show(); $stringtoshow.='
'; } if ($nbofgraph == 3) @@ -412,7 +412,7 @@ class box_graph_product_distribution extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index fc1f2d6b4f2..e24f58a1a01 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -48,7 +48,7 @@ class box_graph_propales_permonth extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -63,7 +63,7 @@ class box_graph_propales_permonth extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -276,7 +276,7 @@ class box_graph_propales_permonth extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index 9ce7dd91605..34281d13c82 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -187,7 +187,7 @@ class box_last_modified_ticket extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index a824a707168..a1a52c3070d 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -187,7 +187,7 @@ class box_last_ticket extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index 68b0ee91c6a..0536a2c34a0 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -53,7 +53,7 @@ class box_lastlogin extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $conf; @@ -66,7 +66,7 @@ class box_lastlogin extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -109,7 +109,7 @@ class box_lastlogin extends ModeleBoxes * @param int $nooutput No print, only return string * @return void */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 8b0e50c567f..d621a3557a3 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -55,7 +55,7 @@ class box_members extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -74,7 +74,7 @@ class box_members extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; $langs->load("boxes"); @@ -178,7 +178,7 @@ class box_members extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index e68f37fd7e3..4b235ec63c0 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -55,7 +55,7 @@ class box_produits extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $conf, $user; @@ -73,7 +73,7 @@ class box_produits extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf, $hookmanager; @@ -226,7 +226,7 @@ class box_produits extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index a0b4fbe855a..97c86ceb4dd 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -57,7 +57,7 @@ class box_produits_alerte_stock extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf,$user; @@ -75,7 +75,7 @@ class box_produits_alerte_stock extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf, $hookmanager; @@ -238,7 +238,7 @@ class box_produits_alerte_stock extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 0db14f63c9b..dcf90128379 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -51,7 +51,7 @@ class box_project extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $user, $langs; @@ -70,7 +70,7 @@ class box_project extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -195,7 +195,7 @@ class box_project extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 2c8eb2fb37a..25be6d6dcef 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -54,7 +54,7 @@ class box_propales extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -69,7 +69,7 @@ class box_propales extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -188,7 +188,7 @@ class box_propales extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 3ff646e38c1..bf00c2bdc26 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -56,7 +56,7 @@ class box_prospect extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $conf, $user; @@ -74,7 +74,7 @@ class box_prospect extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -176,7 +176,7 @@ class box_prospect extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 4e321a6a319..be1f33a86ab 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -54,7 +54,7 @@ class box_services_contracts extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -69,7 +69,7 @@ class box_services_contracts extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -241,7 +241,7 @@ class box_services_contracts extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 1e074050930..c04486bef33 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -52,7 +52,7 @@ class box_services_expired extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -67,7 +67,7 @@ class box_services_expired extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $user, $langs, $db, $conf; @@ -185,7 +185,7 @@ class box_services_expired extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index ff456ccba47..5c62ae7855a 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -52,7 +52,7 @@ class box_supplier_orders extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param) + function __construct($db, $param) { global $user; @@ -184,7 +184,7 @@ class box_supplier_orders extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index ac4d274510a..ace1744d9e1 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -54,7 +54,7 @@ class box_task extends ModeleBoxes * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { global $user, $langs; @@ -73,7 +73,7 @@ class box_task extends ModeleBoxes * @param int $max Maximum number of records to load * @return void */ - function loadBox($max=5) + function loadBox($max = 5) { global $conf, $user, $langs, $db; @@ -152,7 +152,7 @@ class box_task extends ModeleBoxes * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); } diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 6f80b5bc8af..aaacc5be20d 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -115,7 +115,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box * @param DoliDB $db Database handler * @param string $param More parameters */ - function __construct($db,$param='') + function __construct($db, $param = '') { $this->db=$db; } @@ -204,7 +204,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box * @param int $nooutput No print, only return string * @return string */ - function showBox($head = null, $contents = null, $nooutput=0) + function showBox($head = null, $contents = null, $nooutput = 0) { global $langs, $user, $conf; @@ -385,7 +385,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box * @param array $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. * @return array Array list of widget */ - static function getWidgetsList($forcedirwidget=null) + static function getWidgetsList($forcedirwidget = null) { global $conf, $langs, $db; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 140b3008a22..c46c40999f5 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -119,7 +119,7 @@ class CMailFile * @param string $sendcontext 'standard', 'emailing', ... (used to define with sending mode and parameters to use) * @param string $replyto Reply-to email (will be set to same value than From by default if not provided) */ - function __construct($subject, $to, $from, $msg, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=0, $errors_to='', $css='', $trackid='', $moreinheader='', $sendcontext='standard', $replyto='') + function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '') { global $conf, $dolibarr_main_data_root; @@ -294,7 +294,7 @@ class CMailFile $this->message.= $text_body . $files_encoded; $this->message.= "--" . $this->mixed_boundary . "--" . $this->eol; } - else if ($this->sendmode == 'smtps') + elseif ($this->sendmode == 'smtps') { // Use SMTPS library // ------------------------------------------ @@ -349,7 +349,7 @@ class CMailFile $this->smtps=$smtps; } - else if ($this->sendmode == 'swiftmailer') + elseif ($this->sendmode == 'swiftmailer') { // Use Swift Mailer library // ------------------------------------------ @@ -670,7 +670,7 @@ class CMailFile if (! empty($conf->global->$keyforsmtpserver)) ini_restore('SMTP'); if (! empty($conf->global->$keyforsmtpport)) ini_restore('smtp_port'); } - else if ($this->sendmode == 'smtps') + elseif ($this->sendmode == 'smtps') { if (! is_object($this->smtps)) { @@ -750,7 +750,7 @@ class CMailFile } } } - else if ($this->sendmode == 'swiftmailer') + elseif ($this->sendmode == 'swiftmailer') { // Use Swift Mailer library // ------------------------------------------ @@ -1178,7 +1178,7 @@ class CMailFile * @param array $mimefilename_list Tableau * @return string Chaine fichiers encodes */ - function write_files($filename_list,$mimetype_list,$mimefilename_list) + function write_files($filename_list, $mimetype_list, $mimefilename_list) { // phpcs:enable $out = ''; @@ -1259,7 +1259,7 @@ class CMailFile * @param int $port Example: 25, 465 * @return int Socket id if ok, 0 if KO */ - function check_server_port($host,$port) + function check_server_port($host, $port) { // phpcs:enable global $conf; @@ -1457,7 +1457,7 @@ class CMailFile * If format 3: '' or '"John Doe" ' or '"=?UTF-8?B?Sm9obiBEb2U=?=" ' * If format 4: 'John Doe' or 'john@doe.com' if no label exists */ - static function getValidAddress($address,$format,$encode=0,$maxnumberofemail=0) + static function getValidAddress($address, $format, $encode = 0, $maxnumberofemail = 0) { global $conf; diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 43c322d30aa..8bd70d8e063 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -59,7 +59,7 @@ class CSMSFile * @param int $priority Priority * @param int $class Class */ - function __construct($to,$from,$msg,$deliveryreceipt=0,$deferred=0,$priority=3,$class=1) + function __construct($to, $from, $msg, $deliveryreceipt = 0, $deferred = 0, $priority = 3, $class = 1) { global $conf; @@ -139,7 +139,7 @@ class CSMSFile if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res); } } - else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module' + elseif (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module' { $tmp=explode('@', $conf->global->MAIN_SMS_SENDMODE); $classfile=$tmp[0]; $module=(empty($tmp[1])?$tmp[0]:$tmp[1]); diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index fadf3e4621b..0250a138fb8 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -60,7 +60,7 @@ class Canvas * @param DoliDB $db Database handler * @param string $actiontype Action type ('create', 'view', 'edit', 'list') */ - function __construct($db, $actiontype='view') + function __construct($db, $actiontype = 'view') { $this->db = $db; @@ -142,7 +142,7 @@ class Canvas * @param string $ref Object ref (if id not provided) * @return void */ - function assign_values(&$action='view', $id=0, $ref='') + function assign_values(&$action = 'view', $id = 0, $ref = '') { // phpcs:enable if (method_exists($this->control, 'assign_values')) $this->control->assign_values($action, $id, $ref); @@ -204,7 +204,7 @@ class Canvas * @return mixed Return return code of doActions of canvas * @see http://wiki.dolibarr.org/index.php/Canvas_development */ - function doActions(&$action='view', $id=0) + function doActions(&$action = 'view', $id = 0) { if (method_exists($this->control, 'doActions')) { diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index f07916a7511..e93af622a27 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -86,7 +86,7 @@ class Ccountry // 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; @@ -165,7 +165,7 @@ class Ccountry // extends CommonObject * @param string $code Code * @return int >0 if OK, 0 if not found, <0 if KO */ - function fetch($id,$code='') + function fetch($id, $code = '') { global $langs; $sql = "SELECT"; @@ -214,7 +214,7 @@ class Ccountry // 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; @@ -285,7 +285,7 @@ class Ccountry // 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; diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 6f252fe3c01..6d00b4b8d8d 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -82,7 +82,7 @@ class Comment 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; @@ -155,7 +155,7 @@ class Comment extends CommonObject * @param int $ref ref object * @return int <0 if KO, 0 if not found, >0 if OK */ - function fetch($id, $ref='') + function fetch($id, $ref = '') { global $langs; @@ -213,7 +213,7 @@ class Comment extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <=0 if KO, >0 if OK */ - function update(User $user, $notrigger=0) + function update(User $user, $notrigger = 0) { global $conf, $langs; $error=0; @@ -278,7 +278,7 @@ class Comment 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; require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5e00627383f..1d6789d4e38 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -69,7 +69,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - function get_substitutionarray_user($user,$outputlangs) + function get_substitutionarray_user($user, $outputlangs) { // phpcs:enable global $conf; @@ -107,7 +107,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - function get_substitutionarray_mysoc($mysoc,$outputlangs) + function get_substitutionarray_mysoc($mysoc, $outputlangs) { // phpcs:enable global $conf; @@ -167,7 +167,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - function get_substitutionarray_thirdparty($object,$outputlangs) + function get_substitutionarray_thirdparty($object, $outputlangs) { // phpcs:enable global $conf; @@ -230,7 +230,7 @@ abstract class CommonDocGenerator { $object->array_options['options_'.$key] = price($object->array_options['options_'.$key], 0, $outputlangs, 0, 0, -1, $conf->currency); } - else if($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox') + elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox') { $object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]]; } @@ -361,7 +361,7 @@ abstract class CommonDocGenerator * @param string $array_key Name of the key for return array * @return array Array of substitution */ - function get_substitutionarray_object($object,$outputlangs,$array_key='object') + function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { // phpcs:enable global $conf; @@ -604,7 +604,7 @@ abstract class CommonDocGenerator * @param array $array_key Name of the key for return array * @return array Array of substitution */ - function get_substitutionarray_shipment($object,$outputlangs,$array_key='object') + function get_substitutionarray_shipment($object, $outputlangs, $array_key = 'object') { // phpcs:enable global $conf; @@ -716,7 +716,7 @@ abstract class CommonDocGenerator * @param boolean $recursive Want to fetch child array or child object * @return array Array of substitution key->code */ - function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) + function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = true) { // phpcs:enable $array_other = array(); @@ -747,7 +747,7 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ - function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs) + function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs) { // phpcs:enable global $conf; @@ -760,11 +760,11 @@ abstract class CommonDocGenerator //Add value to store price with currency $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency'])); } - else if($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox') + elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox') { $object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]]; } - else if($extrafields->attribute_type[$key] == 'date') + elseif($extrafields->attribute_type[$key] == 'date') { if (strlen($object->array_options['options_'.$key])>0) { @@ -782,7 +782,7 @@ abstract class CommonDocGenerator $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale'])); $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc'])); } - else if($extrafields->attribute_type[$key] == 'datetime') + elseif($extrafields->attribute_type[$key] == 'datetime') { $datetime = $object->array_options['options_'.$key]; $object->array_options['options_'.$key] = ($datetime!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key], 'dayhour'):''); // using company output language @@ -791,7 +791,7 @@ abstract class CommonDocGenerator $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale'])); $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc'])); } - else if($extrafields->attribute_type[$key] == 'link') + elseif($extrafields->attribute_type[$key] == 'link') { $id = $object->array_options['options_'.$key]; if ($id != "") @@ -834,7 +834,7 @@ abstract class CommonDocGenerator * @param int $hidebottom Hide bottom * @return void */ - function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) + function printRect($pdf, $x, $y, $l, $h, $hidetop = 0, $hidebottom = 0) { if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y); $pdf->line($x+$l, $y, $x+$l, $y+$h); @@ -870,7 +870,7 @@ abstract class CommonDocGenerator * @param int $hideref Do not show ref * @return null */ - function prepareArrayColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0) + function prepareArrayColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { global $conf; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index d319e150d33..7e8c9002042 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -97,7 +97,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return double Remain of amount to pay */ - function getRemainToPay($multicurrency=0) + function getRemainToPay($multicurrency = 0) { $alreadypaid=0; $alreadypaid+=$this->getSommePaiement($multicurrency); @@ -112,7 +112,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return int Amount of payment already done, <0 if KO */ - function getSommePaiement($multicurrency=0) + function getSommePaiement($multicurrency = 0) { $table='paiement_facture'; $field='fk_facture'; @@ -149,7 +149,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of deposits amount otherwise */ - function getSumDepositsUsed($multicurrency=0) + function getSumDepositsUsed($multicurrency = 0) { if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { @@ -178,7 +178,7 @@ abstract class CommonInvoice extends CommonObject * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and deposits amount otherwise */ - function getSumCreditNotesUsed($multicurrency=0) + function getSumCreditNotesUsed($multicurrency = 0) { require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; @@ -233,7 +233,7 @@ abstract class CommonInvoice extends CommonObject * @param string $option filtre sur statut ('', 'validated', ...) * @return int <0 si KO, 0 si aucune facture ne remplace, id facture sinon */ - function getIdReplacingInvoice($option='') + function getIdReplacingInvoice($option = '') { $sql = 'SELECT rowid'; $sql.= ' FROM '.MAIN_DB_PREFIX.$this->table_element; @@ -274,7 +274,7 @@ abstract class CommonInvoice extends CommonObject * @param string $filtertype 1 to filter on type of payment == 'PRE' * @return array Array with list of payments */ - function getListOfPayments($filtertype='') + function getListOfPayments($filtertype = '') { $retarray=array(); @@ -447,7 +447,7 @@ abstract class CommonInvoice extends CommonObject * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label of status */ - function getLibStatut($mode=0, $alreadypaid=-1) + function getLibStatut($mode = 0, $alreadypaid = -1) { return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type); } @@ -463,7 +463,7 @@ abstract class CommonInvoice extends CommonObject * @param int $type Type invoice * @return string Label of status */ - function LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=0) + function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = 0) { // phpcs:enable global $langs; @@ -593,7 +593,7 @@ abstract class CommonInvoice extends CommonObject * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @return date Date limite de reglement si ok, <0 si ko */ - function calculate_date_lim_reglement($cond_reglement=0) + function calculate_date_lim_reglement($cond_reglement = 0) { // phpcs:enable if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 45ab0eee185..98d676307f8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -417,7 +417,7 @@ abstract class CommonObject * @param string $ref_ext Ref ext of object to check * @return int <0 if KO, 0 if OK but not found, >0 if OK and exists */ - static function isExistingObject($element, $id, $ref='', $ref_ext='') + static function isExistingObject($element, $id, $ref = '', $ref_ext = '') { global $db,$conf; @@ -426,8 +426,8 @@ abstract class CommonObject $sql.= " WHERE entity IN (".getEntity($element).")" ; if ($id > 0) $sql.= " AND rowid = ".$db->escape($id); - else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; - else if ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'"; + elseif ($ref) $sql.= " AND ref = '".$db->escape($ref)."'"; + elseif ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'"; else { $error='ErrorWrongParameters'; dol_print_error(get_class()."::isExistingObject ".$error, LOG_ERR); @@ -505,7 +505,7 @@ abstract class CommonObject * @param int $maxlen Maximum length * @return string String with full name */ - function getFullName($langs,$option=0,$nameorder=-1,$maxlen=0) + function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0) { //print "lastname=".$this->lastname." name=".$this->name." nom=".$this->nom."
\n"; $lastname=$this->lastname; @@ -532,7 +532,7 @@ abstract class CommonObject * @param int $withregion 1=Add region into address string * @return string Full address string */ - function getFullAddress($withcountry=0, $sep="\n", $withregion=0) + function getFullAddress($withcountry = 0, $sep = "\n", $withregion = 0) { if ($withcountry && $this->country_id && (empty($this->country_code) || empty($this->country))) { @@ -682,7 +682,7 @@ abstract class CommonObject * @param int $relativelink 0=Return full external link, 1=Return link relative to root of file * @return string Link or empty string if there is no download link */ - function getLastMainDocLink($modulepart, $initsharekey=0, $relativelink=0) + function getLastMainDocLink($modulepart, $initsharekey = 0, $relativelink = 0) { global $user, $dolibarr_main_url_root; @@ -779,7 +779,7 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int <0 if KO, >0 if OK */ - function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0) + function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0) { // phpcs:enable global $user,$langs; @@ -901,7 +901,7 @@ abstract class CommonObject * @param string $source Nature of contact ('internal' or 'external') * @return int >0 if OK, <0 if KO */ - function copy_linked_contact($objFrom, $source='internal') + function copy_linked_contact($objFrom, $source = 'internal') { // phpcs:enable $contacts = $objFrom->liste_contact(-1, $source); @@ -926,7 +926,7 @@ abstract class CommonObject * @param int $fk_socpeople Id of soc_people to update (not modified if 0) * @return int <0 if KO, >= 0 if OK */ - function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) + function update_contact($rowid, $statut, $type_contact_id = 0, $fk_socpeople = 0) { // phpcs:enable // Insert into database @@ -955,7 +955,7 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - function delete_contact($rowid, $notrigger=0) + function delete_contact($rowid, $notrigger = 0) { // phpcs:enable global $user; @@ -994,7 +994,7 @@ abstract class CommonObject * @param string $code Type of contact (code or id) * @return int >0 if OK, <0 if KO */ - function delete_linked_contact($source='',$code='') + function delete_linked_contact($source = '', $code = '') { // phpcs:enable $temp = array(); @@ -1033,7 +1033,7 @@ abstract class CommonObject * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @return array|int Array of contacts, -1 if error */ - function liste_contact($statut=-1,$source='external',$list=0,$code='') + function liste_contact($statut = -1, $source = 'external', $list = 0, $code = '') { // phpcs:enable global $langs; @@ -1143,7 +1143,7 @@ abstract class CommonObject * @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE') * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) */ - function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='') + function liste_type_contact($source = 'internal', $order = 'position', $option = 0, $activeonly = 0, $code = '') { // phpcs:enable global $langs; @@ -1197,7 +1197,7 @@ abstract class CommonObject * @param int $status limited to a certain status * @return array List of id for such contacts */ - function getIdContact($source,$code,$status=0) + function getIdContact($source, $code, $status = 0) { global $conf; @@ -1207,7 +1207,7 @@ abstract class CommonObject if($this->element=='shipping' && $this->origin_id != 0) { $id=$this->origin_id; $element='commande'; - } else if($this->element=='reception' && $this->origin_id != 0) { + } elseif($this->element=='reception' && $this->origin_id != 0) { $id=$this->origin_id; $element='order_supplier'; } else { @@ -1257,7 +1257,7 @@ abstract class CommonObject * @param int $contactid Id du contact. Use this->contactid if empty. * @return int <0 if KO, >0 if OK */ - function fetch_contact($contactid=null) + function fetch_contact($contactid = null) { // phpcs:enable if (empty($contactid)) $contactid=$this->contactid; @@ -1278,7 +1278,7 @@ abstract class CommonObject * @param int $force_thirdparty_id Force thirdparty id * @return int <0 if KO, >0 if OK */ - function fetch_thirdparty($force_thirdparty_id=0) + function fetch_thirdparty($force_thirdparty_id = 0) { // phpcs:enable global $conf; @@ -1353,7 +1353,7 @@ abstract class CommonObject if (empty($idtype) && $idtype != '0') // If type of barcode no set, we try to guess. If set to '0' it means we forced to have type remain not defined { if ($this->element == 'product') $idtype = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; - else if ($this->element == 'societe') $idtype = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY; + elseif ($this->element == 'societe') $idtype = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY; else dol_syslog('Call fetch_barcode with barcode_type not defined and cant be guessed', LOG_WARNING); } @@ -1542,7 +1542,7 @@ abstract class CommonObject * @return int <0 if KO, >0 if OK * @see updateExtraField() */ - function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='', $fk_user_field='fk_user_modif') + function setValueFrom($field, $value, $table = '', $id = null, $format = '', $id_field = '', $fuser = null, $trigkey = '', $fk_user_field = 'fk_user_modif') { global $user,$langs,$conf; @@ -1562,8 +1562,8 @@ abstract class CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET "; if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'"; - else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value); - else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null"); + elseif ($format == 'int') $sql.= $field." = ".$this->db->escape($value); + elseif ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null"); if ($fk_user_field) { @@ -1621,7 +1621,7 @@ abstract class CommonObject * @param int $nodbprefix Do not include DB prefix to forge table name * @return int <0 if KO, >0 if OK */ - function load_previous_next_ref($filter, $fieldid, $nodbprefix=0) + function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0) { // phpcs:enable global $conf, $user; @@ -1648,8 +1648,8 @@ abstract class CommonObject $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity - else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid - else if ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid + elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid + elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc"; $sql.= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) if ($this->restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; @@ -1660,7 +1660,7 @@ abstract class CommonObject $sql.=$filter; } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity - else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid + elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { @@ -1694,8 +1694,8 @@ abstract class CommonObject $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity - else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid - else if ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid + elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid + elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc"; $sql.= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists) if ($this->restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; @@ -1706,7 +1706,7 @@ abstract class CommonObject $sql.=$filter; } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity - else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid + elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) { @@ -1745,7 +1745,7 @@ abstract class CommonObject * @return array Array of id of contacts (if source=external or internal) * Array of id of third parties with at least one contact on object (if source=thirdparty) */ - function getListContactId($source='external') + function getListContactId($source = 'external') { $contactAlreadySelected = array(); $tab = $this->liste_contact(-1, $source); @@ -1892,7 +1892,7 @@ abstract class CommonObject * @param int $mode mode 1 : amounts in company currency will be recalculated, mode 2 : amounts in foreign currency * @return int >0 if OK, <0 if KO */ - function setMulticurrencyRate($rate, $mode=1) + function setMulticurrencyRate($rate, $mode = 1) { dol_syslog(get_class($this).'::setMulticurrencyRate('.$id.')'); if ($this->statut >= 0 || $this->element == 'societe') @@ -2068,7 +2068,7 @@ abstract class CommonObject * * @return int 1 if OK, 0 if KO */ - function setShippingMethod($shipping_method_id, $notrigger=false, $userused=null) + function setShippingMethod($shipping_method_id, $notrigger = false, $userused = null) { global $user; @@ -2192,7 +2192,7 @@ abstract class CommonObject * @param User $userused Object user * @return int 1 if OK, 0 if KO */ - function setBankAccount($fk_account, $notrigger=false, $userused=null) + function setBankAccount($fk_account, $notrigger = false, $userused = null) { global $user; @@ -2257,7 +2257,7 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return int <0 if KO, >0 if OK */ - function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true) + function line_order($renum = false, $rowidorder = 'ASC', $fk_parent_line = true) { // phpcs:enable if (! $this->table_element_line) @@ -2376,7 +2376,7 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_up($rowid, $fk_parent_line=true) + function line_up($rowid, $fk_parent_line = true) { // phpcs:enable $this->line_order(false, 'ASC', $fk_parent_line); @@ -2396,7 +2396,7 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_down($rowid, $fk_parent_line=true) + function line_down($rowid, $fk_parent_line = true) { // phpcs:enable $this->line_order(false, 'ASC', $fk_parent_line); @@ -2418,7 +2418,7 @@ abstract class CommonObject * @param int $rang Position * @return void */ - function updateRangOfLine($rowid,$rang) + function updateRangOfLine($rowid, $rang) { $fieldposition = 'rang'; if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position'; @@ -2457,7 +2457,7 @@ abstract class CommonObject * @param int $rang Position * @return void */ - function updateLineUp($rowid,$rang) + function updateLineUp($rowid, $rang) { if ($rang > 1) { @@ -2491,7 +2491,7 @@ abstract class CommonObject * @param int $max Max * @return void */ - function updateLineDown($rowid,$rang,$max) + function updateLineDown($rowid, $rang, $max) { if ($rang < $max) { @@ -2563,7 +2563,7 @@ abstract class CommonObject * @param int $fk_parent_line Parent line id * @return int Max value of rang in table of lines */ - function line_max($fk_parent_line=0) + function line_max($fk_parent_line = 0) { // phpcs:enable // Search the last rang with fk_parent_line @@ -2645,7 +2645,7 @@ abstract class CommonObject * @param string $suffix '', '_public' or '_private' * @return int <0 if KO, >0 if OK */ - function update_note($note, $suffix='') + function update_note($note, $suffix = '') { // phpcs:enable global $user; @@ -2675,7 +2675,7 @@ abstract class CommonObject if ($this->db->query($sql)) { if ($suffix == '_public') $this->note_public = $note; - else if ($suffix == '_private') $this->note_private = $note; + elseif ($suffix == '_private') $this->note_private = $note; else { $this->note = $note; // deprecated @@ -2716,7 +2716,7 @@ abstract class CommonObject * @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object. * @return int <0 if KO, >0 if OK */ - function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null) + function update_price($exclspec = 0, $roundingadjust = 'none', $nodatabaseupdate = 0, $seller = null) { // phpcs:enable global $conf, $hookmanager, $action; @@ -2953,7 +2953,7 @@ abstract class CommonObject * @return int <=0 if KO, >0 if OK * @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked() */ - function add_object_linked($origin=null, $origin_id=null) + function add_object_linked($origin = null, $origin_id = null) { // phpcs:enable $origin = (! empty($origin) ? $origin : $this->origin); @@ -3014,7 +3014,7 @@ abstract class CommonObject * @return int <0 if KO, >0 if OK * @see add_object_linked(), updateObjectLinked(), deleteObjectLinked() */ - function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1,$orderby='sourcetype',$loadalsoobjects=1) + function fetchObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $clause = 'OR', $alsosametype = 1, $orderby = 'sourcetype', $loadalsoobjects = 1) { global $conf; @@ -3059,7 +3059,7 @@ abstract class CommonObject $sql.= "fk_source = ".$sourceid." AND sourcetype = '".$sourcetype."'"; if ($withtargettype) $sql.= " AND targettype = '".$targettype."'"; } - else if ($justtarget) + elseif ($justtarget) { $sql.= "fk_target = ".$targetid." AND targettype = '".$targettype."'"; if ($withsourcetype) $sql.= " AND sourcetype = '".$sourcetype."'"; @@ -3087,7 +3087,7 @@ abstract class CommonObject { $this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target; } - else if ($justtarget) + elseif ($justtarget) { $this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source; } @@ -3125,28 +3125,28 @@ abstract class CommonObject if ($objecttype == 'facture') { $classpath = 'compta/facture/class'; } - else if ($objecttype == 'facturerec') { + elseif ($objecttype == 'facturerec') { $classpath = 'compta/facture/class'; $module = 'facture'; } - else if ($objecttype == 'propal') { + elseif ($objecttype == 'propal') { $classpath = 'comm/propal/class'; } - else if ($objecttype == 'supplier_proposal') { + elseif ($objecttype == 'supplier_proposal') { $classpath = 'supplier_proposal/class'; } - else if ($objecttype == 'shipping') { + elseif ($objecttype == 'shipping') { $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; } - else if ($objecttype == 'delivery') { + elseif ($objecttype == 'delivery') { $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; } - else if ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { + elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; } - else if ($objecttype == 'fichinter') { + elseif ($objecttype == 'fichinter') { $classpath = 'fichinter/class'; $subelement = 'fichinter'; $module = 'ficheinter'; } - else if ($objecttype == 'subscription') { + elseif ($objecttype == 'subscription') { $classpath = 'adherents/class'; $module = 'adherent'; } @@ -3156,19 +3156,19 @@ abstract class CommonObject if ($objecttype == 'order') { $classfile = 'commande'; $classname = 'Commande'; } - else if ($objecttype == 'invoice_supplier') { + elseif ($objecttype == 'invoice_supplier') { $classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur'; } - else if ($objecttype == 'order_supplier') { + elseif ($objecttype == 'order_supplier') { $classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur'; } - else if ($objecttype == 'supplier_proposal') { + elseif ($objecttype == 'supplier_proposal') { $classfile = 'supplier_proposal'; $classname = 'SupplierProposal'; } - else if ($objecttype == 'facturerec') { + elseif ($objecttype == 'facturerec') { $classfile = 'facture-rec'; $classname = 'FactureRec'; } - else if ($objecttype == 'subscription') { + elseif ($objecttype == 'subscription') { $classfile = 'subscription'; $classname = 'Subscription'; } @@ -3218,13 +3218,13 @@ abstract class CommonObject * @return int >0 if OK, <0 if KO * @see add_object_linked(), fetObjectLinked(), deleteObjectLinked() */ - function updateObjectLinked($sourceid=null, $sourcetype='', $targetid=null, $targettype='') + function updateObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '') { $updatesource=false; $updatetarget=false; if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid) && empty($targettype)) $updatesource=true; - else if (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $updatetarget=true; + elseif (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $updatetarget=true; $sql = "UPDATE ".MAIN_DB_PREFIX."element_element SET "; if ($updatesource) @@ -3234,7 +3234,7 @@ abstract class CommonObject $sql.= " WHERE fk_target = ".$this->id; $sql.= " AND targettype = '".$this->db->escape($this->element)."'"; } - else if ($updatetarget) + elseif ($updatetarget) { $sql.= "fk_target = ".$targetid; $sql.= ", targettype = '".$this->db->escape($targettype)."'"; @@ -3265,13 +3265,13 @@ abstract class CommonObject * @return int >0 if OK, <0 if KO * @see add_object_linked, updateObjectLinked, fetchObjectLinked */ - function deleteObjectLinked($sourceid=null, $sourcetype='', $targetid=null, $targettype='', $rowid='') + function deleteObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $rowid = '') { $deletesource=false; $deletetarget=false; if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid) && empty($targettype)) $deletesource=true; - else if (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $deletetarget=true; + elseif (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $deletetarget=true; $sourceid = (! empty($sourceid) ? $sourceid : $this->id); $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element); @@ -3291,7 +3291,7 @@ abstract class CommonObject $sql.= " fk_source = ".$sourceid." AND sourcetype = '".$this->db->escape($sourcetype)."'"; $sql.= " AND fk_target = ".$this->id." AND targettype = '".$this->db->escape($this->element)."'"; } - else if ($deletetarget) + elseif ($deletetarget) { $sql.= " fk_target = ".$targetid." AND targettype = '".$this->db->escape($targettype)."'"; $sql.= " AND fk_source = ".$this->id." AND sourcetype = '".$this->db->escape($this->element)."'"; @@ -3326,7 +3326,7 @@ abstract class CommonObject * @param string $trigkey Trigger key to use for trigger * @return int <0 if KO, >0 if OK */ - function setStatut($status, $elementId=null, $elementType='', $trigkey='') + function setStatut($status, $elementId = null, $elementType = '', $trigkey = '') { global $user,$langs,$conf; @@ -3414,7 +3414,7 @@ abstract class CommonObject * @param string $ref Record ref * @return int <0 if KO, 0 if nothing done, >0 if OK */ - function getCanvas($id=0,$ref='') + function getCanvas($id = 0, $ref = '') { global $conf; @@ -3474,7 +3474,7 @@ abstract class CommonObject * @param int $id Force id of object * @return int <0 if KO, 0 if not used, >0 if already used */ - function isObjectUsed($id=0) + function isObjectUsed($id = 0) { global $langs; @@ -3543,7 +3543,7 @@ abstract class CommonObject * @param int $predefined -1=All, 0=Count free product/service only, 1=Count predefined product/service only, 2=Count predefined product, 3=Count predefined service * @return int <0 if KO, 0 if no predefined products, nb of lines with predefined products if found */ - function hasProductsOrServices($predefined=-1) + function hasProductsOrServices($predefined = -1) { $nb=0; @@ -3626,7 +3626,7 @@ abstract class CommonObject { if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is '' $totalToShip+=$line->qty_shipped; // defined for shipment only - }else if ($line->element == 'commandefournisseurdispatch' && isset($line->qty)) + }elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty)) { if (empty($totalToShip)) $totalToShip=0; $totalToShip+=$line->qty; // defined for reception only @@ -3881,7 +3881,7 @@ abstract class CommonObject * @param int $dateSelector 1=Show also date range input fields * @return void */ - function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0) + function printObjectLines($action, $seller, $buyer, $selected = 0, $dateSelector = 0) { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! @@ -4035,7 +4035,7 @@ abstract class CommonObject * @param int $extrafieldsline Object of extrafield line attribute * @return void */ - function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$extrafieldsline=0) + function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafieldsline = 0) { global $conf,$langs,$user,$object,$hookmanager; global $form,$bc,$bcdd; @@ -4153,7 +4153,7 @@ abstract class CommonObject * @param string $restrictlist ''=All lines, 'services'=Restrict to services only * @return void */ - function printOriginLinesList($restrictlist='') + function printOriginLinesList($restrictlist = '') { global $langs, $hookmanager, $conf; @@ -4207,7 +4207,7 @@ abstract class CommonObject * @param string $restrictlist ''=All lines, 'services'=Restrict to services only (strike line if not) * @return void */ - function printOriginLine($line, $var, $restrictlist='') + function printOriginLine($line, $var, $restrictlist = '') { global $langs, $conf; @@ -4240,7 +4240,7 @@ abstract class CommonObject $discount->fk_soc = $this->socid; $this->tpl['label'].= $discount->getNomUrl(0, 'discount'); } - else if (! empty($line->fk_product)) + elseif (! empty($line->fk_product)) { $productstatic = new Product($this->db); $productstatic->id = $line->fk_product; @@ -4353,7 +4353,7 @@ abstract class CommonObject * @param int $mandatory Mandatory or not * @return int <=0 if KO, >0 if OK */ - function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0) + function add_element_resource($resource_id, $resource_type, $busy = 0, $mandatory = 0) { // phpcs:enable $this->db->begin(); @@ -4397,7 +4397,7 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - function delete_resource($rowid, $element, $notrigger=0) + function delete_resource($rowid, $element, $notrigger = 0) { // phpcs:enable global $user; @@ -4460,7 +4460,7 @@ abstract class CommonObject * @return int >0 if OK, <0 if KO * @see addFileIntoDatabaseIndex() */ - protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null) + protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams = null) { global $conf, $langs, $user; @@ -4742,7 +4742,7 @@ abstract class CommonObject * @param string $alternatevalue Alternate value to use * @return string|string[] Default value (can be an array if the GETPOST return an array) **/ - function getDefaultCreateValueFor($fieldname, $alternatevalue=null) + function getDefaultCreateValueFor($fieldname, $alternatevalue = null) { global $conf, $_POST; @@ -4818,7 +4818,7 @@ abstract class CommonObject * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. * @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded */ - function fetch_optionals($rowid=null, $optionsArray=null) + function fetch_optionals($rowid = null, $optionsArray = null) { // phpcs:enable if (empty($rowid)) $rowid=$this->id; @@ -4962,7 +4962,7 @@ abstract class CommonObject * @return int -1=error, O=did nothing, 1=OK * @see updateExtraField(), setValueFrom() */ - function insertExtraFields($trigger='', $userused=null) + function insertExtraFields($trigger = '', $userused = null) { global $conf,$langs,$user; @@ -5208,7 +5208,7 @@ abstract class CommonObject * @return int -1=error, O=did nothing, 1=OK * @see setValueFrom(), insertExtraFields() */ - function updateExtraField($key, $trigger=null, $userused=null) + function updateExtraField($key, $trigger = null, $userused = null) { global $conf,$langs,$user; @@ -5342,7 +5342,7 @@ abstract class CommonObject * @param string|int $morecss Value for css to define style/length of field. May also be a numeric. * @return string */ - function showInputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss=0) + function showInputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = 0) { global $conf,$langs,$form; @@ -5437,7 +5437,7 @@ abstract class CommonObject { $morecss = 'minwidth100'; } - else if (round($size) <= 48) + elseif (round($size) <= 48) { $morecss = 'minwidth200'; } @@ -5953,7 +5953,7 @@ abstract class CommonObject * @param mixed $showsize Value for css to define size. May also be a numeric. * @return string */ - function showOutputField($val, $key, $value, $moreparam='', $keysuffix='', $keyprefix='', $showsize=0) + function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $showsize = 0) { global $conf,$langs,$form; @@ -6035,7 +6035,7 @@ abstract class CommonObject { $showsize = 'minwidth100'; } - else if (round($size) <= 48) + elseif (round($size) <= 48) { $showsize = 'minwidth200'; } @@ -6324,7 +6324,7 @@ abstract class CommonObject * @param string $onetrtd All fields in same tr td * @return string */ - function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='', $keyprefix='', $onetrtd=0) + function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0) { global $db, $conf, $langs, $action, $form; @@ -6531,7 +6531,7 @@ abstract class CommonObject * @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one) * @return bool True if success, False if error */ - public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0) + public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors = 0) { foreach ($tables as $table) { @@ -6589,12 +6589,12 @@ abstract class CommonObject { $buyPrice = $product->cost_price; } - else if ($product->pmp > 0) + elseif ($product->pmp > 0) { $buyPrice = $product->pmp; } } - else if (isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp') + elseif (isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp') { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $product = new Product($this->db); @@ -6618,7 +6618,7 @@ abstract class CommonObject { $buyPrice = $productFournisseur->fourn_unitprice; } - else if ($result < 0) + elseif ($result < 0) { $this->errors[] = $productFournisseur->error; return -2; @@ -6647,7 +6647,7 @@ abstract class CommonObject * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto */ - function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0) + function show_photos($modulepart, $sdir, $size = 0, $nbmax = 0, $nbbyrow = 5, $showfilename = 0, $showaction = 0, $maxHeight = 120, $maxWidth = 160, $nolink = 0, $notitle = 0, $usesharelink = 0) { // phpcs:enable global $conf,$user,$langs; @@ -6740,7 +6740,7 @@ abstract class CommonObject if ($nbphoto % $nbbyrow == 1) $return.= '
'; $return.= ''; if (($nbphoto % $nbbyrow) == 0) $return.= ''; } - else if ($nbbyrow < 0) $return.=''; + elseif ($nbbyrow < 0) $return.=''; } if (empty($size)) { // Format origine @@ -7003,7 +7003,7 @@ abstract class CommonObject $queryarray[$field] = $this->db->idate($this->{$field}); } } - else if($this->isArray($info)) + elseif($this->isArray($info)) { if(! empty($this->{$field})) { if(! is_array($this->{$field})) { @@ -7014,7 +7014,7 @@ abstract class CommonObject $queryarray[$field] = null; } } - else if($this->isInt($info)) + elseif($this->isInt($info)) { if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field]=$conf->entity; else @@ -7023,7 +7023,7 @@ abstract class CommonObject if (empty($queryarray[$field])) $queryarray[$field]=0; // May be reset to null later if property 'notnull' is -1 for this field. } } - else if($this->isFloat($info)) + elseif($this->isFloat($info)) { $queryarray[$field] = (double) price2num($this->{$field}); if (empty($queryarray[$field])) $queryarray[$field]=0; @@ -7111,7 +7111,7 @@ abstract class CommonObject protected function quote($value, $fieldsentry) { if (is_null($value)) return 'NULL'; - else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value"); + elseif (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value"); else return "'".$this->db->escape($value)."'"; } @@ -7349,7 +7349,7 @@ abstract class CommonObject * @param int $forcechilddeletion 0=no, 1=Force deletion of children * @return int <=0 if KO, >0 if OK */ - public function deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0) + public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0) { $error=0; diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 91d4245ff88..891ea5e4bc6 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -57,7 +57,7 @@ abstract class CommonObjectLine extends CommonObject * @param string $type Label type (long or short) * @return string|int <0 if ko, label if ok */ - public function getLabelOfUnit($type='long') + public function getLabelOfUnit($type = 'long') { global $langs; diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index cb7a32afe17..0055559c4dc 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -107,7 +107,7 @@ abstract class CommonStickerGenerator * @param string $outputdir Output directory for pdf file * @return int 1=OK, 0=KO */ - abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir=''); + abstract function write_file($arrayofrecords, $outputlangs, $srctemplatepath, $outputdir = ''); // phpcs:enable /** @@ -118,7 +118,7 @@ abstract class CommonStickerGenerator * @param array $param Associative array containing label content and optional parameters * @return void */ - abstract function addSticker(&$pdf,$outputlangs,$param); + abstract function addSticker(&$pdf, $outputlangs, $param); // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** @@ -129,7 +129,7 @@ abstract class CommonStickerGenerator * @param int $pt point * @return void */ - function Set_Char_Size(&$pdf,$pt) + function Set_Char_Size(&$pdf, $pt) { // phpcs:enable if ($pt > 3) { @@ -152,7 +152,7 @@ abstract class CommonStickerGenerator * @param int $nbPointilles Nb pointilles * @return void */ - function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15) + function _Pointille(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $nbPointilles = 15) { // phpcs:enable $pdf->SetLineWidth($epaisseur); @@ -195,7 +195,7 @@ abstract class CommonStickerGenerator * @param int $taille Size * @return void */ - function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4) + function _Croix(&$pdf, $x1 = 0, $y1 = 0, $x2 = 210, $y2 = 297, $epaisseur = 1, $taille = 4) { // phpcs:enable $pdf->SetDrawColor(192, 192, 192); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 70b0b609c67..ec1af205485 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -180,10 +180,10 @@ class Conf if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } $arrValue = json_decode($value, true); if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue; - else if (in_array($partname, array('login','menus','substitutions','triggers','tpl'))) $value = '/'.$modulename.'/core/'.$partname.'/'; - else if (in_array($partname, array('models','theme'))) $value = '/'.$modulename.'/'; - else if (in_array($partname, array('sms'))) $value = '/'.$modulename.'/'; - else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe + elseif (in_array($partname, array('login','menus','substitutions','triggers','tpl'))) $value = '/'.$modulename.'/core/'.$partname.'/'; + elseif (in_array($partname, array('models','theme'))) $value = '/'.$modulename.'/'; + elseif (in_array($partname, array('sms'))) $value = '/'.$modulename.'/'; + elseif ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array } // If this is a module constant (must be at end) @@ -252,7 +252,7 @@ class Conf if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE="eldy_menu.php"; // Use eldy by default because smartphone does not work on all phones // Clean var use vat for company if (! isset($this->global->FACTURE_TVAOPTION)) $this->global->FACTURE_TVAOPTION=1; - else if (! empty($this->global->FACTURE_TVAOPTION) && ! is_numeric($this->global->FACTURE_TVAOPTION)) + elseif (! empty($this->global->FACTURE_TVAOPTION) && ! is_numeric($this->global->FACTURE_TVAOPTION)) { // Old value of option, we clean to use new value (0 or 1) if ($this->global->FACTURE_TVAOPTION != "franchise") $this->global->FACTURE_TVAOPTION=1; diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php index 5129ac54ece..a3a8a0dd5ff 100644 --- a/htdocs/core/class/coreobject.class.php +++ b/htdocs/core/class/coreobject.class.php @@ -123,7 +123,7 @@ class CoreObject extends CommonObject * @param bool $try_to_load Force the fetch if an id is given * @return int */ - public function addChild($tabName, $id=0, $key='id', $try_to_load = false) + public function addChild($tabName, $id = 0, $key = 'id', $try_to_load = false) { if(!empty($id)) { @@ -154,7 +154,7 @@ class CoreObject extends CommonObject * @param string $key Attribute name of the object id * @return bool */ - public function removeChild($tabName, $id, $key='id') + public function removeChild($tabName, $id, $key = 'id') { foreach ($this->{$tabName} as &$object) { @@ -370,7 +370,7 @@ class CoreObject extends CommonObject * @param string $format Output date format * @return string */ - public function getDate($field, $format='') + public function getDate($field, $format = '') { if(empty($this->{$field})) return ''; else @@ -416,15 +416,15 @@ class CoreObject extends CommonObject { $this->setDate($key, $value); } - else if( $this->checkFieldType($key, 'array')) + elseif( $this->checkFieldType($key, 'array')) { $this->{$key} = $value; } - else if( $this->checkFieldType($key, 'float') ) + elseif( $this->checkFieldType($key, 'float') ) { $this->{$key} = (double) price2num($value); } - else if( $this->checkFieldType($key, 'int') ) { + elseif( $this->checkFieldType($key, 'int') ) { $this->{$key} = (int) price2num($value); } else diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 4320446d7b5..6ad6523f199 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -92,7 +92,7 @@ class Cstate // 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; @@ -168,7 +168,7 @@ class Cstate // extends CommonObject * @param string $code Code * @return int <0 if KO, >0 if OK */ - function fetch($id,$code='') + function fetch($id, $code = '') { global $langs; $sql = "SELECT"; @@ -212,7 +212,7 @@ class Cstate // 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; @@ -281,7 +281,7 @@ class Cstate // 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; diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index db8ed461727..ffaccbfe964 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -76,7 +76,7 @@ class Ctypent // 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; @@ -166,7 +166,7 @@ class Ctypent // extends CommonObject * @param string $label Label * @return int <0 if KO, >0 if OK */ - function fetch($id,$code='',$label='') + function fetch($id, $code = '', $label = '') { global $langs; $sql = "SELECT"; @@ -214,7 +214,7 @@ class Ctypent // 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; @@ -285,7 +285,7 @@ class Ctypent // 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; diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 8ef2b738607..a4eed8f8b66 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -159,7 +159,7 @@ class Ctyperesource * * @return int <0 if KO, 0 if not found, >0 if OK */ - public function fetch($id,$code='',$label='') + public function fetch($id, $code = '', $label = '') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -223,7 +223,7 @@ class Ctyperesource * * @return int <0 if KO, >0 if OK */ - public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND') + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 48c426a830f..eb44fac13ea 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -109,7 +109,7 @@ class DiscountAbsolute * @param int $fk_invoice_supplier_source fk_invoice_supplier_source * @return int <0 if KO, =0 if not found, >0 if OK */ - function fetch($rowid, $fk_facture_source=0, $fk_invoice_supplier_source=0) + function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0) { global $conf; @@ -396,7 +396,7 @@ class DiscountAbsolute * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice) * @return int <0 if KO, >0 if OK */ - function link_to_invoice($rowidline,$rowidinvoice) + function link_to_invoice($rowidline, $rowidinvoice) { // phpcs:enable // Check parameters @@ -484,7 +484,7 @@ class DiscountAbsolute * @param int $discount_type 0 => customer discount, 1 => supplier discount * @return int <0 if KO, amount otherwise */ - function getAvailableDiscounts($company='', $user='',$filter='', $maxvalue=0, $discount_type=0) + function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0) { global $conf; @@ -527,7 +527,7 @@ class DiscountAbsolute * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and deposits amount otherwise */ - function getSumDepositsUsed($invoice, $multicurrency=0) + function getSumDepositsUsed($invoice, $multicurrency = 0) { dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG); @@ -538,7 +538,7 @@ class DiscountAbsolute $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; $sql.= ' AND f.type = 3'; } - else if ($invoice->element == 'invoice_supplier') + elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; @@ -573,7 +573,7 @@ class DiscountAbsolute * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and excess received amount otherwise */ - function getSumCreditNotesUsed($invoice, $multicurrency=0) + function getSumCreditNotesUsed($invoice, $multicurrency = 0) { dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG); @@ -584,7 +584,7 @@ class DiscountAbsolute $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received } - else if ($invoice->element == 'invoice_supplier') + elseif ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; @@ -619,7 +619,7 @@ class DiscountAbsolute * @param string $option Where to link to ('invoice' or 'discount') * @return string String with URL */ - function getNomUrl($withpicto,$option='invoice') + function getNomUrl($withpicto, $option = 'invoice') { global $langs; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 8d33399c17f..4cbf20a8a75 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -64,7 +64,7 @@ class DolEditor * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') * @param int $readonly 0=Read/Edit, 1=Read only */ - function __construct($htmlname, $content, $width='', $height=200, $toolbarname='Basic', $toolbarlocation='In', $toolbarstartexpanded=false, $uselocalbrowser=true, $okforextendededitor=true, $rows=0, $cols=0, $readonly=0) + function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = true, $okforextendededitor = true, $rows = 0, $cols = 0, $readonly = 0) { global $conf,$langs; @@ -149,7 +149,7 @@ class DolEditor * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @return void|string */ - function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') + function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '') { // phpcs:enable global $conf,$langs; diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index d0b3f94cdc9..22ec32045a0 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -41,14 +41,14 @@ class DolGeoIP * @param string $type 'country' or 'city' * @param string $datfile Data file */ - function __construct($type,$datfile) + function __construct($type, $datfile) { if ($type == 'country') { // geoip may have been already included with PEAR if (! function_exists('geoip_country_code_by_name')) $res=include_once GEOIP_PATH.'geoip.inc'; } - else if ($type == 'city') + elseif ($type == 'city') { // geoip may have been already included with PEAR if (! function_exists('geoip_country_code_by_name')) $res=include_once GEOIP_PATH.'geoipcity.inc'; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index f9e7ff774dc..e335975e503 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -88,7 +88,7 @@ class DolGraph * * @param string $library 'jflot' (default) or 'artichow' (no more supported) */ - function __construct($library='jflot') + function __construct($library = 'jflot') { global $conf; global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; @@ -658,7 +658,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return integer|null */ - function draw($file, $fileurl='') + function draw($file, $fileurl = '') { if (empty($file)) { @@ -690,7 +690,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return void */ - private function draw_artichow($file,$fileurl) + private function draw_artichow($file, $fileurl) { // phpcs:enable global $artichow_defaultfont; @@ -704,7 +704,7 @@ class DolGraph // Create graph $classname=''; if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow - else if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname='LinePlot'; + elseif ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname='LinePlot'; else $classname='TypeUnknown'; include_once ARTICHOW_PATH.$classname.'.class.php'; @@ -1127,7 +1127,7 @@ class DolGraph * @param int $shownographyet Show graph to say there is not enough data * @return string HTML string to show graph */ - function show($shownographyet=0) + function show($shownographyet = 0) { global $langs; @@ -1149,7 +1149,7 @@ class DolGraph * @param string $defaultsize Value we want as default size * @return int Value of width or height to use by default */ - static function getDefaultGraphSizeForStats($direction,$defaultsize='') + static function getDefaultGraphSizeForStats($direction, $defaultsize = '') { global $conf; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index f38afc67807..19de8abb3f6 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -311,7 +311,7 @@ class dolReceiptPrinter extends Escpos * @param string $htmlname select html name * @return int 0 if OK; >0 if KO */ - function selectTypePrinter($selected='', $htmlname='printertypeid') + function selectTypePrinter($selected = '', $htmlname = 'printertypeid') { global $langs; @@ -335,7 +335,7 @@ class dolReceiptPrinter extends Escpos * @param string $htmlname select html name * @return int 0 if OK; >0 if KO */ - function selectProfilePrinter($selected='', $htmlname='printerprofileid') + function selectProfilePrinter($selected = '', $htmlname = 'printerprofileid') { global $langs; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 1c9d2b3cd8a..a9821178f20 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -277,7 +277,7 @@ class EmailSenderProfile extends CommonObject * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @return string String with URL */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto = 0) { global $db, $conf, $langs; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -309,7 +309,7 @@ class EmailSenderProfile extends CommonObject * @param int $withpicto Add download picto into link * @return string HTML link to file */ - function getDirectExternalLink($withpicto=0) + function getDirectExternalLink($withpicto = 0) { return 'todo'; } @@ -320,7 +320,7 @@ class EmailSenderProfile 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); } @@ -333,7 +333,7 @@ class EmailSenderProfile 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) { global $langs; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 0ce04ddd043..50b948a85be 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -183,7 +183,7 @@ class Events // extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=null, $notrigger=0) + function update($user = null, $notrigger = 0) { global $conf, $langs; @@ -220,7 +220,7 @@ class Events // extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=null) + function fetch($id, $user = null) { global $langs; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c1214f1ee8c..a805ff78706 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -171,7 +171,7 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $computed='', $entity='', $langfile='', $enabled='1') + function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1') { if (empty($attrname)) return -1; if (empty($label)) return -1; @@ -221,7 +221,7 @@ class ExtraFields * @param string $computed Computed value * @return int <=0 if KO, >0 if OK */ - private function create($attrname, $type='varchar', $length=255, $elementtype='member', $unique=0, $required=0, $default_value='',$param='', $perms='', $list='0', $computed='') + private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -317,7 +317,7 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list='-1', $help='', $default='', $computed='',$entity='', $langfile='', $enabled='1') + private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1') { // phpcs:enable global $conf,$user; @@ -414,7 +414,7 @@ class ExtraFields * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @return int < 0 if KO, 0 if nothing is done, 1 if OK */ - function delete($attrname, $elementtype='member') + function delete($attrname, $elementtype = 'member') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -472,7 +472,7 @@ class ExtraFields * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @return int < 0 if KO, 0 if nothing is done, 1 if OK */ - private function delete_label($attrname, $elementtype='member') + private function delete_label($attrname, $elementtype = 'member') { // phpcs:enable global $conf; @@ -529,7 +529,7 @@ class ExtraFields * @param int $totalizable Is extrafield totalizable on list * @return int >0 if OK, <=0 if KO */ - function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $help='', $default='', $computed='', $entity='', $langfile='', $enabled='1', $totalizable=0) + function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0) { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -639,7 +639,7 @@ class ExtraFields * @param int $totalizable Is extrafield totalizable on list * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list='0',$help='',$default='',$computed='',$entity='',$langfile='',$enabled='1', $totalizable=0) + private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0) { // phpcs:enable global $conf, $user; @@ -770,7 +770,7 @@ class ExtraFields * @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED. Deprecated. Should not be required. * @return array Array of attributes keys+label for all extra fields. */ - function fetch_name_optionals_label($elementtype,$forceload=false) + function fetch_name_optionals_label($elementtype, $forceload = false) { // phpcs:enable global $conf; @@ -893,7 +893,7 @@ class ExtraFields * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @return string */ - function showInputField($key, $value, $moreparam='', $keysuffix='', $keyprefix='', $morecss='', $objectid=0, $extrafieldsobjectkey='') + function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '') { global $conf,$langs,$form; @@ -979,7 +979,7 @@ class ExtraFields { $morecss = 'minwidth100'; } - else if (round($size) <= 48) + elseif (round($size) <= 48) { $morecss = 'minwidth200'; } @@ -1333,7 +1333,7 @@ class ExtraFields // current object id can be use into filter if (strpos($InfoFieldList[4], '$ID$')!==false && !empty($objectid)) { $InfoFieldList[4]=str_replace('$ID$', $objectid, $InfoFieldList[4]); - } else if (preg_match("#^.*list.php$#", $_SERVER["DOCUMENT_URI"])) { + } elseif (preg_match("#^.*list.php$#", $_SERVER["DOCUMENT_URI"])) { // Pattern for word=$ID$ $word = '\b[a-zA-Z0-9-\.-_]+\b=\$ID\$'; @@ -1371,7 +1371,7 @@ class ExtraFields $boolCond =(( $matchCondition[1] == "AND" )?' AND 1 ':' OR 0 '); $InfoFieldList[4]=str_replace($matchCondition[0], $boolCond.$matchCondition[3], $InfoFieldList[4]); } - else if (! empty($matchCondition[3])) { + elseif (! empty($matchCondition[3])) { $boolCond =(( $matchCondition[3] == "AND" )?' 1 AND ':' 0 OR'); $InfoFieldList[4]=str_replace($matchCondition[0], $boolCond, $InfoFieldList[4]); } @@ -1508,7 +1508,7 @@ class ExtraFields * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @return string Formated value */ - function showOutputField($key, $value, $moreparam='', $extrafieldsobjectkey='') + function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '') { global $conf,$langs; @@ -1820,7 +1820,7 @@ class ExtraFields * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data * @return string Formated value */ - function getAlignFlag($key, $extrafieldsobjectkey='') + function getAlignFlag($key, $extrafieldsobjectkey = '') { global $conf,$langs; @@ -1890,7 +1890,7 @@ class ExtraFields * @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset. * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) */ - function setOptionalsFromPost($extralabels, &$object, $onlykey='') + function setOptionalsFromPost($extralabels, &$object, $onlykey = '') { global $_POST, $langs; $nofillrequired='';// For error when required field left blank @@ -1945,7 +1945,7 @@ class ExtraFields // TODO GMT date in memory must be GMT so we should add gm=true in parameters $value_key=dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]); } - else if (in_array($key_type, array('checkbox','chkbxlst'))) + elseif (in_array($key_type, array('checkbox','chkbxlst'))) { $value_arr=GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { @@ -1954,7 +1954,7 @@ class ExtraFields $value_key=''; } } - else if (in_array($key_type, array('price','double'))) + elseif (in_array($key_type, array('price','double'))) { $value_arr=GETPOST("options_".$key, 'alpha'); $value_key=price2num($value_arr); @@ -1989,7 +1989,7 @@ class ExtraFields * @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names) * @return array|int array_options set or 0 if no value */ - function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix='', $keysuffix='') + function getOptionalsFromPost($extrafieldsobjectkey, $keyprefix = '', $keysuffix = '') { global $_POST; @@ -2020,14 +2020,22 @@ class ExtraFields // Clean parameters $value_key=dol_mktime($_POST[$keysuffix."options_".$key.$keyprefix."hour"], $_POST[$keysuffix."options_".$key.$keyprefix."min"], 0, $_POST[$keysuffix."options_".$key.$keyprefix."month"], $_POST[$keysuffix."options_".$key.$keyprefix."day"], $_POST[$keysuffix."options_".$key.$keyprefix."year"]); } +<<<<<<< HEAD else if (in_array($key_type, array('checkbox', 'chkbxlst'))) +======= + elseif (in_array($key_type,array('checkbox', 'chkbxlst'))) +>>>>>>> upstream/develop { $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); // Make sure we get an array even if there's only one checkbox $value_arr=(array) $value_arr; $value_key=implode(',', $value_arr); } +<<<<<<< HEAD else if (in_array($key_type, array('price','double'))) +======= + elseif (in_array($key_type,array('price','double'))) +>>>>>>> upstream/develop { $value_arr=GETPOST($keysuffix."options_".$key.$keyprefix); $value_key=price2num($value_arr); diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 89e6f01a17f..d90707db4dd 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -41,7 +41,7 @@ class FileUpload * @param int $fk_element fk_element * @param string $element element */ - function __construct($options=null,$fk_element=null,$element=null) + function __construct($options = null, $fk_element = null, $element = null) { global $db, $conf; global $object; @@ -136,7 +136,7 @@ class FileUpload $object_ref = dol_sanitizeFileName($object->ref); if ($element == 'invoice_supplier') { $object_ref = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier') . $object_ref; - } else if ($element == 'project_task') { + } elseif ($element == 'project_task') { $object_ref = $object->project->ref . '/' . $object_ref; } @@ -456,7 +456,7 @@ class FileUpload } } } - else if ($this->options['discard_aborted_uploads']) + elseif ($this->options['discard_aborted_uploads']) { unlink($file_path); $file->error = 'abort'; diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 0ea612bbc8b..de162f27c37 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -264,7 +264,7 @@ class Fiscalyear 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 * @return string Label */ - function getLibStatut($mode=0) + function getLibStatut($mode = 0) { return $this->LibStatut($this->statut, $mode); } @@ -277,7 +277,7 @@ class Fiscalyear 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 * @return string Label */ - function LibStatut($statut,$mode=0) + function LibStatut($statut, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/core/class/google.class.php b/htdocs/core/class/google.class.php index 615729ba9c3..797f0a14af1 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -44,7 +44,7 @@ class GoogleAPI * @param DoliDB $db Database handler * @param string $key Google key */ - function __construct($db,$key) + function __construct($db, $key) { $this->db=$db; $this->key=$key; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 4491d99e66a..64b67263335 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -136,7 +136,7 @@ class HookManager * All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller. * $this->error or this->errors are also defined by class called by this function if error. */ - function executeHooks($method, $parameters=array(), &$object='', &$action='') + function executeHooks($method, $parameters = array(), &$object = '', &$action = '') { if (! is_array($this->hooks) || empty($this->hooks)) return ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 557a10e7b25..4a8ed275e5a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -102,7 +102,7 @@ class Form * @param string $paramid Key of parameter for id ('id', 'socid') * @return string HTML edit field */ - function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0, $notabletag=0, $paramid='id') + function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata = 'string', $moreparam = '', $fieldrequired = 0, $notabletag = 0, $paramid = 'id') { global $conf,$langs; @@ -164,7 +164,7 @@ class Form * @param string $paramid Key of parameter for id ('id', 'socid') * @return string HTML edit field */ - function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $custommsg=null, $moreparam='', $notabletag=0, $formatfunc='', $paramid='id') + function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata = 'string', $editvalue = '', $extObject = null, $custommsg = null, $moreparam = '', $notabletag = 0, $formatfunc = '', $paramid = 'id') { global $conf,$langs,$db; @@ -194,13 +194,13 @@ class Form $tmp=explode(':', $typeofdata); $ret.=''; } - else if (preg_match('/^(numeric|amount)/', $typeofdata)) + elseif (preg_match('/^(numeric|amount)/', $typeofdata)) { $tmp=explode(':', $typeofdata); $valuetoshow=price2num($editvalue?$editvalue:$value); $ret.=''; } - else if (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) + elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) { $tmp=explode(':', $typeofdata); $cols=$tmp[2]; @@ -217,15 +217,15 @@ class Form $ret.=dol_string_neverthesehtmltags($valuetoshow, array('textarea')); $ret.=''; } - else if ($typeofdata == 'day' || $typeofdata == 'datepicker') + elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') { $ret.=$this->selectDate($value, $htmlname, 0, 0, 1, 'form'.$htmlname, 1, 0); } - else if ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') + elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') { $ret.=$this->selectDate($value, $htmlname, 1, 1, 1, 'form'.$htmlname, 1, 0); } - else if (preg_match('/^select;/', $typeofdata)) + elseif (preg_match('/^select;/', $typeofdata)) { $arraydata=explode(',', preg_replace('/^select;/', '', $typeofdata)); foreach($arraydata as $val) @@ -235,7 +235,7 @@ class Form } $ret.=$this->selectarray($htmlname, $arraylist, $value); } - else if (preg_match('/^ckeditor/', $typeofdata)) + elseif (preg_match('/^ckeditor/', $typeofdata)) { $tmp=explode(':', $typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -261,7 +261,7 @@ class Form elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value, 'day'); elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') $ret.=dol_print_date($value, 'dayhour'); - else if (preg_match('/^select;/', $typeofdata)) + elseif (preg_match('/^select;/', $typeofdata)) { $arraydata=explode(',', preg_replace('/^select;/', '', $typeofdata)); foreach($arraydata as $val) @@ -271,7 +271,7 @@ class Form } $ret.=$arraylist[$value]; } - else if (preg_match('/^ckeditor/', $typeofdata)) + elseif (preg_match('/^ckeditor/', $typeofdata)) { $tmpcontent=dol_htmlentitiesbr($value); if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) @@ -306,7 +306,7 @@ class Form * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @return string HTML edit in place */ - private function editInPlace($object, $value, $htmlname, $condition, $inputType='textarea', $editvalue=null, $extObject=null, $custommsg=null) + private function editInPlace($object, $value, $htmlname, $condition, $inputType = 'textarea', $editvalue = null, $extObject = null, $custommsg = null) { global $conf; @@ -314,8 +314,8 @@ class Form // Check parameters if (preg_match('/^text/', $inputType)) $value = dol_nl2br($value); - else if (preg_match('/^numeric/', $inputType)) $value = price($value); - else if ($inputType == 'day' || $inputType == 'datepicker') $value = dol_print_date($value, 'day'); + elseif (preg_match('/^numeric/', $inputType)) $value = price($value); + elseif ($inputType == 'day' || $inputType == 'datepicker') $value = dol_print_date($value, 'day'); if ($condition) { @@ -348,7 +348,7 @@ class Form if (! empty($tmp[2])) $savemethod=$tmp[2]; $out.= ''."\n"; } - else if ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) + elseif ((preg_match('/^day$/', $inputType)) || (preg_match('/^datepicker/', $inputType)) || (preg_match('/^datehourpicker/', $inputType))) { $tmp=explode(':', $inputType); $inputType=$tmp[0]; @@ -357,21 +357,21 @@ class Form $out.= ''."\n"; // Use for timestamp format } - else if (preg_match('/^(select|autocomplete)/', $inputType)) + elseif (preg_match('/^(select|autocomplete)/', $inputType)) { $tmp=explode(':', $inputType); $inputType=$tmp[0]; $loadmethod=$tmp[1]; if (! empty($tmp[2])) $savemethod=$tmp[2]; if (! empty($tmp[3])) $button_only=true; } - else if (preg_match('/^textarea/', $inputType)) + elseif (preg_match('/^textarea/', $inputType)) { $tmp=explode(':', $inputType); $inputType=$tmp[0]; $rows=(empty($tmp[1])?'8':$tmp[1]); $cols=(empty($tmp[2])?'80':$tmp[2]); } - else if (preg_match('/^ckeditor/', $inputType)) + elseif (preg_match('/^ckeditor/', $inputType)) { $tmp=explode(':', $inputType); $inputType=$tmp[0]; $toolbar=$tmp[1]; @@ -441,7 +441,7 @@ class Form * @see Use function textwithpicto if you can. * TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip */ - function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger='', $forcenowrap=0) + function textwithtooltip($text, $htmltext, $tooltipon = 1, $direction = 0, $img = '', $extracss = '', $notabs = 2, $incbefore = '', $noencodehtmltext = 0, $tooltiptrigger = '', $forcenowrap = 0) { global $conf; @@ -526,7 +526,7 @@ class Form * @param int $forcenowrap Force no wrap between text and picto (works with notabs=2 only) * @return string HTML code of text, picto, tooltip */ - function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger='', $forcenowrap=0) + function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger = '', $forcenowrap = 0) { global $conf, $langs; @@ -578,7 +578,7 @@ class Form * @param int $alwaysvisible 1=select button always visible * @return string Select list */ - function selectMassAction($selected, $arrayofaction, $alwaysvisible=0) + function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0) { global $conf,$langs,$hookmanager; @@ -678,7 +678,7 @@ class Form * @param int $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...) * @return string HTML string with select */ - function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0, $addspecialentries=0) + function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0) { // phpcs:enable global $conf,$langs,$mysoc; @@ -791,7 +791,7 @@ class Form * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @return string HTML string with select and input */ - function select_incoterms($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array()) + function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array()) { // phpcs:enable global $conf,$langs; @@ -884,7 +884,7 @@ class Form * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, 2=Force to show only Products, 3=Force to show only services, -1=Force none (and set hidden field to 'service') * @return void */ - function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) + function select_type_of_lines($selected = '', $htmlname = 'type', $showempty = 0, $hidetext = 0, $forceall = 0) { // phpcs:enable global $db,$langs,$user,$conf; @@ -987,7 +987,7 @@ class Form * @param int $showempty Add an empty field * @return void */ - function select_type_fees($selected='',$htmlname='type',$showempty=0) + function select_type_fees($selected = '', $htmlname = 'type', $showempty = 0) { // phpcs:enable global $user, $langs; @@ -1031,7 +1031,7 @@ class Form * @return string Return select box for thirdparty. * @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0) */ - function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0) + function select_thirdparty($selected = '', $htmlname = 'socid', $filter = '', $limit = 20, $ajaxoptions = array(), $forcecombo = 0) { // phpcs:enable return $this->select_thirdparty_list($selected, $htmlname, $filter, 1, 0, $forcecombo, array(), '', 0, $limit); @@ -1057,7 +1057,7 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) * @return string HTML string with select box for thirdparty. */ - function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false) + function select_company($selected = '', $htmlname = 'socid', $filter = '', $showempty = '', $showtype = 0, $forcecombo = 0, $events = array(), $limit = 0, $morecss = 'minwidth100', $moreparam = '', $selected_input_value = '', $hidelabel = 1, $ajaxoptions = array(), $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -1081,7 +1081,7 @@ class Form $out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); $out.=''; if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : '; - else if ($hidelabel > 1) { + elseif ($hidelabel > 1) { $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"'; if ($hidelabel == 2) { $out.= img_picto($langs->trans("Search"), 'search'); @@ -1121,7 +1121,7 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return string HTML string with */ - function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false) + function select_thirdparty_list($selected = '', $htmlname = 'socid', $filter = '', $showempty = '', $showtype = 0, $forcecombo = 0, $events = array(), $filterkey = '', $outputmode = 0, $limit = 0, $morecss = 'minwidth100', $moreparam = '', $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -1131,7 +1131,7 @@ class Form $outarray=array(); if ($selected === '') $selected = array(); - else if (!is_array($selected)) $selected = array($selected); + elseif (!is_array($selected)) $selected = array($selected); // Clean $filter that may contains sql conditions so sql code if (function_exists('testSqlAndScriptInject')) { @@ -1295,7 +1295,7 @@ class Form * @param int $maxvalue Max value for lines that can be selected * @return int Return number of qualifed lines in list */ - function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0) + function select_remises($selected, $htmlname, $filter, $socid, $maxvalue = 0) { // phpcs:enable global $langs,$conf; @@ -1382,7 +1382,7 @@ class Form * @return int <0 if KO, Nb of contact in list if OK * @deprected You can use selectcontacts directly (warning order of param was changed) */ - function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='') + function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '') { // phpcs:enable print $this->selectcontacts($socid, $selected, $htmlname, $showempty, $exclude, $limitto, $showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid); @@ -1412,7 +1412,7 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return int <0 if KO, Nb of contact in list if OK */ - function selectcontacts($socid, $selected='', $htmlname='contactid', $showempty=0, $exclude='', $limitto='', $showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $events=array(), $moreparam='', $htmlid='', $multiple=false) + function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $moreclass = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false) { global $conf,$langs,$hookmanager,$action; @@ -1421,7 +1421,7 @@ class Form if (empty($htmlid)) $htmlid = $htmlname; if ($selected === '') $selected = array(); - else if (!is_array($selected)) $selected = array($selected); + elseif (!is_array($selected)) $selected = array($selected); $out=''; if (! is_object($hookmanager)) @@ -1559,7 +1559,7 @@ class Form * @deprecated Use select_dolusers instead * @see select_dolusers() */ - function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0') + function select_users($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0') { // phpcs:enable print $this->select_dolusers($selected, $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity); @@ -1589,7 +1589,7 @@ class Form * @return string HTML select string * @see select_dolgroups */ - function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false) + function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -1598,7 +1598,7 @@ class Form if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected=$user->id; if ($selected === '') $selected = array(); - else if (!is_array($selected)) $selected = array($selected); + elseif (!is_array($selected)) $selected = array($selected); $excludeUsers=null; $includeUsers=null; @@ -1607,12 +1607,12 @@ class Form if (is_array($exclude)) $excludeUsers = implode(",", $exclude); // Permettre l'inclusion d'utilisateurs if (is_array($include)) $includeUsers = implode(",", $include); - else if ($include == 'hierarchy') + elseif ($include == 'hierarchy') { // Build list includeUsers to have only hierarchy $includeUsers = implode(",", $user->getAllChildIds(0)); } - else if ($include == 'hierarchyme') + elseif ($include == 'hierarchyme') { // Build list includeUsers to have only hierarchy and current user $includeUsers = implode(",", $user->getAllChildIds(1)); @@ -1797,7 +1797,7 @@ class Form * @return string HTML select string * @see select_dolgroups */ - function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array()) + function select_dolusers_forevent($action = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $showproperties = 0, $listofuserid = array(), $listofcontactid = array(), $listofotherid = array()) { // phpcs:enable global $conf, $user, $langs; @@ -1890,7 +1890,7 @@ class Form * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) * @return void */ - function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array()) + function select_produits($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $status = 1, $finished = 2, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '', $selected_combinations = array()) { // phpcs:enable global $langs,$conf; @@ -1991,7 +1991,7 @@ class Form trans("RefOrLabel").' : '; - else if ($hidelabel > 1) { + elseif ($hidelabel > 1) { $placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"'; if ($hidelabel == 2) { print img_picto($langs->trans("Search"), 'search'); @@ -2032,7 +2032,7 @@ class Form * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @return array Array of keys for json */ - function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='') + function select_produits_list($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $filterkey = '', $status = 1, $finished = 2, $outputmode = 0, $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '') { // phpcs:enable global $langs,$conf,$user,$db; @@ -2324,7 +2324,7 @@ class Form * @param int $hidepriceinlabel Hide price in label * @return void */ - private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel=0) + private function constructProductListOption(&$objp, &$opt, &$optJson, $price_level, $selected, $hidepriceinlabel = 0) { global $langs,$conf,$user,$db; @@ -2367,7 +2367,7 @@ class Form if (! empty($conf->stock->enabled) && $objp->fk_product_type == 0 && isset($objp->stock)) { if ($objp->stock > 0) $opt.= ' class="product_line_stock_ok"'; - else if ($objp->stock <= 0) $opt.= ' class="product_line_stock_too_low"'; + elseif ($objp->stock <= 0) $opt.= ' class="product_line_stock_too_low"'; } $opt.= '>'; $opt.= $objp->ref; @@ -2546,7 +2546,7 @@ class Form * @param string $morecss More CSS * @return void */ - function select_produits_fournisseurs($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0, $morecss='') + function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '') { // phpcs:enable global $langs,$conf; @@ -2592,7 +2592,7 @@ class Form * @param string $morecss Add more CSS * @return array Array of keys for json */ - function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100,$alsoproductwithnosupplierprice=0,$morecss='') + function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '') { // phpcs:enable global $langs,$conf,$db; @@ -2816,7 +2816,7 @@ class Form * @param int $selected_supplier Pre-selected supplier if more than 1 result * @return void */ - function select_product_fourn_price($productid, $htmlname='productfournpriceid', $selected_supplier='') + function select_product_fourn_price($productid, $htmlname = 'productfournpriceid', $selected_supplier = '') { // phpcs:enable global $langs,$conf; @@ -2930,7 +2930,7 @@ class Form * @param int $showempty Add an empty field * @return integer|null */ - function select_address($selected, $socid, $htmlname='address_id',$showempty=0) + function select_address($selected, $socid, $htmlname = 'address_id', $showempty = 0) { // phpcs:enable // looking for users @@ -3081,7 +3081,7 @@ class Form * @param int $addempty Add empty entry * @return void */ - function selectAvailabilityDelay($selected='',$htmlname='availid',$filtertype='',$addempty=0) + function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0) { global $langs,$user; @@ -3167,7 +3167,7 @@ class Form * @param int $addempty Add an empty entry * @return void */ - function selectInputReason($selected='',$htmlname='demandreasonid',$exclude='',$addempty=0) + function selectInputReason($selected = '', $htmlname = 'demandreasonid', $exclude = '', $addempty = 0) { global $langs,$user; @@ -3263,7 +3263,7 @@ class Form * @param string $morecss Add more CSS on select tag * @return void */ - function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='') + function select_conditions_paiements($selected = 0, $htmlname = 'condid', $filtertype = -1, $addempty = 0, $noinfoadmin = 0, $morecss = '') { // phpcs:enable global $langs, $user, $conf; @@ -3310,7 +3310,7 @@ class Form * @param string $morecss Add more CSS on select tag * @return void */ - function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='') + function select_types_paiements($selected = '', $htmlname = 'paiementtype', $filtertype = '', $format = 0, $empty = 1, $noadmininfo = 0, $maxlength = 0, $active = 1, $morecss = '') { // phpcs:enable global $langs,$user; @@ -3364,7 +3364,7 @@ class Form * @param string $htmlname Nom de la zone select * @return string Code of HTML select to chose tax or not */ - function selectPriceBaseType($selected='',$htmlname='price_base_type') + function selectPriceBaseType($selected = '', $htmlname = 'price_base_type') { global $langs; @@ -3402,7 +3402,7 @@ class Form * @param string $moreattrib To add more attribute on select * @return void */ - function selectShippingMethod($selected='',$htmlname='shipping_method_id',$filtre='',$useempty=0,$moreattrib='') + function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '') { global $langs, $conf, $user; @@ -3455,7 +3455,7 @@ class Form * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ - function formSelectShippingMethod($page, $selected='', $htmlname='shipping_method_id', $addempty=0) + function formSelectShippingMethod($page, $selected = '', $htmlname = 'shipping_method_id', $addempty = 0) { global $langs, $db; @@ -3540,7 +3540,7 @@ class Form * @param int $showempty Add a nempty line * @return string HTML select */ - function selectUnits($selected = '', $htmlname = 'units', $showempty=0) + function selectUnits($selected = '', $htmlname = 'units', $showempty = 0) { global $langs; @@ -3591,7 +3591,7 @@ class Form * @param int $showcurrency Show currency in label * @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...) */ - function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0) + function select_comptes($selected = '', $htmlname = 'accountid', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0) { // phpcs:enable global $langs, $conf; @@ -3661,7 +3661,7 @@ class Form * @param int $addempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. * @return void */ - function formSelectAccount($page, $selected='', $htmlname='fk_account', $addempty=0) + function formSelectAccount($page, $selected = '', $htmlname = 'fk_account', $addempty = 0) { global $langs; if ($htmlname != "none") { @@ -3699,7 +3699,7 @@ class Form * @return string * @see select_categories */ - function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0) + function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $excludeafterid = 0, $outputmode = 0) { // phpcs:enable global $conf, $langs; @@ -3790,7 +3790,7 @@ class Form * @deprecated * @see formconfirm() */ - function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) + function form_confirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = "", $useajax = 0, $height = 170, $width = 500) { // phpcs:enable dol_syslog(__METHOD__ . ': using form_confirm is deprecated. Use formconfim instead.', LOG_WARNING); @@ -3821,7 +3821,7 @@ class Form * @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a section. * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form */ - function formconfirm($page, $title, $question, $action, $formquestion='', $selectedchoice='', $useajax=0, $height=210, $width=500, $disableformtag=0) + function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 210, $width = 500, $disableformtag = 0) { global $langs,$conf; global $useglobalvars; @@ -4101,7 +4101,7 @@ class Form * @param int $nooutput No print is done. String is returned. * @return string Return html content */ - function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0) + function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0) { // phpcs:enable global $langs; @@ -4157,7 +4157,7 @@ class Form * @param int $addempty Add empty entry * @return void */ - function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) + function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0) { // phpcs:enable global $langs; @@ -4192,7 +4192,7 @@ class Form * @param int $addempty Ajoute entree vide * @return void */ - function form_availability($page, $selected='', $htmlname='availability', $addempty=0) + function form_availability($page, $selected = '', $htmlname = 'availability', $addempty = 0) { // phpcs:enable global $langs; @@ -4227,7 +4227,7 @@ class Form * @param int $addempty Add empty entry * @return void */ - function formInputReason($page, $selected='', $htmlname='demandreason', $addempty=0) + function formInputReason($page, $selected = '', $htmlname = 'demandreason', $addempty = 0) { global $langs; if ($htmlname != "none") @@ -4271,7 +4271,7 @@ class Form * @return string * @see selectDate */ - function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0) + function form_date($page, $selected, $htmlname, $displayhour = 0, $displaymin = 0, $nooutput = 0) { // phpcs:enable global $langs; @@ -4312,7 +4312,7 @@ class Form * @param array $include List of users id to include * @return void */ - function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='') + function form_users($page, $selected = '', $htmlname = 'userid', $exclude = '', $include = '') { // phpcs:enable global $langs; @@ -4353,7 +4353,7 @@ class Form * @param int $addempty 1=Add empty entry * @return void */ - function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1, $addempty=0) + function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0) { // phpcs:enable global $langs; @@ -4387,7 +4387,7 @@ class Form * @param string $htmlname Name of select html field * @return void */ - function form_multicurrency_code($page, $selected='', $htmlname='multicurrency_code') + function form_multicurrency_code($page, $selected = '', $htmlname = 'multicurrency_code') { // phpcs:enable global $langs; @@ -4417,7 +4417,7 @@ class Form * @param string $currency Currency code to explain the rate * @return void */ - function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='') + function form_multicurrency_rate($page, $rate = '', $htmlname = 'multicurrency_tx', $currency = '') { // phpcs:enable global $langs, $mysoc, $conf; @@ -4466,7 +4466,7 @@ class Form * @param int $discount_type 0 => customer discount, 1 => supplier discount * @return void */ - function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0) + function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter = '', $maxvalue = 0, $more = '', $hidelist = 0, $discount_type = 0) { // phpcs:enable global $conf,$langs; @@ -4557,7 +4557,7 @@ class Form * @param string $htmlname Name of HTML select. If 'none', we just show contact link. * @return void */ - function form_contacts($page, $societe, $selected='', $htmlname='contactid') + function form_contacts($page, $societe, $selected = '', $htmlname = 'contactid') { // phpcs:enable global $langs, $conf; @@ -4608,7 +4608,7 @@ class Form * @param int $nooutput No print output. Return it only. * @return void */ - function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array(), $nooutput=0) + function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0) { // phpcs:enable global $langs; @@ -4651,7 +4651,7 @@ class Form * @deprecated * @return void */ - function select_currency($selected='',$htmlname='currency_id') + function select_currency($selected = '', $htmlname = 'currency_id') { // phpcs:enable print $this->selectCurrency($selected, $htmlname); @@ -4664,7 +4664,7 @@ class Form * @param string $htmlname name of HTML select list * @return string */ - function selectCurrency($selected='',$htmlname='currency_id') + function selectCurrency($selected = '', $htmlname = 'currency_id') { global $conf,$langs,$user; @@ -4707,7 +4707,7 @@ class Form * @param integer $useempty 1=Add empty line * @return string */ - function selectMultiCurrency($selected='', $htmlname='multicurrency_code', $useempty=0) + function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0) { global $db,$conf,$langs,$user; @@ -4844,7 +4844,7 @@ class Form * @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key * @return string */ - function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0) + function load_tva($htmlname = 'tauxtva', $selectedrate = '', $societe_vendeuse = '', $societe_acheteuse = '', $idprod = 0, $info_bits = 0, $type = '', $options_only = false, $mode = 0) { // phpcs:enable global $langs,$conf,$mysoc; @@ -4906,7 +4906,7 @@ class Form $code_country.=",'".$societe_acheteuse->country_code."'"; } } - else if (! $idprod) // We don't know type of product + elseif (! $idprod) // We don't know type of product { $code_country.=",'".$societe_acheteuse->country_code."'"; } @@ -5044,7 +5044,7 @@ class Form * @deprecated * @see form_date, select_month, select_year, select_dayofweek */ - function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='') + function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') { // phpcs:enable $retstring = $this->selectDate($set_time, $prefix, $h, $m, $empty, $form_name, $d, $addnowlink, $disabled, $fullday, $addplusone, $adddateof); @@ -5077,7 +5077,7 @@ class Form * @return string Html for selectDate * @see form_date, select_month, select_year, select_dayofweek */ - function selectDate($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $disabled=0, $fullday='', $addplusone='', $adddateof='') + function selectDate($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') { global $conf,$langs; @@ -5440,7 +5440,7 @@ class Form * @param int $nooutput Do not output html string but return it * @return string|void */ - function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0) + function select_duration($prefix, $iSecond = '', $disabled = 0, $typehour = 'select', $minunderhours = 0, $nooutput = 0) { // phpcs:enable global $langs; @@ -5528,7 +5528,7 @@ class Form * @return string Return HTML string * @see selectForFormsList select_thirdparty */ - function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0) + function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0) { global $conf, $user; @@ -5598,7 +5598,7 @@ class Form * @return string Return HTML string * @see selectForForms */ - function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty='', $searchkey='', $placeholder='', $morecss='', $moreparams='', $forcecombo=0, $outputmode=0) + function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0) { global $conf, $langs, $user; @@ -5735,7 +5735,7 @@ class Form * @return string HTML select string. * @see multiselectarray, selectArrayAjax, selectArrayFilter */ - static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0) + static function selectarray($htmlname, $array, $id = '', $show_empty = 0, $key_in_label = 0, $value_as_key = 0, $moreparam = '', $translate = 0, $maxlen = 0, $disabled = 0, $sort = '', $morecss = '', $addjscombo = 0, $moreparamonempty = '', $disablebademail = 0, $nohtmlescape = 0) { global $conf, $langs; @@ -5845,7 +5845,7 @@ class Form * @return string HTML select string * @see selectArrayFilter, ajax_combobox in ajax.lib.php */ - static function selectArrayAjax($htmlname, $url, $id='', $moreparam='', $moreparamtourl='', $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0) + static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; global $delayedhtmlcontent; @@ -5947,7 +5947,7 @@ class Form * @return string HTML select string * @see selectArrayAjax, ajax_combobox in ajax.lib.php */ - static function selectArrayFilter($htmlname, $array, $id='', $moreparam='', $disableFiltering=0, $disabled=0, $minimumInputLength=1, $morecss='', $callurlonselect=0, $placeholder='', $acceptdelayedhtml=0) + static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; global $delayedhtmlcontent; @@ -6065,7 +6065,7 @@ class Form * @return string HTML multiselect string * @see selectarray, selectArrayAjax, selectArrayFilter */ - static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='', $elemtype='', $placeholder='', $addjscombo=-1) + static function multiselectarray($htmlname, $array, $selected = array(), $key_in_label = 0, $value_as_key = 0, $morecss = '', $translate = 0, $width = 0, $moreattrib = '', $elemtype = '', $placeholder = '', $addjscombo = -1) { global $conf, $langs; @@ -6264,7 +6264,7 @@ class Form * @param int $rendermode 0=Default, use multiselect. 1=Emulate multiselect (recommended) * @return string String with categories */ - function showCategories($id, $type, $rendermode=0) + function showCategories($id, $type, $rendermode = 0) { global $db; @@ -6309,7 +6309,7 @@ class Form * @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action * @return int <0 if KO, >=0 if OK */ - function showLinkedObjectBlock($object, $morehtmlright='',$compatibleImportElementsList=false) + function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false) { global $conf,$langs,$hookmanager; global $bc; @@ -6370,40 +6370,40 @@ class Form $tplpath = 'compta/'.$element; if (empty($conf->facture->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'facturerec') { + elseif ($objecttype == 'facturerec') { $tplpath = 'compta/facture'; $tplname = 'linkedobjectblockForRec'; if (empty($conf->facture->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'propal') { + elseif ($objecttype == 'propal') { $tplpath = 'comm/'.$element; if (empty($conf->propal->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'supplier_proposal') { + elseif ($objecttype == 'supplier_proposal') { if (empty($conf->supplier_proposal->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'shipping' || $objecttype == 'shipment') { + elseif ($objecttype == 'shipping' || $objecttype == 'shipment') { $tplpath = 'expedition'; if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'reception') { + elseif ($objecttype == 'reception') { $tplpath = 'reception'; if (empty($conf->reception->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'delivery') { + elseif ($objecttype == 'delivery') { $tplpath = 'livraison'; if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled } - else if ($objecttype == 'invoice_supplier') { + elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; } - else if ($objecttype == 'order_supplier') { + elseif ($objecttype == 'order_supplier') { $tplpath = 'fourn/commande'; } - else if ($objecttype == 'expensereport') { + elseif ($objecttype == 'expensereport') { $tplpath = 'expensereport'; } - else if ($objecttype == 'subscription') { + elseif ($objecttype == 'subscription') { $tplpath = 'adherents'; } @@ -6457,7 +6457,7 @@ class Form * @param array $excludelinksto Do not show links of this type, for exemple array('order') or array('supplier_order'). null or array() if no exclusion. * @return string <0 if KO, >0 if OK */ - function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinksto=array()) + function showLinkToObjectBlock($object, $restrictlinksto = array(), $excludelinksto = array()) { global $conf, $langs, $hookmanager; global $bc; @@ -6509,7 +6509,7 @@ class Form $possiblelinks=array_merge($possiblelinks, $hookmanager->resArray); } } - else if ($reshook > 0) + elseif ($reshook > 0) { if (is_array($hookmanager->resArray) && count($hookmanager->resArray)) { @@ -6630,7 +6630,7 @@ class Form * @param int $useempty 1=Add empty line * @return string See option */ - function selectyesno($htmlname, $value='', $option=0, $disabled=false, $useempty=0) + function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0) { global $langs; @@ -6672,7 +6672,7 @@ class Form * @param int $useempty Affiche valeur vide dans liste * @return void */ - function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) + function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0) { // phpcs:enable $sql = "SELECT rowid, label"; @@ -6730,7 +6730,7 @@ class Form * @param string $morehtmlright More html code to show after ref. * @return string Portion HTML with ref + navigation buttons */ - function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='') + function showrefnav($object, $paramid, $morehtml = '', $shownav = 1, $fieldid = 'rowid', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlstatus = '', $morehtmlright = '') { global $langs,$conf,$hookmanager; @@ -6832,7 +6832,7 @@ class Form { $ret.=dol_htmlentities($object->name); } - else if ($object->element == 'member') + elseif ($object->element == 'member') { $ret.=$object->ref.'
'; $fullname=$object->getFullName($langs); @@ -6842,23 +6842,23 @@ class Form $ret.= dol_htmlentities($fullname) . ((! empty($object->societe) && $object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':''); } } - else if (in_array($object->element, array('contact', 'user', 'usergroup'))) + elseif (in_array($object->element, array('contact', 'user', 'usergroup'))) { $ret.=dol_htmlentities($object->getFullName($langs)); } - else if (in_array($object->element, array('action', 'agenda'))) + elseif (in_array($object->element, array('action', 'agenda'))) { $ret.=$object->ref.'
'.$object->label; } - else if (in_array($object->element, array('adherent_type'))) + elseif (in_array($object->element, array('adherent_type'))) { $ret.=$object->label; } - else if ($object->element == 'ecm_directories') + elseif ($object->element == 'ecm_directories') { $ret.=''; } - else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); + elseif ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref); if ($morehtmlref) @@ -6880,7 +6880,7 @@ class Form * @param int $width Width of photo * @return string HTML code to output barcode */ - function showbarcode(&$object,$width=100) + function showbarcode(&$object, $width = 100) { global $conf; @@ -6917,7 +6917,7 @@ class Form * @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty. * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='') + static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '') { global $conf,$langs; @@ -6931,32 +6931,32 @@ class Form if (! empty($object->logo)) { if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs - else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small'); + elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small'); else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo; $originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo; } $email=$object->email; } - else if ($modulepart=='contact') + elseif ($modulepart=='contact') { $dir=$conf->societe->multidir_output[$entity].'/contact'; if (! empty($object->photo)) { if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini'); - else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small'); + elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo; $originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo; } $email=$object->email; $capture='user'; } - else if ($modulepart=='userphoto') + elseif ($modulepart=='userphoto') { $dir=$conf->user->dir_output; if (! empty($object->photo)) { if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_mini'); - else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small'); + elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo; $originalfile=get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo; } @@ -6964,13 +6964,13 @@ class Form $email=$object->email; $capture='user'; } - else if ($modulepart=='memberphoto') + elseif ($modulepart=='memberphoto') { $dir=$conf->adherent->dir_output; if (! empty($object->photo)) { if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini'); - else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); + elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; $originalfile=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo; } @@ -6985,7 +6985,7 @@ class Form if (! empty($object->photo)) { if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini'); - else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); + elseif ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small'); else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; $originalfile=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo; } @@ -7008,7 +7008,7 @@ class Form $ret.='Photo'; if ($addlinktofullsize) $ret.=''; } - else if ($altfile && file_exists($dir."/".$altfile)) + elseif ($altfile && file_exists($dir."/".$altfile)) { if ($addlinktofullsize) { @@ -7076,7 +7076,7 @@ class Form * @return string * @see select_dolusers */ - function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0', $multiple=false) + function select_dolgroups($selected = '', $htmlname = 'groupid', $show_empty = 0, $exclude = '', $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $multiple = false) { // phpcs:enable global $conf,$user,$langs; @@ -7191,7 +7191,7 @@ class Form * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes * @return string */ - function showCheckAddButtons($cssclass='checkforaction', $calljsfunction=0) + function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0) { global $conf, $langs; @@ -7230,7 +7230,7 @@ class Form * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes * @return string */ - function showFilterAndCheckAddButtons($addcheckuncheckall=0, $cssclass='checkforaction', $calljsfunction=0) + function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0) { $out.=$this->showFilterButtons(); if ($addcheckuncheckall) @@ -7252,7 +7252,7 @@ class Form * @param array $params param to give * @return string */ - function selectExpenseCategories($selected='', $htmlname='fk_c_exp_tax_cat', $useempty=0, $excludeid=array(), $target='', $default_selected=0, $params=array()) + function selectExpenseCategories($selected = '', $htmlname = 'fk_c_exp_tax_cat', $useempty = 0, $excludeid = array(), $target = '', $default_selected = 0, $params = array()) { global $db, $conf, $langs, $user; @@ -7341,7 +7341,7 @@ class Form * @param integer $useempty 1=Add empty line * @return string */ - function selectExpenseRanges($selected='', $htmlname='fk_range', $useempty=0) + function selectExpenseRanges($selected = '', $htmlname = 'fk_range', $useempty = 0) { global $db,$conf,$langs; @@ -7378,7 +7378,7 @@ class Form * @param integer $useid 0=use 'code' as key, 1=use 'id' as key * @return string */ - function selectExpense($selected='', $htmlname='fk_c_type_fees', $useempty=0, $allchoice=1, $useid=0) + function selectExpense($selected = '', $htmlname = 'fk_c_type_fees', $useempty = 0, $allchoice = 1, $useid = 0) { global $db,$langs; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 23aec0c3464..77812226138 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -70,7 +70,7 @@ class FormAccounting extends Form * @param int $disabledajaxcombo Disable ajax combo box. * @return string String with HTML select */ - function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0) + function select_journal($selectid, $htmlname = 'journal', $nature = 0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss = 'maxwidth300 maxwidthonsmartphone', $usecache = '', $disabledajaxcombo = 0) { // phpcs:enable global $conf,$langs; @@ -151,7 +151,7 @@ class FormAccounting extends Form * @param int $allcountries All countries * @return void */ - function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0) + function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { // phpcs:enable global $db,$langs,$user,$mysoc; @@ -267,7 +267,7 @@ class FormAccounting extends Form * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @return string String with HTML select */ - function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='') + function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss = 'maxwidth300 maxwidthonsmartphone', $usecache = '') { // phpcs:enable global $conf, $langs; @@ -356,7 +356,7 @@ class FormAccounting extends Form * @param string $morecss More css * @return string String with HTML select */ - function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') + function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth200') { // phpcs:enable diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 65d4597df3a..dd9cb1da961 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -64,7 +64,7 @@ class FormActions * @param string $morecss More css on select field * @return void */ - function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100') + function form_select_status_action($formname, $selected, $canedit = 1, $htmlname = 'complete', $showempty = 0, $onlyselect = 0, $morecss = 'maxwidth100') { // phpcs:enable global $langs,$conf; @@ -168,7 +168,7 @@ class FormActions * @param string $morehtmlright More html text on right of title line * @return int <0 if KO, >=0 if OK */ - function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='', $morehtmlright='') + function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlright = '') { global $langs,$conf,$user; global $bc; @@ -327,7 +327,7 @@ class FormActions * @param int $nooutput 1=No output * @return string */ - function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) + function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0, $nooutput = 0) { // phpcs:enable global $langs,$user,$form,$conf; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index ca4f7541814..04235da29ed 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -59,7 +59,7 @@ class FormAdmin * @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @return string Return HTML select string with list of languages */ - function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0) + function select_language($selected = '', $htmlname = 'lang_id', $showauto = 0, $filter = null, $showempty = '', $showwarning = 0, $disabled = 0, $morecss = '', $showcode = 0, $forcecombo = 0) { // phpcs:enable global $langs; @@ -100,7 +100,7 @@ class FormAdmin $out.= ''; } } - else if ($selected == $key) + elseif ($selected == $key) { $out.= ''; } @@ -131,7 +131,7 @@ class FormAdmin * @param string $moreattrib More attributes on html select tag * @return integer|null */ - function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') + function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib = '') { // phpcs:enable global $langs,$conf; @@ -167,7 +167,7 @@ class FormAdmin $prefix=''; // 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other if (preg_match('/^eldy/i', $file)) $prefix='0'; - else if (preg_match('/^smartphone/i', $file)) $prefix='2'; + elseif (preg_match('/^smartphone/i', $file)) $prefix='2'; else $prefix='3'; if ($file == $selected) @@ -293,7 +293,7 @@ class FormAdmin * @param string $htmlname Nom de la zone select * @return void */ - function select_timezone($selected,$htmlname) + function select_timezone($selected, $htmlname) { // phpcs:enable global $langs,$conf; @@ -349,7 +349,7 @@ class FormAdmin * @param int $showempty Add empty value * @return string Return HTML output */ - function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0) + function select_paper_format($selected = '', $htmlname = 'paperformat_id', $filter = 0, $showempty = 0) { // phpcs:enable global $langs; diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 65a3213bad8..f7a7199ab03 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -60,7 +60,7 @@ class FormBarCode * @param int $idForm Id du formulaire * @return string HTML select string */ - function setBarcodeEncoder($selected,$barcodelist,$code_id,$idForm='formbarcode') + function setBarcodeEncoder($selected, $barcodelist, $code_id, $idForm = 'formbarcode') { global $conf, $langs; @@ -123,7 +123,7 @@ class FormBarCode * @return void * @deprecated */ - function select_barcode_type($selected='', $htmlname='barcodetype_id', $useempty=0) + function select_barcode_type($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) { // phpcs:enable print $this->selectBarcodeType($selected, $htmlname, $useempty); @@ -137,7 +137,7 @@ class FormBarCode * @param int $useempty Display empty value in select * @return string */ - function selectBarcodeType($selected='', $htmlname='barcodetype_id', $useempty=0) + function selectBarcodeType($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) { global $langs, $conf; @@ -193,7 +193,7 @@ class FormBarCode * @return void * @deprecated */ - function form_barcode_type($page, $selected='', $htmlname='barcodetype_id') + function form_barcode_type($page, $selected = '', $htmlname = 'barcodetype_id') { // phpcs:enable print $this->formBarcodeType($page, $selected, $htmlname); @@ -207,7 +207,7 @@ class FormBarCode * @param string $htmlname Nom du formulaire select * @return string */ - function formBarcodeType($page, $selected='', $htmlname='barcodetype_id') + function formBarcodeType($page, $selected = '', $htmlname = 'barcodetype_id') { global $langs, $conf; $out = ''; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 40ba40d1b14..58c9950898c 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -60,7 +60,7 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types */ - function typent_array($mode=0, $filter='') + function typent_array($mode = 0, $filter = '') { // phpcs:enable global $langs,$mysoc; @@ -103,7 +103,7 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types d'effectifs */ - function effectif_array($mode=0, $filter='') + function effectif_array($mode = 0, $filter = '') { // phpcs:enable $effs = array(); @@ -145,7 +145,7 @@ class FormCompany * @param int $empty Add empty value in list * @return void */ - function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0) + function form_prospect_level($page, $selected = '', $htmlname = 'prospect_level_id', $empty = 0) { // phpcs:enable global $user, $langs; @@ -199,7 +199,7 @@ class FormCompany * @param string $htmlname Id of department * @return void */ - function select_departement($selected='',$country_codeid=0, $htmlname='state_id') + function select_departement($selected = '', $country_codeid = 0, $htmlname = 'state_id') { // phpcs:enable print $this->select_state($selected, $country_codeid, $htmlname); @@ -219,7 +219,7 @@ class FormCompany * @return string String with HTML select * @see select_country */ - function select_state($selected='',$country_codeid=0, $htmlname='state_id') + function select_state($selected = '', $country_codeid = 0, $htmlname = 'state_id') { // phpcs:enable global $conf,$langs,$user; @@ -332,7 +332,7 @@ class FormCompany * @param string $htmlname Name of HTML select field * @return void */ - function select_region($selected='',$htmlname='region_id') + function select_region($selected = '', $htmlname = 'region_id') { // phpcs:enable global $conf,$langs; @@ -398,7 +398,7 @@ class FormCompany * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ - function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') + function select_civility($selected = '', $htmlname = 'civility_id', $morecss = 'maxwidth100') { // phpcs:enable global $conf,$langs,$user; @@ -459,7 +459,7 @@ class FormCompany * @deprecated Use print xxx->select_juridicalstatus instead * @see select_juridicalstatus() */ - function select_forme_juridique($selected='', $country_codeid=0, $filter='') + function select_forme_juridique($selected = '', $country_codeid = 0, $filter = '') { // phpcs:enable print $this->select_juridicalstatus($selected, $country_codeid, $filter); @@ -476,7 +476,7 @@ class FormCompany * @param string $htmlname HTML name of select * @return string String with HTML select */ - function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code') + function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code') { // phpcs:enable global $conf,$langs,$user; @@ -581,7 +581,7 @@ class FormCompany * @param string $morecss More CSS on select component * @return int The selected third party ID */ - function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='', $morecss='') + function selectCompaniesForNewContact($object, $var_id, $selected = '', $htmlname = 'newcompany', $limitto = '', $forceid = 0, $moreparam = '', $morecss = '') { global $conf, $langs; @@ -740,7 +740,7 @@ class FormCompany * @param string $morecss Add more css to select component * @return void */ - function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $sortorder='position', $showempty=0, $morecss='') + function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '') { global $user, $langs; @@ -774,7 +774,7 @@ class FormCompany * @param string $morecss More css * @return string */ - function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') + function select_ziptown($selected = '', $htmlname = 'zipcode', $fields = '', $fieldsize = 0, $disableautocomplete = 0, $moreattrib = '', $morecss = '') { // phpcs:enable global $conf; @@ -805,7 +805,7 @@ class FormCompany * @param string $morecss More css * @return string HTML string with prof id */ - function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent') + function get_input_id_prof($idprof, $htmlname, $preselected, $country_code, $morecss = 'maxwidth100onsmartphone quatrevingtpercent') { // phpcs:enable global $conf,$langs; @@ -816,12 +816,12 @@ class FormCompany { if (isset($idprof)) { if ($idprof==1) $formlength=9; - else if ($idprof==2) $formlength=14; - else if ($idprof==3) $formlength=5; // 4 chiffres et 1 lettre depuis janvier - else if ($idprof==4) $formlength=32; // No maximum as we need to include a town name in this id + elseif ($idprof==2) $formlength=14; + elseif ($idprof==3) $formlength=5; // 4 chiffres et 1 lettre depuis janvier + elseif ($idprof==4) $formlength=32; // No maximum as we need to include a town name in this id } } - else if ($country_code == 'ES') + elseif ($country_code == 'ES') { if ($idprof==1) $formlength=9; //CIF/NIF/NIE 9 digits if ($idprof==2) $formlength=12; //NASS 12 digits without / @@ -833,9 +833,9 @@ class FormCompany $selected=$preselected; if (! $selected && isset($idprof)) { if ($idprof==1 && ! empty($this->idprof1)) $selected=$this->idprof1; - else if ($idprof==2 && ! empty($this->idprof2)) $selected=$this->idprof2; - else if ($idprof==3 && ! empty($this->idprof3)) $selected=$this->idprof3; - else if ($idprof==4 && ! empty($this->idprof4)) $selected=$this->idprof4; + elseif ($idprof==2 && ! empty($this->idprof2)) $selected=$this->idprof2; + elseif ($idprof==3 && ! empty($this->idprof3)) $selected=$this->idprof3; + elseif ($idprof==4 && ! empty($this->idprof4)) $selected=$this->idprof4; } $maxlength=$formlength; diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 45b9ae33a4e..d7cf1cd62d9 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -60,7 +60,7 @@ class FormContract * @param int $showempty Show empty line * @return int Nbr of project if OK, <0 if KO */ - function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1) { // phpcs:enable global $db,$user,$conf,$langs; @@ -78,7 +78,7 @@ class FormContract // CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma. if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; - else if ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') + elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') { $sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") "; $sql.= " OR c.fk_soc IS NULL)"; @@ -177,7 +177,7 @@ class FormContract * @param int $showempty Show empty line * @return int Nbr of project if OK, <0 if KO */ - function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1) { global $langs; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 94747481cb0..13cf88e9aa2 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -58,7 +58,7 @@ class FormCron extends Form * @param integer $readonly Select is read only or not * @return string HTML select field */ - function select_typejob($htmlname,$selected=0,$readonly=0) + function select_typejob($htmlname, $selected = 0, $readonly = 0) { // phpcs:enable global $langs; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index ca5a4d19c7d..4cb2ebad882 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -77,7 +77,7 @@ class FormFile * @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @return int <0 if KO, >0 if OK */ - function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='') + function form_attach_new_file($url, $title = '', $addcancel = 0, $sectionid = 0, $perm = 1, $size = 50, $object = '', $options = '', $useajax = 1, $savingdocmask = '', $linkfiles = 1, $htmlname = 'formuserfile', $accept = '', $sectiondir = '') { // phpcs:enable global $conf,$langs, $hookmanager; @@ -255,7 +255,7 @@ class FormFile * @return int <0 if KO, number of shown files if OK * @deprecated Use print xxx->showdocuments() instead. */ - function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') + function show_documents($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '') { // phpcs:enable $this->numoffiles=0; @@ -288,7 +288,7 @@ class FormFile * @param int $hideifempty Hide section of generated files if there is no file * @return string Output string with HTML array of documents (might be empty string) */ - function showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='',$object=null,$hideifempty=0) + function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '', $morepicto = '', $object = null, $hideifempty = 0) { // Deprecation warning if (! empty($iconPDF)) { @@ -380,7 +380,7 @@ class FormFile $modellist=ModeleThirdPartyDoc::liste_modeles($this->db); } } - else if ($modulepart == 'propal') + elseif ($modulepart == 'propal') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -389,7 +389,7 @@ class FormFile $modellist=ModelePDFPropales::liste_modeles($this->db); } } - else if ($modulepart == 'supplier_proposal') + elseif ($modulepart == 'supplier_proposal') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -398,7 +398,7 @@ class FormFile $modellist=ModelePDFSupplierProposal::liste_modeles($this->db); } } - else if ($modulepart == 'commande') + elseif ($modulepart == 'commande') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -434,7 +434,7 @@ class FormFile $modellist=ModelePDFDeliveryOrder::liste_modeles($this->db); } } - else if ($modulepart == 'ficheinter') + elseif ($modulepart == 'ficheinter') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -524,7 +524,7 @@ class FormFile $modellist=ModeleExports::liste_modeles($this->db); } } - else if ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') + elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -533,7 +533,7 @@ class FormFile $modellist=ModelePDFSuppliersOrders::liste_modeles($this->db); } } - else if ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') + elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -542,7 +542,7 @@ class FormFile $modellist=ModelePDFSuppliersInvoices::liste_modeles($this->db); } } - else if ($modulepart == 'supplier_payment') + elseif ($modulepart == 'supplier_payment') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -551,7 +551,7 @@ class FormFile $modellist=ModelePDFSuppliersPayments::liste_modeles($this->db); } } - else if ($modulepart == 'remisecheque') + elseif ($modulepart == 'remisecheque') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -587,7 +587,7 @@ class FormFile $modellist=ModeleAction::liste_modeles($this->db); } } - else if ($modulepart == 'expensereport') + elseif ($modulepart == 'expensereport') { if (is_array($genallowed)) $modellist=$genallowed; else @@ -596,7 +596,7 @@ class FormFile $modellist=ModeleExpenseReport::liste_modeles($this->db); } } - else if ($modulepart == 'unpaid') + elseif ($modulepart == 'unpaid') { $modellist=''; } @@ -887,7 +887,7 @@ class FormFile * @param string $filter Filter filenames on this regex string (Example: '\.pdf$') * @return string Output string with HTML link of documents (might be empty string). This also fill the array ->infofiles */ - function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter='') + function getDocumentsLink($modulepart, $modulesubdir, $filedir, $filter = '') { global $conf, $langs; @@ -1022,7 +1022,7 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_autoecmfiles */ - function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) + function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0) { // phpcs:enable global $user, $conf, $langs, $hookmanager; @@ -1412,7 +1412,7 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_documents */ - function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) + function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permtodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0) { // phpcs:enable global $user, $conf, $langs, $form; @@ -1465,72 +1465,72 @@ class FormFile include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $object_instance=new Societe($this->db); } - else if ($modulepart == 'invoice') + elseif ($modulepart == 'invoice') { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object_instance=new Facture($this->db); } - else if ($modulepart == 'invoice_supplier') + elseif ($modulepart == 'invoice_supplier') { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $object_instance=new FactureFournisseur($this->db); } - else if ($modulepart == 'propal') + elseif ($modulepart == 'propal') { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $object_instance=new Propal($this->db); } - else if ($modulepart == 'supplier_proposal') + elseif ($modulepart == 'supplier_proposal') { include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; $object_instance=new SupplierProposal($this->db); } - else if ($modulepart == 'order') + elseif ($modulepart == 'order') { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $object_instance=new Commande($this->db); } - else if ($modulepart == 'order_supplier') + elseif ($modulepart == 'order_supplier') { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $object_instance=new CommandeFournisseur($this->db); } - else if ($modulepart == 'contract') + elseif ($modulepart == 'contract') { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $object_instance=new Contrat($this->db); } - else if ($modulepart == 'product') + elseif ($modulepart == 'product') { include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $object_instance=new Product($this->db); } - else if ($modulepart == 'tax') + elseif ($modulepart == 'tax') { include_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; $object_instance=new ChargeSociales($this->db); } - else if ($modulepart == 'project') + elseif ($modulepart == 'project') { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $object_instance=new Project($this->db); } - else if ($modulepart == 'fichinter') + elseif ($modulepart == 'fichinter') { include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $object_instance=new Fichinter($this->db); } - else if ($modulepart == 'user') + elseif ($modulepart == 'user') { include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $object_instance=new User($this->db); } - else if ($modulepart == 'expensereport') + elseif ($modulepart == 'expensereport') { include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; $object_instance=new ExpenseReport($this->db); } - else if ($modulepart == 'holiday') + elseif ($modulepart == 'holiday') { include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $object_instance=new Holiday($this->db); @@ -1695,7 +1695,7 @@ class FormFile * @param string $param More param to add into URL * @return int Number of links */ - public function listOfLinks($object, $permtodelete=1, $action=null, $selected=null, $param='') + public function listOfLinks($object, $permtodelete = 1, $action = null, $selected = null, $param = '') { global $user, $conf, $langs, $user; global $sortfield, $sortorder; @@ -1831,7 +1831,7 @@ class FormFile * @param string $param More param on http links * @return string $out Output string with HTML */ - public function showPreview($file, $modulepart, $relativepath, $ruleforpicto=0, $param='') + public function showPreview($file, $modulepart, $relativepath, $ruleforpicto = 0, $param = '') { global $langs, $conf; diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 267d62af95f..3d0a84b074c 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -60,7 +60,7 @@ class FormIntervention * @param int $showempty Show empty line * @return int Nbre of project if OK, <0 if KO */ - function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1) + function select_interventions($socid = -1, $selected = '', $htmlname = 'interventionid', $maxlength = 16, $showempty = 1) { // phpcs:enable global $db,$user,$conf,$langs; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 226d5abc9d2..06fd860a560 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -183,7 +183,7 @@ class FormMail extends Form * @param string $type Mime type (can be dol_mimetype($file)) * @return void */ - function add_attached_files($path, $file='', $type='') + function add_attached_files($path, $file = '', $type = '') { // phpcs:enable $listofpaths=array(); @@ -268,7 +268,7 @@ class FormMail extends Form * @param string $removefileaction Name of action when removing file attachments * @return void */ - function show_form($addfileaction='addfile',$removefileaction='removefile') + function show_form($addfileaction = 'addfile', $removefileaction = 'removefile') { // phpcs:enable print $this->get_form($addfileaction, $removefileaction); @@ -285,7 +285,7 @@ class FormMail extends Form * @param string $removefileaction Name of action when removing file attachments * @return string Form to show */ - function get_form($addfileaction='addfile', $removefileaction='removefile') + function get_form($addfileaction = 'addfile', $removefileaction = 'removefile') { // phpcs:enable global $conf, $langs, $user, $hookmanager, $form; @@ -614,7 +614,7 @@ class FormMail extends Form $soc->fetch($this->toid); $out.= $soc->getNomUrl(1); } - else if ($this->totype == 'contact') + elseif ($this->totype == 'contact') { $contact=new Contact($this->db); $contact->fetch($this->toid); @@ -841,7 +841,7 @@ class FormMail extends Form $out.= '
'; } } - else if (empty($this->withmaindocfile)) // Do not show message if we asked to show the checkbox + elseif (empty($this->withmaindocfile)) // Do not show message if we asked to show the checkbox { $out.= $langs->trans("NoAttachedFiles").'
'; } @@ -924,7 +924,7 @@ class FormMail extends Form // Deal with format differences between message and signature (text / HTML) if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) { $this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']); - } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) { + } elseif(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) { $defaultmessage = dol_nl2br($defaultmessage); } @@ -1143,7 +1143,7 @@ class FormMail extends Form * @param string $label Label of template * @return ModelMail One instance of ModelMail */ - public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1, $label='') + public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '') { $ret = new ModelMail(); @@ -1267,7 +1267,7 @@ class FormMail extends Form * @param int $active 1=Only active template, 0=Only disabled, -1=All * @return int <0 if KO, nb of records found if OK */ - public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active=1) + public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active = 1) { $ret=array(); @@ -1378,7 +1378,7 @@ class FormMail extends Form * @param Object $object Object if applicable * @return array Array of substitution values for emails. */ - static function getAvailableSubstitKey($mode='formemail', $object=null) + static function getAvailableSubstitKey($mode = 'formemail', $object = null) { global $conf, $langs; diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index 067692f5094..95c2c057b40 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -40,7 +40,7 @@ class FormMailing extends Form * @param integer $show_empty Show empty option * @return string HTML select */ - public function selectDestinariesStatus($selectedid='', $htmlname='dest_status', $show_empty=0) + public function selectDestinariesStatus($selectedid = '', $htmlname = 'dest_status', $show_empty = 0) { global $langs; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 0cb5661e770..4a970797902 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -59,7 +59,7 @@ class FormMargin * @param boolean $force_price True of not * @return array Array with info */ - function getMarginInfosArray($object, $force_price=false) + function getMarginInfosArray($object, $force_price = false) { global $conf, $db; @@ -191,7 +191,7 @@ class FormMargin * @param boolean $force_price Force price * @return void */ - function displayMarginInfos($object, $force_price=false) + function displayMarginInfos($object, $force_price = false) { global $langs, $conf, $user; diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 5f6e5bd19bc..472af06c7b2 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -39,7 +39,7 @@ class FormOrder extends Form * @param string $hmlname Name of HTML select element * @return void */ - public function selectSupplierOrderStatus($selected='', $short=0, $hmlname='order_status') + public function selectSupplierOrderStatus($selected = '', $short = 0, $hmlname = 'order_status') { $options = array(); @@ -74,7 +74,7 @@ class FormOrder extends Form * @param int $addempty 0=list with no empty value, 1=list with empty value * @return array Tableau des sources de commandes */ - public function selectInputMethod($selected='',$htmlname='source_id',$addempty=0) + public function selectInputMethod($selected = '', $htmlname = 'source_id', $addempty = 0) { global $langs; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 5fc6df4e062..b60c7d50b02 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -67,7 +67,7 @@ class FormOther * @param int $fk_user Utilisateur créant le modèle * @return void */ - function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null) + function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null) { // phpcs:enable $sql = "SELECT rowid, label"; @@ -119,7 +119,7 @@ class FormOther * @param int $useempty Affiche valeur vide dans liste * @return void */ - function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0) + function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0) { // phpcs:enable $sql = "SELECT rowid, label"; @@ -168,7 +168,7 @@ class FormOther * @param string $htmlname Name of combo list * @return integer */ - function select_ecotaxes($selected='', $htmlname='ecotaxe_id') + function select_ecotaxes($selected = '', $htmlname = 'ecotaxe_id') { // phpcs:enable global $langs; @@ -227,7 +227,7 @@ class FormOther * @param string $country_code Country Code * @return string HTML select list */ - function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='') + function select_revenue_stamp($selected = '', $htmlname = 'revenuestamp', $country_code = '') { // phpcs:enable global $langs; @@ -290,7 +290,7 @@ class FormOther * @param int $showempty Add also an empty line * @return string HTML select string */ - function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0) + function select_percent($selected = 0, $htmlname = 'percent', $disabled = 0, $increment = 5, $start = 0, $end = 100, $showempty = 0) { // phpcs:enable $return = ''; print ''; print ''; print ''; print ''; print ''; } - else if (in_array($obj->id, $permsuser)) // Permission granted by user + elseif (in_array($obj->id, $permsuser)) // Permission granted by user { if ($caneditperms) { @@ -361,7 +361,7 @@ if ($result) print ''; } - else if (is_array($permsgroupbyentity[$entity])) + elseif (is_array($permsgroupbyentity[$entity])) { if (in_array($obj->id, $permsgroupbyentity[$entity])) // Permission granted by group { diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index b5b2f09a86c..ddeaba0e955 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -244,7 +244,7 @@ $server->register( * @param int $id Id of object * @return mixed */ -function getActionComm($authentication,$id) +function getActionComm($authentication, $id) { global $db,$conf,$langs; @@ -408,7 +408,7 @@ function getListActionCommType($authentication) * @param ActionComm $actioncomm $actioncomm * @return array Array result */ -function createActionComm($authentication,$actioncomm) +function createActionComm($authentication, $actioncomm) { global $db,$conf,$langs; @@ -491,7 +491,7 @@ function createActionComm($authentication,$actioncomm) * @param ActionComm $actioncomm $actioncomm * @return array Array result */ -function updateActionComm($authentication,$actioncomm) +function updateActionComm($authentication, $actioncomm) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 876caf98c94..74d175ac2c9 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -186,7 +186,7 @@ $server->register( * @param int $id Id of object * @return mixed */ -function getCategory($authentication,$id) +function getCategory($authentication, $id) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index c3b34ed3712..c8ce37f7d87 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -235,7 +235,7 @@ $server->register( * @param string $ref_ext Ref external of object * @return mixed */ -function getContact($authentication,$id,$ref_ext) +function getContact($authentication, $id, $ref_ext) { global $db,$conf,$langs; @@ -352,7 +352,7 @@ function getContact($authentication,$id,$ref_ext) * @param Contact $contact $contact * @return array Array result */ -function createContact($authentication,$contact) +function createContact($authentication, $contact) { global $db,$conf,$langs; @@ -463,7 +463,7 @@ function createContact($authentication,$contact) * @param int $idthirdparty Id thirdparty * @return array Array result */ -function getContactsForThirdParty($authentication,$idthirdparty) +function getContactsForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; @@ -595,7 +595,7 @@ function getContactsForThirdParty($authentication,$idthirdparty) * @param Contact $contact Contact * @return array Array result */ -function updateContact($authentication,$contact) +function updateContact($authentication, $contact) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index e31726ea252..68a18ac91c0 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -286,7 +286,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getInvoice($authentication,$id='',$ref='',$ref_ext='') +function getInvoice($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -399,7 +399,7 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='') * @param int $idthirdparty Id thirdparty * @return array Array result */ -function getInvoicesForThirdParty($authentication,$idthirdparty) +function getInvoicesForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; @@ -534,7 +534,7 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) * @param Facture $invoice Invoice * @return array Array result */ -function createInvoice($authentication,$invoice) +function createInvoice($authentication, $invoice) { global $db,$conf,$langs; @@ -654,7 +654,7 @@ function createInvoice($authentication,$invoice) * @param string $ref_ext_order ref_ext of order to copy invoice from * @return array Array result */ -function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $ref_ext_order='') +function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = '', $ref_ext_order = '') { global $db,$conf; @@ -740,7 +740,7 @@ function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $re * @param Facture $invoice Invoice * @return array Array result */ -function updateInvoice($authentication,$invoice) +function updateInvoice($authentication, $invoice) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 213d5fd4b3e..2cefbf3e988 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -344,7 +344,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getOrder($authentication,$id='',$ref='',$ref_ext='') +function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -496,7 +496,7 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='') * @param int $idthirdparty Id of thirdparty * @return array Array result */ -function getOrdersForThirdParty($authentication,$idthirdparty) +function getOrdersForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; @@ -655,7 +655,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty) * @param array $order Order info * @return int Id of new order */ -function createOrder($authentication,$order) +function createOrder($authentication, $order) { global $db,$conf,$langs; @@ -795,7 +795,7 @@ function createOrder($authentication,$order) * @param int $id_warehouse Id of warehouse to use for stock decrease * @return array Array result */ -function validOrder($authentication,$id='',$id_warehouse=0) +function validOrder($authentication, $id = '', $id_warehouse = 0) { global $db,$conf,$langs; @@ -875,7 +875,7 @@ function validOrder($authentication,$id='',$id_warehouse=0) * @param array $order Order info * @return array Array result */ -function updateOrder($authentication,$order) +function updateOrder($authentication, $order) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 88b2ba1f48b..d297e4be082 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -181,7 +181,7 @@ function getVersions($authentication) * @param string $refname Ref of object to check permission for external users (autodetect if not provided) * @return void */ -function getDocument($authentication, $modulepart, $file, $refname='') +function getDocument($authentication, $modulepart, $file, $refname = '') { global $db,$conf,$langs,$mysoc; diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index b1c74a221f3..d49a76af117 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -333,7 +333,7 @@ $server->register( * @param string $lang Lang to force * @return mixed */ -function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='') +function getProductOrService($authentication, $id = '', $ref = '', $ref_ext = '', $lang = '') { global $db,$conf,$langs; @@ -467,7 +467,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='' * @param Product $product Product * @return array Array result */ -function createProductOrService($authentication,$product) +function createProductOrService($authentication, $product) { global $db,$conf,$langs; @@ -635,7 +635,7 @@ function createProductOrService($authentication,$product) * @param Product $product Product * @return array Array result */ -function updateProductOrService($authentication,$product) +function updateProductOrService($authentication, $product) { global $db,$conf,$langs; @@ -823,7 +823,7 @@ function updateProductOrService($authentication,$product) * @param string $listofidstring List of id with comma * @return array Array result */ -function deleteProductOrService($authentication,$listofidstring) +function deleteProductOrService($authentication, $listofidstring) { global $db,$conf,$langs; @@ -903,7 +903,7 @@ function deleteProductOrService($authentication,$listofidstring) //$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel), 'listofid'=>$listofiddeleted); $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel), 'nbdeleted'=>0); } - else if (count($listofiddeleted) == 0) + elseif (count($listofiddeleted) == 0) { //$objectresp=array('result'=>array('result_code'=>'NOT_FOUND', 'result_label'=>'No product or service with id '.join(',',$listofid).' found'), 'listofid'=>$listofiddeleted); $objectresp=array('result'=>array('result_code'=>'NOT_FOUND', 'result_label'=>'No product or service with id '.join(',', $listofid).' found'), 'nbdeleted'=>0); @@ -920,7 +920,7 @@ function deleteProductOrService($authentication,$listofidstring) * @param array $filterproduct Filter fields * @return array Array result */ -function getListOfProductsOrServices($authentication,$filterproduct) +function getListOfProductsOrServices($authentication, $filterproduct) { global $db,$conf,$langs; @@ -997,7 +997,7 @@ function getListOfProductsOrServices($authentication,$filterproduct) * @param $lang $lang Force lang * @return array Array result */ -function getProductsForCategory($authentication,$id,$lang='') +function getProductsForCategory($authentication, $id, $lang = '') { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index bde94141d4c..bc8e53b62a6 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -329,7 +329,7 @@ function createProject($authentication, $project) * @param string $ref internal reference * @return array Array result */ -function getProject($authentication,$id='',$ref='') +function getProject($authentication, $id = '', $ref = '') { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index 84803016ad2..38b50520d5a 100644 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -223,7 +223,7 @@ $server->register( * @param string $ref_ext Ref_ext * @return array Array result */ -function getSupplierInvoice($authentication,$id='',$ref='',$ref_ext='') +function getSupplierInvoice($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -333,7 +333,7 @@ function getSupplierInvoice($authentication,$id='',$ref='',$ref_ext='') * @return array Array result * */ -function getSupplierInvoicesForThirdParty($authentication,$idthirdparty) +function getSupplierInvoicesForThirdParty($authentication, $idthirdparty) { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 258c749ab09..8b5672d81fd 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -283,7 +283,7 @@ $server->register( * @param string $ref_ext external reference * @return array Array result */ -function getThirdParty($authentication,$id='',$ref='',$ref_ext='') +function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -399,7 +399,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='') * @param Societe $thirdparty Thirdparty * @return array Array result */ -function createThirdParty($authentication,$thirdparty) +function createThirdParty($authentication, $thirdparty) { global $db,$conf,$langs; @@ -525,7 +525,7 @@ function createThirdParty($authentication,$thirdparty) * @param Societe $thirdparty Thirdparty * @return array Array result */ -function updateThirdParty($authentication,$thirdparty) +function updateThirdParty($authentication, $thirdparty) { global $db,$conf,$langs; @@ -655,7 +655,7 @@ function updateThirdParty($authentication,$thirdparty) * @param array $filterthirdparty Filter fields (key=>value to filer on. For example 'client'=>2, 'supplier'=>1, 'category'=>idcateg, 'name'=>'searchstring', ...) * @return array Array result */ -function getListOfThirdParties($authentication,$filterthirdparty) +function getListOfThirdParties($authentication, $filterthirdparty) { global $db,$conf,$langs; @@ -760,7 +760,7 @@ function getListOfThirdParties($authentication,$filterthirdparty) * @param string $ref_ext external reference * @return array Array result */ -function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='') +function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '') { global $db,$conf,$langs; diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index cc53a845747..ff320e8416d 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -301,7 +301,7 @@ $server->register( * @param string $ref_ext Ref external of object * @return mixed */ -function getUser($authentication,$id,$ref='',$ref_ext='') +function getUser($authentication, $id, $ref = '', $ref_ext = '') { global $db,$conf,$langs; @@ -473,7 +473,7 @@ function getListOfGroups($authentication) * @param array $thirdpartywithuser Datas * @return mixed */ -function createUserFromThirdparty($authentication,$thirdpartywithuser) +function createUserFromThirdparty($authentication, $thirdpartywithuser) { global $db,$conf,$langs; @@ -681,7 +681,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) * @param array $shortuser Array of login/password info * @return mixed */ -function setUserPassword($authentication,$shortuser) +function setUserPassword($authentication, $shortuser) { global $db,$conf,$langs; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index de9951bb34e..36e35d5a07c 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -301,7 +301,7 @@ class Website extends CommonObject * * @return int <0 if KO, >0 if OK */ - public function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter = array(), $filtermode='AND') + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -517,7 +517,7 @@ class Website extends CommonObject * @param string $newlang New language * @return mixed New object created, <0 if KO */ - public function createFromClone($user, $fromid, $newref, $newlang='') + public function createFromClone($user, $fromid, $newref, $newlang = '') { global $hookmanager, $langs; global $dolibarr_main_data_root; @@ -671,7 +671,7 @@ class Website extends CommonObject * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -707,7 +707,7 @@ class Website 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); } @@ -720,7 +720,7 @@ class Website 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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; @@ -1094,7 +1094,7 @@ class Website extends CommonObject * @param string $htmlname Suffix for HTML name * @return string HTML select component */ - public function componentSelectLang($languagecodes, $weblangs, $morecss='', $htmlname='') + public function componentSelectLang($languagecodes, $weblangs, $morecss = '', $htmlname = '') { global $websitepagefile, $website; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index f61af40dc48..cee9e247e2a 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -256,7 +256,7 @@ class WebsitePage extends CommonObject * @param string $filtermode Filter mode (AND or OR) * @return array|int int <0 if KO, array of pages if OK */ - public function fetchAll($websiteid, $sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND') + public function fetchAll($websiteid, $sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { dol_syslog(__METHOD__, LOG_DEBUG); @@ -407,7 +407,7 @@ class WebsitePage extends CommonObject * @param int $keeptitleunchanged 1=Keep title unchanged * @return mixed New object created, <0 if KO */ - public function createFromClone(User $user, $fromid, $newref, $newlang='', $istranslation=0, $newwebsite=0, $keeptitleunchanged=0) + public function createFromClone(User $user, $fromid, $newref, $newlang = '', $istranslation = 0, $newwebsite = 0, $keeptitleunchanged = 0) { global $hookmanager, $langs; @@ -472,7 +472,7 @@ class WebsitePage extends CommonObject * @param string $morecss Add more css on link * @return string String with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='') + function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '') { global $langs, $conf, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -507,7 +507,7 @@ class WebsitePage 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); } @@ -520,7 +520,7 @@ class WebsitePage 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($status,$mode=0) + function LibStatut($status, $mode = 0) { // phpcs:enable global $langs; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ca8eba5bc6b..8b31d448c5b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -677,7 +677,7 @@ if ($action == 'addcontainer') $error++; $action='createcontainer'; } - else if (! preg_match('/^[a-z0-9\-\_]+$/i', $objectpage->pageurl)) + elseif (! preg_match('/^[a-z0-9\-\_]+$/i', $objectpage->pageurl)) { $langs->load("errors"); setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities('WEBSITE_PAGENAME')), null, 'errors'); diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index dff057f7fc7..8fa7be90bb5 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -220,7 +220,7 @@ else * @param int $duration_value duration value * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget,$duration_value) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget, $duration_value) { global $conf,$langs; diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 3a19346fa0e..cb75cef08eb 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -187,7 +187,7 @@ else * @param int $duration_value duration value * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresentative,$duration_value) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative, $duration_value) { global $conf,$langs; diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index bd21ab55d38..6e6e02998c3 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -255,7 +255,7 @@ exit(0); * @param string $script_file filename * @return void */ -function usage($path,$script_file) +function usage($path, $script_file) { global $conf; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 316e0e534ad..d5768b8a51b 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -218,7 +218,7 @@ else * @param string $oldtarget Target name * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget) { global $conf,$langs; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 820de590cb6..ba8943171b6 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -192,7 +192,7 @@ else * @param string $oldsalerepresentative Old sale representative * @return int <0 if KO, >0 if OK */ -function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresentative) +function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldsalerepresentative) { global $conf,$langs; diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 3f986ae3fd0..0135faab59c 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -197,7 +197,7 @@ if ($result >= 0) if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) { $fuser->fetch('', '', $userKey[0]); // Chargement du user concerné par le SID - } else if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) { + } elseif ($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) { $fuser->fetch('', $userKey[0]); // Chargement du user concerné par le login } diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 9308fa0e798..712d8f8e074 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -195,7 +195,7 @@ if ($result >= 0) if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) { $fuser->fetch('', '', $ldapuser[$conf->global->LDAP_KEY_USERS]); // Chargement du user concerné par le SID - } else if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) { + } elseif ($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) { $fuser->fetch('', $ldapuser[$conf->global->LDAP_KEY_USERS]); // Chargement du user concerné par le login } diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 7156827ab72..720e1951788 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -171,7 +171,7 @@ class FactureRecTest extends PHPUnit_Framework_TestCase * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) { $retAr=array(); diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index c450d30d056..9ac4cd05f33 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -349,7 +349,7 @@ class FactureTest extends PHPUnit_Framework_TestCase * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) { $retAr=array(); diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index b6994863347..c4cfe63e9dc 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -321,7 +321,7 @@ class UserTest extends PHPUnit_Framework_TestCase * @param array $fieldstoignorearray Array of fields to ignore in diff * @return array Array with differences */ - public function objCompare($oA,$oB,$ignoretype=true,$fieldstoignorearray=array('id')) + public function objCompare($oA, $oB, $ignoretype = true, $fieldstoignorearray = array('id')) { $retAr=array();
'.$langs->trans("Status").''; +<<<<<<< HEAD if ( !empty($object->statut) ) print img_picto($langs->trans('TypeStatusActive'), 'statut4').' '.$langs->trans("InActivity"); else print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased"); +======= + if ( !empty($object->statut) ) { + print img_picto($langs->trans('TypeStatusActive'),'statut4').' '.$langs->trans("InActivity"); + } else { + print img_picto($langs->trans('TypeStatusInactive'),'statut5').' '.$langs->trans("ActivityCeased"); + } +>>>>>>> upstream/develop print '
'.$langs->trans("SubscriptionRequired").''; @@ -444,12 +457,12 @@ if ($rowid > 0) } // Add - if ( $user->rights->adherent->configurer && !empty($object->statut) ) + if ( $user->rights->adherent->configurer && !empty($object->statut) ) { - print ''; - } else { - print ''; - } + print ''; + } else { + print ''; + } // Delete if ($user->rights->adherent->configurer) @@ -538,11 +551,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') { @@ -598,8 +611,8 @@ if ($rowid > 0) print ''; print ''; - print '  '; - print ''; + print '  '; + print ''; print '
'.$langs->trans("Label").'
'.$langs->trans("Status").''; - print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut); - print '
'.$langs->trans("SubscriptionRequired").''; print $form->selectyesno("subscription", $object->subscription, 1); +======= + print '
'.$langs->trans("SubscriptionRequired").''; + print $form->selectyesno("subscription",$object->subscription,1); +>>>>>>> upstream/develop print '
'.$langs->trans("VoteAllowed").''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index f5e2fe7c360..facb13cf59f 100644 --- a/htdocs/admin/agenda_other.php +++ b/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)) { diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 44229e5dcb2..d92ce1ee213 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/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)) { diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 031e4200268..34becb49ada 100644 --- a/htdocs/admin/bank.php +++ b/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 diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index eb5e958f70c..3cee6aa27f4 100644 --- a/htdocs/admin/boxes.php +++ b/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']."'"; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index cead1eb3acb..3dc59b1b247 100644 --- a/htdocs/admin/commande.php +++ b/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 @@ -192,10 +192,8 @@ else if ($action == 'set_ORDER_FREE_TEXT') { setEventMessages($langs->trans("Error"), null, 'errors'); } -} - -// Activate Set Shippable Icon In List -else if ($action=="setshippableiconinlist") { +} elseif ($action=="setshippableiconinlist") { + // Activate Set Shippable Icon In List $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 +205,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 +222,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); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 447b5f521ee..14dde504460 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -136,9 +136,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) else dol_syslog($imgThumbMini); } else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); - } - else if (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) - { + } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); $tmparray=explode(':', $result); @@ -821,7 +819,7 @@ else { print '  '; } - 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 ''; } @@ -1097,11 +1095,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 +1149,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"); } diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index e9a47e4db8f..cead92670a4 100644 --- a/htdocs/admin/confexped.php +++ b/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"); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index ecba471fdbd..5624d6903fc 100644 --- a/htdocs/admin/const.php +++ b/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"; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 87d65d65e6b..7cad76585e2 100644 --- a/htdocs/admin/contract.php +++ b/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); diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d94ffeaf4e2..dff30150544 100644 --- a/htdocs/admin/dict.php +++ b/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 ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - 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 ''; if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - 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 ''; } - else if ($tmpfieldlist == 'joinfiles') { + elseif ($tmpfieldlist == 'joinfiles') { print ''; } 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; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 925cbd5b93a..cda216a452b 100644 --- a/htdocs/admin/menus/other.php +++ b/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"]); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index ce8e58e32b7..56590d0c187 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -142,6 +142,12 @@ if ($action=='install') setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file, 'module_*-x.y*.zip'), null, 'errors'); $error++; } + if (empty($_FILES['fileinstall']['tmp_name'])) + { + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors'); + $error++; + } } if (! $error) @@ -152,7 +158,7 @@ if ($action=='install') dol_mkdir($conf->admin->dir_temp.'/'.$original_file); } - $tmpdir=preg_replace('/\.zip$/', '', $original_file).'.dir'; + $tmpdir=preg_replace('/\.zip$/i', '', $original_file).'.dir'; if ($tmpdir) { @dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$tmpdir); @@ -207,6 +213,7 @@ if ($action=='install') } else { + setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors'); $error++; } } @@ -244,7 +251,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 +705,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 +768,7 @@ if ($mode == 'common') } print "'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'
'.$newkey.'"; - 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'); + if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*', ${$newkey}); + 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 ""; 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; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 2cb939c131d..82f73b8066c 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -166,7 +166,7 @@ print '
';
diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 21453ad26fd..b30494cc1c3 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -106,7 +106,7 @@ print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'

';
@@ -164,7 +164,7 @@ if (in_array($type, array('mysql', 'mysqli')))
diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index 49eba6a1902..830499f2c59 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/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; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index e0235d07067..bb397833ed3 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/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); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index a64e9e06baa..622a0f3ad9a 100644 --- a/htdocs/admin/translation.php +++ b/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 '' . img_edit_add($langs->trans("Overwrite")) . ''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index ed688d93b2c..2f6ee202a74 100644 --- a/htdocs/admin/website.php +++ b/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; diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 055d3d66dac..5595f94a950 100644 --- a/htdocs/api/class/api.class.php +++ b/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); } diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 2e9c0f92179..43a0aeb9bbb 100644 --- a/htdocs/api/class/api_login.class.php +++ b/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; diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 0122d858627..00a84a00555 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/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'); } diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 5bc79bd5a33..91a6f4956bf 100644 --- a/htdocs/asset/class/asset.class.php +++ b/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; diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index b175d827b31..50910f78014 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/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; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index e0e96bd68c1..36553ec2237 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -104,9 +104,7 @@ if ($action === 'downloadblockchain') { echo $bc; exit; -} -else if (GETPOST('downloadcsv', 'alpha')) -{ +} elseif (GETPOST('downloadcsv', 'alpha')) { $error = 0; $previoushash=''; @@ -608,4 +606,4 @@ print '

'; // End of page llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index 2e67cb1babc..e50e6db86d2 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/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) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index c5e2f8acefe..b85b3be4659 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/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 'System to track events into unalterable logs were enabled'; } - 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; diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index c50abf3aa5a..cbaacee2a2f 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/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)) { diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 074050d145f..96a7aaf23c8 100644 --- a/htdocs/cashdesk/facturation.php +++ b/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"). ' -----'; } diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 80406567ec3..13b5a441529 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/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']; } diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 1fe70ae4675..155c708c67a 100644 --- a/htdocs/categories/card.php +++ b/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; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 5117c0a709e..1d05f7035dc 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/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 = " >> ", $url='', $nocolor=0) + function print_all_ways($sep = " >> ", $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 { diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 934e29da06a..dc4ad6bd393 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -270,7 +270,7 @@ if ($action == 'edit') print ''; } -else if ($action != 'add') +elseif ($action != 'add') { if ($cnt_trans) print '
'; diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 1635ecd69e8..1f6e9280475 100644 --- a/htdocs/categories/viewcat.php +++ b/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); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index ed67a9f3db7..c7cea037944 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -791,11 +791,11 @@ if ($action == 'create') print '
'; $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 '
'; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects", $max); - else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects", $max); + elseif (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects", $max); else print $langs->trans("BoxTitleLastModifiedCustomers", $max); print ''.$langs->trans("FullList").'
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 
'.$langs->trans("XMoreLines", ($num - $nbofloop))."
'.$langs->trans("Total")."".price($total)." 
'.$langs->trans("BankAccountCountry").''; $conciliate=$object->canBeConciliated(); if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; - else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')'; + elseif ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')'; else print ($object->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')')); print '
'.$langs->trans("Country").''; $conciliate=$object->canBeConciliated(); if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')'; - else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')'; + elseif ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')'; else print ' 0)?'':' checked="checked"').'"> '.$langs->trans("DisableConciliation"); print '
'.$langs->trans("ErrorNoAccountancyModuleLoaded").'
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("Error").'
'.$langs->trans("ErrorNoAccountancyModuleLoaded").'
'.$langs->trans("FeatureNotYetAvailable").'
'.$langs->trans("Error").'
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '
' . $langs->trans("FeatureNotYetAvailable") . '
' . $langs->trans("Error") . '
'; } - else if ($nbbyrow < 0) $return .= '
'; + elseif ($nbbyrow < 0) $return .= '
'; $return.= "\n"; @@ -6821,7 +6821,7 @@ abstract class CommonObject $return.= '
'; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); - if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"), 'redstar'); - else if ($useringroup->admin) print img_picto($langs->trans("Administrator"), 'star'); + if ($useringroup->admin && ! $useringroup->entity) { + print img_picto($langs->trans("SuperAdministrator"), 'redstar'); + } elseif ($useringroup->admin) { + print img_picto($langs->trans("Administrator"), 'star'); + } print ''.$useringroup->lastname.''.$useringroup->firstname.''.$useringroup->getLibStatut(3).''; - if (! empty($user->admin)) - { + if (! empty($user->admin)) { print ''; print img_picto($langs->trans("RemoveFromGroup"), 'unlink'); print ''; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index ae38f7e6f97..d765b01f651 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -121,7 +121,7 @@ foreach($fulltree as $key => $val) { $li.=img_picto($langs->trans("SuperAdministrator"), 'redstar'); } - else if ($userstatic->admin) + elseif ($userstatic->admin) { $li.=img_picto($langs->trans("Administrator"), 'star'); } diff --git a/htdocs/user/home.php b/htdocs/user/home.php index e0fe3af9a03..5c1d20ab544 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -156,7 +156,7 @@ if ($resql) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); } - else if ($obj->admin) + elseif ($obj->admin) { print img_picto($langs->trans("Administrator"), 'star'); } diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ffe76f0c749..22601df793f 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -504,7 +504,7 @@ while ($i < min($num, $limit)) { print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); } - else if ($obj->admin) + elseif ($obj->admin) { print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); } @@ -553,7 +553,7 @@ while ($i < min($num, $limit)) $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1); } - else if ($obj->ldap_sid) + elseif ($obj->ldap_sid) { print $langs->trans("DomainUser"); } @@ -604,7 +604,7 @@ while ($i < min($num, $limit)) { print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); } - else if ($obj->admin2) + elseif ($obj->admin2) { print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"'); } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index b3fef3cf07b..ce57f2cfe9d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -350,7 +350,7 @@ if ($result) print img_picto($langs->trans("Active"), 'tick'); print '