diff --git a/.mailmap b/.mailmap index 436b557ee63..ae4b0eb7146 100644 --- a/.mailmap +++ b/.mailmap @@ -21,9 +21,9 @@ Florian Henry FHenry Florian HENRY Florian Henry FHenry Florian Henry HENRY Florian -Alexandre Spangaro aspangaro -Alexandre Spangaro Spangaro Alexandre -Alexandre Spangaro Alexandre SPANGARO +Alexandre Spangaro aspangaro +Alexandre Spangaro Spangaro Alexandre +Alexandre Spangaro Alexandre SPANGARO Raphaël Doursenaud Raphaël Doursenaud Philippe Grand Grand Philippe Philippe Grand Philippe GRAND diff --git a/README-FR.md b/README-FR.md index 19d4ae25df9..4feb27893e0 100644 --- a/README-FR.md +++ b/README-FR.md @@ -15,37 +15,43 @@ Dolibarr est distribué sous les termes de la licence GNU General Public License ## INSTALLER DOLIBARR -Si vous n'avez pas de connaissances techniques, et que vous recherchez -un programme d'installation qui installe Dolibarr ERP/CRM en quelques clics, -vous devez vous ré-orienter vers DoliWamp (la version tout-en-un -de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou -Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat, -OpenSuse, Mandriva ou Mageia). +### Configuration simple -Vous pouvez les télécharger depuis la rubrique *download* du portail officiel: -https://www.dolibarr.org/ +Si vous avez peu de compétences techniques et que vous souhaitez installer Dolibarr ERP/CRM en quelques clics, vous pouvez utiliser l'une des versions pré-packagées avec les prérequis: -Si vous avez déjà installé un serveur Web avec PHP et une base de données (MariaDb/MySql/PostgreSql), -vous pouvez installer Dolibarr avec cette version de la manière suivante: +- DoliWamp pour Windows +- DoliDeb pour Debian ou Ubuntu +- DoliRpm pour Redhat, Fedora, OpenSuse, Mandriva ou Mageia -- Copiez le répertoire "dolibarr" et son contenu dans la racine de votre serveur - web, ou bien copiez le répertoire sur le serveur et configurez ce serveur pour - utiliser "dolibarr/htdocs" comme racine d'un nouveau virtual host (ce second - choix requiert des compétences et habilitations en administration du serveur - web). - -- Créez un fichier vide "htdocs/conf/conf.php" et attribuez les permissions - en lecture et écriture pour le user du serveur web (les permissions en - écriture seront supprimées une fois l'installation terminée). +Les packages peuvent être téléchargés à partir de [site web officiel] (https://www.dolibarr.org/). -- Depuis votre navigateur, appelez la page "install/" de dolibarr. L'url dépend - du choix fait à la première étape: - http://localhost/dolibarr/htdocs/install/ - ou - http://yourdolibarrvirtualhost/install/ - -- Suivez les instructions fournies par l'installateur... +### Configuration avancée +Vous pouvez aussi utiliser un serveur Web et une base de données prise en charge (MariaDB, MySQL ou PostgreSQL) pour installer la version standard. + +- Décompressez l'archive .zip téléchargée pour copier le répertoire "dolibarr/htdocs" et tous ses fichiers à la racine du serveur Web ou récupérez-les directement à partir de GitHub (recommandé si vous connaissez git): + +  git clone https://github.com/dolibarr/dolibarr -b x.y (où x.y est la version principale comme 3.6, 9.0, ...) + +- Configurez votre serveur Web pour qu'il utilise "*dolibarr/htdocs*" en tant que racine si votre serveur Web ne possède pas déjà de répertoire défini vers lequel pointer. +  +- Créez un fichier `htdocs/conf/conf.php` vide et définissez les autorisations d'*écrire* pour l'utilisateur de votre serveur Web (l'autorisation *écrire* sera supprimée une fois l'installation terminée) + +- Depuis votre navigateur, allez à la page "install/" de dolibarr + +    L’URL dépendra de la façon dont votre configuration Web a été configurée pour pointer vers votre installation de dolibarr. Cela peut ressembler à: + +        http://localhost/dolibarr/htdocs/install/ +         +    ou +     +        http://localhost/dolibarr/install/ +         +    ou +     +    http://yourdolibarrvirtualhost/install/ +    +- Suivez les instructions de l'installateur ## METTRE A JOUR DOLIBARR diff --git a/README.md b/README.md index bcff409035f..9dfd1a8a750 100644 --- a/README.md +++ b/README.md @@ -29,27 +29,6 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git ## INSTALLING -### Download - -Releases can be downloaded from [official website](https://www.dolibarr.org/). - -### Install from composer - -If you do not already have Composer installed, you may do so by following the instructions at [getcomposer.org](https://getcomposer.org/). On Linux and macOS, you may run the following commands: - -```bash -curl -sS https://getcomposer.org/installer | php -mv composer.phar /usr/local/bin/composer -``` - -On Windows, you can download and run https://getcomposer.org/Composer-Setup.exe - -You can then create a new project - -```bash -composer create-project dolibarr/dolibarr erp -``` - ### Simple setup If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: @@ -58,16 +37,23 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM - DoliDeb for Debian or Ubuntu - DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia +Releases can be downloaded from [official website](https://www.dolibarr.org/). + ### Advanced setup You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. -- Uncompress the downloaded archive -- Copy the "dolibarr" directory and all its files inside your web server root or anywhere you'd like and set up your web server to use "*dolibarr/htdocs*" as root for a new web server virtual host (second choice need to be server administrator) -- Create an empty `htdocs/conf/conf.php` file and set permissions for your web server user (*write* permissions will be removed once install is finished) +- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you known git): + + git clone https://github.com/dolibarr/dolibarr -b x.y (where x.y is main version like 3.6, 9.0, ...) + +- Set up your web server to use "*dolibarr/htdocs*" as root if you'r web server does not have directory to point to already defined. + +- Create an empty `htdocs/conf/conf.php` file and set *write* permissions for your web server user (*write* permission will be removed once install is finished) + - From your browser, go to the dolibarr "install/" page - The URL will depends on choices made in the first step: + The URL will depends on how you web setup was setup to point to your dolibarr installation. It may looks like: http://localhost/dolibarr/htdocs/install/ @@ -81,6 +67,11 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) - Follow the installer instructions +### Saas/Cloud setup + +If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free. + + ## UPGRADING diff --git a/build/doxygen/doxygen_header.html b/build/doxygen/doxygen_header.html index fe316d2081e..c83191268d7 100644 --- a/build/doxygen/doxygen_header.html +++ b/build/doxygen/doxygen_header.html @@ -42,7 +42,7 @@ src="https://www.facebook.com/tr?id=1998533953704960&ev=PageView&noscript=1" - '; if ($action != 'editdocref') - print ''; + print ''; print '
$projectname
- $projectnumber
+ '; if ($action != 'editjournal') - print ''; + print ''; print '
diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl index b7c5ecb6230..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 @@ -43,5 +43,5 @@ DoliWampWillStartApacheMysql=DoliWamp installer will now start or restart Apache OldVersionFoundAndMoveInNew=An old database version has been found and moved to be used by new Dolibarr version OldVersionFoundButFailedToMoveInNew=An old database version has been found but could not be moved to be used with new Dolibarr version -DLLMissing=The "Visual C++ Redistributable for Visual Studio 2012" component is missing. Please install the 32-bit version (vcredit_x86.exe) first from https://www.microsoft.com/en-us/download/details.aspx?id=30679 and restart DoliWamp installation/upgrade. +DLLMissing=Your Windows installation is missing The "Micrsoft Visual C++ Redistributable for Visual Studio 2012" component. Please install the 32-bit version (vcredist_x86.exe) first (you can find it at https://www.microsoft.com/en-us/download/) and restart DoliWamp installation/upgrade after. ContinueAnyway=Continue anyway (install process may fails without this prerequisite) diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl index 8c7cff0bb42..2e93a44081e 100644 --- a/build/exe/doliwamp/Languages/MyFrench.isl +++ b/build/exe/doliwamp/Languages/MyFrench.isl @@ -11,10 +11,10 @@ LaunchProgram=Ex 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 prrequis (Apache, Mysql et PHP) optimiss pour une utilisation de Dolibarr. -IfYouHaveTechnicalKnowledge=Si vous cherchez un hbergement dans le Cloud, aller voir sur https://saas.dolibarr.org. Si vous avez des comptences techniques et voulez grer vous mme Apache, Mysql et PHP, vous ne devriez pas utiliser cet assistant mais faire plutt une installation manuelle de Dolibarr sur votre socle Apache, Mysql et PHP existant. -ButIfYouLook=Mais si vous recherchez une installation automatise locale sur votre ordinateur, cl en main, vous tes sur la bonne voie... +YouWillInstallDoliWamp=Vous allez installer ou mettre jour DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prrequis 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 donnes. Faites-le si vous tes prt grer les sauvegardes vous-mme srieusement. Sinon, utilisez plutt une installation en Saas (voir https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=De plus, si vous avez des comptences 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 plutt 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 automatise sur une poste local, vous tes sur la bonne voie... DoYouWantToStart=Voulez-vous dmarrer le processus d'installation/mise jour ? TechnicalParameters=Paramtres techniques @@ -33,7 +33,7 @@ PortAlreadyInUse=Le port %1 semble d FirefoxDetected=Firefox a t dtect sur votre ordinateur. Voulez-vous en faire votre navigateur par dfaut pour Dolibarr ? ChromeDetected=Chrome a t dtect sur votre ordinateur. Voulez-vous en faire votre navigateur par dfaut pour Dolibarr ? -ChooseDefaultBrowser=Merci de choisir votre navigateur par dfaut. Si vous n'tes pas sr, cliquez simplement sur Ouvrir : +ChooseDefaultBrowser=Merci de choisir votre navigateur par dfaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'tes pas sr, cliquez simplement sur Ouvrir : LaunchNow=Lancer Dolibarr maintenant @@ -44,3 +44,5 @@ DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant d OldVersionFoundAndMoveInNew=Une ancienne version de base a t trouve et dplace pour fonctionner avec la nouvelle version de Dolibarr. OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a t trouve mais ne peut tre dplace pour tre utilise avec la nouvelle version de Dolibarr. +DLLMissing=L'installation de votre Windows est incomplte. 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 aprs. +ContinueAnyway=Continuer malgr tout (le process d'installaton chouera) diff --git a/build/exe/doliwamp/index.php.install b/build/exe/doliwamp/index.php.install index c511d973393..1245e1f18b2 100644 --- a/build/exe/doliwamp/index.php.install +++ b/build/exe/doliwamp/index.php.install @@ -530,7 +530,7 @@ a:hover { -'; if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print ''; if (! empty($arrayfields['aa.active']['checked'])) print ''; - print ''; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index e8f6b8e43b7..637d9548eb9 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * @@ -221,10 +221,10 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); } } - if ($id == 3 && ! is_numeric($_POST["code"])) + if (! is_numeric($_POST["code"])) { $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric", $langs->transnoentities("Code")), null, 'errors'); } // Clean some parameters @@ -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.=","; @@ -462,11 +462,6 @@ $linkback=''; print load_fiche_titre($titre,$linkback,'title_accountancy'); -if (empty($id)) -{ - print $langs->trans("DictionaryDesc"); - print " ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; -} print "
\n"; @@ -522,7 +517,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { @@ -540,7 +535,7 @@ if ($id) { print '
'; } @@ -578,7 +573,7 @@ if ($id) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add'); } - print ''; print ""; @@ -611,7 +606,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; } @@ -639,7 +634,7 @@ if ($id) } } print ''; - print ''; @@ -652,7 +647,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; /* @@ -707,7 +702,7 @@ if ($id) if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit'); - print ''; } else @@ -724,7 +719,7 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($value == 'type_template') { @@ -734,14 +729,14 @@ if ($id) { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; } - else if ($value == 'source') + elseif ($value == 'source') { $valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow; } - else if ($valuetoshow=='all') { + elseif ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); } - else if ($fieldlist[$field]=='country') { + elseif ($fieldlist[$field]=='country') { if (empty($obj->country_code)) { $valuetoshow='-'; @@ -752,7 +747,7 @@ if ($id) $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country); } } - else if ($fieldlist[$field]=='country_id') { + elseif ($fieldlist[$field]=='country_id') { $showfield=0; } @@ -816,7 +811,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='') +function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db; global $form; @@ -879,4 +874,3 @@ function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='') } } } - diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index a2ec757b212..449d425b846 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -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.php b/htdocs/accountancy/admin/categories.php index 6e003738173..14eec9fa58a 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Alexandre Spangaro + * Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -171,7 +171,7 @@ if ($action == 'display' || $action == 'delete') { print ''; print ''; print ''; - print ''; } @@ -531,7 +531,7 @@ if ($id) fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'add'); } - print ''; print ""; @@ -559,7 +559,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; } @@ -607,7 +607,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; @@ -693,16 +693,16 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($value == 'category_type') { $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; @@ -873,4 +873,3 @@ function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $contex } } } - diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 2f41dfa4bfd..1cd00627aa3 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2019 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -55,6 +55,8 @@ $list_account_main = array ( $list_account = array ( 'ACCOUNTING_PRODUCT_BUY_ACCOUNT', 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT', + 'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT', + 'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT', 'ACCOUNTING_SERVICE_BUY_ACCOUNT', 'ACCOUNTING_SERVICE_SOLD_ACCOUNT', 'ACCOUNTING_VAT_BUY_ACCOUNT', diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 6ef4bdda90b..21fef9a1930 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index ca0de98875f..06641d7d0a9 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -133,7 +133,7 @@ if ($result) print ''; print ''; print ''; - print ''; + print ''; print ''; if ($num) { @@ -149,7 +149,7 @@ if ($result) print ''; print ''; print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 297a3026b02..19f6da0c922 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -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/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 3141a624194..9dfa7a681e2 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2016 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index d3a62b5a6ab..236ca09cfee 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France * diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 60a81df9a56..b3b8a67241b 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent @@ -202,11 +202,11 @@ if (! empty($user->admin)) print ''; print ''; if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { - print ''; } else { - print ''; } @@ -215,11 +215,11 @@ if (! empty($user->admin)) print ''; print ''; if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { - print ''; } else { - print ''; } @@ -228,11 +228,11 @@ if (! empty($user->admin)) print ''; print ''; if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) { - print ''; } else { - print ''; } @@ -241,11 +241,11 @@ if (! empty($user->admin)) print ''; print ''; if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; } else { - print ''; } @@ -254,11 +254,11 @@ if (! empty($user->admin)) print ''; print ''; if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; } else { - print ''; } @@ -277,7 +277,7 @@ foreach ($list as $key) $label = $langs->trans($key); print ''; // Value - print ''; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 49745676eb3..f8f7a5f7a54 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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.=","; @@ -429,7 +429,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { @@ -441,7 +441,7 @@ if ($id) { print ''; } @@ -480,7 +480,7 @@ if ($id) fieldListJournal($fieldlist,$obj,$tabname[$id],'add'); } - print ''; print ""; @@ -508,7 +508,7 @@ if ($id) // There is several pages if ($num > $listlimit) { - print ''; } @@ -537,7 +537,7 @@ if ($id) // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees $showfield=1; // By defaut - $align="left"; + $class="left"; $sortable=1; $valuetoshow=''; /* @@ -606,16 +606,16 @@ if ($id) { $showfield=1; - $align="left"; + $class="left"; $valuetoshow=$obj->{$fieldlist[$field]}; if ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); } - else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { + elseif ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { $key=$langs->trans("AccountingJournalType".strtoupper($obj->nature)); $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { + elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { $valuetoshow=$langs->trans($obj->label); } @@ -630,8 +630,8 @@ if ($id) if (isset($obj->code) && $id != 10) { if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } - else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } - else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } + elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } + elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } $canbemodified=$iserasable; @@ -696,7 +696,7 @@ $db->close(); * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered * @return void */ -function fieldListJournal($fieldlist, $obj='', $tabname='', $context='') +function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '') { global $conf,$langs,$db; global $form, $mysoc; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index bce4f12e559..78d2ac08e14 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index de7fa495770..86d513d059a 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Florian Henry - * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2016-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -235,7 +235,7 @@ if ($action != 'export_csv') print $langs->trans('to'); print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, ''); print ''; - print ''; @@ -245,9 +245,9 @@ if ($action != 'export_csv') print ''; print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); - print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -274,7 +274,7 @@ if ($action != 'export_csv') { // Affiche un Sous-Total par compte comptable if ($displayed_account != "") { - print ''; + print ''; print "\n"; print ''; } @@ -293,9 +293,9 @@ if ($action != 'export_csv') print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; print "\n"; @@ -305,11 +305,11 @@ if ($action != 'export_csv') $sous_total_credit += $line->credit; } - print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; print ''; diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index a01c42b285a..c2e34270438 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2015 Jean-François Ferry * @@ -117,19 +117,19 @@ if ($resql) { $row = $db->fetch_row($resql); print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $i ++; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 567fccaeab1..105c87409c1 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2017 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * @@ -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)) @@ -171,8 +171,8 @@ else if ($action == "add") { $object->doc_ref = GETPOST('doc_ref','alpha'); $object->code_journal = $journal_code; $object->journal_label = $journal_label; - $object->fk_doc = GETPOST('fk_doc','alpha'); - $object->fk_docdet = GETPOST('fk_docdet','alpha'); + $object->fk_doc = GETPOST('fk_doc','int'); + $object->fk_docdet = GETPOST('fk_docdet','int'); if (floatval($debit) != 0.0) { $object->montant = $debit; @@ -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); @@ -436,7 +436,7 @@ if ($action == 'create') print $langs->trans('Docdate'); print ''; if ($action != 'editdate') - print ''; + print ''; print '
+
  • {$langues[$langue]['autreLangue1']} - {$langues[$langue]['autreLangue2']}
  • 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/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 14f28a71edc..bbdfa564183 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -589,7 +589,8 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/dav/tests`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index f8e0ba23011..4e6669de03c 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/initdata/generate-order.php b/dev/initdata/generate-order.php index 5e53fa752a2..e0adb2a256e 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -220,4 +220,3 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) dol_print_error($db,$object->error); } } - diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index 393d5c5ce3d..f1b6c25e92a 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -96,5 +96,3 @@ for ($s = 0 ; $s < GEN_NUMBER_PRODUIT ; $s++) if ($ret < 0) print "Error $ret - ".$produit->error."\n"; else print " OK with ref ".$produit->ref."\n"; } - - diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 7f2c3e2055d..3744abeae7c 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -127,5 +127,3 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) print "Error: ".$soc->error."\n"; } } - - diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 2bdf200225b..63a10d84bc5 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -275,4 +275,3 @@ else } $db->close(); - diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 879d791b8e9..b5c1ae5b6a9 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -65,7 +65,7 @@ 0 - + @@ -392,6 +401,7 @@ + @@ -419,4 +429,8 @@ + + + + diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 123b7f6157d..569bcc9dfd4 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"; @@ -221,8 +221,8 @@ class autoTranslator } if ($key == 'CHARSET') $val=$this->_outputpagecode; - else if (preg_match('/^Format/',$key)) $val=$value; - else if ($value=='-') $val=$value; + elseif (preg_match('/^Format/',$key)) $val=$value; + elseif ($value=='-') $val=$value; else { // If not translated then translate diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 0e3b2c7513f..556a0fce254 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; } @@ -388,4 +388,3 @@ if ($web) } exit; - diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php index 92233d71b98..685626d6c11 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 c9b72d9cc4c..6a6e1f44a6a 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2016-2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -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); } @@ -298,7 +298,7 @@ if ($resql) if (! empty($arrayfields['aa.pcg_type']['checked'])) print '
 '; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; 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 ''; + print ''; print ''; print '
'; + print '
'; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
'; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ' '; + print ' '; print ' 
' . length_accountg($cpt->account_number) . '' . $cpt->label . ''; + print ''; print ""; print img_delete($langs->trans("DeleteFromCat")).' '; print $langs->trans("DeleteFromCat").""; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 1f10403f798..e18be1b8d60 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011-2017 Alexandre Spangaro + * Copyright (C) 2011-2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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.=","; @@ -467,7 +467,7 @@ if ($id) // dans les dictionnaires de donnees $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate - $align="left"; + $class="left"; if ($fieldlist[$field]=='type') { if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); else $valuetoshow=$langs->trans("Type"); @@ -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 ''; + print ''; print ''; print '
'; + print '
'; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
' . $langs->trans("DateEnd") . '' . $langs->trans("NumberOfAccountancyEntries") . '' . $langs->trans("NumberOfAccountancyMovements") . '' . $langs->trans("Statut") . '' . $langs->trans("Statut") . '
' . dol_print_date($db->jdate($obj->date_end), 'day') . '' . $object->getAccountancyEntriesByFiscalYear($obj->date_start, $obj->date_end) . '' . $object->getAccountancyMovementsByFiscalYear($obj->date_start, $obj->date_end) . '' . $fiscalyearstatic->LibStatut($obj->statut, 5) . '' . $fiscalyearstatic->LibStatut($obj->statut, 5) . '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '
' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '
' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '
' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print '
' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''.$label.''; + print ''; print ''; 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 ''; + print ''; print ''; print '
'; + print '
'; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
'; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ' 
' . length_accountg($line->numero_compte) . '' . $description . '' . price($line->debit) . '' . price($line->credit) . '' . price($line->credit - $line->debit) . '' . price($line->debit) . '' . price($line->credit) . '' . price($line->credit - $line->debit) . '' . $link; print '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . '
' . $langs->trans("SubTotal") . ':' . price($sous_total_debit) . '' . price($sous_total_credit) . '' . price(price2num($sous_total_credit - $sous_total_debit)) . ' 
' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . '
' . $langs->trans("AccountBalance") . ':' . price($total_debit) . '' . price($total_credit) . '' . price(price2num($total_credit - $total_debit)) . ' 
' . length_accountg($row[0]) . '' . price($row[1]) . '' . price($row[2]) . '' . price($row[3]) . '' . price($row[4]) . '' . price($row[5]) . '' . price($row[6]) . '' . price($row[7]) . '' . price($row[8]) . '' . price($row[9]) . '' . price($row[10]) . '' . price($row[11]) . '' . price($row[12]) . '' . price($row[13]) . '' . price($row[1]) . '' . price($row[2]) . '' . price($row[3]) . '' . price($row[4]) . '' . price($row[5]) . '' . price($row[6]) . '' . price($row[7]) . '' . price($row[8]) . '' . price($row[9]) . '' . price($row[10]) . '' . price($row[11]) . '' . price($row[12]) . '' . price($row[13]) . '
piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'),1).'piece_num .'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('SetDate'),1).'
'; print '
'; if ($action == 'editdate') { @@ -459,7 +459,7 @@ if ($action == 'create') print $langs->trans('Codejournal'); print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'
'; print '
'; if ($action == 'editjournal') { @@ -482,7 +482,7 @@ if ($action == 'create') print $langs->trans('Piece'); print 'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'piece_num.'&mode='. $mode .'">'.img_edit($langs->transnoentitiesnoconv('Edit'),1).'
'; print ''; if ($action == 'editdocref') { @@ -602,8 +602,8 @@ if ($action == 'create') print_liste_field_titre("AccountAccountingShort"); print_liste_field_titre("SubledgerAccount"); print_liste_field_titre("LabelOperation"); - print_liste_field_titre("Debit", "", "", "", "", 'align="right"'); - print_liste_field_titre("Credit", "", "", "", "", 'align="right"'); + print_liste_field_titre("Debit", "", "", "", "", 'class="right"'); + print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); print_liste_field_titre("Action", "", "", "", "", 'width="60" align="center"'); print "\n"; @@ -630,8 +630,8 @@ if ($action == 'create') } print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '' . "\n"; print ''; @@ -641,8 +641,8 @@ if ($action == 'create') print '' . $accountingaccount->getNomUrl(0,1,1,'',0) . ''; print '' . length_accounta($line->subledger_account) . ''; print '' . $line->label_operation. ''; - print '' . price($line->debit) . ''; - print '' . price($line->credit) . ''; + print '' . price($line->debit) . ''; + print '' . price($line->credit) . ''; print ''; print 'id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">'; @@ -687,8 +687,8 @@ if ($action == 'create') } print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 4b0ab08d1b1..d61b3c991e4 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018 Frédéric France * @@ -546,14 +546,14 @@ if (! empty($arrayfields['t.label_operation']['checked'])) // Debit if (! empty($arrayfields['t.debit']['checked'])) { - print ''; + print ''; print ''; print ''; } // Credit if (! empty($arrayfields['t.credit']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -611,9 +611,9 @@ if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($a if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); -if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'align="center"', $sortfield, $sortorder); +if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'class="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder); @@ -683,7 +683,7 @@ if ($num > 0) // Amount debit if (! empty($arrayfields['t.debit']['checked'])) { - print '' . ($line->debit ? price($line->debit) : ''). ''; + print '' . ($line->debit ? price($line->debit) : ''). ''; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totaldebitfield']=$totalarray['nbfield']; $totalarray['totaldebit'] += $line->debit; @@ -692,7 +692,7 @@ if ($num > 0) // Amount credit if (! empty($arrayfields['t.credit']['checked'])) { - print '' . ($line->credit ? price($line->credit) : '') . ''; + print '' . ($line->credit ? price($line->credit) : '') . ''; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalcreditfield']=$totalarray['nbfield']; $totalarray['totalcredit'] += $line->credit; @@ -754,8 +754,8 @@ if ($num > 0) if ($num < $limit && empty($offset)) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; } - elseif ($totalarray['totaldebitfield'] == $i) print ''.price($totalarray['totaldebit']).''; - elseif ($totalarray['totalcreditfield'] == $i) print ''.price($totalarray['totalcredit']).''; + elseif ($totalarray['totaldebitfield'] == $i) print ''.price($totalarray['totaldebit']).''; + elseif ($totalarray['totalcreditfield'] == $i) print ''.price($totalarray['totalcredit']).''; else print ''; } print ''; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index c5726901e2e..30019885281 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -295,22 +295,22 @@ print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; -print ''; +print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -340,7 +340,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total par compte comptable if (isset($displayed_account_number)) { - print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; + print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -363,7 +363,7 @@ while ($i < min($num, $limit)) print ''; print ' '; - print ''.$line->piece_num.''; + print ''.$line->piece_num.''; print '' . dol_print_date($line->doc_date, 'day') . ''; // TODO Add a link according to doc_type and fk_doc @@ -378,8 +378,8 @@ while ($i < min($num, $limit)) print strlen(length_accounta($line->subledger_account)) == 0 ? '' . $line->label_operation . '' : '' . $line->label_operation . '
(' . length_accounta($line->subledger_account) . ')'; - print '' . ($line->debit ? price($line->debit) :''). ''; - print '' . ($line->credit ? price($line->credit) : '') . ''; + print '' . ($line->debit ? price($line->debit) :''). ''; + print '' . ($line->credit ? price($line->credit) : '') . ''; $accountingjournal = new AccountingJournal($db); $result = $accountingjournal->fetch('',$line->code_journal); @@ -401,7 +401,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total du dernier compte comptable affiché print ''; -print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; +print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -409,11 +409,11 @@ print ''; // Affiche le Total print ''; -print ''.$langs->trans("Total").':'; -print ''; +print ''.$langs->trans("Total").':'; +print ''; print price($total_debit); print ''; -print ''; +print ''; print price($total_credit); print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 3fdda686eab..843ab21e901 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -3,7 +3,7 @@ * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -209,7 +209,7 @@ if ($resql) { print ''; print ''; print ' '; - print ''; + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print ''; @@ -235,9 +235,9 @@ if ($resql) { print '' . dol_print_date($db->jdate($obj->doc_date), 'day') . ''; print '' . $obj->doc_ref . ''; print '' . $obj->label_compte . ''; - print '' . price($obj->debit) . ''; - print '' . price($obj->credit) . ''; - print '' . price(round($solde, 2)) . ''; + print '' . price($obj->debit) . ''; + print '' . price($obj->credit) . ''; + print '' . price(round($solde, 2)) . ''; print '' . $obj->code_journal . ''; if (empty($obj->lettering_code)) { @@ -249,16 +249,16 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; - print '' . price($debit) . ''; - print '' . price($credit) . ''; + print ''.$langs->trans("Total").':' . "\n"; + print '' . price($debit) . ''; + print '' . price($credit) . ''; print ''; print "\n"; print ''; - print ''.$langs->trans("Balancing").':' . "\n"; + print ''.$langs->trans("Balancing").':' . "\n"; print ' '; - print '' . price($credit - $debit) . ''; + print '' . price($credit - $debit) . ''; print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 8cd51847b1e..f9489040c36 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -3,7 +3,7 @@ * Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2013 Olivier Geffroy * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -212,7 +212,7 @@ if ($resql) { print ''; print ''; print ' '; - print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -238,9 +238,9 @@ if ($resql) { print '' . dol_print_date($db->jdate($obj->doc_date), 'day') . ''; print '' . $obj->doc_ref . ''; print '' . $obj->label_compte . ''; - print '' . price($obj->debit) . ''; - print '' . price($obj->credit) . ''; - print '' . price(round($solde, 2)) . ''; + print '' . price($obj->debit) . ''; + print '' . price($obj->credit) . ''; + print '' . price(round($solde, 2)) . ''; print '' . $obj->code_journal . ''; if (empty($obj->lettering_code)) { @@ -252,16 +252,16 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; - print '' . price($debit) . ''; - print '' . price($credit) . ''; + print ''.$langs->trans("Total").':' . "\n"; + print '' . price($debit) . ''; + print '' . price($credit) . ''; print ''; print "\n"; print ''; - print ''.$langs->trans("Balancing").':' . "\n"; + print ''.$langs->trans("Balancing").':' . "\n"; print ' '; - print '' . price($credit - $debit) . ''; + print '' . price($credit - $debit) . ''; print ''; print "\n"; diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5b3282a3b29..6885df63b61 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016-2017 Alexandre Spangaro + * Copyright (C) 2016-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -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/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 6f9c0534d2f..d61932884dc 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2016-2018 Alexandre Spangaro + * Copyright (C) 2016-2018 Alexandre Spangaro * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz * Copyright (C) 2017 Frédéric France diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index b70fa7238bb..65852258867 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 886e19577fb..681073332d7 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Ari Elbaz (elarifr) @@ -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 9bd21a4a5c4..2a2d050af7b 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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 297fe0e3e9c..2aaf918b197 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2017 Alexandre Spangaro + * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015-2017 Florian Henry * Copyright (C) 2018 Frédéric France * @@ -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/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 1130020b01d..83a018a24cc 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2013 Olivier Geffroy - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -314,4 +314,3 @@ class Lettering extends BookKeeping } } } - diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 7d506c6c72c..5c1dfc5ccbb 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 6995ab4d384..9c9d0db38a4 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * @@ -158,13 +158,13 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', print '
'; print ''; print ''; -print ''; +print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } -print ''; +print ''; $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; @@ -211,10 +211,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; print ''; } $db->free($resql); @@ -234,13 +234,13 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '' . price($row[13]) . '' . price($row[14]) . '
'; print ''; -print ''; +print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } -print ''; +print ''; $sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; @@ -289,10 +289,10 @@ if ($resql) { print ''; for($i = 2; $i <= 12; $i++) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; print ''; } $db->free($resql); @@ -313,13 +313,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '' . price($row[13]) . '' . price($row[14]) . '
'; - print ''; + print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } - print ''; + print ''; $sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,"; for($i = 1; $i <= 12; $i ++) { @@ -348,9 +348,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. while ($row = $db->fetch_row($resql)) { print ''; for($i = 1; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; + print ''; print ''; } $db->free($resql); @@ -369,9 +369,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } - print ''; + print ''; $sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,"; for($i = 1; $i <= 12; $i ++) { @@ -401,9 +401,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print ''; for($i = 1; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; + print ''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index f13344c936b..076c1d7b3c8 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2014-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -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))."'"; } @@ -316,8 +316,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; - print ''; + print ''; print ''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 9f95c6857b0..6768e94ce02 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))."'"; } @@ -382,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index b245e2539a7..eb620d7bf14 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index b1187b9a480..81b1f81416a 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -155,13 +155,13 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', print '
'; print '
' . $langs->trans("TotalVente") . '
' . $langs->trans("TotalVente") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . $row[0] . '' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[13]) . '
' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . $row[0] . '' . price(price2num($row[$i])) . '' . price(price2num($row[$i])) . '' . price(price2num($row[13])) . '' . price(price2num($row[13])) . '
'; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -336,8 +336,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); @@ -383,9 +383,9 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print '' . price($objp->total_ht) . '' . price($objp->total_ht) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')'; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -404,8 +405,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -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'; } @@ -483,14 +497,14 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print ''; + print ''; print price($objp->total_ht); print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print '
'; print ''; -print ''; +print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } -print ''; +print ''; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; @@ -203,10 +203,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; print ''; } $db->free($resql); @@ -227,13 +227,13 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '' . price($row[13]) . '' . price($row[14]) . '
'; print ''; -print ''; +print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } -print ''; +print ''; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; @@ -276,10 +276,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; print ''; } $db->free($resql); @@ -301,13 +301,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '' . price($row[13]) . '' . price($row[14]) . '
'; - print ''; + print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } - print ''; + print ''; $sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,"; for($i = 1; $i <= 12; $i ++) { @@ -331,9 +331,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. while ($row = $db->fetch_row($resql)) { print ''; for($i = 1; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; + print ''; print ''; } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index d8dd122150c..5d1c4ba7fc3 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -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))."'"; } @@ -269,11 +269,11 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; @@ -285,7 +285,7 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); print_liste_field_titre(''); @@ -319,7 +319,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments); print ''; - print ''; + print ''; print ''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 8057c9809f2..bf6f597924d 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent s @@ -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))."'"; } @@ -315,8 +315,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; - print ''; // Vat rate - print ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 40fca78ab3b..b6b5137fe34 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -8,7 +8,8 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2017-2018 Frédéric France - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018 Eric Seigne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -289,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']; @@ -309,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']; @@ -338,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']; @@ -353,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']; @@ -379,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']; @@ -398,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; @@ -566,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; @@ -785,17 +786,17 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; // CSV header line - print '"' . $langs->trans("BankId").'"' . $sep; - print '"' . $langs->trans("Date") . '"' . $sep; - print '"' . $langs->trans("PaymentMode") . '"' . $sep; - print '"' . $langs->trans("AccountAccounting") . '"' . $sep; - print '"' . $langs->trans("LedgerAccount") . '"' . $sep; - print '"' . $langs->trans("SubledgerAccount") . '"' . $sep; - print '"' . $langs->trans("Label"). '"' . $sep; - print '"' . $langs->trans("Debit") . '"' . $sep; - print '"' . $langs->trans("Credit") . '"' . $sep; - print '"' . $langs->trans("Journal") . '"' . $sep; - print '"' . $langs->trans("Note") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("BankId").'"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Date") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("PaymentMode") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("AccountAccounting") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("LedgerAccount") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("SubledgerAccount") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Label"). '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Debit") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Credit") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Journal") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Note") . '"' . $sep; print "\n"; @@ -844,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/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 3147339601c..34a8d219b90 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -3,10 +3,11 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Eric Seigne * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -425,115 +426,67 @@ $form = new Form($db); $userstatic = new User($db); // Export -/*if ($action == 'exportcsv') { // ISO and not UTF8 ! +if ($action == 'exportcsv') { // ISO and not UTF8 ! $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; $filename = 'journal'; $type_export = 'journal'; include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; - // Model Cegid Expert Export - if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) { - $sep = ";"; + // CSV header line + print '"' . $langs->transnoentitiesnoconv("Date") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Piece") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("AccountAccounting") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("LabelOperation") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Debit") . '"' . $sep; + print '"' . $langs->transnoentitiesnoconv("Credit") . '"' . $sep; + print "\n"; - foreach ( $taber as $key => $val ) { - $date = dol_print_date($val["date"], '%d%m%Y'); - - // Fees - foreach ( $tabht[$key] as $k => $mt ) { - $userstatic->id = $tabuser[$key]['id']; - $userstatic->name = $tabuser[$key]['name']; - $userstatic->client = $tabuser[$key]['code_client']; - - if ($mt) { - print $date . $sep; - print $journal . $sep; - print length_accountg(html_entity_decode($k)) . $sep; - print $sep; - print ($mt < 0 ? 'C' : 'D') . $sep; - print ($mt <= 0 ? price(- $mt) : $mt) . $sep; - print dol_trunc($val["comments"], 32) . $sep; - print $val["ref"]; - print "\n"; - } - } - - // VAT - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { - print $date . $sep; - print $journal . $sep; - print length_accountg(html_entity_decode($k)) . $sep; - print $sep; - print ($mt < 0 ? 'C' : 'D') . $sep; - print ($mt <= 0 ? price(- $mt) : $mt) . $sep; - print $langs->trans("VAT") . $sep; - print $val["ref"]; - print "\n"; - } - } - - foreach ( $tabttc[$key] as $k => $mt ) { - print $date . $sep; - print $journal . $sep; - print length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) . $sep; - print length_accounta(html_entity_decode($k)) . $sep; - print ($mt < 0 ? 'D' : 'C') . $sep; - print ($mt <= 0 ? price(- $mt) : $mt) . $sep; - print $userstatic->name . $sep; - print $val["ref"]; - print "\n"; - } - } - } elseif ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) { - // Model Classic Export - foreach ( $taber as $key => $val ) { - $date = dol_print_date($val["date"], 'day'); - - $userstatic->id = $tabuser[$key]['id']; - $userstatic->name = $tabuser[$key]['name']; - - // Fees - foreach ( $tabht[$key] as $k => $mt ) { - $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch(null, $k, true); - if ($mt) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; - print "\n"; - } - } - // VAT - foreach ( $tabtva[$key] as $k => $mt ) { - if ($mt) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($langs->trans("VAT")) . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; - print "\n"; - } - } - - // Third party - foreach ( $tabttc[$key] as $k => $mt ) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($userstatic->name) . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"'; - } - print "\n"; - } + foreach ( $taber as $key => $val ) { + $date = dol_print_date($val["date"], 'day'); + + $userstatic->id = $tabuser[$key]['id']; + $userstatic->name = $tabuser[$key]['name']; + + // Fees + foreach ( $tabht[$key] as $k => $mt ) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(null, $k, true); + if ($mt) { + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; + print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; + print "\n"; + } + } + // VAT + foreach ( $tabtva[$key] as $k => $mt ) { + if ($mt) { + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; + print '"' . dol_trunc($langs->trans("VAT")) . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; + print "\n"; + } + } + + // Third party + foreach ( $tabttc[$key] as $k => $mt ) { + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; + print '"' . dol_trunc($userstatic->name) . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"'; + } + print "\n"; } } -*/ if (empty($action) || $action == 'view') { @@ -560,6 +513,8 @@ if (empty($action) || $action == 'view') { print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); } print '
'; + + if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print ''; if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') { print ''; } @@ -567,7 +522,6 @@ if (empty($action) || $action == 'view') { if ($in_bookkeeping == 'notyet') print ''; else print '' . $langs->trans("WriteBookKeeping") . ''; } - //print ''; print '
'; // TODO Avoid using js. We can use a direct link with $param @@ -601,8 +555,8 @@ if (empty($action) || $action == 'view') { print "
"; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print "\n"; $r = ''; @@ -644,8 +598,8 @@ if (empty($action) || $action == 'view') { $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; print ""; - print '"; - print '"; + print '"; + print '"; print ""; } } @@ -677,8 +631,8 @@ if (empty($action) || $action == 'view') { else print $accountoshow; print ''; print ""; - print '"; - print '"; + print '"; + print '"; print ""; } @@ -709,8 +663,8 @@ if (empty($action) || $action == 'view') { print ''; print ""; - print '"; - print '"; + print '"; + print '"; print ""; } } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 28d4916884f..54024fe6471 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France @@ -788,8 +788,8 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print "\n"; $r = ''; @@ -841,8 +841,8 @@ if (empty($action) || $action == 'view') { print ''; print ""; - print ''; - print ''; + print ''; + print ''; print ""; continue; @@ -862,8 +862,8 @@ if (empty($action) || $action == 'view') { print ''; print ""; - print ''; - print ''; + print ''; + print ''; print ""; } @@ -879,7 +879,7 @@ if (empty($action) || $action == 'view') { $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER); if (($accountoshow == "") || $accountoshow == 'NotDefined') { - print ''.$langs->trans("MainAccountForSupplierssNotDefined").''; + print ''.$langs->trans("MainAccountForSuppliersNotDefined").''; } else print $accountoshow; print ''; @@ -893,8 +893,8 @@ if (empty($action) || $action == 'view') { else print $accountoshow; print ''; print ""; - print '"; - print '"; + print '"; + print '"; print ""; //} } @@ -924,8 +924,8 @@ if (empty($action) || $action == 'view') { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; print ""; - print '"; - print '"; + print '"; + print '"; print ""; //} } @@ -958,8 +958,8 @@ if (empty($action) || $action == 'view') { print ""; - print '"; - print '"; + print '"; + print '"; print ""; } } @@ -987,8 +987,8 @@ if (empty($action) || $action == 'view') { print "'; print ""; - print '"; - print '"; + print '"; + print '"; print ""; } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 243c9fb943c..9526bc763ec 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -4,7 +4,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2018 Alexandre Spangaro * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2014 Raphaël Doursenaud @@ -725,8 +725,8 @@ if (empty($action) || $action == 'view') { print ""; print ""; print ""; - print ""; - print ""; + print ""; + print ""; print "\n"; $r = ''; @@ -776,8 +776,8 @@ if (empty($action) || $action == 'view') { print ''; print ""; - print ''; - print ''; + print ''; + print ''; print ""; continue; @@ -797,8 +797,8 @@ if (empty($action) || $action == 'view') { print ''; print ""; - print ''; - print ''; + print ''; + print ''; print ""; } @@ -829,8 +829,8 @@ if (empty($action) || $action == 'view') { else print $accountoshow; print ''; print ""; - print '"; - print '"; + print '"; + print '"; print ""; //} } @@ -861,8 +861,8 @@ if (empty($action) || $action == 'view') { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; print ""; - print ""; - print ""; + print ""; + print ""; print ""; //} } @@ -895,8 +895,8 @@ if (empty($action) || $action == 'view') { print ''; print ""; - print '"; - print '"; + print '"; + print '"; print ""; } } diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 8de24e09a9e..10e52d6c029 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 5e993d43834..fcc6bbecd81 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -155,13 +155,13 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', print '
'; print '
' . $langs->trans("Total") . '
' . $langs->trans("Total") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . $row[0] . '' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[13]) . '
'; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '' . price($objp->total_ht) . '' . price($objp->total_ht) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . ''; @@ -331,8 +331,8 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder); print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder); $checkpicto=''; @@ -376,12 +376,12 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->comments); print ''; + print ''; print price($objp->price); print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print '" . $langs->trans("AccountAccounting") . "" . $langs->trans("SubledgerAccount") . "" . $langs->trans("LabelOperation") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $accountingaccount->label . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("SubledgerAccount") . "' . ($mt < 0 ? - price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? - price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); print "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
" . $langs->trans("AccountAccounting") . "" . $langs->trans("SubledgerAccount") . "" . $langs->trans("LabelOperation") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
"; print "
"; print "
" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount") . "'. ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "'. ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
"; print $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); print "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
"; print '" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("VAT") . " NPR (counterpart)' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
" . $langs->trans("AccountAccounting") . "" . $langs->trans("SubledgerAccount") . "" . $langs->trans("LabelOperation") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "" . $langs->trans("Debit") . "" . $langs->trans("Credit") . "
"; print "
"; print "
" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "
" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "" . ($mt < 0 ? price(- $mt) : '') . "" . ($mt >= 0 ? price($mt) : '') . "
" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT"). ' '.join(', ',$def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); print "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "' . ($mt < 0 ? price(- $mt) : '') . "' . ($mt >= 0 ? price($mt) : '') . "
'; print ''; -print ''; +print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } -print ''; +print ''; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; @@ -203,10 +203,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; print ''; } $db->free($resql); @@ -226,13 +226,13 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', print '
'; print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '' . price($row[13]) . '' . price($row[14]) . '
'; print ''; -print ''; +print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } -print ''; +print ''; $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,"; $sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,"; @@ -274,10 +274,10 @@ if ($resql) { else print $row[1]; print ''; for($i = 2; $i <= 12; $i++) { - print ''; + print ''; } - print ''; - print ''; + print ''; + print ''; print ''; } $db->free($resql); @@ -299,13 +299,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. print '
'; print '
' . $langs->trans("Account") . '' . $langs->trans("Label") . '' . $langs->trans("Label") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[14]) . '' . price($row[13]) . '' . price($row[14]) . '
'; - print ''; + print ''; for($i = 1; $i <= 12; $i ++) { $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1; if ($j > 12) $j-=12; - print ''; + print ''; } - print ''; + print ''; $sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,"; for($i = 1; $i <= 12; $i ++) { @@ -329,9 +329,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. while ($row = $db->fetch_row($resql)) { print ''; for($i = 1; $i <= 12; $i ++) { - print ''; + print ''; } - print ''; + print ''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 580cf4c407c..247c2db93cd 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -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))."'"; } @@ -321,8 +321,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; + print ''; - print ''; + print ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 5ac90068ffb..99f0fb30ae5 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2017 Alexandre Spangaro + * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014-2015 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent s @@ -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))."'"; } @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index ca3c9c49ea0..97f0da548ca 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2016 Charlie Benke * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index cb1fdfac816..bf14ff09fcd 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -198,7 +198,7 @@ if ($conf->facture->enabled) } else { - print ''; } diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 9ee06cd3fa7..33d42986256 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -43,6 +43,22 @@ $oldtypetonewone=array('texte'=>'text','chaine'=>'string'); // old type to new o $action = GETPOST('action','alpha'); +$error = 0; + +// Editing global variables not related to a specific theme +$constantes=array( + 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), + 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ + 'ADHERENT_MAIL_FROM'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', +); + + /* * Actions @@ -133,24 +149,10 @@ $head = member_admin_prepare_head(); dol_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); -print ''; -print ''; -print ''; - -/* - * Editing global variables not related to a specific theme - */ -$constantes=array( - 'ADHERENT_MAIL_FROM'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', - 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ - 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ - 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ - 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ - 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), - 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', -); +// TODO Use global form +//print ''; +//print ''; +//print ''; $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; @@ -159,6 +161,9 @@ $helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, form_constantes($constantes, 0, $helptext); +//print '
'; +//print ''; + dol_fiche_end(); // End of page diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 51aca179195..02364a3a1d8 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -136,7 +136,7 @@ if ($conf->use_javascript_ajax) } -print $langs->trans("BlankSubscriptionFormDesc").'

'; +print ''.$langs->trans("BlankSubscriptionFormDesc").'

'; $enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; @@ -168,14 +168,14 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) print ''; print ''; - print ''; + print ''; print "\n"; // Force Type $adht = new AdherentType($db); print '\n"; // Can edit print '\n"; // Jump to an online payment page print ''; - print ''; print '
' . $langs->trans("Total") . '
' . $langs->trans("Total") . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '' . $langs->trans("Total") . '
' . $langs->trans("Total") . '
' . $row[0] . '' . price($row[$i]) . '' . price($row[$i]) . '' . price($row[13]) . '' . price($row[13]) . '
'; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); // print ''; @@ -343,8 +343,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); @@ -396,9 +396,9 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print '' . price($objp->total_ht) . '' . price($objp->total_ht) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')'; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -406,8 +406,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -491,14 +491,14 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description); print ''; + print ''; print price($objp->total_ht); print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print ''; + print ''; print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name")); print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Value").'
'; print $langs->trans("ForceMemberType"); - print ''; + print ''; $listofval = array(-1 => $langs->trans("Undefined")); $listofval += $adht->liste_array(); $forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1; @@ -185,21 +185,21 @@ if (! empty($conf->global->MEMBER_ENABLE_PUBLIC)) // Amount print '
'; print $langs->trans("DefaultAmount"); - print ''; + print ''; print ''; print "
'; print $langs->trans("CanEditAmount"); - print ''; + print ''; print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1); print "
'; print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); - print ''; + print ''; $listofval=array(); $listofval['-1']=$langs->trans('No'); $listofval['all']=$langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')'; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 2f2c5f9dde8..7a6898da9d3 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2012-2018 Philippe Grand - * Copyright (C) 2015-2018 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3a698c6b042..f5cb86304d5 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2017 Regis Houssin - * Copyright (C) 2014-2018 Alexandre Spangaro + * Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud @@ -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 @@ -2520,7 +2520,7 @@ class Adherent extends CommonObject /** - * Charge les informations d'ordre info dans l'objet adherent + * Load type info information in the member object * * @param int $id Id of member to load * @return void @@ -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 984cf49d44d..dd9da927c25 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; @@ -164,13 +164,13 @@ class AdherentType extends CommonObject } /** - * Met a jour en base donnees du type + * Updating the type in the database * * @param User $user Object user making change * @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; @@ -234,9 +234,9 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de supprimer le status de l'adherent + * Function to delete the member's status * - * @return int >0 if OK, 0 if not found, < 0 if KO + * @return int > 0 if OK, 0 if not found, < 0 if KO */ function delete() { @@ -267,7 +267,7 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de recuperer le status de l'adherent + * Function that retrieves the status of the member * * @param int $rowid Id of member type to load * @return int <0 if KO, >0 if OK @@ -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 310a40c52b3..f5ef24fb465 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 2da35df7e2c..9ced878a68e 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 96876eb82b6..319dbb1f75b 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/index.php b/htdocs/adherents/index.php index 3d1883eda0a..b3c40e0bfeb 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -203,7 +203,7 @@ if ($conf->use_javascript_ajax) print $dolgraph->show($total?0:1); print '
'.$langs->trans("Total").''; + print '
'.$langs->trans("Total").''; print $SommeA+$SommeB+$SommeC+$SommeD; print '
'; @@ -247,9 +247,9 @@ print '
'; print ''; print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print "\n"; krsort($Total); @@ -257,18 +257,18 @@ foreach ($Total as $key=>$value) { print ''; print ""; - print ""; - print ""; - print ""; + print ""; + print ""; + print ""; print "\n"; } // Total print ''; print ''; -print ""; -print '"; -print ""; +print ""; +print '"; +print ""; print "\n"; print "
'.$langs->trans("Subscriptions").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'
$key".$Number[$key]."".price($value)."".price(price2num($value/$Number[$key],'MT'))."".$Number[$key]."".price($value)."".price(price2num($value/$Number[$key],'MT'))."
'.$langs->trans("Total").'".$numb."'.price($tot)."".price(price2num($numb>0?($tot/$numb):0,'MT'))."".$numb."'.price($tot)."".price(price2num($numb>0?($tot/$numb):0,'MT'))."
"; print "
\n"; @@ -325,7 +325,7 @@ if ($resql) print ''.$staticmember->getNomUrl(1,32).''; print ''.$statictype->getNomUrl(1,32).''; print ''.dol_print_date($db->jdate($obj->datem),'dayhour').''; - print ''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''; + print ''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''; print ''; $i++; } @@ -385,9 +385,9 @@ if ($resql) print ''.$subscriptionstatic->getNomUrl(1).''; print ''.$staticmember->getNomUrl(1,32,'subscription').''; print ''.get_date_range($db->jdate($obj->date_start),$db->jdate($obj->date_end)).''; - print ''.price($obj->subscription).''; - //print ''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''; - print ''.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec),'dayhour').''; + print ''.price($obj->subscription).''; + //print ''.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).''; + print ''.dol_print_date($db->jdate($obj->datem?$obj->datem:$obj->datec),'dayhour').''; print ''; $i++; } @@ -406,28 +406,28 @@ print '
'; print ''; print ''; print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print "\n"; foreach ($AdherentType as $key => $adhtype) { print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; } print ''; print ''; -print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; +print ''; print ''; print "
'.$langs->trans("MembersTypes").''.$langs->trans("MembersStatusToValid").''.$langs->trans("MenuMembersNotUpToDate").''.$langs->trans("MenuMembersUpToDate").''.$langs->trans("MembersStatusResiliated").''.$langs->trans("MembersStatusToValid").''.$langs->trans("MenuMembersNotUpToDate").''.$langs->trans("MenuMembersUpToDate").''.$langs->trans("MembersStatusResiliated").'
'.$adhtype->getNomUrl(1, dol_size(32)).''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).'
'.$langs->trans("Total").''.$SommeA.' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''.$SommeB.' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).''.$SommeD.' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).''.$SommeA.' '.$staticmember->LibStatut(-1,$adhtype->subscription,0,3).''.$SommeB.' '.$staticmember->LibStatut(1,$adhtype->subscription,0,3).''.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->subscription,$now,3).''.$SommeD.' '.$staticmember->LibStatut(0,$adhtype->subscription,0,3).'
\n"; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d7b3f3304ff..79841823d08 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2016 Juanjo Menent - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -566,7 +566,7 @@ if (! empty($arrayfields['d.tms']['checked'])) // Status if (! empty($arrayfields['d.statut']['checked'])) { - print ''; + print ''; $liststatus=array( '-1'=>$langs->trans("Draft"), '1'=>$langs->trans("Validated"), @@ -613,7 +613,7 @@ $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // No print $hookmanager->resPrint; if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); -if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'align="right"',$sortfield,$sortorder); +if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'class="right"',$sortfield,$sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -842,7 +842,7 @@ while ($i < min($num, $limit)) // Status if (! empty($arrayfields['d.statut']['checked'])) { - print ''; + print ''; print $memberstatic->LibStatut($obj->statut,$obj->subscription,$datefin,5); print ''; if (! $i) $totalarray['nbfield']++; @@ -870,7 +870,7 @@ if (isset($totalarray['pos'])) while ($i < $totalarray['nbfield']) { $i++; - if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; + if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; else { if ($i == 1) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index defbde2dce2..cc40a5a4120 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -119,7 +119,7 @@ else print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; @@ -132,7 +132,7 @@ foreach ($data as $val) $year = $val['year']; print ''; print ''; - print ''; + print ''; print ''; print ''; $oldyear=$year; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 2175569b7ce..1a52c9226f5 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").'
'; @@ -286,7 +286,7 @@ if ($mode) print ''; print ''; if ($label2) print ''; - print ''; + print ''; print ''; print ''; @@ -297,7 +297,7 @@ if ($mode) print ''; print ''; if ($label2) print ''; - print ''; + print ''; print ''; print ''; $oldyear=$year; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index feebd776d94..e9866d20f1a 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -171,9 +171,9 @@ print '
'; print '
'.$langs->trans("Nature").''.$langs->trans("NbOfMembers").''.$langs->trans("NbOfMembers").''.$langs->trans("LatestSubscriptionDate").'
'.$memberstatic->getmorphylib($val['label']).''.$val['nb'].''.$val['nb'].''.dol_print_date($val['lastdate'],'dayhour').'
'.$label.''.$label2.''.$langs->trans("NbOfMembers").''.$langs->trans("NbOfMembers").''.$langs->trans("LastMemberDate").'
'.$val['label'].''.$val['label2'].''.$val['nb'].''.$val['nb'].''.dol_print_date($val['lastdate'],'dayhour').'
'; print ''; print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; $oldyear=0; @@ -189,9 +189,9 @@ foreach ($data as $val) print $oldyear; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; } print ''; @@ -200,9 +200,9 @@ foreach ($data as $val) print $year; //print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; $oldyear=$year; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 29a1c97ca90..da35a182f24 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2012-2017 Regis Houssin - * Copyright (C) 2015-2016 Alexandre Spangaro + * Copyright (C) 2015-2016 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -570,7 +570,7 @@ if ($rowid > 0) print '
'.$langs->trans("Year").''.$langs->trans("NbOfSubscriptions").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''.$langs->trans("NbOfSubscriptions").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").'
000000
'.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).''.$val['nb'].''.price(price2num($val['total'],'MT'),1).''.price(price2num($val['avg'],'MT'),1).'
'; - if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; + if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; print '
'; print $langs->trans("LinkedToDolibarrThirdParty"); print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'
'; print ''; if ($action == 'editthirdparty') @@ -610,7 +610,7 @@ if ($rowid > 0) print ''; if ($action != 'editlogin' && $user->rights->adherent->creer) { - print ''; + print ''; if ($user->rights->user->user->creer) { print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).''; @@ -695,10 +695,10 @@ if ($rowid > 0) print ''.$langs->trans("DateCreation").''; print ''.$langs->trans("DateStart").''; print ''.$langs->trans("DateEnd").''; - print ''.$langs->trans("Amount").''; + print ''.$langs->trans("Amount").''; if (! empty($conf->banque->enabled)) { - print ''.$langs->trans("Account").''; + print ''.$langs->trans("Account").''; } print "\n"; @@ -716,10 +716,10 @@ if ($rowid > 0) print ''.dol_print_date($db->jdate($objp->datec),'dayhour')."\n"; print ''.dol_print_date($db->jdate($objp->dateh),'day')."\n"; print ''.dol_print_date($db->jdate($objp->datef),'day')."\n"; - print ''.price($objp->subscription).''; + print ''.price($objp->subscription).''; if (! empty($conf->banque->enabled)) { - print ''; + print ''; if ($objp->bid) { $accountstatic->label=$objp->label; @@ -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/subscription/list.php b/htdocs/adherents/subscription/list.php index 336122c605e..7e97752af5d 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -355,7 +355,7 @@ if (! empty($arrayfields['d.date_fin']['checked'])) if (! empty($arrayfields['d.amount']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -380,7 +380,7 @@ if (! empty($arrayfields['d.tms']['checked'])) } // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -427,7 +427,7 @@ if (! empty($arrayfields['d.date_fin']['checked'])) } if (! empty($arrayfields['d.amount']['checked'])) { - print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"c.subscription",$param,"",'class="right"',$sortfield,$sortorder); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -541,7 +541,7 @@ while ($i < min($num, $limit)) // Price if (! empty($arrayfields['d.amount']['checked'])) { - print ''.price($obj->subscription).''; + print ''.price($obj->subscription).''; if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['pos'][$totalarray['nbfield']]='d.amount'; $totalarray['val']['d.amount'] += $obj->subscription; @@ -591,7 +591,7 @@ if (isset($totalarray['pos'])) while ($i < $totalarray['nbfield']) { $i++; - if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; + if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; else { if ($i == 1) diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index eec61e3ba22..988dda8fce6 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -46,13 +46,13 @@ foreach($linkedObjectBlock as $key => $objectlink) getNomUrl(1); ?> dateh,'day'); ?> - rights->adherent->lire) { $total = $total + $objectlink->amount; echo price($objectlink->amount); } ?> - - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> + + ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,6 +57,7 @@ if (! $sortorder) { $sortorder="DESC"; } if (! $sortfield) { $sortfield="d.lastname"; } $label=GETPOST("label","alpha"); +$statut=GETPOST("statut","int"); $subscription=GETPOST("subscription","int"); $vote=GETPOST("vote","int"); $comment=GETPOST("comment",'alphanohtml'); @@ -104,7 +105,8 @@ if ($cancel) { if ($action == 'add' && $user->rights->adherent->configurer) { $object->label = trim($label); - $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); @@ -157,7 +159,8 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object->oldcopy = clone $object; $object->label = trim($label); - $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); @@ -214,7 +217,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') { //dol_fiche_head(''); - $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote"; + $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql.= " WHERE d.entity IN (".getEntity('member_type').")"; @@ -242,7 +245,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''; print ''; print ''; - print ''; + print ''; print ''; print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic.png', 0, $newcardbutton, '', $limit); @@ -257,6 +260,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''.$langs->trans("Label").''; print ''.$langs->trans("SubscriptionRequired").''; print ''.$langs->trans("VoteAllowed").''; + print ''.$langs->trans("Status").''; print ' '; print "\n"; @@ -278,10 +282,17 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''.dol_escape_htmltag($objp->label).''; 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 ($user->rights->adherent->configurer) - print 'rowid.'">'.img_edit().''; + print 'rowid.'">'.img_edit().''; else - print ' '; + print ' '; print ""; $i++; } @@ -319,7 +330,11 @@ if ($action == 'create') print ''.$langs->trans("Label").''; - print ''.$langs->trans("SubscriptionRequired").''; + 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 ''; @@ -392,6 +407,14 @@ if ($rowid > 0) print ''; + print ''; + print ''; @@ -427,7 +450,12 @@ if ($rowid > 0) } // Add - print ''; + if ( $user->rights->adherent->configurer && !empty($object->statut) ) + { + print ''; + } else { + print ''; + } // Delete if ($user->rights->adherent->configurer) @@ -516,11 +544,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') { @@ -574,7 +602,7 @@ if ($rowid > 0) print ''; - print ''; - print ''; + + print ''; @@ -743,7 +775,7 @@ if ($rowid > 0) // Other attributes $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; + print $hookmanager->resPrint; if (empty($reshook)) { print $object->showOptionals($extrafields,'edit'); diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 92d80464088..7b24260cd8d 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 1c6e5c16fcf..27dad04dc32 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -144,7 +144,7 @@ print ''; print ''; print ''; // Action column -print ''; @@ -179,7 +179,7 @@ if (! empty($triggers)) print ''; print ''; print ''; - print '"; print ""; print "'; print "'; -print ''; +print ''; print ""; $i=1; @@ -220,7 +220,7 @@ while ($i <= $MAXAGENDA) // Offset TZ print ''; // Color (Possible colors are limited by Google) - print ''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 2a370cdf580..639671b4647 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -35,7 +35,7 @@ if (!$user->admin) accessforbidden(); // Load translation files required by the page -$langs->loadLangs(array('admin', 'other', 'agenda')); +$langs->loadLangs(array('admin', 'other', 'agenda', 'users')); $action = GETPOST('action','alpha'); $value = GETPOST('value','alpha'); @@ -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)) { @@ -331,7 +331,7 @@ print '
'.$langs->trans("Status").''; + 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"); + } + print '
'.$langs->trans("SubscriptionRequired").''; print yn($object->subscription); print '
 '; + print ''; print ''; print '  '; print ''; @@ -723,7 +751,11 @@ if ($rowid > 0) print '
'.$langs->trans("Label").'
'.$langs->trans("SubscriptionRequired").''; + print '
'.$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 '
'; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'.$trigger['code'].''.$trigger['label'].''; + print ''; $key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; $value=$conf->global->$key; print ''; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 236483f5ed4..3fe540a2baf 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -196,7 +196,7 @@ print "".$langs->trans("Parameter")."".$langs->trans("Name")."".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).''.$langs->trans("Color").''.$langs->trans("Color").'
'; + print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key)?GETPOST("AGENDA_EXT_COLOR".$key):$conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; // Manual or automatic @@ -339,7 +339,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; // AGENDA_DEFAULT_VIEW print ''."\n"; -print ''."\n"; +$htmltext=$langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup")); +print ''."\n"; print ''."\n"; -print ''."\n"; @@ -367,7 +368,7 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; } @@ -376,7 +377,7 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; @@ -385,7 +386,7 @@ print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 269880236cb..10d716a1af6 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)) { @@ -186,7 +186,7 @@ print '
'.$langs->trans("Parameters").' '.$langs->trans("Value").''.$langs->trans("Value").'
'.$langs->trans("AGENDA_USE_EVENT_TYPE").' '."\n"; +print ''."\n"; //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { @@ -353,9 +353,10 @@ print '
'.$langs->trans("AGENDA_DEFAULT_VIEW").''.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).' '."\n"; +print ''."\n"; $tmplist=array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); print '
'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").' '."\n"; + print ''."\n"; $formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1); print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").' '."\n"; +print ''."\n"; $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1); print '
'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").' '."\n"; +print ''."\n"; $formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; @@ -196,7 +196,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; print ''."\n"; print ''."\n"; - print ''; print ''; - print ''; } @@ -344,7 +344,7 @@ if (! empty($conf->societe->enabled)) print ''; print ''; - print ''; } diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index c0480bb7e50..c5bc3f596b4 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/chequereceipts.php b/htdocs/admin/chequereceipts.php index f85018c03b8..013b140ee60 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -267,7 +267,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print '\n"; print '
'.$langs->trans("Parameters").' '.$langs->trans("Value").''.$langs->trans("Value").'
'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).' '."\n"; + print ''."\n"; if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { print ''.img_picto($langs->trans('Disabled'),'switch_off').''; @@ -213,7 +213,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print '
'.$langs->trans('AGENDA_REMINDER_BROWSER').' '."\n"; + print ''."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { print ''.img_picto($langs->trans('Disabled'),'switch_off').''; @@ -225,7 +225,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) print '
'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').' '."\n"; + print ''."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { print ''.img_picto($langs->trans('Disabled'),'switch_off').''; 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/barcode.php b/htdocs/admin/barcode.php index 6cf9c84d265..45b908487a3 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -333,7 +333,7 @@ if (! empty($conf->product->enabled)) print '
'.$langs->trans("SetDefaultBarcodeTypeProducts").''; + print ''; print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1); print '
'.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; + print ''; print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print '
'; +print ''; print ''; print "
'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index d4d7b789974..42ea60d0f9f 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 @@ -195,7 +195,7 @@ else if ($action == 'set_ORDER_FREE_TEXT') } // Activate Set Shippable Icon In List -else if ($action=="setshippableiconinlist") { +elseif ($action=="setshippableiconinlist") { $setshippableiconinlist = GETPOST('value','int'); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); if (! $res > 0) $error++; @@ -207,7 +207,7 @@ else if ($action=="setshippableiconinlist") { } // Activate ask for payment bank -else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') +elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity); @@ -224,7 +224,7 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') } // Activate ask for warehouse -else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') +elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') { $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity); @@ -556,7 +556,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print ''; +print ''; print ''; print "\n"; print ''; @@ -570,7 +570,7 @@ print ''; print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; print ''; @@ -674,7 +674,7 @@ print "\n"; print ''; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; -print ''; +print ''; print "\n"; print ''; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 15af65fbb8d..16b57ab1e74 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2017 Philippe Grand - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2017 Rui Strecht * * This program is free software; you can redistribute it and/or modify @@ -137,7 +137,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) } else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); } - else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) + elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) { $error++; $langs->load("errors"); @@ -417,7 +417,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print '"; print ""; - print ''; print ''; print ''; - print ''; + print ''; print "\n"; $listtype=array( @@ -662,7 +662,7 @@ print ''; print ''; -print ''; +print ''; print "\n"; print ''; @@ -762,7 +762,7 @@ print '\n"; print ''; @@ -789,7 +789,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print '\n"; print ''; @@ -802,7 +802,7 @@ print ''; print '\n"; print ''; @@ -842,7 +842,7 @@ print "\n"; print '\n"; print '
'; print ''; - print ''; + print ''; if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { @@ -602,7 +602,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''; print ''; - print ''; + print ''; print "\n"; @@ -635,7 +635,7 @@ if ($action == 'edit' || $action == 'updateedit') print '
'.$langs->trans("VATManagement").''.$langs->trans("Description").'  
'; print ''; print ''; - print ''; + print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option @@ -678,7 +678,7 @@ if ($action == 'edit' || $action == 'updateedit') print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").'  
'; print ''; print ''; - print ''; + print ''; print "\n"; @@ -821,7 +821,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 ''; } @@ -1040,7 +1040,7 @@ else print '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").'  
'; print ''; print ''; - print ''; + print ''; print "\n"; @@ -1077,7 +1077,7 @@ else print '
'.$langs->trans("VATManagement").''.$langs->trans("Description").'  
'; print ''; print ''; - print ''; + print ''; print "\n"; @@ -1097,11 +1097,11 @@ else { print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1) + elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1) { print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ + elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); } @@ -1131,7 +1131,7 @@ else print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").'  
'; print ''; print ''; - print ''; + print ''; print "\n"; @@ -1151,11 +1151,11 @@ else { print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1) + elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1) { print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); } - else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2) + elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2) { print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); } diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 660f7c7c500..a54e1eb7aeb 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 cfda870e9da..bc48425017b 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"; @@ -304,10 +304,10 @@ print ''; if ($conf->use_javascript_ajax) { print '
'; - print '
'; + print '
'; print ''; print '
'; - print '
'; + print '
'; print ''; print '
'; } diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 60be9e062ba..0a704ce5ee8 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 fc3b8f15f39..ee3083410dd 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * @@ -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 ''; } @@ -1246,7 +1246,7 @@ if ($id) } if ($id == 4) print '
'; print ''; - 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; @@ -1990,4 +1990,3 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') return $withentity; } - 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 3126f432938..e058778155a 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/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index eaef18c9543..12dd01d20f8 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -404,7 +404,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { - //$morehtmlstatus .= imap_num_msg($connection).'
'; $morehtml .= imap_num_msg($connection); } @@ -449,7 +448,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; - print ''; + print ''; print ''; // List filters foreach($object->filters as $rulefilter) @@ -462,7 +461,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $langs->trans($arrayoftypes[$rulefilter['type']]); print ''; print ''; - print ''; @@ -492,7 +491,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $form->textwithpicto('', $htmltext); print ''; print ''; - print ''; + print ''; print ''; // List operations $nboflines = count($object->actions); @@ -509,7 +508,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $langs->trans($arrayoftypes[$ruleaction['type']]); print ''; print ''; - print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 7e72a5ce003..bb6fa4bdd87 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -385,7 +385,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; @@ -503,7 +503,7 @@ if (isset($totalarray['pos'])) while ($i < $totalarray['nbfield']) { $i++; - if (! empty($totalarray['pos'][$i])) print ''; + if (! empty($totalarray['pos'][$i])) print ''; else { if ($i == 1) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 2ae3a7cad99..2dec14f0a24 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 f8429069611..23d2571b256 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/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index d3937a98ba7..0f01fa7a750 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -154,7 +154,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) echo ''; // Action - echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; echo '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").'  
'; + print ''; if ($filterfound) { $searchpicto=$form->showFilterAndCheckAddButtons(0); @@ -1409,14 +1409,14 @@ if ($id) { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; } - else if ($value == 'source') + elseif ($value == 'source') { $valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow; } - else if ($valuetoshow=='all') { + elseif ($valuetoshow=='all') { $valuetoshow=$langs->trans('All'); } - else if ($fieldlist[$field]=='country') { + elseif ($fieldlist[$field]=='country') { if (empty($obj->country_code)) { $valuetoshow='-'; @@ -1427,143 +1427,143 @@ if ($id) $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country); } } - else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { + elseif ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') { $valuetoshow=yn($valuetoshow); $align="center"; } - else if ($fieldlist[$field]=='type_cdr') { + elseif ($fieldlist[$field]=='type_cdr') { if(empty($valuetoshow)) $valuetoshow = $langs->trans('None'); elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth'); elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext'); $align="center"; } - else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) { + elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) { $valuetoshow=price($valuetoshow); } if ($value == 'private') { $valuetoshow = yn($elementList[$valuetoshow]); } - else if ($fieldlist[$field]=='libelle_facture') { + elseif ($fieldlist[$field]=='libelle_facture') { $langs->load("bills"); $key=$langs->trans("PaymentCondition".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); $valuetoshow=nl2br($valuetoshow); } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') { + elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') { $key=$langs->trans("Country".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { + elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { $langs->load("propal"); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') { $key=$langs->trans("Action".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') { + elseif (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') { $key=$langs->trans("Currency".strtoupper($obj->code_iso)); $valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') { $key=$langs->trans(strtoupper($obj->code)); $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') { $key=$langs->trans(strtoupper($obj->code)); $valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') { + elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') { $key=$langs->trans("Civility".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { $langs->load('agenda'); $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { $langs->load("bills"); $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { $langs->load("bills"); $key=$langs->trans("PaymentType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') { + elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') { $key=$langs->trans("DemandReasonType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { $langs->load("orders"); $key=$langs->trans($obj->code); $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]}; } - else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { + elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { $langs->load("sendings"); $key=$langs->trans("SendingMethod".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format') + elseif ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format') { $key = $langs->trans('PaperFormat'.strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') + elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') { $langs->load('trips'); $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { + elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; } - else if ($fieldlist[$field]=='unicode') { + elseif ($fieldlist[$field]=='unicode') { $valuetoshow = $langs->getCurrencySymbol($obj->code,1); } - else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { + elseif ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { $langs->load("products"); $valuetoshow=$langs->trans($obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { + elseif ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); } - else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) + elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) { $key = $langs->trans('SizeUnit'.strtolower($obj->unit)); $valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]}); } - else if ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') { + elseif ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') { $align="center"; } - else if ($fieldlist[$field]=='localtax1_type') { + elseif ($fieldlist[$field]=='localtax1_type') { if ($obj->localtax1 != 0) $valuetoshow=$localtax_typeList[$valuetoshow]; else $valuetoshow = ''; $align="center"; } - else if ($fieldlist[$field]=='localtax2_type') { + elseif ($fieldlist[$field]=='localtax2_type') { if ($obj->localtax2 != 0) $valuetoshow=$localtax_typeList[$valuetoshow]; else $valuetoshow = ''; $align="center"; } - else if ($fieldlist[$field]=='taux') { + elseif ($fieldlist[$field]=='taux') { $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); $align="center"; } - else if (in_array($fieldlist[$field],array('recuperableonly'))) + elseif (in_array($fieldlist[$field],array('recuperableonly'))) { $align="center"; } - else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { + elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') { $valuetoshow = length_accountg($valuetoshow); } elseif ($fieldlist[$field] == 'fk_tva') @@ -1604,8 +1604,8 @@ if ($id) if (isset($obj->code) && $id != 10) { if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } - else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } - else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } + elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } + elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } @@ -1639,8 +1639,8 @@ if ($id) else { if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); - else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); - else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); + elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); + elseif (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); else print $langs->trans("AlwaysActive"); } print "'; print ''; print '
'.$rulefilter['rulevalue'].''; + print ''; //print $rulefilterobj->getLibStatut(3); print ' '.img_delete().''; print '
'.$ruleaction['actionparam'].''; + print ''; //print $ruleactionobj->getLibStatut(3); print ' '.img_delete().''; print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans('expenseReportPrintExample', price($range->ik->offset + 5 * $range->ik->coef)).''; + echo ''; if ($range->range_active == 1) { if ($action == 'edit' && $range->ik->id == $id && $range->rowid == $fk_range && $range->fk_c_exp_tax_cat == $fk_c_exp_tax_cat) diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 7b2baf0ed94..8594d060951 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -187,7 +187,7 @@ if ($action != 'edit') echo ''.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).''.$conf->currency.''.$form->selectyesno('restrictive', 0, 1).'
'; diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index 048d002a3b7..c289c64b217 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -259,7 +259,7 @@ if ($resql) print "
".$langs->trans("RSS")." ".($i+1)."'; + print ''; print "trans("Modify")."\">"; print "   "; print "trans("Delete")."\">"; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 683453023b9..6e9ccf792b0 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 @@ -619,7 +619,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf print '
'.$langs->trans("Type").''.$langs->trans("Name").'
'; print ''; print $langs->trans("PaymentMode").'
'; print $langs->trans("ForceInvoiceDate"); print ''; print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1); -print ''; +print ''; print ''; print "
'; +print ''; print ''; print "
'; print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print '
'; -print ''; +print ''; print ''; print "
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; -print '
'; +print ''; print "
'; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 8751d906918..e975a2f0ff8 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 7fd349363e1..7e263a5e285 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); @@ -554,7 +554,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print ''; +print ''; print ''; print "\n"; print ''; @@ -567,7 +567,7 @@ print ''; print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; print ''; @@ -581,7 +581,7 @@ print 'global->FICHINTER_PRINT_PRODUCTS) print 'checked '; print '/>'; -print ''; +print ''; print ''; print "\n"; print ''; @@ -596,7 +596,7 @@ print ''; print ''; print 'global->FICHINTER_USE_SERVICE_DURATION?' checked':'') . '>'; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -612,7 +612,7 @@ print ''; print ''; print 'global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>'; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -628,7 +628,7 @@ print ''; print ''; print 'global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>'; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 47c51069299..98ab10a988e 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -102,7 +102,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index c687a6fbc2d..62fe6631a60 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 e2168ec2d76..84ce38f9757 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/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index f5f5f868801..56866fdaea7 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -143,105 +143,105 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("PathToGeoIPMaxmindCountryDataFile").'
'; print ''; print ''; print ''; -print ''; +print ''; print "\n"; // Common name print ''; -print '"; +print '"; print ''; // Name print ''; -print '"; +print '"; print ''; // Firstname print ''; -print '"; +print '"; print ''; // Company print ''; -print '"; +print '"; print ''; // Mail print ''; -print '"; +print '"; print ''; // Phone pro print ''; -print '"; +print '"; print ''; // Phone home print ''; -print '"; +print '"; print ''; // Mobile print ''; -print '"; +print '"; print ''; // Skype print ''; -print '"; +print '"; print ''; // Fax print ''; -print '"; +print '"; print ''; // Address print ''; -print '"; +print '"; print ''; // ZIP print ''; -print '"; +print '"; print ''; // TOWN print ''; -print '"; +print '"; print ''; // COUNTRY print ''; -print '"; +print '"; print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FULLNAME?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FULLNAME?' checked':'').">
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_NAME?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_NAME?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME?' checked':'').">
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COMPANY?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COMPANY?' checked':'').">
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MAIL?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MAIL?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_PHONE?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_PHONE?' checked':'').">
'.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE?' checked':'').">
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked':'').">
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked':'').">
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FAX?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_FAX?' checked':'').">
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ADDRESS?' checked':'').">
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_ZIP?' checked':'').">
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_TOWN?' checked':'').">
'.$langs->trans("LDAPFieldCountry").''; print ''; print ' global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked':'').">global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_COUNTRY?' checked':'').">
'; @@ -321,4 +321,3 @@ if (function_exists("ldap_connect")) // End of page llxFooter(); $db->close(); - diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 247ecfb28aa..43f66147123 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -135,7 +135,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; // Filtre @@ -144,7 +144,7 @@ print "\n"; print ''; -print '"; +print '"; print ''; // Name @@ -152,7 +152,7 @@ print ''; print ''; -print '"; +print '"; print ''; */ @@ -160,14 +160,14 @@ print ''; print ''; -print '"; +print '"; print ''; // User group print ''; -print '"; +print '"; print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_FULLNAME)?' checked':'').">global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_NAME?' checked':'').">global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_NAME?' checked':'').">
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION)?' checked':'').">global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_DESCRIPTION)?' checked':'').">
'.$langs->trans("LDAPFieldGroupMembers").''; print ''; print ''.$langs->trans("LDAPFieldGroupMembersExample").'global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'').">global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS==$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)?' checked':'').">
'; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 818ec5aaff6..48d2aace5d7 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -167,7 +167,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; // Filtre @@ -176,63 +176,63 @@ print "\n"; print ''; -print '"; +print '"; print ''; // Name print ''; -print '"; +print '"; print ''; // Firstname print ''; -print ''; +print ''; print ''; // Login unix print ''; -print '"; +print '"; print ''; // Login samba print ''; -print '"; +print '"; print ''; // Password not crypted print ''; -print ''; +print ''; print ''; // Password crypted print ''; -print ''; +print ''; print ''; // Mail print ''; -print '"; +print '"; print ''; // Phone pro print ''; -print ''; +print ''; print ''; // Phone perso @@ -240,77 +240,77 @@ print ''; print ''; -print ''; +print ''; print ''; // Mobile print ''; -print ''; +print ''; print ''; // Skype print ''; -print ''; +print ''; print ''; // Fax print ''; -print ''; +print ''; print ''; // Company print ''; -print ''; +print ''; print ''; // Address print ''; -print ''; +print ''; print ''; // ZIP print ''; -print ''; +print ''; print ''; // TOWN print ''; -print ''; +print ''; print ''; // COUNTRY print ''; -print ''; +print ''; print ''; // Description print ''; -print ''; +print ''; print ''; // Public Note print ''; -print ''; +print ''; print ''; // Birthday @@ -318,14 +318,14 @@ print ''; print ''; -print ''; +print ''; print ''; // Status print ''; -print ''; +print ''; print ''; // First subscription date @@ -333,35 +333,35 @@ print ''; print ''; -print ''; +print ''; print ''; // First subscription amount print ''; -print ''; +print ''; print ''; // Last subscription date print ''; -print ''; +print ''; print ''; // Last subscription amount print ''; -print ''; +print ''; print ''; // End last subscriptions print ''; -print ''; +print ''; print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_FULLNAME)?' checked':'').">global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_NAME)?' checked':'').">global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_NAME)?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'  
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN)?' checked':'').">global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN)?' checked':'').">
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA)?' checked':'').">global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'  
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'  
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_MAIL)?' checked':'').">global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS==$conf->global->LDAP_MEMBER_FIELD_MAIL)?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'  
'.$langs->trans("LDAPFieldHomePhone").''; print ''; print ''.$langs->trans("LDAPFieldHomePhoneExample").'  
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'  
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'  
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'  
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").'  
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").'  
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").'  
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").'  
'.$langs->trans("LDAPFieldCountry").''; print ''; print '   
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'  
'.$langs->trans("LDAPFieldNotePublic").''; print ''; print ''.$langs->trans("LDAPFieldNotePublicExample").'  
'.$langs->trans("LDAPFieldBirthdate").''; print ''; print '   
'.$langs->trans("LDAPFieldStatus").''; print ''; print '   
'.$langs->trans("LDAPFieldFirstSubscriptionDate").''; print ''; print '   
'.$langs->trans("LDAPFieldFirstSubscriptionAmount").''; print ''; print '   
'.$langs->trans("LDAPFieldLastSubscriptionDate").''; print ''; print '   
'.$langs->trans("LDAPFieldLastSubscriptionAmount").''; print ''; print '   
'.$langs->trans("LDAPFieldEndLastSubscription").''; print ''; print '   
'; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 912d4ee3ea9..b07bf0b1484 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -134,7 +134,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; // Filtre @@ -143,21 +143,21 @@ print "\n"; print ''; -print '"; +print '"; print ''; // Description print ''; -print '"; +print '"; print ''; // User group print ''; -print '"; +print '"; print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldCommonNameExample").'global->LDAP_KEY_MEMBERS_TYPES && $conf->global->LDAP_KEY_MEMBERS_TYPES==$conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME)?' checked':'').">global->LDAP_KEY_MEMBERS_TYPES && $conf->global->LDAP_KEY_MEMBERS_TYPES==$conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldDescription").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'global->LDAP_KEY_MEMBERS_TYPES && $conf->global->LDAP_KEY_MEMBER_TYPES==$conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION)?' checked':'').">global->LDAP_KEY_MEMBERS_TYPES && $conf->global->LDAP_KEY_MEMBER_TYPES==$conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION)?' checked':'').">
'.$langs->trans("LDAPFieldGroupMembers").''; print ''; print ''.$langs->trans("LDAPFieldGroupMembersExample").'global->LDAP_KEY_MEMBERS_TYPES && $conf->global->LDAP_KEY_MEMBERS_TYPES==$conf->global->LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS)?' checked':'').">global->LDAP_KEY_MEMBERS_TYPES && $conf->global->LDAP_KEY_MEMBERS_TYPES==$conf->global->LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS)?' checked':'').">
'; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 934fcf8e03e..124bec14f6d 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -158,147 +158,147 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; // Common name print ''; -print '"; +print '"; print ''; // Name print ''; -print '"; +print '"; print ''; // Firstname print ''; -print '"; +print '"; print ''; // Login unix print ''; -print '"; +print '"; print ''; // Login samba print ''; -print '"; +print '"; print ''; // Password not crypted print ''; -print ''; +print ''; print ''; // Password crypted print ''; -print ''; +print ''; print ''; // Mail print ''; -print '"; +print '"; print ''; // Phone print ''; -print '"; +print '"; print ''; // Mobile print ''; -print '"; +print '"; print ''; // Skype print ''; -print '"; +print '"; print ''; // Fax print ''; -print '"; +print '"; print ''; // Company print ''; -print ''; +print ''; print ''; // Address print ''; -print ''; +print ''; print ''; // ZIP print ''; -print ''; +print ''; print ''; // TOWN print ''; -print ''; +print ''; print ''; // COUNTRY print ''; -print ''; +print ''; print ''; // Title print ''; -print ''; +print ''; print ''; // Note print ''; -print ''; +print ''; print ''; // Sid print ''; -print '"; +print '"; print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPFieldFullname").''; print ''; print ''.$langs->trans("LDAPFieldFullnameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FULLNAME)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FULLNAME)?' checked':'').">
'.$langs->trans("LDAPFieldName").''; print ''; print ''.$langs->trans("LDAPFieldNameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_NAME)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_NAME)?' checked':'').">
'.$langs->trans("LDAPFieldFirstName").''; print ''; print ''.$langs->trans("LDAPFieldFirstNameExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FIRSTNAME)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FIRSTNAME)?' checked':'').">
'.$langs->trans("LDAPFieldLoginUnix").''; print ''; print ''.$langs->trans("LDAPFieldLoginExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN)?' checked':'').">
'.$langs->trans("LDAPFieldLoginSamba").''; print ''; print ''.$langs->trans("LDAPFieldLoginSambaExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN_SAMBA)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_LOGIN_SAMBA)?' checked':'').">
'.$langs->trans("LDAPFieldPasswordNotCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'  
'.$langs->trans("LDAPFieldPasswordCrypted").''; print ''; print ''.$langs->trans("LDAPFieldPasswordExample").'  
'.$langs->trans("LDAPFieldMail").''; print ''; print ''.$langs->trans("LDAPFieldMailExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MAIL)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MAIL)?' checked':'').">
'.$langs->trans("LDAPFieldPhone").''; print ''; print ''.$langs->trans("LDAPFieldPhoneExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PHONE)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PHONE)?' checked':'').">
'.$langs->trans("LDAPFieldMobile").''; print ''; print ''.$langs->trans("LDAPFieldMobileExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked':'').">
'.$langs->trans("LDAPFieldSkype").''; print ''; print ''.$langs->trans("LDAPFieldSkypeExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked':'').">
'.$langs->trans("LDAPFieldFax").''; print ''; print ''.$langs->trans("LDAPFieldFaxExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'').">
'.$langs->trans("LDAPFieldCompany").''; print ''; print ''.$langs->trans("LDAPFieldCompanyExample").'  
'.$langs->trans("LDAPFieldAddress").''; print ''; print ''.$langs->trans("LDAPFieldAddressExample").'  
'.$langs->trans("LDAPFieldZip").''; print ''; print ''.$langs->trans("LDAPFieldZipExample").'  
'.$langs->trans("LDAPFieldTown").''; print ''; print ''.$langs->trans("LDAPFieldTownExample").'  
'.$langs->trans("LDAPFieldCountry").''; print ''; print '   
'.$langs->trans("LDAPFieldTitle").''; print ''; print ''.$langs->trans("LDAPFieldTitleExample").'  
'.$langs->trans("Note").''; print ''; print ''.$langs->trans("LDAPFieldDescriptionExample").'  
'.$langs->trans("LDAPFieldSid").''; print ''; print ''.$langs->trans("LDAPFieldSidExample").'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'').">global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SID)?' checked':'').">
'; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 6342f731347..ad41d7bd945 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -139,20 +139,20 @@ else print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); - print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.''; + print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.''; print ''; print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); - print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.''; + print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.''; - print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.''; + print ''.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.''; print ''; print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); - print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.''; + print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.''; print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index bc82d03d8d7..e49ef792700 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -471,7 +471,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print ''; +print ''; print ''; print "\n"; print ''; @@ -481,4 +481,3 @@ print ''; // End of page llxFooter(); $db->close(); - diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 419f6efbee9..20e0b59199a 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 33b6d83e0da..d7eb804fa4d 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_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index bbfc2ee2363..a5cb2d8b396 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -356,7 +356,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -462,7 +462,7 @@ if (isset($totalarray['pos'])) while ($i < $totalarray['nbfield']) { $i++; - if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; + if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; else { if ($i == 1) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 289a3ecd081..844fe093315 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Remy Younes * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2011-2016 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2018 Frédéric France @@ -479,7 +479,7 @@ foreach ($fieldlist as $field => $value) { 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 @@ -525,7 +525,7 @@ if (empty($reshook)) } } -print ''; +print ''; print ''; print ""; @@ -552,7 +552,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) if ($tmpfieldlist == 'topic') { print ''; } - else if ($tmpfieldlist == 'joinfiles') { + elseif ($tmpfieldlist == 'joinfiles') { print ''; } else @@ -621,7 +621,7 @@ if ($resql) // There is several pages if ($num > $listlimit) { - print ''; + print ''; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print ''; } @@ -657,7 +657,7 @@ if ($resql) } if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print ''; // Action column - print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -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; @@ -1065,4 +1065,3 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } } } - diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index d7ef0c4d62b..a7a11068256 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -266,7 +266,7 @@ print ''; print ''; print ''; -print ''; print ''; @@ -326,7 +326,7 @@ if ($conf->use_javascript_ajax) 'position'=>$menu['position'], 'entry'=>'
'.$langs->trans("TreeMenuPersonalized").'
'; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 6e5f0d77b4b..d85218dbd5a 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 4694021c233..df1d1d48c90 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,14 +158,14 @@ 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); dol_mkdir($conf->admin->dir_temp.'/'.$tmpdir); } - $result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']); + $result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'], $newfile, 1, 0, $_FILES['fileinstall']['error']); if ($result > 0) { $result=dol_uncompress($newfile,$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 "\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/multicurrency.php b/htdocs/admin/multicurrency.php index 0a64145e9a4..fbf6603d139 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -193,7 +193,7 @@ print ''; print ''; print ''; -print ''; print ''; print ''; -print ''; print ''."\n"; - print ''; print ''; - print ''; print ''; - print ''; print ''; - print ''; print ''; print ''; print ''; -print ''; print ''; -print ''; +print ''; print ''; foreach ($TCurrency as &$currency) @@ -309,7 +309,7 @@ foreach ($TCurrency as &$currency) print ''; print ''; - print ''; print ''; /*print ''; print '';*/ -//print ''; +//print ''; print "\n"; // Load array of available notifications diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index 19225273bfc..da5aed70c81 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 816ab8344ce..f01794c6c17 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -247,7 +247,7 @@ print '\n"; print '
'. '   '.$titre.''. - ''. + ''. ''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. ''.img_edit_add('default').' '. ''.img_delete('default').' '. @@ -373,7 +373,7 @@ if ($conf->use_javascript_ajax) print '
'.$langs->trans("NotTopTreeMenuPersonalized").'
'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'
'.$langs->transnoentitiesnoconv("multicurrency_buyPriceInCurrency").''; +print ''; print '
'; print ''; print ''; @@ -207,7 +207,7 @@ print '
'.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").''; +print ''; print ''; print ''; print ''; @@ -229,7 +229,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print '
'.$form->textwithpicto($langs->trans("CurrencyLayerAccount"), $langs->trans("CurrencyLayerAccount_help_to_synchronize")).''; + print ''; print ''; print ''; print ''; @@ -240,7 +240,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print '
'.$langs->transnoentitiesnoconv("multicurrency_appId").''; + print ''; print ''; print ''; print ''; @@ -252,7 +252,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print '
'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").''; + print ''; print ''; print ''; print ''; @@ -263,7 +263,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print '
'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").''; + print ''; print ''; print ''; print ''; @@ -289,7 +289,7 @@ print '
'.$form->selectCurrency('', 'code').''; +print ''; print ''; print ''; print ' '; @@ -300,7 +300,7 @@ print ''; print '
'.$conf->currency.$form->textwithpicto(' ', $langs->trans("BaseCurrency")).'11
'.$currency->code.' - '.$currency->name.''; + print ''; print '
'; print ''; print ''; diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 92ba0bec200..4a4e07d35f9 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')); @@ -151,7 +151,7 @@ print '
'.$langs->trans("Label").''.$langs->trans("Code").''.$langs->trans("Label").''.$langs->trans("NbOfTargetedContacts").''.$langs->trans("NbOfTargetedContacts").'
'; print $langs->trans("PaymentOnDifferentThirdBills"); print ''; print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS,1); -print ''; +print ''; print "
'; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 37c836043a0..3d9a6984f88 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 6cec4a52bb9..a6c5c54a40f 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'); @@ -252,7 +250,7 @@ print ''; //ADDDAYS print ''.$langs->trans("ADDDAYS").''; -print ''; +print ''; if (! $conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS=0; print ''; print ''; @@ -495,7 +493,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print ''; print ''.$langs->trans("User").''; print ''.$langs->trans("Value").''; - print ''.$langs->trans("Action").''; + print ''.$langs->trans("Action").''; print "\n"; print ''; @@ -506,7 +504,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print $form->selectarray('action',$actions);// select_dolusers(0,'user',0); print ''; - print ''; + print ''; // List of current notifications for objet_type='withdraw' $sql = "SELECT u.lastname, u.firstname,"; @@ -532,7 +530,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).''; $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); print ''.$label.''; - print 'rowid.'">'.img_delete().''; + print 'rowid.'">'.img_delete().''; print ''; $i++; } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index cf860cd64ba..b9fe6bca9d0 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 @@ -522,7 +522,7 @@ print ""; print ''; print ''.$langs->trans("DefaultProposalDurationValidity").''; print ''."global->PROPALE_VALIDITY_DURATION."\">"; -print ''; +print ''; print ''; print ''; @@ -534,7 +534,7 @@ print ''; print $langs->trans("UseCustomerContactAsPropalRecipientIfExist"); print ''; print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1); -print ''; +print ''; print ''; print "\n"; print ''; @@ -562,7 +562,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print ''; +print ''; print ''; print "\n"; print ''; @@ -575,7 +575,7 @@ print ''; print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; print ''; @@ -585,7 +585,7 @@ if ($conf->banque->enabled) { print ''; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL'); @@ -644,7 +644,7 @@ print "\n"; print ''; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; -print ''; +print ''; print "\n"; print ''; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 9490a291729..5a4581e7e83 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -132,7 +132,7 @@ print "\n"; print ''; -print ''.$langs->trans("ConnectionTimeout").''; +print ''.$langs->trans("ConnectionTimeout").''; print ''; print ''; print 'global->MAIN_USE_CONNECT_TIMEOUT).'">'; @@ -142,7 +142,7 @@ print ''; print ''; -print ''.$langs->trans("ResponseTimeout").''; +print ''.$langs->trans("ResponseTimeout").''; print ''; print ''; print ''; @@ -152,7 +152,7 @@ print ''; print ''; -print ''.$langs->trans("MAIN_PROXY_USE").''; +print ''.$langs->trans("MAIN_PROXY_USE").''; print ''; print ''; print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1); @@ -161,7 +161,7 @@ print ''; print ''; -print ''.$langs->trans("MAIN_PROXY_HOST").''; +print ''.$langs->trans("MAIN_PROXY_HOST").''; print ''; print ''; print ''; @@ -170,7 +170,7 @@ print ''; print ''; -print ''.$langs->trans("MAIN_PROXY_PORT").''; +print ''.$langs->trans("MAIN_PROXY_PORT").''; print ''; print ''; print ''; @@ -179,7 +179,7 @@ print ''; print ''; -print ''.$langs->trans("MAIN_PROXY_USER").''; +print ''.$langs->trans("MAIN_PROXY_USER").''; print ''; print ''; print ''; @@ -188,7 +188,7 @@ print ''; print ''; -print ''.$langs->trans("MAIN_PROXY_PASS").''; +print ''.$langs->trans("MAIN_PROXY_PASS").''; print ''; print ''; print ''; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 4aa362932af..07781551eb6 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/resource.php b/htdocs/admin/resource.php index 566e57e587b..acb4ab2166e 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -79,7 +79,7 @@ print ''; print ''; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; @@ -88,13 +88,13 @@ print ''; print ''; if (empty($conf->use_javascript_ajax)) { - print ''; } else { - print ''; - print ''; } diff --git a/htdocs/admin/salaries.php b/htdocs/admin/salaries.php index f724bd9e50c..057c2cfa3db 100644 --- a/htdocs/admin/salaries.php +++ b/htdocs/admin/salaries.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2014-2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 26dcdc85b8d..91973ea22c3 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"); @@ -330,7 +330,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ print '
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Value").'
'.$langs->trans("UseSearchToSelectResource").''; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; + print ''; $arrval=array( '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')', @@ -103,7 +103,7 @@ else ); print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT",$arrval,$conf->global->RESOURCE_USE_SEARCH_TO_SELECT); print ''; + print ''; print ''; print '
'; print '
'; - print ''; + print '
'; print ''; diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index 87e0d6dd941..f3449e12885 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). @@ -126,7 +126,7 @@ print ''; print ''; -print ''; print '\n"; @@ -560,7 +560,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print '\n"; @@ -584,7 +584,7 @@ print "\n"; print '\n"; print '
'; print ''.$langs->trans("Save").''; print '
'.$langs->trans("UMask").''; +print ''.$langs->trans("UMask").''; print $form->textwithpicto('',$langs->trans("UMaskExplanation")); print ''; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index b1e4f745560..99684305cec 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -57,7 +57,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) } } -else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -71,7 +71,7 @@ else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) } } -else if ($action == 'updateform') +elseif ($action == 'updateform') { $res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity); $res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity); @@ -109,13 +109,13 @@ dol_fiche_head($head, 'misc', $langs->trans("Security"), -1); print ''; print ''; print ''; -print ''; +print ''; print ''; // Enable Captcha code print ''; print ''; -print ''; // Enable advanced perms print ''; print ''; -print '\n"; $sessiontimeout=ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=$sessiontimeout; print ''; -print ''; print ''; $sessiontimeout=ini_get("session.gc_maxlifetime"); if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE=""; print ''; -print ''; print ''; print ''; - print ''; print ''; - print '\n"; @@ -514,7 +516,7 @@ print "\n"; print '\n"; print '
'.$langs->trans("Parameters").''.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("UseCaptchaCode").''; +print ''; if (function_exists("imagecreatefrompng")) { if (! empty($conf->use_javascript_ajax)) @@ -144,7 +144,7 @@ print '
'.$langs->trans("UseAdvancedPerms").''; +print ''; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS'); @@ -179,7 +179,7 @@ print "
'.$langs->trans("SessionTimeOut").''; +print ''.$langs->trans("SessionTimeOut").''; print $form->textwithpicto('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); print ''; @@ -191,7 +191,7 @@ print '
'.$langs->trans("MAIN_APPLICATION_TITLE").''; +print ''.$langs->trans("MAIN_APPLICATION_TITLE").''; print ''; print ' '; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 7a60d234405..f358d3310da 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -454,7 +454,7 @@ if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULAT print '
'.$langs->trans("UseDispatchStatus").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); } else { @@ -522,7 +522,7 @@ if ($conf->global->PRODUIT_SOUSPRODUITS) print '
'.$langs->trans("IndependantSubProductStock").''; + print ''; print "
"; print ''; print ""; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 45d588fb031..b6214232971 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -43,6 +43,8 @@ accessforbidden(); $type=GETPOST('type', 'alpha'); $value=GETPOST('value', 'alpha'); $action=GETPOST('action', 'alpha'); + +$label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir','alpha'); $specimenthirdparty=new Societe($db); @@ -122,12 +124,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 +139,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 +155,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); } @@ -491,7 +493,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print '
'; +print ''; print ''; print "
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; -print '
'; +print ''; print "
'; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 88cb18d5d80..69d582ff90a 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); @@ -503,7 +503,7 @@ $var=false; print $langs->trans("IfSetToYesDontForgetPermission"); print '
'; print ''; - print ''; + print ''; print ''; print "
'; +print ''; print ''; print "
'; print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'
'; -print '
'; +print ''; print "
'; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 77f2a95070e..ecb7b455657 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 056982c4d08..430bd3b8436 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 @@ -517,7 +517,7 @@ else $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); print $doleditor->Create(); } -print ''; +print ''; print ''; print "\n"; print ''; @@ -530,7 +530,7 @@ print ''; print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print ''; print ''; -print ''; +print ''; print ''; print "\n"; print ''; @@ -539,7 +539,7 @@ if ($conf->banque->enabled) { print ''; - print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; if (! empty($conf->use_javascript_ajax)) { print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); @@ -585,4 +585,3 @@ print "\n
"; // End of page llxFooter(); $db->close(); - diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index a3cceda40da..e212ee8b949 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -202,7 +202,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; foreach ($syslogModules as $moduleName) @@ -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'] : ''); @@ -275,7 +275,7 @@ print ''; print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; print ''; print ''; -print ''; +print ''; print "\n"; print ''; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index fef49bd5c12..645abf36ce8 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -183,7 +183,7 @@ foreach($configfileparameters as $key) // Value print ""; diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index addeb3793c6..2436807b584 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; @@ -87,14 +87,14 @@ else print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; $sql = "SHOW TABLE STATUS"; @@ -120,14 +120,14 @@ else print ''; } print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $i++; } @@ -162,11 +162,11 @@ else $row = $db->fetch_row($resql); print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; $i++; } diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php index 2cf249c0f74..9f9cc63505d 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 85c3a8a1d94..a8b5b2da401 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -141,7 +141,7 @@ print ''."\n"; print ''."\n"; print ''; print ''; print ''; - print ''; + print ''; print ''."\n"; foreach($shmoparray as $key => $val) { print ''; print ''; - print ''; + print ''; print ''."\n"; } @@ -374,8 +374,8 @@ foreach($configfileparameters as $key => $value) // Value print "'; $out.=''; $out.=''; - $out.=''; - $out.=''; + $out.=''; + $out.=''; $out.=''."\n"; $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename'); if (is_array($tmpfilelist2) && count($tmpfilelist2)) @@ -292,8 +292,8 @@ if (! $error && $xml) $out.='' . "\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; - $out.='' . "\n"; - $out.='' . "\n"; + $out.='' . "\n"; + $out.='' . "\n"; $out.="\n"; } $out.=''; @@ -301,8 +301,8 @@ if (! $error && $xml) $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; - $out.='' . "\n"; - $out.='' . "\n"; + $out.='' . "\n"; + $out.='' . "\n"; $out.="\n"; } else @@ -325,8 +325,8 @@ if (! $error && $xml) $out.=''; $out.=''; $out.=''; - $out.=''; - $out.=''; + $out.=''; + $out.=''; $out.=''."\n"; $tmpfilelist3 = dol_sort_array($file_list['added'], 'filename'); if (is_array($tmpfilelist3) && count($tmpfilelist3)) @@ -338,7 +338,6 @@ if (! $error && $xml) $out.=''; $out.='' . "\n"; $out.='' . "\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; - $out.='' . "\n"; - $out.='' . "\n"; + $out.='' . "\n"; + $out.='' . "\n"; $out.="\n"; } $out.=''; @@ -357,8 +356,8 @@ if (! $error && $xml) $out.='' . "\n"; $out.='' . "\n"; $out.='' . "\n"; - $out.='' . "\n"; - $out.='' . "\n"; + $out.='' . "\n"; + $out.='' . "\n"; $out.="\n"; } else diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 76e7496cc4e..723cf4e33a0 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011-2013 Juanjo Menent - * Copyright (C) 2015-2018 Alexandre Spangaro + * Copyright (C) 2015-2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,7 +147,7 @@ else print ''; if (! $conf->use_javascript_ajax) { - print '"; } diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 55be556afb9..d74afcc90bc 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -166,7 +166,7 @@ print ''; print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("SyslogLevel").'"; if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey}); - else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); + elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); else print ${$newkey}; if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; print "'.$langs->trans("TableName").''.$langs->trans("Type").''.$langs->trans("Format").''.$langs->trans("NbOfRecord").'Avg_row_lengthData_lengthMax_Data_lengthIndex_lengthIncrementLast checkCollation'.$langs->trans("NbOfRecord").'Avg_row_lengthData_lengthMax_Data_lengthIndex_lengthIncrementLast checkCollation
 '.$obj->Row_format.''.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation.''.$obj->Rows.''.$obj->Avg_row_length.''.$obj->Data_length.''.$obj->Max_data_length.''.$obj->Index_length.''.$obj->Auto_increment.''.$obj->Check_time.''.$obj->Collation.'
'.$row[0].''.$row[1].''.$row[2].''.$row[3].''.$row[4].''.$row[5].''.$row[1].''.$row[2].''.$row[3].''.$row[4].''.$row[5].'
'.$langs->trans("SessionSavePath").''.$langs->trans("SessionName").''.session_name().'
'.$langs->trans("SessionId").''.session_id().'
'.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime)'.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); -print ''; +print ''; print ''."\n"; print ''."\n"; print ''."\n"; @@ -179,14 +179,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S print '
'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").''.$langs->trans("NbOfEntries").''.$langs->trans("Address").''.$langs->trans("Address").'
'.$key.''.count($val).''.dol_getshmopaddress($key).''.dol_getshmopaddress($key).'
"; 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/system/filecheck.php b/htdocs/admin/system/filecheck.php index 895393eec1d..094212d817b 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -275,8 +275,8 @@ if (! $error && $xml) $out.='' . $langs->trans("Filename") . '' . $langs->trans("ExpectedChecksum") . '' . $langs->trans("CurrentChecksum") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '
'.$file['md5'].''.dol_print_size($size).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').''.dol_print_size($size).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'
'.$langs->trans("Total").''.dol_print_size($totalsize).''.dol_print_size($totalsize).'
' . $langs->trans("Filename") . '' . $langs->trans("ExpectedChecksum") . '' . $langs->trans("CurrentChecksum") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '' . $langs->trans("Size") . '' . $langs->trans("DateModification") . '
'.$i.''.$file['filename']; - $out.=PHP_OS; if (! preg_match('/^win/i',PHP_OS)) { $htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.'/'.$file['filename']); $out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'); @@ -348,8 +347,8 @@ if (! $error && $xml) $out.=''.$file['md5'].''.dol_print_size($size).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').''.dol_print_size($size).''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'
'.$langs->trans("Total").''.dol_print_size($totalsize).''.dol_print_size($totalsize).'
'; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "
';
diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 90220f1bb23..e1357a39fb5 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 c6209cd7c34..353cd6b6b98 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; @@ -174,9 +174,9 @@ function create_script_table($list) print '
'.dol_trunc($script['file'],80,'left').''.dol_print_date($script['mtime'],'dayhour').''.number_format($script['size'] / 1024, 2).'KB'.$script['reloads'].' ('.$script['usecount'].')'.$script['hits'].''.number_format($script['size'] / 1024, 2).'KB'.$script['reloads'].' ('.$script['usecount'].')'.$script['hits'].'
'; @@ -204,8 +204,8 @@ function create_key_table($list) print ''; print ''.dol_trunc($key['name'],80,'left').''; print ''.dol_print_date($key['created'],'dayhour').''; - print ''.number_format($key['size']/1024, 3).'KB'; - print ''; + print ''.number_format($key['size']/1024, 3).'KB'; + print ''; if ($key['ttl'] == -1) { print 'expired'; } elseif ($key['ttl'] == 0) { @@ -232,37 +232,37 @@ print ''; print ''; print 'Caching enabled'; -print ''.($info['cache']?'yes':'no').''; +print ''.($info['cache']?'yes':'no').''; print ''; print ''; print 'Optimizer enabled'; -print ''.$info['optimizer']?'yes':'no'.''; +print ''.$info['optimizer']?'yes':'no'.''; print ''; print ''; print 'Memory usage'; -print ''.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)'; +print ''.number_format(100 * $info['memoryAllocated']/$info['memorySize'], 2).'%('.number_format($info['memoryAllocated'] / (1024*1024), 2).'MB / '.number_format($info['memorySize']/(1024*1024), 2).'MB)'; print ''; print ''; print 'Free memory in reserved cache'; -print ''.number_format($info['memoryAvailable']/(1024*1024), 2).'MB'; +print ''.number_format($info['memoryAvailable']/(1024*1024), 2).'MB'; print ''; print ''; print 'Cached scripts'; -print ''.$info['cachedScripts'].''; +print ''.$info['cachedScripts'].''; print ''; print ''; print 'Removed scripts'; -print ''.$info['removedScripts'].''; +print ''.$info['removedScripts'].''; print ''; print ''; print 'Cached keys'; -print ''.(isset($info['cachedKeys'])?$info['cachedKeys']:'').''; +print ''.(isset($info['cachedKeys'])?$info['cachedKeys']:'').''; print ''; print ''; @@ -279,29 +279,29 @@ if (is_array($resCached) || is_array($resRemoved)) { if (is_array($resCached)) { print ''; print "Caching"; - print ''; + print ''; print ""; print ''; print "Optimizer"; - print ''; + print ''; print ""; } if (is_array($resRemoved)) { print ''; print "Clear cache"; - print ''; + print ''; print ""; print ''; print "Clean cache"; - print ''; + print ''; print ""; print ''; print "Purge cache"; - print ''; + print ''; print ""; } diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 6b0ea790ab2..9f3caf91881 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -234,4 +234,3 @@ header("Location: dolibarr_export.php"); $time_end = time(); $db->close(); - diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 809cea3b271..0aae9083565 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -163,4 +163,3 @@ header("Location: dolibarr_export.php"); $time_end = time(); $db->close(); - diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index eedb22f0aa8..e00e2c6a98e 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -255,7 +255,7 @@ if ($result) //print ''; print ''; - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; @@ -313,7 +313,7 @@ if ($result) print ''; // More informations - print ''; + print ''; $htmltext=''.$langs->trans("UserAgent").': '.($obj->user_agent?$obj->user_agent:$langs->trans("Unknown")); print $form->textwithpicto('',$htmltext); print ''; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 7cbb82fbe6e..759bf1dfc48 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 6b893a4a78b..a791cdde4ed 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -500,7 +500,7 @@ if ($mode == 'searchkey') //} print ''; // Action column - print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print ''; @@ -520,7 +520,7 @@ if ($mode == 'searchkey') if ($i > ($offset + $limit)) break; print ''.$langcode.''.$key.''; print dol_escape_htmltag($val); - print ''; + print ''; if (! empty($newlangfileonly->tab_translate[$key])) { if ($val != $newlangfileonly->tab_translate[$key]) @@ -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 e36b8d59df3..4abcaed9b6a 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -502,7 +502,7 @@ if ($id) fieldListWebsites($fieldlist,$obj,$tabname[$id],'add'); - print ''; + print ''; if ($action != 'edit') { print ''; @@ -585,7 +585,7 @@ if ($id) if (empty($reshook)) fieldListWebsites($fieldlist,$obj,$tabname[$id],'edit'); - print ' '; + print ' '; print ' '; } else @@ -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; @@ -695,4 +695,3 @@ function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='') } } } - diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 9d724b86390..48c2bdcdd08 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -147,4 +147,3 @@ dol_fiche_end(); // End of page llxFooter(); $db->close(); - diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index c3b54e36b6c..951e88f63fc 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -221,4 +221,3 @@ print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules llxFooter(); $db->close(); - diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 6d6ef4578cd..d79b34b8949 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 86d1cfff87c..01b0fdd56da 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 39c1f8d6db6..e9d69728979 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'); } @@ -1080,8 +1080,8 @@ class Setup extends DolibarrApi $out.='' . $langs->trans("Filename") . ''; $out.='' . $langs->trans("ExpectedChecksum") . ''; $out.='' . $langs->trans("CurrentChecksum") . ''; - $out.='' . $langs->trans("Size") . ''; - $out.='' . $langs->trans("DateModification") . ''; + $out.='' . $langs->trans("Size") . ''; + $out.='' . $langs->trans("DateModification") . ''; $out.=''."\n"; $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename'); if (is_array($tmpfilelist2) && count($tmpfilelist2)) @@ -1097,8 +1097,8 @@ class Setup extends DolibarrApi $out.=''.$file['md5'].'' . "\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; - $out.=''.dol_print_size($size).'' . "\n"; - $out.=''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'' . "\n"; + $out.=''.dol_print_size($size).'' . "\n"; + $out.=''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'' . "\n"; $out.="\n"; } $out.=''; @@ -1106,8 +1106,8 @@ class Setup extends DolibarrApi $out.=''.$langs->trans("Total").'' . "\n"; $out.='' . "\n"; $out.='' . "\n"; - $out.=''.dol_print_size($totalsize).'' . "\n"; - $out.='' . "\n"; + $out.=''.dol_print_size($totalsize).'' . "\n"; + $out.='' . "\n"; $out.="\n"; } else @@ -1130,8 +1130,8 @@ class Setup extends DolibarrApi $out.='' . $langs->trans("Filename") . ''; $out.='' . $langs->trans("ExpectedChecksum") . ''; $out.='' . $langs->trans("CurrentChecksum") . ''; - $out.='' . $langs->trans("Size") . ''; - $out.='' . $langs->trans("DateModification") . ''; + $out.='' . $langs->trans("Size") . ''; + $out.='' . $langs->trans("DateModification") . ''; $out.=''."\n"; $tmpfilelist3 = dol_sort_array($file_list['added'], 'filename'); if (is_array($tmpfilelist3) && count($tmpfilelist3)) @@ -1147,8 +1147,8 @@ class Setup extends DolibarrApi $out.=''.$file['md5'].'' . "\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; - $out.=''.dol_print_size($size).'' . "\n"; - $out.=''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'' . "\n"; + $out.=''.dol_print_size($size).'' . "\n"; + $out.=''.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']),'dayhour').'' . "\n"; $out.="\n"; } $out.=''; @@ -1156,8 +1156,8 @@ class Setup extends DolibarrApi $out.=''.$langs->trans("Total").'' . "\n"; $out.='' . "\n"; $out.='' . "\n"; - $out.=''.dol_print_size($totalsize).'' . "\n"; - $out.='' . "\n"; + $out.=''.dol_print_size($totalsize).'' . "\n"; + $out.='' . "\n"; $out.="\n"; } else diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index f220d5cb849..2735981b564 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index a791078f37b..7038f6df5a0 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 57738309abd..236315b52d8 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index d8b8f3aa056..e24e6a96c83 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 335a9f6e9d1..aafdbacc791 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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 51d76d75155..29851185391 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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/asset/document.php b/htdocs/asset/document.php index c1332ed10a2..6433b30a543 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index e01316ae685..3c6260ffde7 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index cb0a8cca7b2..262b203f26e 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -364,7 +364,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -469,7 +469,7 @@ if (isset($totalarray['pos'])) while ($i < $totalarray['nbfield']) { $i++; - if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; + if (! empty($totalarray['pos'][$i])) print ''.price($totalarray['val'][$totalarray['pos'][$i]]).''; else { if ($i == 1) diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index f76c6ea028f..7e74ec0a805 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Alexandre Spangaro + * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index b8a282430cc..31c328d9326 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -299,9 +299,9 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''; if ($user->rights->asset->write) - print 'rowid.'">'.img_edit().''; + print 'rowid.'">'.img_edit().''; else - print ' '; + print ' '; print ""; $i++; } diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 8c2835d856c..36ac6615efa 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -116,7 +116,7 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) { // Example with a yes / no select print ''; print ''.$langs->trans("BlockedLogAuthorityUrl").img_info($langs->trans('BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote')).''; - print ''; + print ''; print '
'; print ''; print ''; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 49a4daa3b3f..e100371e965 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -105,7 +105,7 @@ if ($action === 'downloadblockchain') { exit; } -else if (GETPOST('downloadcsv','alpha')) +elseif (GETPOST('downloadcsv','alpha')) { $error = 0; @@ -327,7 +327,7 @@ if (GETPOST('withtab','alpha')) $param.='&withtab='.urlencode(GETPOST('withtab', print ''; -print '
'; +print '
'; print $langs->trans("RestrictYearToExport").': '; $smonth=GETPOST('monthtoexport','int'); // Month @@ -430,7 +430,7 @@ print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"],'user print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"],'ref_object','',$param,'',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; -print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder,'')."\n"; +print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'class="right"',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n"; print getTitleFieldOfList($langs->trans('Status'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n"; @@ -498,7 +498,7 @@ if (is_array($blocks)) print ''.$object_link.''; // Amount - print ''.price($block->amounts).''; + print ''.price($block->amounts).''; // Details link print ''.img_info($langs->trans('ShowDetails')).''; diff --git a/htdocs/blockedlog/ajax/authority.php b/htdocs/blockedlog/ajax/authority.php index 1104eeb3c02..1b002dda574 100644 --- a/htdocs/blockedlog/ajax/authority.php +++ b/htdocs/blockedlog/ajax/authority.php @@ -69,5 +69,3 @@ elseif(!empty($newblock)){ else{ echo 'idontunderstandwhatihavetodo'; } - - diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index 0d0fc183b6c..afdacdaa0a6 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 bc65c72260d..0d24b71b343 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') { @@ -385,7 +385,7 @@ class BlockedLog $this->object_data=new stdClass(); // Add fields to exclude $arrayoffieldstoexclude = array( - 'table_element','fields','ref_previous','ref_next','origin','origin_id','oldcopy','picto','error','errors','modelpdf','civility_id','contact','contact_id', + 'table_element','fields','ref_previous','ref_next','origin','origin_id','oldcopy','picto','error','errors','modelpdf','last_main_doc','civility_id','contact','contact_id', 'table_element_line','ismultientitymanaged','isextrafieldmanaged', 'linkedObjectsIds','linkedObjects','fk_delivery_address', 'context', @@ -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/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 319c44c9d73..5dd55a95873 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -116,7 +116,7 @@ function printBookmarksList($aDb, $aLangs) $ret.=ajax_combobox('boxbookmark'); - $ret.=''; + print ''; print ''; } @@ -4035,7 +4041,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,22 +4159,22 @@ 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; print ''; print ''.$langs->trans('Ref').''; print ''.$langs->trans('Description').''; - print ''.$langs->trans('VATRate').''; - print ''.$langs->trans('PriceUHT').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('PriceUHTCurrency').''; - print ''.$langs->trans('Qty').''; + print ''.$langs->trans('VATRate').''; + print ''.$langs->trans('PriceUHT').''; + if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('PriceUHTCurrency').''; + print ''.$langs->trans('Qty').''; if($conf->global->PRODUCT_USE_UNITS) { print ''.$langs->trans('Unit').''; } - print ''.$langs->trans('ReductionShort').''; + print ''.$langs->trans('ReductionShort').''; $var = true; $i = 0; @@ -4207,7 +4213,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 +4246,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 +4359,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 +4403,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; @@ -4458,9 +4464,9 @@ abstract class CommonObject * @param int $hideref 1 to hide product reference. 0 by default * @param null|array $moreparams Array to provide more information * @return int >0 if OK, <0 if KO - * @see addFileIntoDatabaseIndex + * @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; @@ -4667,10 +4673,15 @@ abstract class CommonObject if (! empty($obj->update_main_doc_field)) $update_main_doc_field=1; if ($update_main_doc_field && ! empty($this->table_element)) { - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET last_main_doc = '".($ecmfile->filepath.'/'.$ecmfile->filename)."'"; + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element." SET last_main_doc = '".$this->db->escape($ecmfile->filepath.'/'.$ecmfile->filename)."'"; $sql.= ' WHERE rowid = '.$this->id; + $resql = $this->db->query($sql); if (! $resql) dol_print_error($this->db); + else + { + $this->last_main_doc = $ecmfile->filepath.'/'.$ecmfile->filename; + } } } } @@ -4742,7 +4753,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 +4829,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; @@ -4900,6 +4911,14 @@ abstract class CommonObject //var_dump('key '.$key.' '.$value.' type='.$extrafields->attributes[$this->table_element]['type'][$key].' '.$this->array_options["options_".$key]); } } + + // If field is a computed field, value must become result of compute + foreach ($tab as $key => $value) { + if (! empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) + { + $this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0); + } + } } $this->db->free($resql); @@ -4952,9 +4971,9 @@ abstract class CommonObject * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) * @param User $userused Object user * @return int -1=error, O=did nothing, 1=OK - * @see updateExtraField, setValueFrom + * @see updateExtraField(), setValueFrom() */ - function insertExtraFields($trigger='', $userused=null) + function insertExtraFields($trigger = '', $userused = null) { global $conf,$langs,$user; @@ -5198,9 +5217,9 @@ abstract class CommonObject * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) * @param User $userused Object user * @return int -1=error, O=did nothing, 1=OK - * @see setValueFrom, insertExtraFields + * @see setValueFrom(), insertExtraFields() */ - function updateExtraField($key, $trigger=null, $userused=null) + function updateExtraField($key, $trigger = null, $userused = null) { global $conf,$langs,$user; @@ -5334,7 +5353,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; @@ -5429,7 +5448,7 @@ abstract class CommonObject { $morecss = 'minwidth100'; } - else if (round($size) <= 48) + elseif (round($size) <= 48) { $morecss = 'minwidth200'; } @@ -5909,7 +5928,7 @@ abstract class CommonObject if(! empty($conf->use_javascript_ajax)) { $out.= ' - '."\n"; + print ''."\n"; } @@ -7393,7 +7405,7 @@ function dol_getmypid() * @param integer $nofirstand 1=Do not output the first 'AND' * @return string $res The statement to append to the SQL query */ -function natural_search($fields, $value, $mode=0, $nofirstand=0) +function natural_search($fields, $value, $mode = 0, $nofirstand = 0) { global $db,$langs; @@ -7447,12 +7459,12 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) $i2++; // a criteria was added to string } } - else if ($mode == 2) + elseif ($mode == 2) { $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")"; $i2++; // a criteria was added to string } - else if ($mode == 3) + elseif ($mode == 3) { $tmparray=explode(',',trim($crit)); if (count($tmparray)) @@ -7470,7 +7482,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0) $i2++; // a criteria was added to string } } - else if ($mode == 4) + elseif ($mode == 4) { $tmparray=explode(',',trim($crit)); if (count($tmparray)) @@ -7576,7 +7588,7 @@ function showDirectDownloadLink($object) * @param string $extImgTarget Force image extension for thumbs. Use '' to keep same extension than original image (default). * @return string New file name (full or relative path, including the thumbs/) */ -function getImageFileNameForSize($file, $extName, $extImgTarget='') +function getImageFileNameForSize($file, $extName, $extImgTarget = '') { $dirName = dirname($file); if ($dirName == '.') $dirName=''; @@ -7608,7 +7620,7 @@ function getImageFileNameForSize($file, $extName, $extImgTarget='') * @param string $param More param on http links * @return string|array Output string with href link or array with all components of link */ -function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param='') +function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param = '') { global $conf, $langs; @@ -7638,10 +7650,10 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata=0, $param='' * @param string $addlink Add a 'link to' after * @return string */ -function ajax_autoselect($htmlname, $addlink='') +function ajax_autoselect($htmlname, $addlink = '') { global $langs; - $out = ''."\n"; - else print ''."\n"; + if (defined('JS_JQUERY') && constant('JS_JQUERY')) print ''."\n"; + else print ''."\n"; if (! empty($conf->global->MAIN_FEATURES_LEVEL) && ! defined('JS_JQUERY_MIGRATE_DISABLED')) { - if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print ''."\n"; - else print ''."\n"; + if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print ''."\n"; + else print ''."\n"; } - if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) print ''."\n"; - else print ''."\n"; - if (! defined('DISABLE_JQUERY_TABLEDND')) print ''."\n"; + if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) print ''."\n"; + else print ''."\n"; + if (! defined('DISABLE_JQUERY_TABLEDND')) print ''."\n"; // jQuery jnotify if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && ! defined('DISABLE_JQUERY_JNOTIFY')) { - print ''."\n"; + print ''."\n"; } // Flot if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && ! defined('DISABLE_JQUERY_FLOT')) { if (constant('JS_JQUERY_FLOT')) { - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } else { - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; } } // jQuery jeditable if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! defined('DISABLE_JQUERY_JEDITABLE')) { print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; } // jQuery Timepicker if (! empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) { - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; } if (! defined('DISABLE_SELECT2') && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) // jQuery plugin "mutiselect", "multiple-select", "select2", ... { $tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT; - print ''."\n"; // We include full because we need the support of containerCssClass + print ''."\n"; // We include full because we need the support of containerCssClass } if (! defined('DISABLE_MULTISELECT')) // jQuery plugin "mutiselect" to select with checkboxes { - print ''."\n"; + print ''."\n"; } } @@ -1413,13 +1413,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { $pathckeditor=constant('JS_CKEDITOR'); } - print ''."\n"; - print ''."\n"; + print ''."\n"; } // Browser notifications @@ -1431,13 +1431,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if ($enablebrowsernotif) { print ''."\n"; - print ''."\n"; + print ''."\n"; } } // Global js function print ''."\n"; - print ''."\n"; + print ''."\n"; // JS forced by modules (relative url starting with /) if (! empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) @@ -1449,7 +1449,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs foreach($filesjs as $jsfile) { // jsfile is a relative path - print ''."\n".''."\n"; + print ''."\n".''."\n"; } } } @@ -1461,11 +1461,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs { if (preg_match('/^http/i',$jsfile)) { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } } } @@ -1501,7 +1501,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs * For other external page: http://server/url * @return void */ -function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $helppagename='') +function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $helppagename = '') { global $user, $conf, $langs, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -1706,7 +1706,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a * @param string $acceptdelayedhtml 1 if caller request to have html delayed content not returned but saved into global $delayedhtmlcontent (so caller can show it at end of page to avoid flash FOUC effect) * @return void */ -function left_menu($menu_array_before, $helppagename='', $notused='', $menu_array_after='', $leftmenuwithoutmainarea=0, $title='', $acceptdelayedhtml=0) +function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_array_after = '', $leftmenuwithoutmainarea = 0, $title = '', $acceptdelayedhtml = 0) { global $user, $conf, $langs, $db, $form; global $hookmanager, $menumanager; @@ -1764,7 +1764,7 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra elseif ($conf->use_javascript_ajax && ! empty($conf->global->MAIN_USE_OLD_SEARCH_FORM)) { $searchform='
'; - $searchform.=''."\n"; + print ''."\n"; } // Wrapper to add log when clicking on download or preview @@ -2092,7 +2092,7 @@ if (! function_exists("llxFooter")) { print "\n\n"; ?> - @@ -62,8 +63,25 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); get_full_arbo('product'); + +$maincategories = array_filter($categories, function ($item) { + if (($item['level']==1) !== false) { + return true; + } + return false; +}); + +$subcategories = array_filter($categories, function ($item) { + if (($item['level']!=1) !== false) { + return true; + } + return false; +}); ?> -var categories = JSON.parse( '' ); + +var categories = ; +var subcategories = ; + var currentcat; var pageproducts=0; var pagecategories=0; @@ -108,15 +126,27 @@ function MoreCategories(moreorless){ } } -function LoadProducts(position){ +function LoadProducts(position, issubcat=false){ $('#catimg'+position).animate({opacity: '0.5'}, 1); $('#catimg'+position).animate({opacity: '1'}, 100); - currentcat=$('#catdiv'+position).data('rowid'); + if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid'); + else currentcat=$('#catdiv'+position).data('rowid'); if (currentcat=="") return; pageproducts=0; + ishow=0; //product to show counter + + jQuery.each(subcategories, function(i, val) { + if (currentcat==val.fk_parent){ + $("#prodesc"+ishow).text(val.label); + $("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid); + $("#prodiv"+ishow).data("rowid",val.rowid); + $("#prodiv"+ishow).data("iscat",1); + ishow++; + } + }); + + idata=0; //product data counter $.getJSON('./ajax.php?action=getProducts&category='+currentcat, function(data) { - idata=0; //product data counter - ishow=0; //product to show counter while (idata < 30) { if (typeof (data[idata]) == "undefined") { $("#prodesc"+ishow).text(""); @@ -129,6 +159,7 @@ function LoadProducts(position){ $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); + $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } idata++; //Next data everytime @@ -167,6 +198,7 @@ function MoreProducts(moreorless){ $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); + $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } idata++; //Next data everytime @@ -177,12 +209,16 @@ function MoreProducts(moreorless){ function ClickProduct(position){ $('#proimg'+position).animate({opacity: '0.5'}, 1); $('#proimg'+position).animate({opacity: '1'}, 100); - idproduct=$('#prodiv'+position).data('rowid'); - if (idproduct=="") return; - $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() { - $('#poslines').scrollTop($('#poslines')[0].scrollHeight); - }); - + if ($('#prodiv'+position).data('iscat')==1){ + LoadProducts(position, true); + } + else{ + idproduct=$('#prodiv'+position).data('rowid'); + if (idproduct=="") return; + $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() { + $('#poslines').scrollTop($('#poslines')[0].scrollHeight); + }); + } } function deleteline(){ @@ -232,6 +268,7 @@ function Search2(){ $("#prodesc"+i).text(data[parseInt(i)]['label']); $("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']); $("#prodiv"+i).data("rowid",data[i]['rowid']); + $("#prodiv"+ishow).data("iscat",0); } }); } @@ -352,27 +389,30 @@ $( document ).ready(function() { -
-
+
+
-
- - - - - - - - - - - - - - - - -
+
+
+ +
+ + + + + + + + + + + + + + + + +
global->TAKEPOSCONNECTOR){ $menus[$r++]=array('title'=>$langs->trans("DOL_OPEN_DRAWER"), 'action'=>'OpenDrawer();'); } + +$hookmanager->initHooks(array('takeposfrontend')); +$reshook=$hookmanager->executeHooks('ActionButtons'); +if (!empty($reshook)) + { + $menus[$r++]=$reshook; + } + ?> -
+
'.$langs->trans("Next").''; echo ''; } - else if ($i>9) echo ''; + elseif ($i>9) echo ''; else echo ''; } ?> -
- -
+
+
+
+
-
id='catdiv'> - width="98%" id='catimg'/> -
-
-
-
+
id='catdiv'> + width="98%" id='catimg'/> +
+
+
+
-
+
-
+
-
onclick="MoreProducts('less');" onclick="MoreProducts('more');" > - width="95%" id='proimg'/> -
-
-
-
+
onclick="MoreProducts('less');" onclick="MoreProducts('more');" > + width="95%" id='proimg'/> +
+
+
+
+
+
- into the textarea, and go into "source", then ckeditor change the & into &. We don't want this. But this option does not fix this. + //config.entities = false; // When you put a into the textarea, and go into "source", then ckeditor change the & into &. We don't want this. But this option does not fix this. config.resize_enabled = false; //config.resize_maxHeight = 3000; //config.resize_maxWidth = 3000; diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php index 920fa7833af..49091d810b1 100644 --- a/htdocs/theme/eldy/graph-color.php +++ b/htdocs/theme/eldy/graph-color.php @@ -31,4 +31,3 @@ $theme_bordercolor = array(235,235,224); $theme_datacolor = array(array(136,102,136), array(0,130,110), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150)); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); - diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b120e2c04d2..4e65b1bc5ed 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1562,7 +1562,7 @@ div#tmenu_tooltip { } -div.tmenusep { +div.topmenuimage { display: none; @@ -3935,6 +3935,7 @@ tr.visible { display: inline-block; padding-left: 10px; vertical-align: middle; + line-height: 28px; } .websitetools { float: right; diff --git a/htdocs/theme/md/graph-color.php b/htdocs/theme/md/graph-color.php index 72cc839043b..78a621ada1d 100644 --- a/htdocs/theme/md/graph-color.php +++ b/htdocs/theme/md/graph-color.php @@ -31,4 +31,3 @@ $theme_bordercolor = array(235,235,224); $theme_datacolor = array(array(136,102,136), array(0,130,110), array(140,140,220), array(190,120,120), array(190,190,100), array(115,125,150), array(100,170,20), array(250,190,30), array(150,135,125), array(85,135,150), array(150,135,80), array(150,80,150)); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); - diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e20ffbe43e2..d3e2368217e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4,7 +4,7 @@ * Copyright (C) 2007-2017 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 68f01707d58..fd81b3cbadb 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -444,7 +444,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd // Progression print ''; print ''; if ($action != 'progression' && $object->fk_statut < 8 && !$user->societe_id) { print ''; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index e67cd7a313c..b4a106d48e5 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -109,7 +109,7 @@ class ActionsTicket * @param Ticket $object Object Ticket * @return int 0 */ - public function doActions(&$action = '', Ticket $object=null) + public function doActions(&$action = '', Ticket $object = null) { global $conf, $user, $langs, $mysoc; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index dd3307a391c..28ba0ce4938 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -901,11 +901,6 @@ class Ticket extends CommonObject if ($res < 0) $error++; } - if (!$error) { - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticket_logs"; - $sql .= " WHERE fk_track_id = '" . $this->db->escape($this->track_id) . "'"; - $resql = $this->db->query($sql); - } if (!$error) { $sql = "DELETE FROM " . MAIN_DB_PREFIX . "ticket_msg"; $sql .= " WHERE fk_track_id = '" . $this->db->escape($this->track_id) . "'"; @@ -1334,7 +1329,7 @@ class Ticket 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; @@ -1671,7 +1666,7 @@ class Ticket extends CommonObject dol_syslog(get_class($this) . "::loadCacheLogsTicket " . $this->error, LOG_ERR); return -1; }*/ - + return 0; } diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index f89dd82cbca..b8d5cbad454 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -327,7 +327,7 @@ if ($result) { print "\n"; // Creation date - print '"; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 64ec859cc0c..d0d60df5e1f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -672,8 +672,8 @@ if (isset($totalarray['pos'])) { if ($i == 1) { - if ($num < $limit) print ''; - else print ''; + if ($num < $limit) print ''; + else print ''; } else print ''; } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 2eb2ede000b..e504f5ed8e2 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -57,10 +57,7 @@ $object->getrights(); $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id) // A user can always read its own card -{ - $feature2=''; -} + $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // If user is not user that read and no permission to read other users, we stop diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index c76cab34f3b..527a7af5cb7 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Peter Fontaine * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8db719c62d4..f0b3aa361cc 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -8,7 +8,7 @@ * Copyright (C) 2011 Herve Prot * Copyright (C) 2012-2018 Juanjo Menent * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013-2016 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2015-2017 Jean-François Ferry * Copyright (C) 2015 Ari Elbaz (elarifr) * Copyright (C) 2015-2018 Charlene Benke @@ -85,11 +85,8 @@ if ($id) $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2='user'; -if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card -if (! $canreaduser) { - $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -} +$result = restrictedArea($user, 'user', $id, 'user&user', $feature2); if ($user->id <> $id && ! $canreaduser) accessforbidden(); @@ -393,7 +390,7 @@ if (empty($reshook)) { { $object->entity = 0; } - else if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + elseif (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $object->entity = 1; // all users in master entity } @@ -1407,11 +1404,11 @@ else { $valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').$langs->trans("LdapUacf_".$statutUACF); } - else if($userChangePassNextLogon) + elseif($userChangePassNextLogon) { $valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).''; } - else if($userDisabled) + elseif($userDisabled) { $valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).''; } @@ -1463,7 +1460,7 @@ else { print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); } - else if ($object->admin) + elseif ($object->admin) { print $form->textwithpicto(yn($object->admin),$langs->trans("AdministratorDesc"),1,"admin"); } @@ -1777,7 +1774,7 @@ else { print ''; } - else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { if ($object->email) print ''; diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 3b7d7ee5b00..0458d2c98be 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -17,7 +17,8 @@ use Luracast\Restler\RestException; -//require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; /** * API class for users @@ -217,11 +218,22 @@ class Users extends DolibarrApi foreach ($request_data as $field => $value) { - if ($field == 'id') continue; - $this->useraccount->$field = $value; + if ($field == 'id') continue; + // The status must be updated using setstatus() because it + // is not handled by the update() method. + if ($field == 'statut') { + $result = $this->useraccount->setstatus($value); + if ($result < 0) { + throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error); + } + } else { + $this->useraccount->$field = $value; + } } - if ($this->useraccount->update(DolibarrApiAccess::$user) > 0) + // If there is no error, update() returns the number of affected + // rows so if the update is a no op, the return value is zezo. + if ($this->useraccount->update(DolibarrApiAccess::$user) >= 0) { return $this->get($id); } @@ -231,6 +243,41 @@ class Users extends DolibarrApi } } + + /** + * List the groups of a user + * + * @param int $id Id of user + * @return array Array of group objects + * + * @throws RestException + * + * @url GET {id}/groups + */ + function getGroups($id) + { + $obj_ret = array(); + + if (! DolibarrApiAccess::$user->rights->user->user->lire) { + throw new RestException(401); + } + + $user = new User($this->db); + $result = $user->fetch($id); + if( ! $result ) { + throw new RestException(404, 'user not found'); + } + + $usergroup = new UserGroup($this->db); + $groups = $usergroup->listGroupsForUser($id, false); + $obj_ret = array(); + foreach ($groups as $group) { + $obj_ret[] = $this->_cleanObjectDatas($group); + } + return $obj_ret; + } + + /** * Add a user into a group * diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 2c189ad07d1..15139bd0291 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2013-2018 Philippe Grand - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke * Copyright (C) 2018 Nicolas ZABOURI @@ -219,7 +219,7 @@ class User extends CommonObject * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. * @return int <0 if KO, 0 not found, >0 if OK */ - function fetch($id='', $login='', $sid='', $loadpersonalconf=0, $entity=-1) + function fetch($id = '', $login = '', $sid = '', $loadpersonalconf = 0, $entity = -1) { global $conf, $user; @@ -279,7 +279,7 @@ class User extends CommonObject { $sql.= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1"; } - else if ($login) + elseif ($login) { $sql.= " AND u.login = '".$this->db->escape($login)."'"; } @@ -501,7 +501,7 @@ class User extends CommonObject * @return int > 0 if OK, < 0 if KO * @see clearrights, delrights, getrights */ - function addrights($rid, $allmodule='', $allperms='', $entity=0, $notrigger=0) + function addrights($rid, $allmodule = '', $allperms = '', $entity = 0, $notrigger = 0) { global $conf, $user, $langs; @@ -538,7 +538,7 @@ class User extends CommonObject $whereforadd="id=".$this->db->escape($rid); // Ajout des droits induits if (! empty($subperms)) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))"; - else if (! empty($perms)) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)"; + elseif (! empty($perms)) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)"; } else { // On a pas demande un droit en particulier mais une liste de droits @@ -627,7 +627,7 @@ class User extends CommonObject * @return int > 0 if OK, < 0 if OK * @see clearrights, addrights, getrights */ - function delrights($rid, $allmodule='', $allperms='', $entity=0, $notrigger=0) + function delrights($rid, $allmodule = '', $allperms = '', $entity = 0, $notrigger = 0) { global $conf, $user, $langs; @@ -762,7 +762,7 @@ class User extends CommonObject * @return void * @see clearrights, delrights, addrights */ - function getrights($moduletag='', $forcereload=0) + function getrights($moduletag = '', $forcereload = 0) { global $conf; @@ -1102,7 +1102,7 @@ class User extends CommonObject * @param int $notrigger 1=do not execute triggers, 0 otherwise * @return int <0 if KO, id of created user if OK */ - function create($user, $notrigger=0) + function create($user, $notrigger = 0) { global $conf,$langs; global $mysoc; @@ -1236,7 +1236,7 @@ class User extends CommonObject * @param string $password Password to force * @return int <0 if error, if OK returns id of created user */ - function create_from_contact($contact,$login='',$password='') + function create_from_contact($contact, $login = '', $password = '') { // phpcs:enable global $conf,$user,$langs; @@ -1316,7 +1316,7 @@ class User extends CommonObject * @param string $login Login to force * @return int <0 if KO, if OK, return id of created account */ - function create_from_member($member,$login='') + function create_from_member($member, $login = '') { // phpcs:enable global $conf,$user,$langs; @@ -1438,7 +1438,7 @@ class User extends CommonObject * @param int $nosynccontact 0=Synchronize linked contact, 1=Do not synchronize linked contact * @return int <0 si KO, >=0 si OK */ - function update($user, $notrigger=0, $nosyncmember=0, $nosyncmemberpass=0, $nosynccontact=0) + function update($user, $notrigger = 0, $nosyncmember = 0, $nosyncmemberpass = 0, $nosynccontact = 0) { global $conf, $langs; @@ -1777,7 +1777,7 @@ class User extends CommonObject * @param int $nosyncmember Do not synchronize linked member * @return string If OK return clear password, 0 if no change, < 0 if error */ - function setPassword($user, $password='', $changelater=0, $notrigger=0, $nosyncmember=0) + function setPassword($user, $password = '', $changelater = 0, $notrigger = 0, $nosyncmember = 0) { global $conf, $langs; require_once DOL_DOCUMENT_ROOT .'/core/lib/security2.lib.php'; @@ -1909,7 +1909,7 @@ class User extends CommonObject * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @TODO Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ - function send_password($user, $password='', $changelater=0) + function send_password($user, $password = '', $changelater = 0) { // phpcs:enable global $conf, $langs; @@ -2102,7 +2102,7 @@ class User extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function SetInGroup($group, $entity, $notrigger=0) + function SetInGroup($group, $entity, $notrigger = 0) { // phpcs:enable global $conf, $langs, $user; @@ -2164,7 +2164,7 @@ class User extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - function RemoveFromGroup($group, $entity, $notrigger=0) + function RemoveFromGroup($group, $entity, $notrigger = 0) { // phpcs:enable global $conf,$langs,$user; @@ -2224,7 +2224,7 @@ class User extends CommonObject * @param string $imagesize 'mini', 'small' or '' (original) * @return string String with URL link */ - function getPhotoUrl($width, $height, $cssclass='', $imagesize='') + function getPhotoUrl($width, $height, $cssclass = '', $imagesize = '') { $result =''; $result.=Form::showphoto('userphoto', $this, $width, $height, 0, $cssclass, $imagesize); @@ -2248,7 +2248,7 @@ class User 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($withpictoimg=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0, $mode='',$morecss='', $save_lastsearch_value=-1) + function getNomUrl($withpictoimg = 0, $option = '', $infologin = 0, $notooltip = 0, $maxlen = 24, $hidethirdpartylogo = 0, $mode = '', $morecss = '', $save_lastsearch_value = -1) { global $langs, $conf, $db, $hookmanager, $user; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -2385,7 +2385,7 @@ class User extends CommonObject * @param string $option Sur quoi pointe le lien * @return string Chaine avec URL */ - function getLoginUrl($withpicto=0,$option='') + function getLoginUrl($withpicto = 0, $option = '') { global $langs, $user; @@ -2422,7 +2422,7 @@ class User 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->statut,$mode); } @@ -2435,7 +2435,7 @@ class User 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; @@ -2484,7 +2484,7 @@ class User extends CommonObject * 2=Return key only (RDN) (uid=qqq) * @return string DN */ - function _load_ldap_dn($info,$mode=0) + function _load_ldap_dn($info, $mode = 0) { // phpcs:enable global $conf; @@ -2735,7 +2735,7 @@ class User extends CommonObject * @param int $admin Filter on admin tag * @return int Number of users */ - function getNbOfUsers($limitTo, $option='', $admin=-1) + function getNbOfUsers($limitTo, $option = '', $admin = -1) { global $conf; @@ -2891,7 +2891,7 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - function get_full_tree($deleteafterid=0, $filter='') + function get_full_tree($deleteafterid = 0, $filter = '') { // phpcs:enable global $conf, $user; @@ -2993,7 +2993,7 @@ class User extends CommonObject * @return array Array of user id lower than user (all levels under user). This overwrite this->users. * @see get_children */ - function getAllChildIds($addcurrentuser=0) + function getAllChildIds($addcurrentuser = 0) { $childids=array(); @@ -3031,7 +3031,7 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - function build_path_from_id_user($id_user,$protection=0) + function build_path_from_id_user($id_user, $protection = 0) { // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); @@ -3134,7 +3134,7 @@ class User 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, $user, $langs; @@ -3166,7 +3166,7 @@ class User extends CommonObject * @param string $mode 'email' or 'mobile' * @return string Email of user with format: "Full name " */ - function user_get_property($rowid,$mode) + function user_get_property($rowid, $mode) { // phpcs:enable $user_property=''; @@ -3187,7 +3187,7 @@ class User extends CommonObject $obj = $this->db->fetch_object($resql); if ($mode == 'email') $user_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">"; - else if ($mode == 'mobile') $user_property = $obj->user_mobile; + elseif ($mode == 'mobile') $user_property = $obj->user_mobile; } return $user_property; } @@ -3208,7 +3208,7 @@ class User extends CommonObject * @param string $filtermode Filter mode (AND or OR) * @return int <0 if KO, >0 if OK */ - function fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter=array(), $filtermode='AND') + function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array(), $filtermode = 'AND') { global $conf; diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 7870fe9c35e..8e9ad2745c3 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2010-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Peter Fontaine - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -62,7 +62,7 @@ class UserBankAccount extends Account * @param int $notrigger 1=Disable triggers * @return int <0 if KO, >= 0 if OK */ - function create(User $user=null, $notrigger=0) + function create(User $user = null, $notrigger = 0) { $now=dol_now(); @@ -92,7 +92,7 @@ class UserBankAccount extends Account * @param int $notrigger 1=Disable triggers * @return int <=0 if KO, >0 if OK */ - function update(User $user=null, $notrigger=0) + function update(User $user = null, $notrigger = 0) { global $conf; @@ -139,7 +139,7 @@ class UserBankAccount extends Account * @param int $userid User id * @return int <0 if KO, >0 if OK */ - function fetch($id, $ref='', $userid=0) + function fetch($id, $ref = '', $userid = 0) { if (empty($id) && empty($ref) && empty($userid)) return -1; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index f70f61e2ed6..a6e443a26dc 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -107,7 +107,7 @@ class UserGroup extends CommonObject * @param boolean $load_members Load all members of the group * @return int <0 if KO, >0 if OK */ - function fetch($id='', $groupname='', $load_members = true) + function fetch($id = '', $groupname = '', $load_members = true) { global $conf; @@ -224,7 +224,7 @@ class UserGroup extends CommonObject * @param int $mode 0=Return array of user instance, 1=Return array of users id only * @return mixed Array of users or -1 on error */ - function listUsersForGroup($excludefilter='', $mode=0) + function listUsersForGroup($excludefilter = '', $mode = 0) { global $conf, $user; @@ -289,7 +289,7 @@ class UserGroup extends CommonObject * @param int $entity Entity to use * @return int > 0 if OK, < 0 if KO */ - function addrights($rid, $allmodule='', $allperms='', $entity=0) + function addrights($rid, $allmodule = '', $allperms = '', $entity = 0) { global $conf, $user, $langs; @@ -326,7 +326,7 @@ class UserGroup extends CommonObject $whereforadd="id=".$this->db->escape($rid); // Ajout des droits induits if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))"; - else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)"; + elseif ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)"; // Pour compatibilite, si lowid = 0, on est en mode ajout de tout // TODO A virer quand sera gere par l'appelant @@ -415,7 +415,7 @@ class UserGroup extends CommonObject * @param int $entity Entity to use * @return int > 0 if OK, < 0 if OK */ - function delrights($rid, $allmodule='', $allperms='', $entity=0) + function delrights($rid, $allmodule = '', $allperms = '', $entity = 0) { global $conf, $user, $langs; @@ -537,7 +537,7 @@ class UserGroup extends CommonObject * @param string $moduletag Name of module we want permissions ('' means all) * @return int <0 if KO, >0 if OK */ - function getrights($moduletag='') + function getrights($moduletag = '') { global $conf; @@ -676,7 +676,7 @@ class UserGroup extends CommonObject * @param int $notrigger 0=triggers enabled, 1=triggers disabled * @return int <0 if KO, >=0 if OK */ - function create($notrigger=0) + function create($notrigger = 0) { global $user, $conf, $langs, $hookmanager; @@ -747,7 +747,7 @@ class UserGroup extends CommonObject * @param int $notrigger 0=triggers enabled, 1=triggers disabled * @return int <0 if KO, >=0 if OK */ - function update($notrigger=0) + function update($notrigger = 0) { global $user, $conf, $langs, $hookmanager; @@ -817,7 +817,7 @@ class UserGroup 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(0,$mode); } @@ -830,7 +830,7 @@ class UserGroup 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; @@ -849,7 +849,7 @@ class UserGroup 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 $langs, $conf, $db, $hookmanager; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -925,7 +925,7 @@ class UserGroup 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; @@ -1011,7 +1011,7 @@ class UserGroup 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,$user,$langs; diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index a6618f3a7c0..21342704524 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -35,10 +35,7 @@ $id=GETPOST('id','int'); $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id) // A user can always read its own card -{ - $feature2=''; -} + $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 6f7e27b13dd..13975dff97c 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -66,10 +66,9 @@ if ($id) $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2='user'; -if ($user->id == $id) { $feature2=''; $canreaduser=1; } // A user can always read its own card -if (!$canreaduser) { - $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -} + +$result = restrictedArea($user, 'user', $id, 'user&user', $feature2); + if ($user->id <> $id && ! $canreaduser) accessforbidden(); // Get parameters diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 61c817a4c72..b940e6befe6 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -473,7 +473,7 @@ else print ''; print ''; print ''; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 65723b4d65d..f0673966f44 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 da31b6027ed..efb1ba33b78 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -156,12 +156,12 @@ if ($resql) { print img_picto($langs->trans("SuperAdministrator"),'redstar'); } - else if ($obj->admin) + elseif ($obj->admin) { print img_picto($langs->trans("Administrator"),'star'); } 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) { @@ -362,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/variants/ajax/orderAttribute.php b/htdocs/variants/ajax/orderAttribute.php index 92bbcc241d5..518b41fb388 100644 --- a/htdocs/variants/ajax/orderAttribute.php +++ b/htdocs/variants/ajax/orderAttribute.php @@ -50,4 +50,3 @@ if (isset($_POST['roworder'])) { ProductAttribute::bulkUpdateOrder($db, $newrowordertab); } - diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index ea29fe0d8bd..2385a558307 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -84,7 +84,7 @@ require 'main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $action=GETPOST('action','alpha'); -$original_file=GETPOST('file','alpha'); // Do not use urldecode here ($_GET are already decoded by PHP). +$original_file=GETPOST('file','alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). $hashp=GETPOST('hashp','aZ09'); $modulepart=GETPOST('modulepart','alpha'); $urlsource=GETPOST('urlsource','alpha'); diff --git a/htdocs/webservices/index.php b/htdocs/webservices/index.php index e0a1ba998c8..2f469fa95fd 100644 --- a/htdocs/webservices/index.php +++ b/htdocs/webservices/index.php @@ -54,4 +54,3 @@ print 'List of available SOAP Web services is visible on the setup area, setup p $db->close(); - diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index a9edcb0557a..763dd500366 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 a941c2aceff..491122f748c 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 edb429af0d3..8143b4cd178 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 4e8d3ec41d8..8287d3bff48 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 c74b5660873..0d38d601b99 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 895e5d55af4..6037b5285e0 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 1e301350063..b4ad2460700 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 822081011aa..a064eff1ebc 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 50e5498dbe1..c5005dab24d 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 7f0b590ee9a..1587a403940 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 81702c55456..5bc8350d563 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 0e6ee83aa9d..e0cd985ced1 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 ffa2176f142..778998f8ac2 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 ecb80bf6c22..db253adafbf 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; -$langs->loadLangs(array("admin","other","website")); +$langs->loadLangs(array("admin","other","website","errors")); if (! $user->rights->website->read) accessforbidden(); @@ -280,6 +280,12 @@ if ($action == 'addsite') { $db->begin(); + if (GETPOST('virtualhost','alpha') && ! preg_match('/^http/',GETPOST('virtualhost','alpha'))) + { + $error++; + setEventMessages($langs->trans('ErrorURLMustStartWithHttp', $langs->transnoentitiesnoconv("VirtualHost")), null, 'errors'); + } + if (! $error && ! GETPOST('WEBSITE_REF','alpha')) { $error++; @@ -298,7 +304,7 @@ if ($action == 'addsite') $tmpobject=new Website($db); $tmpobject->ref = GETPOST('WEBSITE_REF','alpha'); $tmpobject->description = GETPOST('WEBSITE_DESCRIPTION','alpha'); - $tmpobject->virtualhost = GETPOST('WEBSITE_VIRTUALHOST','alpha'); + $tmpobject->virtualhost = GETPOST('virtualhost','alpha'); $result = $tmpobject->create($user); if ($result <= 0) @@ -353,6 +359,7 @@ if ($action == 'addcontainer') if (! preg_match('/^http/', $urltograb)) { $error++; + $langs->load("errors"); setEventMessages('Error URL must start with http:// or https://', null, 'errors'); $action = 'createcontainer'; } @@ -670,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'); @@ -867,180 +874,207 @@ if ($action == 'updatecss') $res = $object->fetch(0, $websitekey); $website = $object; - // Save master.inc.php file - $filemaster=$pathofwebsite.'/master.inc.php'; - - dol_syslog("Save master file ".$filemaster); - - dol_mkdir($pathofwebsite); - - // Now generate the master.inc.php page - $result = dolSaveMasterFile($filemaster); - if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors'); - - - // Html header file - $htmlheadercontent =''; - - /* We disable php code since htmlheader is never executed as an include but only read by fgets_content. - $htmlheadercontent.= "\n";*/ - - $htmlheadercontent.= preg_replace(array('/\n*/ims','/<\/html>\n*/ims'),array('',''),GETPOST('WEBSITE_HTML_HEADER', 'none')); - - /*$htmlheadercontent.= "\n".'"."\n";*/ - - $htmlheadercontent = trim($htmlheadercontent)."\n"; - - dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent); - - - // Css file - $csscontent =''; - - $csscontent.= "\n"; - - $csscontent.= GETPOST('WEBSITE_CSS_INLINE', 'none'); - - $csscontent.= "\n".'"."\n"; - - dol_syslog("Save css content into ".$filecss); - - dol_mkdir($pathofwebsite); - $result = file_put_contents($filecss, $csscontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filecss, octdec($conf->global->MAIN_UMASK)); - - if (! $result) + if (GETPOSTISSET('virtualhost')) { - $error++; - setEventMessages('Failed to write file '.$filecss, null, 'errors'); + if (GETPOST('virtualhost','alpha') && ! preg_match('/^http/',GETPOST('virtualhost','alpha'))) + { + $error++; + setEventMessages($langs->trans('ErrorURLMustStartWithHttp', $langs->transnoentitiesnoconv("VirtualHost")), null, 'errors'); + $action='editcss'; + } + + if (! $error) + { + $object->virtualhost = GETPOST('virtualhost','alpha'); + + $result = $object->update($user); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + $action='editcss'; + } + } } - - // Js file - $jscontent =''; - - $jscontent.= "\n"; - - $jscontent.= GETPOST('WEBSITE_JS_INLINE', 'none'); - - $jscontent.= "\n".'"."\n"; - - dol_syslog("Save js content into ".$filejs); - - dol_mkdir($pathofwebsite); - $result = file_put_contents($filejs, $jscontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filejs, octdec($conf->global->MAIN_UMASK)); - - if (! $result) - { - $error++; - setEventMessages('Failed to write file '.$filejs, null, 'errors'); - } - - - // Robot file - $robotcontent =''; - - /*$robotcontent.= "\n";*/ - - $robotcontent.= GETPOST('WEBSITE_ROBOT', 'none'); - - /*$robotcontent.= "\n".'"."\n";*/ - - dol_syslog("Save file robot into ".$filerobot); - - dol_mkdir($pathofwebsite); - $result = file_put_contents($filerobot, $robotcontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filerobot, octdec($conf->global->MAIN_UMASK)); - - if (! $result) - { - $error++; - setEventMessages('Failed to write file '.$filerobot, null, 'errors'); - } - - - // Css file - $htaccesscontent =''; - - /*$htaccesscontent.= "\n";*/ - - $htaccesscontent.= GETPOST('WEBSITE_HTACCESS', 'none'); - - /*$htaccesscontent.= "\n".'"."\n";*/ - - dol_syslog("Save file htaccess into ".$filehtaccess); - - dol_mkdir($pathofwebsite); - $result = file_put_contents($filehtaccess, $htaccesscontent); - if (! empty($conf->global->MAIN_UMASK)) - @chmod($filehtaccess, octdec($conf->global->MAIN_UMASK)); - - if (! $result) - { - $error++; - setEventMessages('Failed to write file '.$filehtaccess, null, 'errors'); - } - - // Message if no error if (! $error) { - setEventMessages($langs->trans("Saved"), null, 'mesgs'); - } + // Save master.inc.php file + $filemaster=$pathofwebsite.'/master.inc.php'; - $action='preview'; + dol_syslog("Save master file ".$filemaster); + + dol_mkdir($pathofwebsite); + + // Now generate the master.inc.php page + $result = dolSaveMasterFile($filemaster); + if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors'); + + + // Html header file + $htmlheadercontent =''; + + /* We disable php code since htmlheader is never executed as an include but only read by fgets_content. + $htmlheadercontent.= "\n";*/ + + $htmlheadercontent.= preg_replace(array('/\n*/ims','/<\/html>\n*/ims'),array('',''),GETPOST('WEBSITE_HTML_HEADER', 'none')); + + /*$htmlheadercontent.= "\n".'"."\n";*/ + + $htmlheadercontent = trim($htmlheadercontent)."\n"; + + dolSaveHtmlHeader($filehtmlheader, $htmlheadercontent); + + + // Css file + $csscontent =''; + + $csscontent.= "\n"; + + $csscontent.= GETPOST('WEBSITE_CSS_INLINE', 'none'); + + $csscontent.= "\n".'"."\n"; + + dol_syslog("Save css content into ".$filecss); + + dol_mkdir($pathofwebsite); + $result = file_put_contents($filecss, $csscontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filecss, octdec($conf->global->MAIN_UMASK)); + + if (! $result) + { + $error++; + setEventMessages('Failed to write file '.$filecss, null, 'errors'); + } + + + // Js file + $jscontent =''; + + $jscontent.= "\n"; + + $jscontent.= GETPOST('WEBSITE_JS_INLINE', 'none'); + + $jscontent.= "\n".'"."\n"; + + dol_syslog("Save js content into ".$filejs); + + dol_mkdir($pathofwebsite); + $result = file_put_contents($filejs, $jscontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filejs, octdec($conf->global->MAIN_UMASK)); + + if (! $result) + { + $error++; + setEventMessages('Failed to write file '.$filejs, null, 'errors'); + } + + + // Robot file + $robotcontent =''; + + /*$robotcontent.= "\n";*/ + + $robotcontent.= GETPOST('WEBSITE_ROBOT', 'none'); + + /*$robotcontent.= "\n".'"."\n";*/ + + dol_syslog("Save file robot into ".$filerobot); + + dol_mkdir($pathofwebsite); + $result = file_put_contents($filerobot, $robotcontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filerobot, octdec($conf->global->MAIN_UMASK)); + + if (! $result) + { + $error++; + setEventMessages('Failed to write file '.$filerobot, null, 'errors'); + } + + + // Css file + $htaccesscontent =''; + + /*$htaccesscontent.= "\n";*/ + + $htaccesscontent.= GETPOST('WEBSITE_HTACCESS', 'none'); + + /*$htaccesscontent.= "\n".'"."\n";*/ + + dol_syslog("Save file htaccess into ".$filehtaccess); + + dol_mkdir($pathofwebsite); + $result = file_put_contents($filehtaccess, $htaccesscontent); + if (! empty($conf->global->MAIN_UMASK)) + @chmod($filehtaccess, octdec($conf->global->MAIN_UMASK)); + + if (! $result) + { + $error++; + setEventMessages('Failed to write file '.$filehtaccess, null, 'errors'); + } + + + // Message if no error + if (! $error) + { + setEventMessages($langs->trans("Saved"), null, 'mesgs'); + } + + $action='preview'; + } } } @@ -1784,53 +1818,46 @@ if (! GETPOST('hide_websitemenu')) // Toolbar for websites - print '
'; + print '
'; if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone') { $urlext=$virtualurl; $urlint=$urlwithroot.'/public/website/index.php?website='.$websitekey; - $htmltext = $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot); - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); - print '
'; - print $form->textwithpicto('', $htmltext, 1, 'preview'); - print ''; - - print '
'; - print ''; - //print ''; - $htmltext =$langs->trans("SetHereVirtualHost", $dataroot); - $htmltext.='
'; - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); - $htmltext.='
'; - $htmltext.='
'; - $htmltext.=$langs->trans("YouCanAlsoTestWithPHPS", $dataroot); - print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helpvirtualhost'); - print '
'; - + print '
'; + $linktotestonwebserver = ''; + $linktotestonwebserver.= $langs->trans("TestDeployOnWeb", $virtualurl).' '.img_picto('','object_globe'); + $linktotestonwebserver.= ''; + $htmltext = ''; if (empty($object->fk_default_home)) { - $htmltext = ''.$langs->trans("YouMustDefineTheHomePage").'
'.$langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''); - $htmltext.='
'; - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT); - print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', $htmltext, 1, 'preview_ext'); - print ''; + $htmltext.= '
'.$langs->trans("YouMustDefineTheHomePage").'

'; + } + elseif (empty($virtualurl)) + { + $htmltext.= '
'.$langs->trans("VirtualHostUrlNotDefined").'

'; } else { - $htmltext = $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:''.$langs->trans("VirtualHostUrlNotDefined").''); - $htmltext.='
'; - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); - $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); - print 'transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; - print $form->textwithpicto('', $htmltext, 1, 'preview_ext'); - print ''; + $htmltext.= '
'.$langs->trans("GoTo").' '.$virtualurl.'

'; } + if (! empty($conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER)) + { + $htmltext.= '
'.$conf->global->WEBSITE_REPLACE_INFO_ABOUT_USAGE_WITH_WEBSERVER; + } + else + { + $htmltext.=$langs->trans("SetHereVirtualHost", $dataroot); + $htmltext.='
'; + $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); + $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); + $htmltext.='
'; + $htmltext.='
'; + $htmltext.=$langs->trans("YouCanAlsoTestWithPHPS", $dataroot); + } + print $form->textwithpicto($linktotestonwebserver, $htmltext, 1, 'none', 'valignmiddle', 0, 2, 'helpvirtualhost'); + print '
'; } if (in_array($action, array('editcss','editmenu','file_manager'))) @@ -2129,7 +2156,7 @@ if (! GETPOST('hide_websitemenu')) newurl=jQuery("#previewsiteurl").val(); if (! newurl.startsWith("http")) { - alert(\''.dol_escape_js($langs->trans("ExternalURLMustStartWithHttp")).'\'); + alert(\''.dol_escape_js($langs->trans("ErrorURLMustStartWithHttp")).'\'); return false; } @@ -2321,6 +2348,19 @@ if ($action == 'editcss') print '
'; + // VirtualHost + print ''; + print '
'; - print $langs->trans('Progression') . ''; + print $langs->trans('Progression') . ''; print '' . img_edit($langs->trans('Modify')) . ''; + print ''; print dol_print_date($db->jdate($objp->datec), 'dayhour'); print "'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.$langs->trans("Total").''.$langs->trans("Totalforthispage").''; 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'); + elseif ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star'); print ''.$useringroup->lastname.''.$useringroup->firstname.''.$obj->login.''.$obj->login.'"; if ($obj->fk_soc) { diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 5e1bfaddc4c..5936c36e2d2 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -43,10 +43,7 @@ if ($id > 0 || ! empty($ref)) $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id) // A user can always read its own card -{ - $feature2=''; -} + $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // If user is not user that read and no permission to read other users, we stop diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 45b575b9843..d120e7334b4 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -37,7 +37,7 @@ $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'userldap'; $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id) $feature2=''; // A user can always read its own card + $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); $object = new User($db); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index dcede3a5576..4a449771a64 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002-2005 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2016 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -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/note.php b/htdocs/user/note.php index c4f657a29bc..3d2880b99a5 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -45,7 +45,7 @@ if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessfor $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id) $feature2=''; // A user can always read its own card + $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 0e53db2c954..48e6674a031 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -49,11 +49,7 @@ if ($id) $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id) // A user can always read its own card -{ - $feature2=''; - $canreaduser=1; -} + $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); if ($user->id <> $id && ! $canreaduser) accessforbidden(); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 17666183319..495cd3d913d 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -58,10 +58,9 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $socid=0; if (isset($user->societe_id) && $user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); -if ($user->id == $id && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->user->self_advance->readperms)) // A user can always read its own card if not advanced perms enabled, or if he has advanced perms +if ($user->id == $id && (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->user->self_advance->readperms))) // A user can always read its own card if not advanced perms enabled, or if he has advanced perms { - $feature2=''; - $canreaduser=1; + accessforbidden(); } $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); @@ -351,7 +350,7 @@ if ($result) print img_picto($langs->trans("Active"),'tick'); print '
'; + + $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/'.$websitekey.''); + $htmltext.='
'; + $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); + $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); + + print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip'); + print '
'; + print ''; + print '
'; dol_fiche_end(); @@ -2356,7 +2396,6 @@ if ($action == 'createsite') if (GETPOST('WEBSITE_REF')) $siteref=GETPOST('WEBSITE_REF','alpha'); if (GETPOST('WEBSITE_DESCRIPTION')) $sitedesc=GETPOST('WEBSITE_DESCRIPTION','alpha'); - if (GETPOST('WEBSITE_VIRTUALHOST')) $sitevhost=GETPOST('WEBSITE_VIRTUALHOST','alpha'); print ''; print $langs->trans('Ref'); @@ -2371,14 +2410,15 @@ if ($action == 'createsite') print ''; print ''; + $htmltext = $langs->trans("SetHereVirtualHost", DOL_DATA_ROOT.'/website/websiteref'); $htmltext.='
'; $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); $htmltext.='
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); - print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'tooltipvirtual'); + print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip'); print ''; - print ''; + print ''; print ''; diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index c135e33016c..90a072ebeba 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -1,7 +1,7 @@ #!/usr/bin/env php - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2014 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2018 Frédéric France * @@ -188,16 +188,16 @@ if ($resql) { print ''; print ''; print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; while ($obj = $db->fetch_object($resql)) { @@ -210,15 +210,15 @@ if ($resql) { $thirdpartystatic->status = $obj->status; print $thirdpartystatic->getNomUrl(1); print ''; - print '' . "\n"; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print '' . "\n"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "\n"; $i ++; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 43a0b2524e6..12a2fbd6c85 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; @@ -314,4 +314,3 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget,$durati return -1; } } - diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index a23652a779f..bfde9ab51c6 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; @@ -280,4 +280,3 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta return -1; } } - diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 873fc0ae9fb..228f130dbb3 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 57fdeeed76f..aa9214b9ec6 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; @@ -305,4 +305,3 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) return -1; } } - diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 37b421bcefd..70d216750c5 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; @@ -277,4 +277,3 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta return -1; } } - diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index d7d4fbdeaaf..a82caf4cbe7 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -340,4 +340,3 @@ function dolValidElement($element) { return (trim($element) != ''); } - diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index cb85e38bd89..b9ded8436b7 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -216,4 +216,3 @@ function dolValidElementType($element) { return (trim($element) != ''); } - diff --git a/scripts/modulebuilder/initmodule.php b/scripts/modulebuilder/initmodule.php index bee931dc8fa..09daa1024d5 100755 --- a/scripts/modulebuilder/initmodule.php +++ b/scripts/modulebuilder/initmodule.php @@ -172,4 +172,3 @@ if (! $error) print 'Module initialized'."\n"; exit(0); - diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 4063d2f9321..be65fbb2943 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 } @@ -263,4 +263,3 @@ function dolValidElement($element) { return (trim($element) != ''); } - diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 320a1f495ad..30663f53518 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 } @@ -319,4 +319,3 @@ function dolValidElement($element) { return (trim($element) != ''); } - diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index 07d728eb0ec..432c3556ff0 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 cb23c7d092e..abf1f286a90 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 9b8e5217183..58e08affb69 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("ThirdParties") . '' . $langs->trans("AccountNumber") . '' . $langs->trans("RaisonSociale") . '' . $langs->trans("Address") . '' . $langs->trans("Zip") . '' . $langs->trans("Town") . '' . $langs->trans("Country") . '' . $langs->trans("Contact") . '' . $langs->trans("Phone") . '' . $langs->trans("Fax") . '
' . $langs->trans("ThirdParties") . '' . $langs->trans("AccountNumber") . '' . $langs->trans("RaisonSociale") . '' . $langs->trans("Address") . '' . $langs->trans("Zip") . '' . $langs->trans("Town") . '' . $langs->trans("Country") . '' . $langs->trans("Contact") . '' . $langs->trans("Phone") . '' . $langs->trans("Fax") . '
' . $obj->compta . '' . $obj->address . '' . $obj->zip . '' . $obj->town . '' . $obj->country . '' . $obj->phone . '' . $obj->fax . '' . $obj->compta . '' . $obj->address . '' . $obj->zip . '' . $obj->town . '' . $obj->country . '' . $obj->phone . '' . $obj->fax . '