diff --git a/ChangeLog b/ChangeLog index 96027e862ac..294a0c78aec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -145,6 +145,7 @@ NEW: #4301 For Developers or integrators: NEW: Add a manifest.json.php file for web app. +NEW: Support of deployement of metapackages NEW: Removed deprecated code that create linked object from ->origin NEW: experimental zapier for dolibarr NEW: Accountancy - Add hook bookkeepinglist on general ledger diff --git a/README-FR.md b/README-FR.md index 4feb27893e0..3d5473b14cc 100644 --- a/README-FR.md +++ b/README-FR.md @@ -1,18 +1,14 @@ # DOLIBARR ERP & CRM -Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans). +Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans). Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...). - + ![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_640x480.png) - - ## LICENCE Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure. - - ## INSTALLER DOLIBARR ### Configuration simple @@ -23,7 +19,7 @@ Si vous avez peu de compétences techniques et que vous souhaitez installer Doli - DoliDeb pour Debian ou Ubuntu - DoliRpm pour Redhat, Fedora, OpenSuse, Mandriva ou Mageia -Les packages peuvent être téléchargés à partir de [site web officiel] (https://www.dolibarr.org/). +Les packages peuvent être téléchargés à partir de [site web officiel](https://www.dolibarr.org/). ### Configuration avancée @@ -31,50 +27,47 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg - 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, ...) +  `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 à: + 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/` -        http://localhost/dolibarr/htdocs/install/ -         -    ou -     -        http://localhost/dolibarr/install/ -         -    ou -     -    http://yourdolibarrvirtualhost/install/ -    - Suivez les instructions de l'installateur - ## METTRE A JOUR DOLIBARR Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: + - Ecrasez les vieux fichiers dans le vieux répertoire 'dolibarr' par les fichiers fournis dans ce nouveau package. - + - Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire). - Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents") - + Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents") + *Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* - ## CE QUI EST NOUVEAU Voir fichier ChangeLog. - - ## CE QUE DOLIBARR PEUT FAIRE -### Modules principaux (tous optionnels): +### Modules principaux (tous optionnels) - Annuaires des prospects et/ou client et/ou fournisseurs - Gestion de catalogue de produits et services @@ -83,7 +76,7 @@ Voir fichier ChangeLog. - Gestion des factures clients/fournisseurs et paiements - Gestion des virements bancaires SEPA - Gestion des comptes bancaires -- Calendrier/Agenda partagé (avec export ical, vcal) +- Calendrier/Agenda partagé (avec export ical, vcal) - Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...) - Gestion de contrats de services - Gestion de stock @@ -96,7 +89,7 @@ Voir fichier ChangeLog. - Point de vente/Caisse enregistreuse - … -### Autres modules: +### Autres modules - Gestion de marque-pages - Gestion des promesses de dons @@ -111,7 +104,7 @@ Voir fichier ChangeLog. - Intégration de système de paiements (Paypal, Stripe, Paybox...) - … -### Divers: +### Divers - Multi-langue. - Multi-utilisateurs avec différents niveaux de permissions par module. @@ -119,66 +112,60 @@ Voir fichier ChangeLog. - Peux être multi-société par ajout du module externe multi-société. - Plusieurs thèmes visuels. - Application simple à utiliser. -- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur https://wiki.dolibarr.org/index.php/Prérequis). +- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur https://wiki.dolibarr.org/index.php/Prérequis). - Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP. - APIs. - Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...) - Code simple et facilement personnalisable (pas de framework lourd; mécanisme de hook et triggers). - Support natif de nombreuses fonctions spécifiques aux pays comme: - - La tax espagnole TE et ISPF - - Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM) - - La loi française Finance 2016 et logiciels de caisse - - La double taxe canadienne - - Le timbre fiscal tunisien - - Numérotation de facture de l'argentines (avec type A,B,C...) - - Compatible avec vos processus RGPD - - ... + - La tax espagnole TE et ISPF + - Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM) + - La loi française Finance 2016 et logiciels de caisse + - La double taxe canadienne + - Le timbre fiscal tunisien + - Numérotation de facture de l'argentines (avec type A,B,C...) + - Compatible avec vos processus RGPD + - ... - … ### Extension Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com). - ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE Voici un liste de fonctionnalités pas encore gérées par Dolibarr: + - Dolibarr ne contient pas de module de Gestion de la paie. - Les tâches du module de gestion de projets n'ont pas de dépendances entre elle. - Dolibarr n'embarque pas de Webmail intégré nativement. -- Dolibarr ne fait pas le café (pas encore). - +- Dolibarr ne fait pas le café (pas encore). ## DOCUMENTATION La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org). - ## CONTRIBUER Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. - ## CREDITS Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs. Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) - ## ACTUALITES ET RESEAUX SOCIAUX Suivez le projet Dolibarr project sur les réseaux francophones -- Facebook: -- Google+: -- Twitter: +- [Facebook](https://www.facebook.com/dolibarr.fr) +- [Twitter](https://www.twitter.com/dolibarr_france) ou sur les réseaux anglophones - [Facebook](https://www.facebook.com/dolibarr) -- [Google+](https://plus.google.com/+DolibarrOrg) - [Twitter](https://www.twitter.com/dolibarr) - [LinkedIn](https://www.linkedin.com/company/association-dolibarr) - [YouTube](https://www.youtube.com/user/DolibarrERPCRM) diff --git a/README.md b/README.md index 0ae6d1b9de5..e7f1535d1e5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ You can use it as a standalone application or as a web application to be able to ![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_640x400.png) - ## LICENSE Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (GPL-3+). @@ -25,7 +24,6 @@ See the [COPYING](https://github.com/Dolibarr/dolibarr/blob/develop/COPYING) fil Other licenses apply for some included dependencies. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) for a full list. - ## INSTALLING ### Simple setup @@ -42,51 +40,47 @@ Releases can be downloaded from [official website](https://www.dolibarr.org/). You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. -- 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): +- 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, ...) + `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 your web server does not have an already defined directory to point to. -- Set up your web server to use "*dolibarr/htdocs*" as root if your web server does not have an already defined directory to point to. - - 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 how you web setup was setup to point to your dolibarr installation. It may looks like: + 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/` + + or + + `http://localhost/dolibarr/install/` + + or + + `http://yourdolibarrvirtualhost/install/` - http://localhost/dolibarr/htdocs/install/ - - or - - http://localhost/dolibarr/install/ - - or - - http://yourdolibarrvirtualhost/install/ - - 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 -- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr +- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect your to the "install/" page to follow the upgrade process.  If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). *Note: migration process can be safely done multiple times by calling the `/install/index.php` page* - ## WHAT'S NEW See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. - ## FEATURES ### Main application/modules (all optional) @@ -113,7 +107,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Foundations members management - Mass emailing - Surveys -- Point of Sale (POS) +- Point of Sale (POS) - … ### Other application/modules @@ -144,14 +138,14 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - APIs - An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture) - Support a lot of country specific features: - - Spanish Tax RE and ISPF - - French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM) - - Canadian double taxes (federal/province) and other countries using cumulative VAT - - Tunisian tax stamp - - Argentina invoice numbering using A,B,C... - - Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) - - Compatible with European GDPR rules - - ... + - Spanish Tax RE and ISPF + - French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM) + - Canadian double taxes (federal/province) and other countries using cumulative VAT + - Tunisian tax stamp + - Argentina invoice numbering using A,B,C... + - Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE) + - Compatible with European GDPR rules + - ... - PDF or ODT generation for invoice, proposals, orders... - … @@ -160,12 +154,10 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Works with PHP 5.5+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) - Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites. - ### Extending Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com). - ## WHAT DOLIBARR CAN'T DO YET These are features that Dolibarr does **not** yet fully support: @@ -175,37 +167,31 @@ These are features that Dolibarr does **not** yet fully support: - No native embedded Webmail - Dolibarr can't do coffee (yet) - ## DOCUMENTATION Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](https://wiki.dolibarr.org). - ## CONTRIBUTING This project exists thanks to all the people who contribute. [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. - ## CREDITS Dolibarr is the work of many contributors over the years and uses some fine libraries. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file. - ## NEWS AND SOCIAL NETWORKS Follow Dolibarr project on: - [Facebook](https://www.facebook.com/dolibarr) -- [Google+](https://plus.google.com/+DolibarrOrg) - [Twitter](https://www.twitter.com/dolibarr) - [LinkedIn](https://www.linkedin.com/company/association-dolibarr) - [YouTube](https://www.youtube.com/user/DolibarrERPCRM) - [GitHub](https://github.com/Dolibarr/dolibarr) - ### Sponsors Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)] diff --git a/build/docker/Dockerfile b/build/docker/Dockerfile index 0d5918c3f4c..507170c7368 100644 --- a/build/docker/Dockerfile +++ b/build/docker/Dockerfile @@ -1,31 +1,37 @@ -FROM php:7.0-apache +FROM php:7.2-apache ENV HOST_USER_ID 33 ENV PHP_INI_DATE_TIMEZONE 'UTC' -RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev \ +RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev zlib1g-dev libicu-dev g++\ && rm -rf /var/lib/apt/lists/* \ && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-install gd \ && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \ && docker-php-ext-install ldap \ && docker-php-ext-install mysqli \ - && apt-get purge -y libjpeg-dev libldap2-dev + && docker-php-ext-install calendar \ + && docker-php-ext-configure intl \ + && docker-php-ext-install intl \ + && apt-get autoremove --purge -y libjpeg-dev libldap2-dev zlib1g-dev libicu-dev g++ + +RUN mkdir /var/documents +RUN chown www-data /var/documents COPY docker-run.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-run.sh -RUN pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug +RUN pecl install xdebug && docker-php-ext-enable xdebug RUN echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_autostart=0' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.default_enable=0' >> /usr/local/etc/php/php.ini -RUN echo 'xdebug.remote_host=docker.for.mac.host.internal' >> /usr/local/etc/php/php.ini +RUN echo 'xdebug.remote_host=docker.host' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_connect_back=0' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.profiler_enable=0' >> /usr/local/etc/php/php.ini RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> /usr/local/etc/php/php.ini - +RUN echo '172.17.0.1 docker.host' >> /etc/hosts EXPOSE 80 diff --git a/build/docker/docker-compose.yml b/build/docker/docker-compose.yml index a2017335197..3fe6125a874 100644 --- a/build/docker/docker-compose.yml +++ b/build/docker/docker-compose.yml @@ -1,5 +1,5 @@ mariadb: - image: mariadb:latest + build: mariadb environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: dolibarr diff --git a/build/docker/docker-run.sh b/build/docker/docker-run.sh index c151e1c3cab..df7272c317d 100644 --- a/build/docker/docker-run.sh +++ b/build/docker/docker-run.sh @@ -3,7 +3,8 @@ usermod -u $HOST_USER_ID www-data groupmod -g $HOST_USER_ID www-data -chown -hR www-data:www-data /var/www +chgrp -hR www-data /var/www/html +chmod g+rwx /var/www/html/conf if [ ! -f /usr/local/etc/php/php.ini ]; then cat < /usr/local/etc/php/php.ini diff --git a/build/docker/mariadb/Dockerfile b/build/docker/mariadb/Dockerfile new file mode 100644 index 00000000000..a4db0f42065 --- /dev/null +++ b/build/docker/mariadb/Dockerfile @@ -0,0 +1,3 @@ +FROM mariadb:latest +# Enable comented out UTF8 charset/collation options +RUN sed '/utf8/ s/^#//' /etc/mysql/mariadb.cnf >/tmp/t && mv /tmp/t /etc/mysql/mariadb.cnf diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 0db4c7b6c24..758906cb19d 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -974,7 +974,7 @@ while ($i < min($num, $limit)) // Exported operation date if (! empty($arrayfields['t.date_export']['checked'])) { - print '' . dol_print_date($line->date_export, 'dayhour') . ''; + print '' . dol_print_date($line->date_export, 'dayhour') . ''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php index 4572164fdcf..9778db176d6 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_create.tpl.php @@ -116,7 +116,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?> trans("Note"); ?> - + diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php index 942ddb2d647..1e75fd57dd6 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php @@ -125,7 +125,7 @@ echo $this->control->tpl['ajax_selectcountry']; trans("Note"); ?> - + diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index a06f5faab5d..8d4053642ac 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1072,16 +1072,10 @@ else // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - //Hooks here - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) - { - print $object->showOptionals($extrafields, 'edit', $parameters); - } print ''; print "\n"; + dol_fiche_end(); print '
'; @@ -1769,7 +1763,7 @@ else /* - * Hotbar + * Action bar */ print '
'; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index dcd3d48d323..28fb8b3b29a 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -124,7 +124,6 @@ if ($result) } -//print ''; print '
'; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index be722b6ca00..ab58a0d0919 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -71,7 +71,6 @@ $adht = new AdherentType($db); $extrafields->fetch_name_optionals_label($object->table_element); $errmsg = ''; -$errmsgs = array(); $defaultdelay = 1; $defaultdelayunit = 'y'; @@ -687,20 +686,19 @@ if ($rowid > 0) $subscriptionstatic = new Subscription($db); $num = $db->num_rows($result); - $i = 0; print ''."\n"; print ''; print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'c.rowid', '', $param, '', $sortfield, $sortorder); - print ''; - print ''; - print ''; - print ''; - print ''; + print_liste_field_titre('DateCreation', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); + print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); if (!empty($conf->banque->enabled)) { - print ''; + print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); } print "\n"; @@ -708,6 +706,7 @@ if ($rowid > 0) $adh = new Adherent($db); $adht = new AdherentType($db); + $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); @@ -766,6 +765,13 @@ if ($rowid > 0) print ""; $i++; } + + if (empty($num)) { + $colspan = 6; + if (!empty($conf->banque->enabled)) $colspan++; + print ''; + } + print "
'.$langs->trans("DateCreation").''.$langs->trans("Type").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("Account").'
'.$langs->trans("None").'
"; } else @@ -1002,7 +1008,7 @@ if ($rowid > 0) print $langs->trans("CreateDolibarrThirdParty"); print ')'; } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0); + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); @@ -1027,7 +1033,7 @@ if ($rowid > 0) print $langs->trans("CreateDolibarrThirdParty"); print ')'; } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0); + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); @@ -1070,9 +1076,9 @@ if ($rowid > 0) } } - print ' '; + print ''; - print ''.$langs->trans("SendAcknowledgementByMail").''; + print ''.$langs->trans("SendAcknowledgementByMail").''; print ''; if (!$object->email) { @@ -1117,11 +1123,20 @@ if ($rowid > 0) $helpcontent .= ''.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.'
'."\n"; $helpcontent .= ''.$langs->trans("MailRecipient").': '.$object->email.'
'."\n"; $helpcontent .= ''.$langs->trans("MailTopic").':
'."\n"; - $helpcontent .= $subjecttosend."\n"; + if ($subjecttosend) { + $helpcontent .= $subjecttosend."\n"; + } else { + $langs->load("errors"); + $helpcontent .= ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).''."\n"; + } $helpcontent .= "
"; $helpcontent .= ''.$langs->trans("MailText").':
'; - $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; - + if ($texttosend) { + $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; + } else { + $langs->load("errors"); + $helpcontent .= ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Module310Name")).''."\n"; + } print $form->textwithpicto($tmp, $helpcontent, 1, 'help', '', 0, 2, 'helpemailtosend'); } print ''; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 0dc682a32f8..534153a6c37 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -442,7 +442,7 @@ print $langs->trans('BankColorizeMovementDesc'); print ""; // Active if ($conf->global->BANK_COLORIZE_MOVEMENT) { - print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -450,7 +450,7 @@ if ($conf->global->BANK_COLORIZE_MOVEMENT) { } else { - print ''."\n"; + print ''."\n"; print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index ca569b66b76..0109538f71f 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -74,7 +74,7 @@ llxHeader('', $langs->trans("Audit"), $wikihelp); //$linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); -print $langs->trans("LogEventDesc", $langs->transnoentitiesnoconv("AdminTools"), $langs->transnoentitiesnoconv("Audit"))."
\n"; +print ''.$langs->trans("LogEventDesc", $langs->transnoentitiesnoconv("AdminTools"), $langs->transnoentitiesnoconv("Audit"))."
\n"; print "
\n"; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index b9e89450d33..413f14e02df 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print ''; + print ''; if ($conf->global->FICHEINTER_ADDON == $classname) { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -348,7 +348,7 @@ foreach ($dirmodels as $reldir) $htmltooltip .= $langs->trans($module->error).'
'; } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; @@ -486,12 +486,12 @@ foreach ($dirmodels as $reldir) $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); $htmltooltip .= '
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, -1, 0); print ''; // Preview - print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'intervention').''; @@ -587,7 +587,7 @@ print ''; print ''; print $langs->trans("UseServicesDurationOnFichinter"); print ''; -print ''; +print ''; print 'global->FICHINTER_USE_SERVICE_DURATION ? ' checked' : '').'>'; print ''; print ''; @@ -603,7 +603,7 @@ print ''; print ''; print $langs->trans("UseDurationOnFichinter"); print ''; -print ''; +print ''; print 'global->FICHINTER_WITHOUT_DURATION ? ' checked' : '').'>'; print ''; print ''; @@ -619,7 +619,7 @@ print ''; print ''; print $langs->trans("UseDateWithoutHourOnFichinter"); print ''; -print ''; +print ''; print 'global->FICHINTER_DATE_WITHOUT_HOUR ? ' checked' : '').'>'; print ''; print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 5eb36b111c8..0920b656e4f 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -250,7 +250,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print ''; + print ''; if ($conf->global->HOLIDAY_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -281,7 +281,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; @@ -397,7 +397,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -405,13 +405,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } // Default - print ''; + print ''; if ($conf->global->HOLIDAY_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); @@ -437,12 +437,12 @@ foreach ($dirmodels as $reldir) $htmltooltip .= '
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview - print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'contract').''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 6d08456a470..a1f6f27883f 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -245,7 +245,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print ''; + print ''; if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; @@ -408,12 +408,12 @@ foreach ($dirmodels as $reldir) $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview - print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'sending').''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index aa8a7e79719..47300a5530d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -571,7 +571,7 @@ foreach ($fieldsforcontent as $tmpfieldlist) } print ''; if ($tmpfieldlist == 'topic') { - print ''; + print ''; if ($action != 'edit') { print ''; } @@ -730,7 +730,7 @@ if ($resql) if (empty($reshook)) fieldList($fieldlist, $obj, $tabname[$id], 'edit'); print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -874,7 +874,7 @@ if ($resql) $url.='&'; // Status / Active - print ''; + print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; else print ''.$actl[$obj->active].''; print ""; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8bdfb978219..9171d9ffda7 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -198,20 +198,36 @@ if ($action=='install') // TODO Make more test } - // Now we install the module - if (! $error) - { - //var_dump($dirins); - @dol_delete_dir_recursive($dirins.'/'.$modulename); // delete the zip file - dol_syslog("Uncompress of module file is a success. We copy it from ".$modulenamedir." into target dir ".$dirins.'/'.$modulename); - $result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1); - if ($result <= 0) - { - dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$modulenamedir." and ".$dirins.'/'.$modulename, LOG_WARNING); - $langs->load("errors"); - setEventMessages($langs->trans("ErrorFailToCopyDir", $modulenamedir, $dirins.'/'.$modulename), null, 'errors'); - $error++; - } + dol_syslog("Uncompress of module file is a success."); + + $modulenamearrays = array(); + if (dol_is_file($modulenamedir.'/metapackage.conf')) { + // This is a meta package + $metafile = file_get_contents($modulenamedir.'/metapackage.conf'); + $modulenamearrays = explode("\n", $metafile); + } + $modulenamearrays[$modulename] = $modulename; + + foreach($modulenamearrays as $modulenameval) { + if (strpos($modulenameval, '#') === 0) continue; // Discard comments + if (strpos($modulenameval, '//') === 0) continue; // Discard comments + if (! trim($modulenameval)) continue; + + // Now we install the module + if (! $error) + { + //var_dump($dirins); + @dol_delete_dir_recursive($dirins.'/'.$modulenameval); // delete the zip file + dol_syslog("We copy now directory ".$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval." into target dir ".$dirins.'/'.$modulenameval); + $result=dolCopyDir($conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval, $dirins.'/'.$modulenameval, '0444', 1); + if ($result <= 0) + { + dol_syslog('Failed to call dolCopyDir result='.$result." with param ".$modulenamedir." and ".$dirins.'/'.$modulenameval, LOG_WARNING); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorFailToCopyDir", $conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulenameval, $dirins.'/'.$modulenameval), null, 'errors'); + $error++; + } + } } } } diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index d6a7fb26a98..2544b9bd0ee 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -189,12 +189,12 @@ dol_fiche_head($head, 'settings', $langs->trans("ModuleSetup"), -1, "multicurren print ''; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; print ''; print ''; -print ''; print ''; print ''; -print ''; print ''; - print ''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan += 2; + print ''; } print "
'.$langs->trans("Parameters").''.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->transnoentitiesnoconv("MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE'); } else { @@ -206,7 +206,7 @@ print '
'.$langs->transnoentitiesnoconv("multicurrency_useOriginTx").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MULTICURRENCY_USE_ORIGIN_TX'); } else { @@ -220,7 +220,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print '
'.$langs->transnoentitiesnoconv("MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT'); } else { @@ -313,7 +313,7 @@ print ''; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; print ''; diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 4fcb3c84786..0aa25d446dd 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -175,7 +175,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; } @@ -194,7 +193,7 @@ if ($result) $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle)); print ''; - print '"; } // Default - print ''; // Preview - print ''."\n"; - print ''; @@ -442,7 +442,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''; // Preview - print ''."\n"; - print ''; @@ -395,7 +395,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print '"; } // Defaut - print ''; // Preview - print ''; } else print ''; @@ -690,7 +694,9 @@ if ($socid > 0) } else { - print ''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan += 2; + print ''; } $db->free($resql); print "
'.$form->textwithpicto($langs->trans("CurrenciesUsed"), $langs->transnoentitiesnoconv("CurrenciesUsed_help_to_add")).''.$langs->trans("Rate").''.$langs->trans("Rate").'
'; + print ''; //print "> ".$conf->global->PAYMENT_ADDON." - ".$file; if ($conf->global->PAYMENT_ADDON == $file || $conf->global->PAYMENT_ADDON.'.php' == $file) { @@ -205,7 +205,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); if ($conf->global->PAYMENT_ADDON.'.php' == $file) // If module is the one used, we show existing errors diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 23fa06887a9..ea8f839600d 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -66,8 +66,7 @@ llxHeader('', $langs->trans("DefaultRights"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); -print $langs->trans("DefaultRightsDesc"); -print " ".$langs->trans("OnlyActiveElementsAreShown")."

\n"; +print ''.$langs->trans("DefaultRightsDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."

\n"; $db->begin(); @@ -179,7 +178,7 @@ if ($result) print '
'.$langs->trans("Module").''.$langs->trans("Permission").''.$langs->trans("Default").''.$langs->trans("Default").' 
'.$perm_libelle. ''; + print ''; if ($obj->bydefault == 1) { print img_picto($langs->trans("Active"), 'tick'); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 1d9b181b295..d7061def3e9 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -355,7 +355,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"),'switch_on'); print ''; @@ -363,13 +363,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print "'; + print ''; if ($conf->global->PAYMENTORDER_ADDON_PDF == $name) { print img_picto($langs->trans("Default"),'on'); @@ -397,12 +397,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); - print '
'; + print ''; print $form->textwithpicto('',$htmltooltip,1,0); print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"),'bill').''; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index dc58a2c4809..4cde7aa8a20 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''; + print ''; if ($conf->global->PROPALE_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -338,7 +338,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -484,12 +484,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 9974e58a1f6..670e6e43b54 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -82,7 +82,7 @@ llxHeader('', $langs->trans("Proxy"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); -print $langs->trans("ProxyDesc")."
\n"; +print ''.$langs->trans("ProxyDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index eacf0deaf68..d705ee0e38d 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -259,7 +259,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print '
'; + print ''; if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -290,7 +290,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -403,13 +403,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; if ($conf->global->RECEPTION_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); @@ -434,12 +434,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; if ($module->type == 'pdf') { print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 1760651b693..f3004e7b6e7 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -194,6 +194,7 @@ if ($action == 'maj_pattern') /* * View */ + $form = new Form($db); $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; @@ -201,7 +202,7 @@ llxHeader('', $langs->trans("Passwords"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); -print $langs->trans("GeneratedPasswordDesc")."
\n"; +print ''.$langs->trans("GeneratedPasswordDesc")."
\n"; print "
\n"; @@ -245,7 +246,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; foreach ($arrayhandler as $key => $module) @@ -405,8 +406,8 @@ print ""; print '
'.$langs->trans("RuleForGeneratedPasswords").''.$langs->trans("Example").''.$langs->trans("Activated").''.$langs->trans("Activated").'
'; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; // Disable clear password in database diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index aeb2ee0fe19..7b11aa3570e 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -90,7 +90,7 @@ llxHeader('', $langs->trans("Files"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); -print $langs->trans("SecurityFilesDesc")."
\n"; +print ''.$langs->trans("SecurityFilesDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index b36106b3e80..d3a361db66f 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -473,7 +473,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Example with a yes / no select /*print ''; print ''; - print ''; print ''; - print ''."\n"; - print ''; @@ -395,7 +395,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print '"; } // Default - print ''; - print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index fa87a7f5bb7..9a97ccb640f 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print ''; @@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print '"; } // Default - print ''; - print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index e184e98a4b1..1f368eb2b50 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -259,7 +259,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print '"; } // Default - print ''; - print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 03f144ecd38..783804a3d3f 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''."\n"; - print ''; @@ -408,7 +408,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''; // Preview - print ''."\n"; - print ''; @@ -315,7 +315,7 @@ if ($conf->use_javascript_ajax) { print $form->selectarray("TICKET_DISABLE_ALL_MAILS", $arrval, $conf->global->TICKET_DISABLE_ALL_MAILS); } print ''; -print ''; print ''; @@ -330,7 +330,7 @@ if ($conf->use_javascript_ajax) { print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL); } print ''; -print ''; print ''; @@ -348,7 +348,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS); } print ''; - print ''; print ''; @@ -365,7 +365,7 @@ if ($conf->use_javascript_ajax) { print $form->selectarray("TICKET_LIMIT_VIEW_ASSIGNED_ONLY", $arrval, $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY); } print ''; -print ''; print ''; @@ -386,7 +386,7 @@ if ($conf->use_javascript_ajax) { print $form->selectarray("TICKET_AUTO_ASSIGN_USER_CREATE", $arrval, $conf->global->TICKET_AUTO_ASSIGN_USER_CREATE); } print ''; -print ''; print ''; @@ -426,7 +426,7 @@ if ($conf->use_javascript_ajax) { print $form->selectarray("TICKET_ACTIVATE_LOG_BY_EMAIL", $arrval, $conf->global->TICKET_ACTIVATE_LOG_BY_EMAIL); } print ''; -print ''; print ''; @@ -438,7 +438,7 @@ print ''; print ''; print ''; -print ''; print ''; @@ -447,7 +447,7 @@ print ''; print ''; print ''; -print ''; print ''; @@ -460,7 +460,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); $doleditor->Create(); print ''; -print ''; @@ -472,7 +472,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); $doleditor->Create(); print ''; -print ''; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index d216252c329..de46acb69f5 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -218,7 +218,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print $form->selectarray("TICKET_EMAIL_MUST_EXISTS", $arrval, $conf->global->TICKET_EMAIL_MUST_EXISTS); } print ''; - print ''; print ''; @@ -235,7 +235,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print $form->selectarray("TICKET_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKET_SHOW_MODULE_LOGO); } print ''; - print ''; print ''; @@ -251,7 +251,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print $form->selectarray("TICKET_SHOW_COMPANY_LOGO", $arrval, $conf->global->TICKET_SHOW_COMPANY_LOGO); } print ''; - print ''; print ''; @@ -268,7 +268,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print $form->selectarray("TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS); } print ''; - print ''; print ''; @@ -310,7 +310,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print ''; print ''; - print ''; @@ -322,7 +322,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; - print ''; @@ -334,7 +334,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; - print ''; @@ -348,7 +348,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS); } print ''; - print ''; print ''; @@ -361,7 +361,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) $doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70); $doleditor->Create(); print ''; - print ''; @@ -371,7 +371,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) print ''; print ''; - print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index f1759ec6c06..46e9651e2ca 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -224,6 +224,13 @@ if (in_array($type, array('mysql', 'mysqli'))) { print ''; print ''; print '
'; + + print ''; + print ''; + print '
'; + print ''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 99a198df394..9be3591a298 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -302,11 +302,11 @@ if ($mode == 'overwrite') print ''; - print ''; - print '"; } // Defaut - print ''; // Preview - print '"; } // Defaut - print ''; // Preview - print ''; - else print ''; + else print ''; print "\n"; } diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 81899fee0f0..02abcf59660 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -162,7 +162,7 @@ foreach ($workflowcodes as $key => $params) print ' '.img_warning($langs->transnoentitiesnoconv($params['warning'])); } print "\n"; - print ''; $out .= ''; $out .= ''; - $out .= ''; - $out .= ''; + $out .= ''; + $out .= ''; $out .= ''."\n"; $i = 0; @@ -1451,8 +1451,8 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''."\n"; $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; $out .= "\n"; } @@ -1498,7 +1498,7 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''; $out .= ''; - $out .= ''; + $out .= ''; $out .= ''."\n"; $tmpfilelist = dol_sort_array($file_list['missing'], 'filename'); if (is_array($tmpfilelist) && count($tmpfilelist)) @@ -1510,7 +1510,7 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''."\n"; $out .= ''."\n"; - $out .= ''."\n"; + $out .= ''."\n"; $out .= "\n"; } } @@ -1532,8 +1532,8 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''; $out .= ''; - $out .= ''; - $out .= ''; + $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= ''."\n"; @@ -1547,8 +1547,8 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''."\n"; $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; $out .= ''."\n"; @@ -1582,8 +1582,8 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''; $out .= ''; - $out .= ''; - $out .= ''; + $out .= ''; + $out .= ''; $out .= ''; $out .= ''; $out .= ''."\n"; @@ -1597,8 +1597,8 @@ class Setup extends DolibarrApi $out .= ''; $out .= ''."\n"; $out .= ''."\n"; - $out .= ''."\n"; - $out .= ''."\n"; + $out .= ''."\n"; + $out .= ''."\n"; $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']); $totalsize += $size; $out .= ''."\n"; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 351f50438ed..be1afb30bd4 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -213,13 +213,13 @@ while ($i < min($num, $limit)) print "\n"; // Target - print '\n"; // Author - print '\n"; // Date creation - print '"; + print '"; // Position print '"; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index dc3a84234b0..b8debf876a2 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1069,7 +1069,7 @@ if ($action == 'create') $numproject = $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   '.$langs->trans("AddProject").''; + print ' '; $urloption = '?action=create'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 9fca6afab6e..b9519dc377c 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -618,7 +618,7 @@ if ($resql) $formatToUse = $obj->fulldayevent ? 'day' : 'dayhour'; // Start date if (!empty($arrayfields['a.datep']['checked'])) { - print ''; } diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 134e239b66f..43e28b34ca3 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -603,7 +603,7 @@ echo ''; $i=0; for ($h = $begin_d; $h < $end_d; $h++) { - echo '"; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 54373fcf8a9..a21d6472ec6 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -665,7 +665,7 @@ while($currentdaytoshow<$lastdaytoshow) { } for ($h = $begin_h; $h < $end_h; $h++) { - echo '"; } diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index c6549c5c39a..b26f05a4adb 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -131,11 +131,11 @@ if ($resql) print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print "\n"; while ($i < min($num, $limit)) @@ -150,10 +150,10 @@ if ($resql) print "\n"; // Nb of events - print ''; + print ''; // Button to build doc - print ''; @@ -184,8 +184,8 @@ if ($resql) print $out; print ''; - print ''; - print ''; + print ''; + print ''; } else { print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index f2754658f37..706153e897c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -598,7 +598,7 @@ if ($object->fetch($id) >= 0) print ''; print ''; print ''; - print ''; + print ''; print ''; } - print ''; if ($user->rights->societe->creer || $user->rights->facture->creer) { - print ''; } else print ''; @@ -535,7 +538,9 @@ if ($socid > 0) } else { - print ''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan += 2; + print ''; } $db->free($resql); print "
'.$langs->trans("Parameters").''.$langs->trans("Activated").''.$langs->trans("Action").''.$langs->trans("Activated").''.$langs->trans("Action").'
'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); } else { @@ -486,7 +486,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Example with a yes / no select /*print '
'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); } else { diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index ff9a621f706..7ebe887f306 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -268,7 +268,7 @@ foreach ($dirmodels as $reldir) else print $tmp; print ''; + print ''; if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -297,7 +297,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''."\n"; + print ''."\n"; //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") //{ // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all @@ -411,13 +411,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") { //print img_picto($langs->trans("Default"),'on'); @@ -438,10 +438,10 @@ foreach ($dirmodels as $reldir) $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; print ''.img_object($langs->trans("Preview"), 'order').''; print ''; + print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -327,7 +327,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''."\n"; + print ''."\n"; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") { print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'; @@ -435,13 +435,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); @@ -460,10 +460,10 @@ foreach ($dirmodels as $reldir) $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); $htmltooltip .= '
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; print ''.img_object($langs->trans("Preview"), 'order').''; print ''; + print ''; //print "> ".$conf->global->SUPPLIER_PAYMENT_ADDON." - ".$file; if ($conf->global->SUPPLIER_PAYMENT_ADDON == $file || $conf->global->SUPPLIER_PAYMENT_ADDON.'.php' == $file) { @@ -289,7 +289,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); if ($conf->global->PAYMENT_ADDON.'.php' == $file) // If module is the one used, we show existing errors @@ -366,7 +366,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''."\n"; + print ''."\n"; //if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF != "$name") //{ // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all @@ -382,13 +382,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF == "$name") { //print img_picto($langs->trans("Default"),'on'); @@ -407,10 +407,10 @@ foreach ($dirmodels as $reldir) $htmltooltip .= '
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip .= '

'.$langs->trans("FeaturesSupported").':'; $htmltooltip .= '
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; print ''.img_object($langs->trans("Preview"), 'order').''; print ''; + print ''; if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); @@ -305,7 +305,7 @@ foreach ($dirmodels as $reldir) } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -450,12 +450,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'bill').''; diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 98d77d47118..a7982d38ab9 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -250,7 +250,7 @@ foreach ($dirmodels as $reldir) { print ''; + print ''; if ($conf->global->TICKET_ADDON == 'mod_'.$classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir) { } } - print ''; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; +print ''; print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help'); print '
'; +print ''; print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); print '
'; +print ''; print $form->textwithpicto('', $langs->trans("TicketsLimitViewAssignedOnlyHelp"), 1, 'help'); print '
'; +print ''; print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1, 'help'); print '
'; +print ''; print $form->textwithpicto('', $langs->trans("TicketsLogEnableEmailHelp"), 1, 'help'); print '
'.$langs->trans("TicketEmailNotificationTo").''; print ''; +print ''; print $form->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help'); print '
'.$langs->trans("TicketEmailNotificationFrom").''; print ''; +print ''; print $form->textwithpicto('', $langs->trans("TicketEmailNotificationFromHelp"), 1, 'help'); print '
'; +print ''; print $form->textwithpicto('', $langs->trans("TicketMessageMailIntroHelpAdmin"), 1, 'help'); print '
'; +print ''; print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelpAdmin"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketsEmailMustExistHelp"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketsShowCompanyLogoHelp"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); print '
'; print ''; + print ''; print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHomeHelpAdmin"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help'); print '
'; + print ''; print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help'); print '
'; print ''; + print ''; print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help'); print '
'; print ''; print ''; + print ''; } else {*/ - print ''; + print ''; print ''; //} print ''; @@ -356,7 +356,7 @@ if ($mode == 'overwrite') } print ''; + print ''; if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index cfc5a65cc54..c0db15a48a7 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -271,13 +271,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; if ($conf->global->USER_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); @@ -303,12 +303,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'contract').''; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index fd7348bc603..75cdc514518 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -210,7 +210,7 @@ foreach ($dirmodels as $reldir) // Active if (in_array($name, $def)) { - print ''."\n"; + print ''."\n"; print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; @@ -218,13 +218,13 @@ foreach ($dirmodels as $reldir) } else { - print ''."\n"; + print ''."\n"; print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; + print ''; if ($conf->global->USERGROUP_ADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); @@ -250,12 +250,12 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); - print '
'; + print ''; print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; + print ''; if ($module->type == 'pdf') { print ''.img_object($langs->trans("Preview"), 'contract').''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index c759b0a8d8c..9840121861a 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -625,7 +625,7 @@ if ($id) // Delete link if ($iserasable) print ''.img_delete().''.img_delete($langs->trans("DisableSiteFirst"), 'class="opacitymedium"').''.img_delete($langs->trans("DisableSiteFirst"), 'class="opacitymedium"').'
'; + print ''; if (!empty($conf->use_javascript_ajax)) { print ajax_constantonoff($key); diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 0dfdc9362ed..05bad1bbe7e 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1430,8 +1430,8 @@ class Setup extends DolibarrApi $out .= '
#'.$langs->trans("Constant").''.$langs->trans("ExpectedValue").''.$langs->trans("Value").''.$langs->trans("ExpectedValue").''.$langs->trans("Value").'
'.$i.''.$constname.''.$constvalue.''.$valueforchecksum.''.$constvalue.''.$valueforchecksum.'
#'.$langs->trans("Filename").''.$langs->trans("ExpectedChecksum").''.$langs->trans("ExpectedChecksum").'
'.$i.''.$file['filename'].''.$file['expectedmd5'].''.$file['expectedmd5'].'
#'.$langs->trans("Filename").''.$langs->trans("ExpectedChecksum").''.$langs->trans("CurrentChecksum").''.$langs->trans("ExpectedChecksum").''.$langs->trans("CurrentChecksum").''.$langs->trans("Size").''.$langs->trans("DateModification").'
'.$i.''.$file['filename'].''.$file['expectedmd5'].''.$file['md5'].''.$file['expectedmd5'].''.$file['md5'].''.dol_print_size($size).'
#'.$langs->trans("Filename").''.$langs->trans("ExpectedChecksum").''.$langs->trans("CurrentChecksum").''.$langs->trans("ExpectedChecksum").''.$langs->trans("CurrentChecksum").''.$langs->trans("Size").''.$langs->trans("DateModification").'
'.$i.''.$file['filename'].''.$file['expectedmd5'].''.$file['md5'].''.$file['expectedmd5'].''.$file['md5'].''.dol_print_size($size).''; + print ''; if ($obj->target == 0) print $langs->trans("BookmarkTargetReplaceWindowShort"); if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort"); print "'; + print ''; if ($obj->fk_user) { $userstatic->id=$obj->fk_user; @@ -233,7 +233,7 @@ while ($i < min($num, $limit)) print "'.dol_print_date($db->jdate($obj->dateb), 'day')."'.dol_print_date($db->jdate($obj->dateb), 'day')."'.$obj->position."'; + print ''; print dol_print_date($db->jdate($obj->dp), $formatToUse); $late = 0; if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1; @@ -631,7 +631,7 @@ if ($resql) // End date if (!empty($arrayfields['a.datep2']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->dp2), $formatToUse); print ''; + echo ''; print ''.sprintf("%02d", $h).''; print "'; + echo ''; print ''.sprintf("%02d", $h).''; print "
'.$langs->trans("Period").''.$langs->trans("EventsNb").''.$langs->trans("Action").''.$langs->trans("EventsNb").''.$langs->trans("Action").''.$langs->trans("PDF").''.$langs->trans("Date").''.$langs->trans("Size").''.$langs->trans("Date").''.$langs->trans("Size").'
".$obj->df."'.$obj->cc.''.$obj->cc.''; + print ''; print 'month.'&year='.$obj->year.'">'.img_picto($langs->trans('BuildDoc'), 'filenew').''; print ''.dol_print_date(dol_filemtime($file), 'dayhour').''.dol_print_size(dol_filesize($file)).''.dol_print_date(dol_filemtime($file), 'dayhour').''.dol_print_size(dol_filesize($file)).' '.$obj->lastname.''.$obj->firstname.''.$obj->other.''; + print ''; if (empty($obj->source_id) || empty($obj->source_type)) { print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility @@ -649,7 +649,7 @@ if ($object->fetch($id) >= 0) else { // Date sent - print ''.$obj->date_envoi.''.$obj->date_envoi.''; print $object::libStatutDest($obj->statut, 2, $obj->error_text); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 1dc7a430575..b0cbcc23784 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -165,8 +165,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; $num = $db->num_rows($result); @@ -184,8 +184,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; $i++; diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index cbd0c244bb3..b3b07a8a875 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -228,14 +228,14 @@ if ($result) print ''; // Date creation - print ''; // Nb of email if (!$filteremail) { - print ''; print ''; print ''; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f654ed932b7..d421e7bc344 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1544,6 +1544,7 @@ class Propal extends CommonObject if (isset($this->note_public)) $this->note_public = trim($this->note_public); if (isset($this->modelpdf)) $this->modelpdf = trim($this->modelpdf); if (isset($this->import_key)) $this->import_key = trim($this->import_key); + if (! empty($this->duree_validite)) $this->fin_validite=$this->date + ($this->duree_validite * 24 * 3600); // Check parameters // Put here code to add control on parameters values @@ -1555,7 +1556,8 @@ class Propal extends CommonObject $sql .= " ref_client=".(isset($this->ref_client) ? "'".$this->db->escape($this->ref_client)."'" : "null").","; $sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").","; $sql .= " fk_soc=".(isset($this->socid) ? $this->socid : "null").","; - $sql .= " datep=".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null').","; + $sql .= " datep=".(strval($this->date) != '' ? "'".$this->db->idate($this->date)."'" : 'null').","; + if (! empty($this->fin_validite)) $sql .= " fin_validite=".(strval($this->fin_validite)!='' ? "'".$this->db->idate($this->fin_validite)."'" : 'null').","; $sql .= " date_valid=".(strval($this->date_validation) != '' ? "'".$this->db->idate($this->date_validation)."'" : 'null').","; $sql .= " tva=".(isset($this->total_tva) ? $this->total_tva : "null").","; $sql .= " localtax1=".(isset($this->total_localtax1) ? $this->total_localtax1 : "null").","; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1a44efa45ec..887c99e7aeb 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -879,7 +879,7 @@ if ($resql) // Country if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; @@ -890,7 +890,7 @@ if ($resql) { if (!is_array($typenArray) || empty($typenArray)) $typenArray = $formcompany->typent_array(1); - print ''; if (!$i) $totalarray['nbfield']++; @@ -899,7 +899,7 @@ if ($resql) // Date proposal if (!empty($arrayfields['p.date']['checked'])) { - print '\n"; if (!$i) $totalarray['nbfield']++; @@ -910,7 +910,7 @@ if ($resql) { if ($obj->dfv) { - print ''; } else @@ -924,7 +924,7 @@ if ($resql) { if ($obj->ddelivery) { - print ''; } else @@ -936,7 +936,7 @@ if ($resql) // Availability if (! empty($arrayfields['ava.rowid']['checked'])) { - print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 4c7b393c8db..4a2b8dea419 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -274,7 +274,7 @@ print '
'; print '
'; print '
'.$langs->trans("LastMailings", $limit).''.$langs->trans("DateCreation").''.$langs->trans("NbOfEMails").''.$langs->trans("DateCreation").''.$langs->trans("NbOfEMails").''.$langs->trans("AllEMailings").'
'.$mailstatic->getNomUrl(1).''.dol_trunc($obj->titre, 38).''.dol_print_date($db->jdate($obj->date_creat), 'day').''.($obj->nbemail ? $obj->nbemail : "0").''.dol_print_date($db->jdate($obj->date_creat), 'day').''.($obj->nbemail ? $obj->nbemail : "0").''.$mailstatic->LibStatut($obj->statut, 5).'
'.$obj->titre.''; + print ''; print dol_print_date($db->jdate($obj->datec), 'day'); print ''; + print ''; $nbemail = $obj->nbemail; /*if ($obj->statut != 3 && !empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e6b1b47d0b6..cc69ecd0c6c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1475,9 +1475,10 @@ if ($action == 'create') { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; + $regs = array(); if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { - $element = $regs [1]; - $subelement = $regs [2]; + $element = $regs[1]; + $subelement = $regs[2]; } if ($element == 'project') { @@ -1675,7 +1676,7 @@ if ($action == 'create') print '
'.$langs->trans("Project").''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id).'">'; + print ' id).'">'; print '
'; + print ''; $tmparray = getCountry($obj->fk_pays, 'all'); print $tmparray['label']; print ''; + print ''; print $typenArray[$obj->typent_code]; print ''; + print ''; print dol_print_date($db->jdate($obj->dp), 'day'); print "'.dol_print_date($db->jdate($obj->dfv), 'day'); + print ''.dol_print_date($db->jdate($obj->dfv), 'day'); print ''.dol_print_date($db->jdate($obj->ddelivery), 'day'); + print ''.dol_print_date($db->jdate($obj->ddelivery), 'day'); print ''; + print ''; $form->form_availability('', $obj->availability, 'none', 1); print '
'; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index a4f3fb0503b..2b8c8ef5df2 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -235,7 +235,7 @@ if ($socid > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; $num = $db->num_rows($resql); if ($num > 0) @@ -246,7 +246,7 @@ if ($socid > 0) $obj = $db->fetch_object($resql); print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -294,7 +294,7 @@ if ($socid > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; $num = $db->num_rows($resql); if ($num > 0) @@ -305,7 +305,7 @@ if ($socid > 0) $obj = $db->fetch_object($resql); print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index e5f84bbec77..c4b6ac18987 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -61,9 +61,9 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes') //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) - $amount_ttc_1 = GETPOST('amount_ttc_1'); + $amount_ttc_1 = GETPOST('amount_ttc_1', 'alpha'); $amount_ttc_1 = price2num($amount_ttc_1); - $amount_ttc_2 = GETPOST('amount_ttc_2'); + $amount_ttc_2 = GETPOST('amount_ttc_2', 'alpha'); $amount_ttc_2 = price2num($amount_ttc_2); $error = 0; @@ -252,7 +252,7 @@ if ($socid > 0) print ''; print ''; - dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), 0, 'company'); + dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), -1, 'company'); dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -273,7 +273,7 @@ if ($socid > 0) } - print '
'.$langs->trans("Year").''.$langs->trans("Year").''.$langs->trans("NbOfProposals").'%'.$langs->trans("AmountTotal").''.$langs->trans("Date").''.$langs->trans("CustomerRelativeDiscountShort").''.$langs->trans("NoteReason").''.$langs->trans("User").''.$langs->trans("User").'
'.dol_print_date($db->jdate($obj->dc), "dayhour").''.price2num($obj->remise_percent).'%'.price2num($obj->remise_percent).'%'.$obj->note.''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'
'.$langs->trans("Date").''.$langs->trans("CustomerRelativeDiscountShort").''.$langs->trans("NoteReason").''.$langs->trans("User").''.$langs->trans("User").'
'.dol_print_date($db->jdate($obj->dc), "dayhour").''.price2num($obj->remise_percent).'%'.price2num($obj->remise_percent).'%'.$obj->note.''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.'
'; + print '
'; if ($isCustomer) { // Calcul avoirs client en cours $remise_all = $remise_user = 0; @@ -342,13 +342,15 @@ if ($socid > 0) print ''; + dol_fiche_end(); + + if ($user->rights->societe->creer) { print '
'; print load_fiche_titre($langs->trans("NewGlobalDiscount"), '', ''); - print '
'; if ($isCustomer && !$isSupplier) { print ''; @@ -358,6 +360,8 @@ if ($socid > 0) print ''; } + dol_fiche_head(); + print '
'; if ($isCustomer && $isSupplier) { print ''; @@ -376,9 +380,9 @@ if ($socid > 0) print ''; print "
'.$langs->trans('DiscountType').'
"; - } - dol_fiche_end(); + dol_fiche_end(); + } if ($user->rights->societe->creer) { @@ -404,7 +408,7 @@ if ($socid > 0) /* - * Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) + * List remises fixes client restant en cours (= liees a aucune facture ni ligne de facture) */ print load_fiche_titre($langs->trans("DiscountStillRemaining")); @@ -511,15 +515,14 @@ if ($socid > 0) { print '
'.price($obj->multicurrency_amount_ttc).''; + print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; - //print '   '; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; + print ''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ' 
'.$langs->trans("None").'
'.$langs->trans("None").'
"; @@ -551,7 +556,7 @@ if ($socid > 0) array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, '', 0); } } else @@ -672,9 +677,8 @@ if ($socid > 0) if ($user->rights->societe->creer || $user->rights->facture->creer) { print '
'; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; - //print '   '; - print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_split($langs->trans("SplitDiscount")).''; + print 'rowid.($backtopage ? '&backtopage='.urlencode($backtopage) : '').'">'.img_delete($langs->trans("RemoveDiscount")).''; print ' 
'.$langs->trans("None").'
'.$langs->trans("None").'
"; @@ -701,9 +707,9 @@ if ($socid > 0) $amount1 = price2num($showconfirminfo['amount_ttc'] / 2, 'MT'); $amount2 = ($showconfirminfo['amount_ttc'] - $amount1); $formquestion = array( - 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), - array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), - array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') + 'text' => $langs->trans('TypeAmountOfEachNewDiscount'), + array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'), + array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5') ); $langs->load("dict"); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0); @@ -738,7 +744,7 @@ if ($socid > 0) // Discount linked to invoice lines $sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,"; - $sql .= " rc.fk_facture_source,"; + $sql .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture_source,"; $sql .= " u.login, u.rowid as user_id,"; $sql .= " f.rowid as invoiceid, f.ref,"; $sql .= " fa.ref as invoice_source_ref, fa.type as type"; @@ -890,7 +896,9 @@ if ($socid > 0) } else { - print '
'.$langs->trans("None").'
'.$langs->trans("None").'
"; @@ -1054,7 +1062,7 @@ if ($socid > 0) { print ''.price($obj->multicurrency_amount_ttc).''; } - print ''; + print ''; print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''; print ''; print ' '; @@ -1064,7 +1072,9 @@ if ($socid > 0) } else { - print ''.$langs->trans("None").''; + $colspan = 8; + if (!empty($conf->multicurrency->enabled)) $colspan += 2; + print ''.$langs->trans("None").''; } print ""; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8d43c54cc7c..97668dcba69 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1642,7 +1642,7 @@ if ($action == 'create' && $usercancreate) }); '; } - print ' '.$langs->trans("AddThirdParty").''; + print ' '; print ''; } print ''."\n"; @@ -1734,7 +1734,7 @@ if ($action == 'create' && $usercancreate) print ''; print ''.$langs->trans("Project").''; $numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0); - print '   id).'">'.$langs->trans("AddProject").''; + print ' id).'">'; print ''; print ''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 70a504f23f3..e8dde584661 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1020,7 +1020,7 @@ if ($resql) // Country if (! empty($arrayfields['country.code_iso']['checked'])) { - print ''; + print ''; $tmparray=getCountry($obj->fk_pays, 'all'); print $tmparray['label']; print ''; @@ -1029,7 +1029,7 @@ if ($resql) // Type ent if (! empty($arrayfields['typent.code']['checked'])) { - print ''; + print ''; if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); print $typenArray[$obj->typent_code]; print ''; @@ -1039,7 +1039,7 @@ if ($resql) // Order date if (! empty($arrayfields['c.date_commande']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_commande), 'day'); print ''; if (! $i) $totalarray['nbfield']++; @@ -1047,7 +1047,7 @@ if ($resql) // Plannned date of delivery if (! empty($arrayfields['c.date_delivery']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->date_delivery), 'day'); print ''; if (! $i) $totalarray['nbfield']++; @@ -1116,7 +1116,7 @@ if ($resql) // Billed if (! empty($arrayfields['c.facture']['checked'])) { - print ''.yn($obj->billed).''; + print ''.yn($obj->billed).''; if (! $i) $totalarray['nbfield']++; } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 20014e58767..ced7d258167 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -705,7 +705,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print ''.$generic_commande->LibStatut($objp->fk_statut, $objp->billed, 5).''; // Checkbox - print ''; + print ''; print ''; print ''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index e3413f5b927..e9eca9dafa9 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -301,7 +301,7 @@ print '

'; print '
'; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index eeb662c6168..0980f70df29 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -93,7 +93,6 @@ $search_req_nb = GETPOST("req_nb", 'alpha'); $search_num_releve = GETPOST("search_num_releve", 'alpha'); $search_conciliated = GETPOST("search_conciliated", 'int'); $num_releve = GETPOST("num_releve", "alpha"); -$cat = GETPOST("cat"); if (empty($dateop)) $dateop = -1; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -420,6 +419,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; $options = array(); $buttonreconcile = ''; +$morehtmlref = ''; if ($id > 0 || !empty($ref)) { @@ -458,9 +458,9 @@ if ($id > 0 || !empty($ref)) if ($user->rights->banque->consolidate) { $newparam = $param; $newparam = preg_replace('/search_conciliated=\d+/i', '', $newparam); - $buttonreconcile = ''.$langs->trans("Conciliate").''; + $buttonreconcile = ''.$langs->trans("Conciliate").''; } else { - $buttonreconcile = ''.$langs->trans("Conciliate").''; + $buttonreconcile = ''.$langs->trans("Conciliate").''; } } } @@ -703,7 +703,7 @@ if ($resql) print ''; /*if (! empty($conf->accounting->enabled)) { - print ''; }*/ @@ -739,11 +739,11 @@ if ($resql) print ''; /*if (! empty($conf->accounting->enabled)) { - print ''; }*/ - print ''; @@ -1101,7 +1101,7 @@ if ($resql) print ''; } - print ''; print ''."\n"; } @@ -3008,7 +3008,7 @@ if ($action == 'create') print '
'; $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -3016,7 +3016,7 @@ if ($action == 'create') print '
'; $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -3025,7 +3025,7 @@ if ($action == 'create') print '
'; $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceReplacementDesc"), 1, 'help', '', 0, 3); print $desc; print '
'; @@ -3114,7 +3114,7 @@ if ($action == 'create') if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp = ' '; else $tmp = ' '; $text = ' '; - $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; + $text .= '('.$langs->trans("YouMustCreateInvoiceFromThird").') '; $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); print $desc; print ''."\n"; @@ -3211,7 +3211,6 @@ if ($action == 'create') $rwStyle = ''; } - $retained_warranty = GETPOST('retained_warranty', 'int'); $retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; print ''; } @@ -3909,9 +3908,14 @@ elseif ($id > 0 || !empty($ref)) if ($object->fk_fac_rec_source > 0) { - $tmptemplate = new FactureRec($db); - $result = $tmptemplate->fetch($object->fk_fac_rec_source); - if ($result > 0) print '. '.$langs->trans("GeneratedFromTemplate", $tmptemplate->ref).''; + $tmptemplate = new FactureRec($db); + $result = $tmptemplate->fetch($object->fk_fac_rec_source); + if ($result > 0) { + print '. '.$langs->trans( + "GeneratedFromTemplate", + ''.$tmptemplate->ref.'' + ).''; + } } print ''; @@ -4378,7 +4382,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; print ''; - print ''; + print ''; if (!empty($conf->banque->enabled)) print ''; print ''; print ''; @@ -4419,7 +4423,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; print ''; - print ''; + print ''; if (!empty($conf->banque->enabled)) print ''; print ''; print ''; @@ -4469,7 +4473,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; print ''; - print ''; + print ''; if (!empty($conf->banque->enabled)) print ''; print ''; print ''; @@ -4566,7 +4570,7 @@ elseif ($id > 0 || !empty($ref)) print ''; } print ''; - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['f.frequency']['checked'])) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['f.unit_frequency']['checked'])) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['f.nb_gen_done']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; @@ -587,7 +587,7 @@ if ($resql) // Date last generation if (!empty($arrayfields['f.date_last_gen']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; @@ -595,7 +595,7 @@ if ($resql) // Date next generation if (!empty($arrayfields['f.date_when']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['f.tms']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; @@ -634,13 +634,13 @@ if ($resql) print $hookmanager->resPrint; // Status if (!empty($arrayfields['status']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; } // Action column - print ''; @@ -1175,7 +1175,7 @@ if ($resql) // Type ent if (! empty($arrayfields['typent.code']['checked'])) { - print ''; @@ -1184,7 +1184,7 @@ if ($resql) // Staff if (! empty($arrayfields['staff.code']['checked'])) { - print ''; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index f1cbb613b18..7f0111f7caf 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -587,11 +587,11 @@ if ($object->id > 0) print ''; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -620,11 +620,11 @@ if ($object->id > 0) print ''; print '\n"; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; - print ''; - print '\n"; + print '\n"; print ''; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 0939da3598b..bd749e02dee 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -276,7 +276,7 @@ print '

'; print '
'; print '
'.$langs->trans("Year").''.$langs->trans("Year").''.$langs->trans("NbOfOrders").'%'.$langs->trans("AmountTotal").''.$langs->trans("Credit").''; + print ''; print $langs->trans("AccountAccounting"); print ''; + print ''; print $formaccounting->select_account($search_accountancy_code, 'search_accountancy_code', 1, null, 1, 1, ''); print ''; + print ''; print '
'; print ''; print '
'; + print ''; print ''; print ' '; } - if (!GETPOST('fac_rec', 'int')) print ' '.$langs->trans("AddThirdParty").''; + if (!GETPOST('fac_rec', 'int')) print ' '; print '
'.$langs->trans('RetainedWarranty').''; @@ -3260,7 +3259,7 @@ if ($action == 'create') $langs->load('projects'); print '
'.$langs->trans('Project').''; $numprojet = $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1); - print '   id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'.$langs->trans("AddProject").''; + print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print '
'.$langs->trans('ListOfSituationInvoices').''.$langs->trans('Situation').''.$langs->trans('Situation').''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').'
'.$object->getNomUrl(1).''.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.''.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.''.price($object->total_ht).''.price($object->total_ttc).'
'.$next_invoice->getNomUrl(1).''.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.''.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.''.price($next_invoice->total_ht).''.price($next_invoice->total_ttc).''.price($sign * $objp->amount).''; + print ''; if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) { print 'rowid.'">'; diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 9975357fc23..57138424465 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -564,22 +564,22 @@ if ($resql) } if (!empty($arrayfields['recurring']['checked'])) { - print ''.yn($objp->frequency ? 1 : 0).''.yn($objp->frequency ? 1 : 0).''.($objp->frequency > 0 ? $objp->frequency : '').''.($objp->frequency > 0 ? $objp->frequency : '').''.($objp->frequency > 0 ? $objp->unit_frequency : '').''.($objp->frequency > 0 ? $objp->unit_frequency : '').''; + print ''; print ($objp->frequency > 0 ? $objp->nb_gen_done.($objp->nb_gen_max > 0 ? ' / '.$objp->nb_gen_max : '') : ''.$langs->trans('NA').''); print ''; + print ''; print ($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : ''.$langs->trans('NA').''); print ''; + print ''; print '
'; print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached() ? '' : '').dol_print_date($db->jdate($objp->date_when), 'day').($invoicerectmp->isMaxNbGenReached() ? '' : '') : ''.$langs->trans('NA').''); if (!$invoicerectmp->isMaxNbGenReached()) @@ -612,14 +612,14 @@ if ($resql) } if (!empty($arrayfields['f.datec']['checked'])) { - print '
'; + print ''; print dol_print_date($db->jdate($objp->datec), 'dayhour'); print ''; + print ''; print dol_print_date($db->jdate($objp->tms), 'dayhour'); print ''; + print ''; print $invoicerectmp->getLibStatut(3, 0); print ''; + print ''; if ($user->rights->facture->creer && empty($invoicerectmp->suspended)) { if ($invoicerectmp->isMaxNbGenReached()) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index a7db0fc332e..b4fa97e209e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1166,7 +1166,7 @@ if ($resql) // Country if (! empty($arrayfields['country.code_iso']['checked'])) { - print ''; + print ''; $tmparray=getCountry($obj->fk_pays, 'all'); print $tmparray['label']; print ''; + print ''; if (! is_array($typenArray) || count($typenArray)==0) $typenArray = $formcompany->typent_array(1); print $typenArray[$obj->typent_code]; print ''; + print ''; if (! is_array($staffArray) || count($staffArray)==0) $staffArray = $formcompany->effectif_array(1); print $staffArray[$obj->staff_code]; print '
'.$langs->trans("DateRequest").''.$langs->trans("User").''.$langs->trans("Amount").''.$langs->trans("WithdrawalReceipt").''.$langs->trans("User").''.$langs->trans("Amount").''.$langs->trans("WithdrawalReceipt").' '.$langs->trans("DateProcess").''.$langs->trans("DateProcess").' 
'.dol_print_date($db->jdate($obj->date_demande), 'day')."'.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''.price($obj->amount).''.price($obj->amount).'- '.$langs->trans("OrderWaiting").''.$langs->trans("OrderWaiting").''; print ''; @@ -672,9 +672,9 @@ if ($object->id > 0) print ''.img_object($langs->trans("ShowUser"), 'user').' '.$obj->login.''.price($obj->amount).''.price($obj->amount).''; + print ''; if ($obj->fk_prelevement_bons > 0) { $withdrawreceipt = new BonPrelevement($db); @@ -686,7 +686,7 @@ if ($object->id > 0) print ' '.dol_print_date($db->jdate($obj->date_traite), 'day')."'.dol_print_date($db->jdate($obj->date_traite), 'day')." 
'; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ae6b0855f39..6e815e8c500 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -667,10 +667,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; $tot_ttc += $obj->amount; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 609181dec96..611667cbdfc 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -584,8 +584,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; - print ''; - print ''; + print ''; + print ''; if (!empty($conf->multicurrency->enabled)) { print ''; print ''; @@ -645,7 +645,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print "\n"; // Date - print '\n"; + print '\n"; // Due date if ($objp->dlr > 0) @@ -666,7 +666,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Currency - if (!empty($conf->multicurrency->enabled)) print '\n"; + if (!empty($conf->multicurrency->enabled)) print '\n"; // Multicurrency Price if (!empty($conf->multicurrency->enabled)) diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 9388fbcdd1f..0f760e9197c 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -502,7 +502,7 @@ if ($action == 'new') print ''; // Link to payment - print ''; // Link to bank transaction - print ''; - print ''; print ''; @@ -685,14 +685,14 @@ else while ($objp = $db->fetch_object($resql)) { print ''; - print ''; - print ''; // Date operation - print ''; + print ''; + print ''; // Date operation + print ''; print ''; print ''; print ''; // Link to payment - print ''; // Link to bank transaction - print ''; // Date - print ''; // TODO Use date hour + print ''; // TODO Use date hour // Bank print ''; + print ''; if (!$i) $totalarray['nbfield']++; // Thirdparty diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index cf5a5cc7bd0..1c5e4be20c2 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -121,7 +121,7 @@ if ($resql) print '\n"; print "\n"; print ''; - print ''; print ''; print ''; - print ''; + print ''; print "\n"; $total = 0; @@ -294,7 +294,7 @@ if ($action == 'create') print '"; - print ''; print ''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -267,7 +267,7 @@ if ($resql) // Expected to pay print ''; // Status - print ''; + print ''; // Amount payed print ''; print "\n"; diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 477f925f534..b09e4b9a098 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -156,7 +156,7 @@ if ($result) print ''.$obj->ref."\n"; - print '\n"; + print '\n"; print '\n"; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 625fc0ce04f..aa64f9675e7 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -339,7 +339,7 @@ if ($result) print"\n\n"; print '
'.$langs->trans("Year").''.$langs->trans("Year").''.$langs->trans("NumberOfBills").'%'.$langs->trans("AmountTotal").'
'.$chargestatic->getNomUrl(1).''.dol_print_date($db->jdate($obj->date_ech), 'day').''.dol_print_date($db->jdate($obj->date_ech), 'day').''.price($obj->amount).''.price($obj->sumpaid).''.$chargestatic->getLibStatut(3).''.$chargestatic->getLibStatut(3).'
'.$arraytitle.''.$langs->trans('Date').''.$langs->trans('DateMaxPayment').''.$langs->trans('Date').''.$langs->trans('DateMaxPayment').''.$langs->trans('Currency').''.$langs->trans('MulticurrencyAmountTTC').''.dol_print_date($db->jdate($objp->df), 'day')."'.dol_print_date($db->jdate($objp->df), 'day')."'.$objp->multicurrency_code."'.$objp->multicurrency_code."'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).''; + print ''; $paymentstatic->id = $value["paymentid"]; $paymentstatic->ref = $value["paymentid"]; if ($paymentstatic->id) @@ -515,7 +515,7 @@ if ($action == 'new') } print ''; + print ''; $accountlinestatic->rowid = $value["id"]; if ($accountlinestatic->rowid) { @@ -527,7 +527,7 @@ if ($action == 'new') } print ''; + print ''; print ''; print '
'.$i.''.dol_print_date($db->jdate($objp->date), 'day').''.($objp->num_chq ? $objp->num_chq : ' ').''.$i.''.dol_print_date($db->jdate($objp->date), 'day').''.($objp->num_chq ? $objp->num_chq : ' ').''.dol_trunc($objp->emetteur, 24).''.dol_trunc($objp->banque, 24).''.price($objp->amount).''; + print ''; $paymentstatic->id = $objp->pid; $paymentstatic->ref = $objp->pid; if ($paymentstatic->id) @@ -705,7 +705,7 @@ else } print ''; + print ''; $accountlinestatic->rowid = $objp->rowid; if ($accountlinestatic->rowid) { diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index d928147d35b..dcf04b95a96 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -197,7 +197,7 @@ if ($resql) print ''.dol_print_date($db->jdate($objp->dp), 'day').''.dol_print_date($db->jdate($objp->dp), 'day').''; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 859ed250312..89878df3e2a 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -306,7 +306,7 @@ if ($resql) // Date $dateformatforpayment = 'day'; if (!empty($conf->global->INVOICE_USE_HOURS_FOR_PAYMENT)) $dateformatforpayment = 'dayhour'; - print ''.dol_print_date($db->jdate($objp->dp), $dateformatforpayment).''.dol_print_date($db->jdate($objp->dp), $dateformatforpayment).''.dol_print_date($db->jdate($objp->dp), 'day')."$objp->paiement_type $objp->num_paiement'.price($objp->amount).''; + print ''; if ($objp->statut == 0) { diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index ebf87b91693..fb60b61077e 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -267,7 +267,7 @@ if ($action == 'create') print ''.$langs->trans("Amount").''.$langs->trans("AlreadyPaid").''.$langs->trans("RemainderToPay").''.$langs->trans("Amount").''.$langs->trans("Amount").'
'.price($objp->amount - $sumpaid)."'; + print ''; if ($sumpaid < $objp->amount) { $namef = "amount_".$objp->id; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 5dfd029747b..ae51707ebc6 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -241,7 +241,7 @@ if ($resql) print ''.$langs->trans('Type').''.$langs->trans('Label').''.$langs->trans('ExpectedToPay').''.$langs->trans('Status').''.$langs->trans('Status').''.$langs->trans('PayedByThisPayment').'
'.price($objp->sc_amount).''.$socialcontrib->getLibStatut(4, $objp->amount).''.$socialcontrib->getLibStatut(4, $objp->amount).''.price($objp->amount).'
'.dol_print_date($db->jdate($obj->datec), 'day')."'.dol_print_date($db->jdate($obj->datec), 'day')."'.price($obj->amount)."
'; print ''; - print ''; + print ''; print ''; while ($i < min($num,$limit)) @@ -355,7 +355,7 @@ if ($result) print $bprev->getNomUrl(1); print "\n"; - print '\n"; + print '\n"; print '\n"; diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index a9fd4f1fbbc..40baf8a3d7d 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -241,7 +241,7 @@ if ($result) print '\n"; // Status of requests - print '\n"; print ''; - print ''; - print ''; + print ''; + print ''; print "\n"; $total += $obj->amount; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 2aaca08e69b..e5ba1daffa8 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -192,7 +192,7 @@ if ($result) print '\n"; - print '\n"; + print '\n"; print '\n"; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 87257db6a9d..55bf5e1f022 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -120,7 +120,7 @@ if ($resql) } print ''; - print ''; print "
'.$langs->trans("Ref").''.$langs->trans("Date").''.$langs->trans("Amount").''.$langs->trans("Date").''.$langs->trans("Amount").'
'.dol_print_date($db->jdate($obj->datec),'day')."'.dol_print_date($db->jdate($obj->datec),'day')."'.price($obj->amount,0,$langs,0,0,-1,$conf->currency)."'.price($obj->amount_requested)."'; + print ''; if ($obj->statut == 0) { diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index d44ffdea4a8..4320a0c6094 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -212,8 +212,8 @@ if ($resql) print ''.price($obj->amount)."'.$rej->motifs[$obj->motif].''.yn($obj->afacturer).''.$obj->fk_facture.''.yn($obj->afacturer).''.$obj->fk_facture.'
'.$obj->code_client."'.dol_print_date($db->jdate($obj->datec), 'day')."'.dol_print_date($db->jdate($obj->datec), 'day')."'.price($obj->amount)."
'.$langs->trans("Total").''.$nbtotal.' '; + print ''.$nbtotal.' '; print price($total); print ' 
"; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index b7ee278f02c..ababa20b50a 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -277,7 +277,7 @@ if ($resql) if (! $i) $totalarray['nbfield']++; // Date end period - print ''; + print ''; if ($obj->periode) { print 'jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode), 'day').''; diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 64a116c5ae4..e634907f4e0 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -170,7 +170,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) // Ref payment print ''.$payment_sc_static->getNomUrl(1)."\n"; // Date payment - print ''.dol_print_date($db->jdate($obj->datep), 'day').''; + print ''.dol_print_date($db->jdate($obj->datep), 'day').''; // Type payment print ''; if ($obj->payment_code) print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; @@ -272,7 +272,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $tva_static->ref = $obj->rowid; print ''.$tva_static->getNomUrl(1)."\n"; - print ''.dol_print_date($db->jdate($obj->dm), 'day')."\n"; + print ''.dol_print_date($db->jdate($obj->dm), 'day')."\n"; print ''.price($obj->amount).""; print "\n"; @@ -373,7 +373,7 @@ while ($j < $numlt) $tva_static->ref = $obj->rowid; print ''.$tva_static->getNomUrl(1)."\n"; - print ''.dol_print_date($db->jdate($obj->dp), 'day')."\n"; + print ''.dol_print_date($db->jdate($obj->dp), 'day')."\n"; print ''.price($obj->amount).""; print "\n"; @@ -455,7 +455,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) $sal_static->ref = $obj->rowid; print ''.$sal_static->getNomUrl(1)."\n"; - print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; + print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; print ''.price($obj->amount).""; print "\n"; diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 3416cd553a0..acd58f90217 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -257,7 +257,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT fd.tva_tx AS vatrate,"; $sql .= " fd.product_type AS product_type,"; - $sql .= " cc.label AS country,"; + $sql .= " cc.code, cc.label AS country,"; for ($i = 1; $i <= 12; $i++) { $sql .= " SUM(".$db->ifsql('MONTH(f.datef)='.$i, 'fd.total_ht', '0').") AS month".str_pad($i, 2, '0', STR_PAD_LEFT).","; } @@ -289,7 +289,10 @@ if ($modecompta == 'CREANCES-DETTES') { } else { print ''.$langs->trans("Service").''; } - print ''.$obj->country.''; + // Country + print ''; + print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country; + print ''; for ($i = 0; $i < 12; $i++) { $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START); if ($j > 12) $j -= 12; @@ -335,7 +338,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql2 = "SELECT ffd.tva_tx AS vatrate,"; $sql2 .= " ffd.product_type AS product_type,"; - $sql2 .= " cc.label AS country,"; + $sql2 .= " cc.code, cc.label AS country,"; for ($i = 1; $i <= 12; $i++) { $sql2 .= " SUM(".$db->ifsql('MONTH(ff.datef)='.$i, 'ffd.total_ht', '0').") AS month".str_pad($i, 2, '0', STR_PAD_LEFT).","; } @@ -368,7 +371,9 @@ if ($modecompta == 'CREANCES-DETTES') { } else { print ''.$langs->trans("Service").''; } - print ''.$obj->country.''; + print ''; + print $langs->trans("Country".$obj->code) != "Country".$obj->code ? $langs->trans("Country".$obj->code) : $obj->country; + print ''; for ($i = 0; $i < 12; $i++) { $j = $i + (empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START); if ($j > 12) $j -= 12; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 286e6aeb29a..7e74e013580 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -426,7 +426,7 @@ if (count($amount)) { print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : ' ').''; // Other stats - print ''; + print ''; if (! empty($conf->propal->enabled) && $key>0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 68f9e0d9f99..b6dc847f6a8 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -602,7 +602,7 @@ if (count($amount)) { print ''.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : ' ').''; // Other stats - print ''; + print ''; if (! empty($conf->propal->enabled) && $key>0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index d1c0897d1e0..d6ed2bf054a 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -43,11 +43,16 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); + +$now = dol_now(); +$current_date = dol_getdate($now); +if (empty($conf->global->SOCIETE_FISCAL_MONTH_START)) $conf->global->SOCIETE_FISCAL_MONTH_START = 1; + // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = $current_date['year']; $year_start = $year_current; } else { $year_current = $year; @@ -55,19 +60,36 @@ if (empty($year)) } $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); -// Quarter +// Set default period if not defined if (empty($date_start) || empty($date_end)) // We define date_start and date_end { - $q = GETPOST("q"); + $q = GETPOST("q", "int"); if (empty($q)) { if (GETPOST("month", 'int')) { $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), false); } else { - $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); - if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter + $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); + $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; + } + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { + if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year + $year_start--; + } + } else { + if (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) < 6) { // If perdio started from less than 6 years, we show past year + $year_start--; + } + } + $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); + $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; + } + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); + $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; + } } } else @@ -166,7 +188,7 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); //$periodlink=($year_start?"".img_previous()." ".img_next()."":""); -$description .= $fsearch; +$description .= ($description ? '
' : '').$fsearch; if (!empty($conf->global->TAX_REPORT_EXTRA_REPORT)) { $description .= '
' diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 55a340d7682..8fbf5b1b0fa 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -35,12 +35,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); +$now = dol_now(); +$current_date = dol_getdate($now); +if (empty($conf->global->SOCIETE_FISCAL_MONTH_START)) $conf->global->SOCIETE_FISCAL_MONTH_START = 1; + // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); - if ($conf->global->SOCIETE_FISCAL_MONTH_START > date('m')) $year_current--; + $year_current = $current_date['year']; $year_start = $year_current; } else { $year_current = $year; @@ -48,6 +51,7 @@ if (empty($year)) } $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); +// Set default period if not defined if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $q = GETPOST("q", "int"); @@ -56,8 +60,27 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { - $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); - $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter + $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); + $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; + } + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { + if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year + $year_start--; + } + } else { + if (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) < 6) { // If perdio started from less than 6 years, we show past year + $year_start--; + } + } + $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); + $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; + } + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); + $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; + } } } else diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index db461c4e790..0309139d3d5 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -44,11 +44,15 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); +$now = dol_now(); +$current_date = dol_getdate($now); +if (empty($conf->global->SOCIETE_FISCAL_MONTH_START)) $conf->global->SOCIETE_FISCAL_MONTH_START = 1; + // Date range $year = GETPOST("year", "int"); if (empty($year)) { - $year_current = strftime("%Y", dol_now()); + $year_current = $current_date['year']; $year_start = $year_current; } else { $year_current = $year; @@ -56,7 +60,7 @@ if (empty($year)) } $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); -// Quarter +// Set default period if not defined if (empty($date_start) || empty($date_end)) // We define date_start and date_end { $q = GETPOST("q", "int"); @@ -65,10 +69,27 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } else { - $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); - if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; - elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; + if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter + $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); + $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; + } + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) { // yearly vat + if ($current_date['mon'] < $conf->global->SOCIETE_FISCAL_MONTH_START) { + if (($conf->global->SOCIETE_FISCAL_MONTH_START - $current_date['mon']) > 6) { // If period started from less than 6 years, we show past year + $year_start--; + } + } else { + if (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) < 6) { // If perdio started from less than 6 years, we show past year + $year_start--; + } + } + $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); + $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; + } + elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) { // monthly vat, we take last past complete month + $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -1, 'm'); + $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; + } } } else diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 84fc87d35f8..a742c5c45fd 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -250,11 +250,11 @@ $dolibarr_main_prod='0'; $dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore'; // $dolibarr_main_restrict_ip -// To restrict access to backoffice to some ip addresses only. +// To restrict access to backoffice to some ip addresses only. Use a comma to separate values. // Note: Pages that does not need login (like public pages, web site) are not protected with this. // Default value: '' // Examples: -// $dolibarr_main_restrict_ip='127.0.0.1, 192.168.0.1'; +// $dolibarr_main_restrict_ip='127.0.0.1, ::1, 192.168.0.1'; // $dolibarr_main_restrict_ip=''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 1f262b18f13..ae6bc068628 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -896,7 +896,7 @@ while ($i < min($num, $limit)) // No EMail if (! empty($arrayfields['p.no_email']['checked'])) { - print ''.yn($obj->no_email).''; + print ''.yn($obj->no_email).''; if (! $i) $totalarray['nbfield']++; } if (! empty($conf->socialnetworks->enabled)) { diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 0d718c2abc2..f5f0f822108 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -44,6 +44,7 @@ if ($cancel) $action = ''; } + // Action to add record if ($action == 'add' && !empty($permissiontoadd)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6a26e9ef3a0..35009811fe2 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -772,7 +772,10 @@ if ($massaction == 'confirm_createbills') // Create bills from orders $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $lines[$i]->label, - $array_options + $array_options, + 100, + 0, + $lines[$i]->fk_unit ); if ($result > 0) { diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index ef37981369e..57bbf9eb54d 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -284,7 +284,7 @@ if ($type == 'directory') } elseif ($section === '0') { - if ($module == 'ecm') $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; + if ($module == 'ecm') $textifempty='
'.$langs->trans("DirNotSynchronizedSyncFirst").'

'; else $textifempty = $langs->trans('NoFileFound'); } else $textifempty=($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("ECMSelectASection")); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 3445dd4f6ee..1870d0a7d88 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -278,7 +278,7 @@ if (empty($conf->use_javascript_ajax) || ! empty($conf->global->MAIN_ECM_DISABLE print ''; // Info - print ''; + print ''; $userstatic->id=$val['fk_user_c']; $userstatic->lastname=$val['login_c']; $htmltooltip=''.$langs->trans("ECMSection").': '.$val['label'].'
'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a6084a49f7e..544063bc4c8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -621,7 +621,7 @@ abstract class CommonObject $thirdpartyid = $object->fk_soc; } - $out = ''; + $out = ''; $outdone = 0; $coords = $this->getFullAddress(1, ', ', $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); @@ -682,7 +682,7 @@ abstract class CommonObject $out .= dol_print_phone($this->office_fax, $this->country_code, $contactid, $thirdpartyid, 'AC_FAX', ' ', 'fax', $langs->trans("Fax")); $outdone++; } - $out .= '
'; + if ($out) $out .= '
'; $outdone = 0; if (!empty($this->email)) { @@ -695,32 +695,36 @@ abstract class CommonObject $out .= dol_print_url($this->url, '_blank', 0, 1); $outdone++; } - $out .= '
'; + if (!empty($conf->socialnetworks->enabled)) { + $outsocialnetwork = ''; + if (is_array($this->socialnetworks) && count($this->socialnetworks) > 0) { foreach ($this->socialnetworks as $key => $value) { - $out .= dol_print_socialnetworks($value, $this->id, $object->id, $key); + $outsocialnetwork .= dol_print_socialnetworks($value, $this->id, $object->id, $key); $outdone++; } } else { - if ($this->skype) $out .= dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype'); + if ($this->skype) $outsocialnetwork .= dol_print_socialnetworks($this->skype, $this->id, $object->id, 'skype'); $outdone++; - if ($this->jabberid) $out .= dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber'); + if ($this->jabberid) $outsocialnetwork .= dol_print_socialnetworks($this->jabberid, $this->id, $object->id, 'jabber'); $outdone++; - if ($this->twitter) $out .= dol_print_socialnetworks($this->twitter, $this->id, $object->id, 'twitter'); + if ($this->twitter) $outsocialnetwork .= dol_print_socialnetworks($this->twitter, $this->id, $object->id, 'twitter'); $outdone++; - if ($this->facebook) $out .= dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook'); + if ($this->facebook) $outsocialnetwork .= dol_print_socialnetworks($this->facebook, $this->id, $object->id, 'facebook'); $outdone++; - if ($this->linkedin) $out .= dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin'); + if ($this->linkedin) $outsocialnetwork .= dol_print_socialnetworks($this->linkedin, $this->id, $object->id, 'linkedin'); $outdone++; } + + if ($outsocialnetwork) { + $out .= '
'.$outsocialnetwork.'
'; + } } - $out .= '
'; - $out .= ''; - - return $out; + if ($out) return ''."\n".$out.''."\n"; + else return ''; } /** @@ -4118,7 +4122,7 @@ abstract class CommonObject $i = 0; - print "\n"; + print "\n"; foreach ($this->lines as $line) { //Line extrafield @@ -7317,7 +7321,7 @@ abstract class CommonObject global $conf; $queryarray = array(); - foreach ($this->fields as $field=>$info) // Loop on definition of fields + foreach ($this->fields as $field => $info) // Loop on definition of fields { // Depending on field type ('datetime', ...) if ($this->isDate($info)) @@ -7553,6 +7557,8 @@ abstract class CommonObject { $error++; $this->errors[] = $this->db->lasterror(); + } else { + $this->ref = '(PROV'.$this->id.')'; } } } diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index d449e7a8424..29bb1c24dce 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -28,7 +28,7 @@ */ class DolEditor { - public $tool; // Store the selected tool + public $tool; // Store the selected tool // If using fckeditor public $editor; @@ -66,55 +66,55 @@ class DolEditor */ public function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = true, $okforextendededitor = true, $rows = 0, $cols = 0, $readonly = 0) { - global $conf,$langs; + global $conf, $langs; dol_syslog(get_class($this)."::DolEditor htmlname=".$htmlname." width=".$width." height=".$height." toolbarname=".$toolbarname); - if (! $rows) $rows=round($height/20); - if (! $cols) $cols=($width?round($width/6):80); - $shorttoolbarname=preg_replace('/_encoded$/', '', $toolbarname); + if (!$rows) $rows = round($height / 20); + if (!$cols) $cols = ($width ?round($width / 6) : 80); + $shorttoolbarname = preg_replace('/_encoded$/', '', $toolbarname); // Name of extended editor to use (FCKEDITOR_EDITORNAME can be 'ckeditor' or 'fckeditor') - $defaulteditor='ckeditor'; - $this->tool=empty($conf->global->FCKEDITOR_EDITORNAME)?$defaulteditor:$conf->global->FCKEDITOR_EDITORNAME; - $this->uselocalbrowser=$uselocalbrowser; - $this->readonly=$readonly; + $defaulteditor = 'ckeditor'; + $this->tool = empty($conf->global->FCKEDITOR_EDITORNAME) ? $defaulteditor : $conf->global->FCKEDITOR_EDITORNAME; + $this->uselocalbrowser = $uselocalbrowser; + $this->readonly = $readonly; // Check if extended editor is ok. If not we force textarea if ((empty($conf->fckeditor->enabled) && $okforextendededitor != 'ace') || empty($okforextendededitor)) $this->tool = 'textarea'; - if ($okforextendededitor === 'ace') $this->tool='ace'; + if ($okforextendededitor === 'ace') $this->tool = 'ace'; //if ($conf->dol_use_jmobile) $this->tool = 'textarea'; // ckeditor and ace seems ok with mobile // Define content and some properties if ($this->tool == 'ckeditor') { - $content=dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. + $content = dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. } if ($this->tool == 'fckeditor') { require_once DOL_DOCUMENT_ROOT.'/includes/fckeditor/fckeditor.php'; - $content=dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. + $content = dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. $this->editor = new FCKeditor($htmlname); - $this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/' ; - $this->editor->Value = $content; + $this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/'; + $this->editor->Value = $content; $this->editor->Height = $height; - if (! empty($width)) $this->editor->Width = $width; - $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js - $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser) + if (!empty($width)) $this->editor->Width = $width; + $this->editor->ToolbarSet = $shorttoolbarname; // Profile of this toolbar set is deinfed into theme/mytheme/ckeditor/config.js + $this->editor->Config['AutoDetectLanguage'] = 'true'; // Language of user (browser) $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In'; $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; // Rem: Le forcage de ces 2 parametres ne semble pas fonctionner. // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? - $modulepart='fckeditor'; + $modulepart = 'fckeditor'; $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file='; - $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ; + $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/'; - $this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false'); - $this->editor->Config['ImageBrowser']=($uselocalbrowser?'true':'false'); + $this->editor->Config['LinkBrowser'] = ($uselocalbrowser ? 'true' : 'false'); + $this->editor->Config['ImageBrowser'] = ($uselocalbrowser ? 'true' : 'false'); if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/fckeditor/fckconfig.js')) { @@ -124,15 +124,15 @@ class DolEditor } // Define some properties - if (in_array($this->tool, array('textarea','ckeditor','ace'))) + if (in_array($this->tool, array('textarea', 'ckeditor', 'ace'))) { - $this->content = $content; + $this->content = $content; $this->htmlname = $htmlname; - $this->toolbarname = $shorttoolbarname; + $this->toolbarname = $shorttoolbarname; $this->toolbarstartexpanded = $toolbarstartexpanded; $this->rows = max(ROWS_3, $rows); - $this->cols = (preg_match('/%/', $cols)?$cols:max(40, $cols)); // If $cols is a percent, we keep it, otherwise, we take max - $this->height = $height; + $this->cols = (preg_match('/%/', $cols) ? $cols : max(40, $cols)); // If $cols is a percent, we keep it, otherwise, we take max + $this->height = $height; $this->width = $width; } } @@ -152,45 +152,45 @@ class DolEditor public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '') { // phpcs:enable - global $conf,$langs; + global $conf, $langs; - $fullpage=false; + $fullpage = false; if (isset($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)) { - $disallowAnyContent=empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all + $disallowAnyContent = empty($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT); // Only predefined list of html tags are allowed or all } - $found=0; - $out=''; + $found = 0; + $out = ''; if ($this->tool == 'fckeditor') // not used anymore { - $found=1; + $found = 1; $this->editor->Create(); } - if (in_array($this->tool, array('textarea','ckeditor'))) + if (in_array($this->tool, array('textarea', 'ckeditor'))) { - $found=1; + $found = 1; //$out.= ''; + $out .= ''; - if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax) && ! empty($conf->fckeditor->enabled)) + if ($this->tool == 'ckeditor' && !empty($conf->use_javascript_ajax) && !empty($conf->fckeditor->enabled)) { - if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR', '1'); + if (!defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR', '1'); - if (! empty($conf->global->FCKEDITOR_SKIN)) { + if (!empty($conf->global->FCKEDITOR_SKIN)) { $skin = $conf->global->FCKEDITOR_SKIN; } else { $skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa } - $htmlencode_force=preg_match('/_encoded$/', $this->toolbarname)?'true':'false'; + $htmlencode_force = preg_match('/_encoded$/', $this->toolbarname) ? 'true' : 'false'; - $out.= ''."\n"; - $out.= ''."\n"; + $out .= ' })'.$morejs; + $out .= '});'."\n"; + $out .= ''."\n"; } } @@ -259,19 +259,19 @@ class DolEditor // Warning: ace.js and ext-statusbar.js must be loaded by the parent page. if (preg_match('/^ace/', $this->tool)) { - $found=1; - $format=$option; + $found = 1; + $format = $option; - $out.= "\n".''."\n"; + $out .= "\n".''."\n"; if ($titlecontent) { - $out.= '
'.$titlecontent; - $out.= '   -   '.dol_escape_htmltag($langs->trans("ShowMoreLines")).'     '; - $out.= '
'; - $out.= ''."\n"; + $out .= ''."\n"; } - $out.= '
htmlname.'aceeditorid" style="'.($this->width ? 'width: '.$this->width.'px; ' : '');
+            $out .= ($this->height ? ' height: '.$this->height.'px; ' : '');
             //$out.=" min-height: 100px;";
-            $out.= '">';
-        	$out.= htmlspecialchars($this->content);
-        	$out.= '
'; - $out.= ''; + $out .= '">'; + $out .= htmlspecialchars($this->content); + $out .= ''; + $out .= ''; - $out.= ''."\n"; + $out .= ''."\n"; } if (empty($found)) { - $out.= 'Error, unknown value for tool '.$this->tool.' in DolEditor Create function.'; + $out .= 'Error, unknown value for tool '.$this->tool.' in DolEditor Create function.'; } if ($noprint) return $out; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 23d7e88b45b..7671c50a09c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4117,7 +4117,9 @@ class Form // Now add questions $more .= '
'."\n"; - if (!empty($formquestion['text'])) $more .= ''.$formquestion['text'].''."\n"; + if (!empty($formquestion['text'])) { + $more .= '
'.$formquestion['text'].'
'."\n"; + } foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) @@ -7409,7 +7411,7 @@ class Form if ($urladvanced) $ret.=''; else $ret.=''; } - $ret.='Photo'; + $ret.='Photo'; if ($addlinktofullsize) $ret.=''; } elseif ($altfile && file_exists($dir."/".$altfile)) @@ -7663,7 +7665,8 @@ class Form { global $db, $conf, $langs, $user; - $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; + $out = ''; + $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; $sql .= ' AND entity IN (0,'.getEntity('exp_tax_cat').')'; if (!empty($excludeid)) $sql .= ' AND rowid NOT IN ('.implode(',', $excludeid).')'; $sql .= ' ORDER BY label'; @@ -7752,6 +7755,7 @@ class Form { global $db, $conf, $langs; + $out = ''; $sql = 'SELECT rowid, range_ik FROM '.MAIN_DB_PREFIX.'c_exp_tax_range'; $sql .= ' WHERE entity = '.$conf->entity.' AND active = 1'; @@ -7789,6 +7793,7 @@ class Form { global $db, $langs; + $out = ''; $sql = 'SELECT id, code, label FROM '.MAIN_DB_PREFIX.'c_type_fees'; $sql .= ' WHERE active = 1'; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index e66b2630ea1..2fd1b409ed7 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -973,7 +973,7 @@ class FormMail extends Form $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage); } $out .= ''; - $out .= ''; + $out .= ''; $out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody'); $out .= ''; $out .= ''; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index cdea1c17e01..8ef02b89616 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -376,33 +376,33 @@ class FormTicket } $out = ''; - $out .= '' . $langs->trans("MailFile") . ''; + $out .= ''.$langs->trans("MailFile").''; $out .= ''; // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript - $out .= '' . "\n"; + $out .= ''."\n"; $out .= '' . "\n"; + $out .= ''."\n"; if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { - $out .= '
'; - $out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key]; + $out .= '
'; + $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; if (!$this->withfilereadonly) { - $out .= ' '; + $out .= ' '; } $out .= '
'; } } else { - $out .= $langs->trans("NoAttachedFiles") . '
'; + $out .= $langs->trans("NoAttachedFiles").'
'; } if ($this->withfile == 2) { // Can add other files - $out .= ''; + $out .= ''; $out .= ' '; - $out .= ''; + $out .= ''; } $out .= "\n"; @@ -912,7 +912,7 @@ class FormTicket $checkbox_selected = (GETPOST('private_message', 'alpha') == "1" ? ' checked' : ''); print ' '; print ''; - print ''; + print ''; print $form->textwithpicto('', $langs->trans("TicketMessagePrivateHelp"), 1, 'help'); print ''; } @@ -980,7 +980,7 @@ class FormTicket $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); - print ''; + print ''; print $form->textwithpicto('', $langs->trans("TicketMessageMailIntroHelp"), 1, 'help'); print ''; } @@ -1013,7 +1013,7 @@ class FormTicket include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70); $doleditor->Create(); - print ''; + print ''; if ($user->rights->ticket->write && !$user->socid) { print $form->textwithpicto('', $langs->trans("TicketMessageHelp"), 1, 'help'); } @@ -1030,7 +1030,7 @@ class FormTicket include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); - print ''; + print ''; print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help'); print ''; } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 3b381bc5796..aea79fdea29 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -262,6 +262,7 @@ class Utils if (GETPOST("disable_fk", "alpha") || $usedefault) $param.=" -K"; if (GETPOST("sql_compat", "alpha") && GETPOST("sql_compat", "alpha") != 'NONE') $param.=" --compatible=".escapeshellarg(GETPOST("sql_compat", "alpha")); if (GETPOST("drop_database", "alpha")) $param.=" --add-drop-database"; + if (GETPOST("use_mysql_quick_param", "alpha"))$param.=" --quick"; if (GETPOST("sql_structure", "alpha") || $usedefault) { if (GETPOST("drop", "alpha") || $usedefault) $param.=" --add-drop-table=TRUE"; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 28821f31725..455ae851a54 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -200,7 +200,7 @@ class DoliDBPgsql extends DoliDB } if (preg_match('/[\s\t\(]*(\w*)[\s\t]+bigint.*auto_increment/i', $line, $reg)) { - $newline=preg_replace('/([\s\t\(]*)([a-zA-Z_0-9]*)[\s\t]+int.*auto_increment[^,]*/i', '\\1 \\2 BIGSERIAL PRIMARY KEY', $line); + $newline=preg_replace('/([\s\t\(]*)([a-zA-Z_0-9]*)[\s\t]+bigint.*auto_increment[^,]*/i', '\\1 \\2 BIGSERIAL PRIMARY KEY', $line); //$line = "-- ".$line." replaced by --\n".$newline; $line=$newline; } diff --git a/htdocs/core/get_info.php b/htdocs/core/get_info.php index 013899869ba..c7c7682c884 100644 --- a/htdocs/core/get_info.php +++ b/htdocs/core/get_info.php @@ -125,7 +125,7 @@ else $toprightmenu.=$result; // For backward compatibility // Link to module builder if (! empty($conf->modulebuilder->enabled)) { - $text =''; + $text =''; //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); $text.=''; $text.=''; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 948064d3b5c..288e7058a08 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -254,7 +254,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle } else { - if (! $silent) print ''; + if (! $silent) print ''; if (! $silent) print '
'.$langs->trans("Failed to get max rowid for ".$table)."
"; if (! $silent) print ''; $error++; @@ -339,7 +339,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle $cursor=$reg[1]; if (empty($listofinsertedrowid[$cursor])) { - if (! $silent) print ''; + if (! $silent) print ''; if (! $silent) print '
'.$langs->trans("FileIsNotCorrect")."
"; if (! $silent) print ''; $error++; @@ -396,7 +396,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle // Is it an error we accept if (! in_array($errno, $okerrors)) { - if (! $silent) print ''; + if (! $silent) print ''; if (! $silent) print '
'.$langs->trans("Error")." ".$db->errno().": ".$newsql."
".$db->error()."
"; if (! $silent) print ''."\n"; dol_syslog('Admin.lib::run_sql Request '.($i+1)." Error ".$db->errno()." ".$newsql."
".$db->error(), LOG_ERR); @@ -1434,7 +1434,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') $text = $langs->trans("Value"); print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext'); print ''; - if (empty($strictw3c)) print ''.$langs->trans("Action").''; + if (empty($strictw3c)) print ''.$langs->trans("Action").''; print "\n"; $label=''; @@ -1600,7 +1600,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') // Submit if (empty($strictw3c)) { - print ''; + print ''; print ''; print ""; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index d9bfc7986c1..1ea2dae72a6 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -184,7 +184,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh else print ''; if ($conf->browser->layout == 'phone') print '
'; - else print ''; + else print ''; print ''; + print ''; } // Extra fields @@ -1753,7 +1753,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } // Status - $out .= ''; + $out .= ''; // Actions $out .= ''; @@ -1838,7 +1838,7 @@ function show_subsidiaries($conf, $langs, $db, $object) print ''; print ''; - print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 59037d18525..76e1105f113 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1582,9 +1582,12 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi if (method_exists($object, 'getBannerAddress') && $object->element != 'product' && $object->element != 'bookmark' && $object->element != 'ecm_directories' && $object->element != 'ecm_files') { - $morehtmlref .= '
'; - $morehtmlref .= $object->getBannerAddress('refaddress', $object); - $morehtmlref .= '
'; + $moreaddress = $object->getBannerAddress('refaddress', $object); + if ($moreaddress) { + $morehtmlref .= '
'; + $morehtmlref .= $moreaddress; + $morehtmlref .= '
'; + } } if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && in_array($object->element, array('societe', 'contact', 'member', 'product'))) { @@ -3081,7 +3084,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'address'=> 'address-book', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accountancy'=>'money-check-alt', 'project'=>'sitemap', 'hrm'=>'umbrella-beach', 'members'=>'users', 'ticket'=>'ticket-alt', 'generic'=>'folder-open', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'object_bookmark'=>'star', 'bookmark'=>'star', 'stats' => 'chart-bar', - 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-fork', + 'bank'=>'university', 'close_title'=>'window-close', 'delete'=>'trash', 'edit'=>'pencil', 'filter'=>'filter', 'split'=>'code-branch', 'object_list'=>'list-alt', 'object_calendar'=>'calendar-alt', 'object_calendarweek'=>'calendar-week', 'object_calendarmonth'=>'calendar-alt', 'object_calendarday'=>'calendar-day', 'object_calendarperuser'=>'table', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt' @@ -8132,7 +8135,7 @@ function roundUpToNextMultiple($n, $x = 5) function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '', $params = array()) { $attr = array( - 'class'=>'badge badge-status'.(!empty($mode) ? ' badge-'.$mode : '').(!empty($type) ? ' badge-'.$type : '').(empty($params['css']) ? '' : ' '.$params['css']) + 'class'=>'badge '.(!empty($mode) ? ' badge-'.$mode : '').(!empty($type) ? ' badge-'.$type : '').(empty($params['css']) ? '' : ' '.$params['css']) ); if (empty($html)) { @@ -8153,7 +8156,15 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = ' // Override attr if (!empty($params['attr']) && is_array($params['attr'])) { foreach ($params['attr']as $key => $value) { - $attr[$key] = $value; + if ($key == 'class') { + $attr['class'] .= ' '.$value; + } + elseif ($key == 'classOverride') { + $attr['class'] = $value; + } + else { + $attr[$key] = $value; + } } } @@ -8260,6 +8271,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st elseif (empty($conf->global->MAIN_STATUS_USES_IMAGES) && !empty($displayMode)) { $statusLabelShort = !empty($statusLabelShort) ? $statusLabelShort : $statusLabel; + $dolGetBadgeParams['attr']['class'] = 'badge-status'; + if ($displayMode == 3) { $return = dolGetBadge($statusLabel, '', $statusType, 'dot', $url, $dolGetBadgeParams); } diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index c40e0c1e406..1d1a6b8c7b9 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -23,8 +23,8 @@ */ // Define size of logo small and mini -$maxwidthsmall=270;$maxheightsmall=150; -$maxwidthmini=128;$maxheightmini=72; +$maxwidthsmall = 270; $maxheightsmall = 150; +$maxwidthmini = 128; $maxheightmini = 72; $quality = 80; @@ -37,14 +37,14 @@ $quality = 80; */ function image_format_supported($file) { - $regeximgext='\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.xpm|\.xbm|\.svg'; // See also into product.class.php + $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.xpm|\.xbm|\.svg'; // See also into product.class.php // Case filename is not a format image $reg = array(); - if (! preg_match('/('.$regeximgext.')$/i', $file, $reg)) return -1; + if (!preg_match('/('.$regeximgext.')$/i', $file, $reg)) return -1; // Case filename is a format image but not supported by this PHP - $imgfonction=''; + $imgfonction = ''; if (strtolower($reg[1]) == '.gif') $imgfonction = 'imagecreatefromgif'; if (strtolower($reg[1]) == '.png') $imgfonction = 'imagecreatefrompng'; if (strtolower($reg[1]) == '.jpg') $imgfonction = 'imagecreatefromjpeg'; @@ -52,10 +52,10 @@ function image_format_supported($file) if (strtolower($reg[1]) == '.bmp') $imgfonction = 'imagecreatefromwbmp'; if (strtolower($reg[1]) == '.xpm') $imgfonction = 'imagecreatefromxpm'; if (strtolower($reg[1]) == '.xbm') $imgfonction = 'imagecreatefromxbm'; - if (strtolower($reg[1]) == '.svg') $imgfonction = 'imagecreatefromsvg'; // Never available + if (strtolower($reg[1]) == '.svg') $imgfonction = 'imagecreatefromsvg'; // Never available if ($imgfonction) { - if (! function_exists($imgfonction)) + if (!function_exists($imgfonction)) { // Fonctions de conversion non presente dans ce PHP return 0; @@ -76,21 +76,21 @@ function image_format_supported($file) */ function dol_getImageSize($file, $url = false) { - $ret=array(); + $ret = array(); if (image_format_supported($file) < 0) return $ret; $filetoread = $file; if (!$url) { - $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image + $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image } if ($filetoread) { $infoImg = getimagesize($filetoread); // Recuperation des infos de l'image - $ret['width']=$infoImg[0]; // Largeur de l'image - $ret['height']=$infoImg[1]; // Hauteur de l'image + $ret['width'] = $infoImg[0]; // Largeur de l'image + $ret['height'] = $infoImg[1]; // Hauteur de l'image } return $ret; @@ -112,29 +112,29 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - global $conf,$langs; + global $conf, $langs; dol_syslog("dol_imageResizeOrCrop file=".$file." mode=".$mode." newWidth=".$newWidth." newHeight=".$newHeight." src_x=".$src_x." src_y=".$src_y); // Clean parameters - $file=trim($file); + $file = trim($file); // Check parameters - if (! $file) + if (!$file) { // Si le fichier n'a pas ete indique return 'Bad parameter file'; } - elseif (! file_exists($file)) + elseif (!file_exists($file)) { // Si le fichier passe en parametre n'existe pas return $langs->trans("ErrorFileNotFound", $file); } - elseif(image_format_supported($file) < 0) + elseif (image_format_supported($file) < 0) { return 'This filename '.$file.' does not seem to be an image filename.'; } - elseif(!is_numeric($newWidth) && !is_numeric($newHeight)) + elseif (!is_numeric($newWidth) && !is_numeric($newHeight)) { return 'Wrong value for parameter newWidth or newHeight'; } @@ -147,7 +147,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, return 'Both newHeight or newWidth must be defined for croping'; } - $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image + $filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image $infoImg = getimagesize($filetoread); // Recuperation des infos de l'image $imgWidth = $infoImg[0]; // Largeur de l'image @@ -155,18 +155,18 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, if ($mode == 0) // If resize, we check parameters { - if ($newWidth <= 0) + if ($newWidth <= 0) { - $newWidth=intval(($newHeight / $imgHeight) * $imgWidth); // Keep ratio + $newWidth = intval(($newHeight / $imgHeight) * $imgWidth); // Keep ratio } if ($newHeight <= 0) { - $newHeight=intval(($newWidth / $imgWidth) * $imgHeight); // Keep ratio + $newHeight = intval(($newWidth / $imgWidth) * $imgHeight); // Keep ratio } } - $imgfonction=''; - switch($infoImg[2]) + $imgfonction = ''; + switch ($infoImg[2]) { case 1: // IMG_GIF $imgfonction = 'imagecreatefromgif'; @@ -183,7 +183,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } if ($imgfonction) { - if (! function_exists($imgfonction)) + if (!function_exists($imgfonction)) { // Fonctions de conversion non presente dans ce PHP return 'Resize not possible. This PHP does not support GD functions '.$imgfonction; @@ -191,27 +191,27 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } // Initialisation des variables selon l'extension de l'image - switch($infoImg[2]) + switch ($infoImg[2]) { case 1: // Gif $img = imagecreatefromgif($filetoread); - $extImg = '.gif'; // File name extension of image - $newquality='NU'; // Quality is not used for this format + $extImg = '.gif'; // File name extension of image + $newquality = 'NU'; // Quality is not used for this format break; case 2: // Jpg $img = imagecreatefromjpeg($filetoread); $extImg = '.jpg'; - $newquality=100; // % quality maximum + $newquality = 100; // % quality maximum break; case 3: // Png $img = imagecreatefrompng($filetoread); $extImg = '.png'; - $newquality=0; // No compression (0-9) + $newquality = 0; // No compression (0-9) break; case 4: // Bmp $img = imagecreatefromwbmp($filetoread); $extImg = '.bmp'; - $newquality='NU'; // Quality is not used for this format + $newquality = 'NU'; // Quality is not used for this format break; } @@ -239,7 +239,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } // Initialisation des variables selon l'extension de l'image - switch($infoImg[2]) + switch ($infoImg[2]) { case 1: // Gif $trans_colour = imagecolorallocate($imgThumb, 255, 255, 255); // On procede autrement pour le format GIF @@ -250,7 +250,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, break; case 3: // Png imagealphablending($imgThumb, false); // Pour compatibilite sur certain systeme - $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel + $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel break; case 4: // Bmp $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); @@ -260,7 +260,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, dol_syslog("dol_imageResizeOrCrop: convert image from ($imgWidth x $imgHeight) at position ($src_x x $src_y) to ($newWidth x $newHeight) as $extImg, newquality=$newquality"); //imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee - imagecopyresampled($imgThumb, $img, 0, 0, $src_x, $src_y, $newWidth, $newHeight, ($mode==0?$imgWidth:$newWidth), ($mode==0?$imgHeight:$newHeight)); // Insere l'image de base redimensionnee + imagecopyresampled($imgThumb, $img, 0, 0, $src_x, $src_y, $newWidth, $newHeight, ($mode == 0 ? $imgWidth : $newWidth), ($mode == 0 ? $imgHeight : $newHeight)); // Insere l'image de base redimensionnee $imgThumbName = $file; @@ -269,7 +269,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, //fclose($fp); // Create image on disk - switch($infoImg[2]) + switch ($infoImg[2]) { case 1: // Gif imagegif($imgThumb, $imgThumbName); @@ -286,13 +286,13 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } // Set permissions on file - if (! empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); + if (!empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); // Free memory. This does not delete image. imagedestroy($img); imagedestroy($imgThumb); - clearstatcache(); // File was replaced by a modified one, so we clear file caches. + clearstatcache(); // File was replaced by a modified one, so we clear file caches. return $imgThumbName; } @@ -323,9 +323,8 @@ function dolRotateImage($file_path) function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) { if (function_exists('exif_read_data')) { - $exif = exif_read_data($fileSource); + $exif = @exif_read_data($fileSource); if ($exif && isset($exif['Orientation'])) { - $infoImg = getimagesize($fileSource); // Get image infos $orientation = $exif['Orientation']; @@ -344,7 +343,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) break; } if ($deg) { - if($infoImg[2] === 'IMAGETYPE_PNG') // In fact there is no exif on PNG but just in case + if ($infoImg[2] === 'IMAGETYPE_PNG') // In fact there is no exif on PNG but just in case { imagealphablending($img, false); imagesavealpha($img, true); @@ -352,12 +351,12 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) imagealphablending($img, false); imagesavealpha($img, true); } - else{ + else { $img = imagerotate($img, $deg, 0); } } // then rewrite the rotated image back to the disk as $fileDest - if($fileDest === false){ + if ($fileDest === false) { return $img; } else @@ -366,7 +365,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) // Create image on disk $image = false; - switch($infoImg[2]) + switch ($infoImg[2]) { case IMAGETYPE_GIF: // 1 $image = imagegif($img, $fileDest); @@ -457,7 +456,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $ort = false; if (function_exists('exif_read_data')) { - $exif = exif_read_data($filetoread); + $exif = @exif_read_data($filetoread); if ($exif && !empty($exif['Orientation'])) { $ort = $exif['Orientation']; } @@ -474,8 +473,8 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', //return 'Le fichier '.$file.' ne necessite pas de creation de vignette'; } - $imgfonction=''; - switch($infoImg[2]) + $imgfonction = ''; + switch ($infoImg[2]) { case IMAGETYPE_GIF: // 1 $imgfonction = 'imagecreatefromgif'; @@ -495,7 +494,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } if ($imgfonction) { - if (! function_exists($imgfonction)) + if (!function_exists($imgfonction)) { // Fonctions de conversion non presente dans ce PHP return 'Error: Creation of thumbs not possible. This PHP does not support GD function '.$imgfonction; @@ -503,12 +502,12 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // On cree le repertoire contenant les vignettes - $dirthumb = dirname($file).($outdir?'/'.$outdir:''); // Chemin du dossier contenant les vignettes + $dirthumb = dirname($file).($outdir ? '/'.$outdir : ''); // Chemin du dossier contenant les vignettes dol_mkdir($dirthumb); // Initialisation des variables selon l'extension de l'image - $img=null; - switch($infoImg[2]) + $img = null; + switch ($infoImg[2]) { case IMAGETYPE_GIF: // 1 $img = imagecreatefromgif($filetoread); @@ -516,7 +515,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', break; case IMAGETYPE_JPEG: // 2 $img = imagecreatefromjpeg($filetoread); - $extImg = (preg_match('/\.jpeg$/', $file)?'.jpeg':'.jpg'); // Extension de l'image + $extImg = (preg_match('/\.jpeg$/', $file) ? '.jpeg' : '.jpg'); // Extension de l'image break; case IMAGETYPE_PNG: // 3 $img = imagecreatefrompng($filetoread); @@ -531,12 +530,13 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $extImg = '.bmp'; break; } + if (! is_resource($img)) { dol_syslog('Failed to detect type of image. We found infoImg[2]='.$infoImg[2], LOG_WARNING); return 0; } - + $exifAngle = false; if ($ort && !empty($conf->global->MAIN_USE_EXIF_ROTATION)) { switch($ort) @@ -571,12 +571,12 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', imagealphablending($rotated, false); imagesavealpha($rotated, true); } - else{ + else { $rotated = imagerotate($img, $exifAngle, 0); } // replace image with good orientation - if(!empty($rotated)){ + if (!empty($rotated)) { $img = $rotated; $imgWidth = $trueImgWidth; $imgHeight = $trueImgHeight; @@ -584,14 +584,14 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // Initialisation des dimensions de la vignette si elles sont superieures a l'original - if($maxWidth > $imgWidth){ $maxWidth = $imgWidth; } - if($maxHeight > $imgHeight){ $maxHeight = $imgHeight; } + if ($maxWidth > $imgWidth) { $maxWidth = $imgWidth; } + if ($maxHeight > $imgHeight) { $maxHeight = $imgHeight; } - $whFact = $maxWidth/$maxHeight; // Facteur largeur/hauteur des dimensions max de la vignette - $imgWhFact = $imgWidth/$imgHeight; // Facteur largeur/hauteur de l'original + $whFact = $maxWidth / $maxHeight; // Facteur largeur/hauteur des dimensions max de la vignette + $imgWhFact = $imgWidth / $imgHeight; // Facteur largeur/hauteur de l'original // Fixe les dimensions de la vignette - if($whFact < $imgWhFact) + if ($whFact < $imgWhFact) { // Si largeur determinante $thumbWidth = $maxWidth; @@ -603,11 +603,11 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $thumbHeight = $maxHeight; $thumbWidth = $thumbHeight * $imgWhFact; } - $thumbHeight=round($thumbHeight); - $thumbWidth=round($thumbWidth); + $thumbHeight = round($thumbHeight); + $thumbWidth = round($thumbWidth); // Define target format - if (empty($targetformat)) $targetformat=$infoImg[2]; + if (empty($targetformat)) $targetformat = $infoImg[2]; // Create empty image if ($targetformat == IMAGETYPE_GIF) @@ -634,35 +634,35 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', // Initialisation des variables selon l'extension de l'image // $targetformat is 0 by default, in such case, we keep original extension - switch($targetformat) + switch ($targetformat) { case IMAGETYPE_GIF: // 1 $trans_colour = imagecolorallocate($imgThumb, 255, 255, 255); // On procede autrement pour le format GIF imagecolortransparent($imgThumb, $trans_colour); $extImgTarget = '.gif'; - $newquality='NU'; + $newquality = 'NU'; break; case IMAGETYPE_JPEG: // 2 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); - $extImgTarget = (preg_match('/\.jpeg$/i', $file)?'.jpeg':'.jpg'); - $newquality=$quality; + $extImgTarget = (preg_match('/\.jpeg$/i', $file) ? '.jpeg' : '.jpg'); + $newquality = $quality; break; case IMAGETYPE_PNG: // 3 imagealphablending($imgThumb, false); // Pour compatibilite sur certain systeme - $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel + $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 127); // Keep transparent channel $extImgTarget = '.png'; - $newquality=$quality-100; - $newquality=round(abs($quality-100)*9/100); + $newquality = $quality - 100; + $newquality = round(abs($quality - 100) * 9 / 100); break; case IMAGETYPE_BMP: // 6 // Not supported by PHP GD $extImgTarget = '.bmp'; - $newquality='NU'; + $newquality = 'NU'; break; case IMAGETYPE_WBMP: // 15 $trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0); $extImgTarget = '.bmp'; - $newquality='NU'; + $newquality = 'NU'; break; } if (function_exists("imagefill")) imagefill($imgThumb, 0, 0, $trans_colour); @@ -671,10 +671,10 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', //imagecopyresized($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee imagecopyresampled($imgThumb, $img, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $imgWidth, $imgHeight); // Insere l'image de base redimensionnee - $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i', '', $file); // On enleve extension quelquesoit la casse + $fileName = preg_replace('/(\.gif|\.jpeg|\.jpg|\.png|\.bmp)$/i', '', $file); // On enleve extension quelquesoit la casse $fileName = basename($fileName); //$imgThumbName = $dirthumb.'/'.getImageFileNameForSize(basename($file), $extName, $extImgTarget); // Full path of thumb file - $imgThumbName = getImageFileNameForSize($file, $extName, $extImgTarget); // Full path of thumb file + $imgThumbName = getImageFileNameForSize($file, $extName, $extImgTarget); // Full path of thumb file // Check if permission are ok @@ -682,7 +682,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', //fclose($fp); // Create image on disk - switch($targetformat) + switch ($targetformat) { case IMAGETYPE_GIF: // 1 imagegif($imgThumb, $imgThumbName); @@ -702,7 +702,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', } // Set permissions on file - if (! empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); + if (!empty($conf->global->MAIN_UMASK)) @chmod($imgThumbName, octdec($conf->global->MAIN_UMASK)); // Free memory. This does not delete image. imagedestroy($img); diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 01ebdd277e1..6e9fd42b932 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -163,7 +163,7 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount = $hide=0; if (! is_numeric($key)) { - print ''; + print ''; print ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 22154d40d79..794e7c57a29 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -175,12 +175,12 @@ class doc_generic_order_odt extends ModelePDFCommandes { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index ca2146703bd..e7770981d09 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -170,7 +170,7 @@ class doc_generic_contract_odt extends ModelePDFContract $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/dons/html_cerfafr.html b/htdocs/core/modules/dons/html_cerfafr.html index 65408d80863..31bf444c63b 100644 --- a/htdocs/core/modules/dons/html_cerfafr.html +++ b/htdocs/core/modules/dons/html_cerfafr.html @@ -8,7 +8,7 @@
'; print '
'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 8435271380f..01fe1c848c3 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1199,7 +1199,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') // Status if (!empty($arrayfields['t.statut']['checked'])) { - print '
'.$contactstatic->getLibStatut(5).''.$contactstatic->getLibStatut(5).''.$actionstatic->LibStatut($histo[$key]['percent'], 3, 0, $histo[$key]['datestart']).''.$actionstatic->LibStatut($histo[$key]['percent'], 3, 0, $histo[$key]['datestart']).''.$obj->town.''.$obj->code_client.''; + print ''; print ''; print img_edit(); print '
'; print $key; print ''; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index deac3de6157..fe5d707b10a 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -321,7 +321,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = ' $tmp = explode('.', $val['foreignkey']); if (!empty($tmp[0]) && !empty($tmp[1])) { - $texttoinsert .= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD CONSTRAINT llx_".strtolower($module).'_'.strtolower($objectname)."_".$key." FOREIGN KEY (".$key.") REFERENCES ".$tmp[0]."(".$tmp[1].");"; + $texttoinsert .= "ALTER TABLE llx_".strtolower($module).'_'.strtolower($objectname)." ADD CONSTRAINT llx_".strtolower($module).'_'.strtolower($objectname)."_".$key." FOREIGN KEY (".$key.") REFERENCES llx_".preg_replace('/^llx_/', '', $tmp[0])."(".$tmp[1].");"; $texttoinsert .= "\n"; } } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 66b39809b29..e7a9bd51034 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -134,7 +134,7 @@ function showOnlinePaymentUrl($type, $ref) global $langs; // Load translation files required by the page - $langs->loadLangs(array('payment', 'paybox')); + $langs->loadLangs(array('payment', 'stripe')); $servicename = $langs->transnoentitiesnoconv('Online'); diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index f4efd0c0ee9..d95acc75718 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -51,6 +51,7 @@ * @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default) * @param double $multicurrency_tx Currency rate (1 by default) * @param double $pu_devise Amount in currency + * @param string $multicurrency_code Value of the foreign currency if multicurrency is used ('EUR', 'USD', ...). It will be used for rounding according to currency. * @return array [ * 0=total_ht, * 1=total_vat, (main vat only) @@ -82,7 +83,7 @@ * 25=multicurrency_total_tax1 for total_ht * 26=multicurrency_total_tax2 for total_ht */ -function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array = '', $progress = 100, $multicurrency_tx = 1, $pu_devise = 0) +function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array = '', $progress = 100, $multicurrency_tx = 1, $pu_devise = 0, $multicurrency_code = '') { global $conf,$mysoc,$db; @@ -185,7 +186,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // if there's some localtax including vat, we calculate localtaxes (we will add later) - //If input unit price is 'HT', we need to have the totals with main VAT for a correct calculation + // if input unit price is 'HT', we need to have the totals with main VAT for a correct calculation if ($price_base_type != 'TTC') { $tot_sans_remise_wt = price2num($tot_sans_remise * (1 + ($txtva / 100)), 'MU'); @@ -367,8 +368,31 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // Multicurrency if ($multicurrency_tx != 1) { + if ($multicurrency_code) { + $savMAIN_MAX_DECIMALS_UNIT = $conf->global->MAIN_MAX_DECIMALS_UNIT; + $savMAIN_MAX_DECIMALS_TOT = $conf->global->MAIN_MAX_DECIMALS_TOT; + $savMAIN_ROUNDING_RULE_TOT = $conf->global->MAIN_ROUNDING_RULE_TOT; + + // Set parameter for currency accurency according to the value of $multicurrency_code (this is because a foreign currency may have different rounding rules) + $keyforforeignMAIN_MAX_DECIMALS_UNIT = 'MAIN_MAX_DECIMALS_UNIT_'.$multicurrency_code; + $keyforforeignMAIN_MAX_DECIMALS_TOT = 'MAIN_MAX_DECIMALS_TOT_'.$multicurrency_code; + $keyforforeignMAIN_ROUNDING_RULE_TOT = 'MAIN_ROUNDING_RULE_TOT_'.$multicurrency_code; + if (! empty($conf->global->$keyforforeignMAIN_ROUNDING_RULE_TOT)) { + $conf->global->MAIN_MAX_DECIMALS_UNIT = $keyforforeignMAIN_MAX_DECIMALS_UNIT; + $conf->global->MAIN_MAX_DECIMALS_TOT = $keyforforeignMAIN_MAX_DECIMALS_TOT; + $conf->global->MAIN_ROUNDING_RULE_TOT = $keyforforeignMAIN_ROUNDING_RULE_TOT; + } + } + // Recal function using the multicurrency price as reference price. We must set param $multicurrency_tx to 1 to avoid infinite loop. - $newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0); + $newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0, ''); + + if ($multicurrency_code) { + // Restore setup of currency accurency + $conf->global->MAIN_MAX_DECIMALS_UNIT = $savMAIN_MAX_DECIMALS_UNIT; + $conf->global->MAIN_MAX_DECIMALS_TOT = $savMAIN_MAX_DECIMALS_TOT; + $conf->global->MAIN_ROUNDING_RULE_TOT = $savMAIN_ROUNDING_RULE_TOT; + } $result[16] = $newresult[0]; $result[17] = $newresult[1]; @@ -381,12 +405,6 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $result[24] = $newresult[8]; $result[25] = $newresult[9]; $result[26] = $newresult[10]; - /* - $result[16] = price2num($result[0] * $multicurrency_tx, 'MT'); - $result[17] = price2num($result[1] * $multicurrency_tx, 'MT'); - $result[18] = price2num($result[2] * $multicurrency_tx, 'MT'); - $result[19] = price2num($pu_devise, 'MU'); - */ } else { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 0c0c70b5708..b593a4bc0a0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1645,7 +1645,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $cssweekend = 'weekend'; } - $tableCell = ''; + $tableCell = ''; $placeholder = ''; if ($alreadyspent) { diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 02c5cf8dcf7..f97c6efed1c 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -384,12 +384,13 @@ function dolWebsiteSaveContent($content) /** * Make a redirect to another container. * - * @param string $containerref Ref of container to redirect to (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php'). + * @param string $containerref Ref of container to redirect to (Example: 'mypage' or 'mypage.php'). * @param string $containeraliasalt Ref of alternative aliases to redirect to. * @param int $containerid Id of container. + * @param int $permanent 0=Use temporary redirect 302, 1=Use permanent redirect 301 * @return void */ -function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0) +function redirectToContainer($containerref, $containeraliasalt = '', $containerid = 0, $permanent = 0) { global $db, $website; @@ -436,6 +437,7 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri if ($result > 0) { $currenturi = $_SERVER["REQUEST_URI"]; + $regtmp = array(); if (preg_match('/&pageref=([^&]+)/', $currenturi, $regtmp)) { if ($regtmp[0] == $containerref) @@ -461,6 +463,9 @@ function redirectToContainer($containerref, $containeraliasalt = '', $containeri if ($newurl) { + if ($permanent) { + header("Status: 301 Moved Permanently", false, 301); + } header("Location: ".$newurl); exit; } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index ff83d9136aa..2ef48e94bda 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -86,9 +86,9 @@ function dolSavePageAlias($filealias, $object, $objectpage) * @param WebsitePage $objectpage Object websitepage * @return boolean True if OK */ -function dolSavePageContent($filetpl, $object, $objectpage) +function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) { - global $conf; + global $conf, $db; // Now create the .tpl file (duplicate code with actions updatesource or updatecontent but we need this to save new header) dol_syslog("We regenerate the tpl page filetpl=".$filetpl); @@ -122,7 +122,47 @@ function dolSavePageContent($filetpl, $object, $objectpage) $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; + // Add translation reference (main language) + if ($object->isMultiLang()) { + // Add myself + $tplcontent .= ''."\n"; + // Add page "translation of" + $translationof = $objectpage->fk_page; + if ($translationof) { + $tmppage = new WebsitePage($db); + $tmppage->fetch($translationof); + if ($tmppage->id > 0) { + $tmpshortlangcode = ''; + if ($tmppage->lang) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en + if ($tmpshortlangcode != $shortlangcode) { + $tplcontent .= ''."\n"; + } + } + } + // Add "has translation pages" + $sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$objectpage->id.($translationof ? ", ".$translationof : "").")"; + $resql = $db->query($sql); + if ($resql) + { + $num_rows = $db->num_rows($resql); + if ($num_rows > 0) + { + while ($obj = $db->fetch_object($resql)) + { + $tmpshortlangcode = ''; + if ($obj->lang) $tmpshortlangcode = preg_replace('/[_-].*$/', '', $obj->lang); // en_US or en-US -> en + if ($tmpshortlangcode != $shortlangcode) { + $tplcontent .= ''."\n"; + } + } + } + } + else dol_print_error($db); + } + // Add canonical reference $tplcontent .= ''."\n"; + // Add manifest.json on homepage + $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; $tplcontent .= ''."\n"; diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index beaaf3cc19b..be50e7bb757 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -168,12 +168,12 @@ class doc_generic_bom_odt extends ModelePDFBom { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
- '; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index bb39f88c45d..be264918a89 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -174,12 +174,12 @@ class doc_generic_invoice_odt extends ModelePDFFactures { $texte.=$file['name'].'
'; } - $texte.='
'; + $texte.='
'; } $texte.= ''; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index b15bd41f9bb..db20bf3b2ff 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -594,7 +594,7 @@ class modProduct extends DolibarrModules $this->import_fields_array[$r] = array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 379799a0ac6..4fb5cb175b0 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -563,7 +563,7 @@ class modService extends DolibarrModules $this->import_fields_array[$r] = array(//field order as per structure of table llx_product_fournisseur_price, without optional fields 'sp.fk_product'=>"ProductOrService*", 'sp.fk_soc' => "Supplier*", - 'sp.ref_fourn' => 'SupplierRef', + 'sp.ref_fourn' => 'SupplierRef*', 'sp.quantity' => "QtyMin*", 'sp.tva_tx' => 'VATRate', 'sp.default_vat_code' => 'VATCode', diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index ef61306c692..735fa64bd6e 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -175,12 +175,12 @@ class doc_generic_mo_odt extends ModelePDFMo { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 1477f4d65f3..63e647e113c 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -200,7 +200,7 @@ class printing_printgcp extends PrintingDriver $html.= ''; $html.= ''; $html.= ''; - $html.= ''; + $html.= ''; $html.= ''."\n"; $list = $this->getlistAvailablePrinters(); //$html.= ''; @@ -215,7 +215,7 @@ class printing_printgcp extends PrintingDriver $html.= ''; $html.= ''; // Defaut - $html.= ''; $html.= ''; $html.= ''; - $html.= ''; + $html.= ''; $html.= "\n"; $list = $this->getlistAvailablePrinters(); foreach ($list as $value) { @@ -190,7 +190,7 @@ class printing_printipp extends PrintingDriver $html.= ''; $html.= ''; // Defaut - $html.= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 938d58a4065..488938a725b 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -446,12 +446,12 @@ class doc_generic_project_odt extends ModelePDFProjects { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index a53e7647711..386de7bfdd7 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -406,12 +406,12 @@ class doc_generic_task_odt extends ModelePDFTask { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index b3c26ffd0bb..b955da102ab 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -178,7 +178,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { @@ -208,7 +208,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 3a53e9294df..4391c52d482 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet * Copyright (C) 2018 Frédéric France + * Copyright (C) 2019 Pierre Ardoin * * 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 @@ -257,7 +258,11 @@ class pdf_azur extends ModelePDFPropales { if (!$arephoto) { - $dir = $conf->product->dir_output.'/'.$midir; + if ($conf->product->entity != $objphoto->entity) { + $dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities + } else { + $dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product + } foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 0cd252924f3..e57d4dc2733 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -169,12 +169,12 @@ class doc_generic_reception_odt extends ModelePdfReception { $texte.=$file['name'].'
'; } - $texte.='
'; + $texte.='
'; } $texte.= ''; - $texte.= '
'; $texte.= ''; diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index a9b95c6035f..cafacc6ac57 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -134,7 +134,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texte .= $conf->global->COMPANY_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= ''; - $texte .= ''; $texte .= ''; @@ -158,12 +158,12 @@ class doc_generic_odt extends ModeleThirdPartyDoc { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= ''; - $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 0d6d2e3d420..4d8692822d7 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -194,7 +194,7 @@ class doc_generic_stock_odt extends ModelePDFStock $texte.= ''; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php index bdb5e88bdb8..cfaf1334b5b 100644 --- a/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php @@ -176,12 +176,12 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders { $texte.=$file['name'].'
'; } - $texte.='
'; + $texte.='
'; } $texte.= ''; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 95f7b0e45d0..dcc9457e588 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -180,7 +180,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal { $texte.=$file['name'].'
'; } - $texte.='
'; + $texte.='
'; if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0) { @@ -210,7 +210,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $texte.= ''; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index c788ce0b03c..ebd40b806a5 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -192,7 +192,7 @@ class doc_generic_user_odt extends ModelePDFUser $texte.= ''; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index ef204e50a16..2dbe87bdccf 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -195,7 +195,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $texte.= ''; - $texte.= ''; $texte.= ''; diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 1a92b559560..7ca287625eb 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -113,7 +113,7 @@ else $searchform=$hookmanager->resPrint; print "\n"; print "\n"; -print '
'; +print '
'; print ''; print '
'."\n"; print $searchform; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 5b85887fc20..2c1b5085e89 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -243,8 +243,6 @@ if (!empty($line->remise_percent) && $line->special_code != 3) { $coldisplay++; } -$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); - // Fields for situation invoices if ($this->situation_cycle_ref) { @@ -263,10 +261,10 @@ if ($usemargins && ! empty($conf->margin->enabled) && empty($user->socid))
global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?> - + global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?> - + special_code == 3) { ?> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 1c4487b555d..265268f6e6f 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -190,7 +190,7 @@ if (! empty($morelogincontent)) { trans('SendNewPasswordDesc'); ?> -
+
trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 34c011c34ca..b90da632fac 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -28,31 +28,31 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; // Define $website -if (! is_object($website)) +if (!is_object($website)) { - $website=new Website($db); + $website = new Website($db); $website->fetch(0, $websitekey); } // Define $weblangs -if (! is_object($weblangs)) +if (!is_object($weblangs)) { - $weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice + $weblangs = dol_clone($langs); // TODO Use an object lang from a language set into $website object instead of backoffice } // Define $websitepage if we have $websitepagefile defined -if (! $pageid && ! empty($websitepagefile)) +if (!$pageid && !empty($websitepagefile)) { $pageid = str_replace(array('.tpl.php', 'page'), array('', ''), basename($websitepagefile)); if ($pageid == 'index.php') $pageid = $website->fk_default_home; } -if (! is_object($websitepage)) +if (!is_object($websitepage)) { - $websitepage=new WebsitePage($db); + $websitepage = new WebsitePage($db); } if ($pageid > 0) { $websitepage->fetch($pageid); - if (! defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) + if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) { $weblangs->load("website"); http_response_code(404); @@ -61,6 +61,15 @@ if ($pageid > 0) } } +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { + header("X-Content-Type-Options: nosniff"); + /* TODO Manage allow_frames flag on websitepage. + if (empty($websitepage->allow_frames) && empty($conf->global->WEBSITE_ALLOW_FRAMES_ON_ALL_PAGES)) { + header("X-Frame-Options: SAMEORIGIN"); + } + */ +} + // A lang was forced, so we change weblangs init if (GETPOST('l', 'aZ09')) $weblangs->setDefaultLang(GETPOST('l', 'aZ09')); // A lang was forced, so we check to find if we must make a redirect on translation page @@ -69,13 +78,13 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing //print_r(get_defined_constants(true));exit; if (GETPOST('l', 'aZ09')) { - $sql ="SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page"; - $sql.=" FROM ".MAIN_DB_PREFIX."website_page as wp"; - $sql.=" WHERE wp.fk_website = ".$website->id; - $sql.=" AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid; - if (is_object($websitepage) && $websitepage->fk_page > 0) $sql.=" OR wp.fk_page = ".$websitepage->fk_page." OR wp.rowid = ".$websitepage->fk_page; - $sql.=")"; - $sql.= " AND wp.lang = '".$db->escape(GETPOST('l', 'aZ09'))."'"; + $sql = "SELECT wp.rowid, wp.lang, wp.pageurl, wp.fk_page"; + $sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp"; + $sql .= " WHERE wp.fk_website = ".$website->id; + $sql .= " AND (wp.fk_page = ".$pageid." OR wp.rowid = ".$pageid; + if (is_object($websitepage) && $websitepage->fk_page > 0) $sql .= " OR wp.fk_page = ".$websitepage->fk_page." OR wp.rowid = ".$websitepage->fk_page; + $sql .= ")"; + $sql .= " AND wp.lang = '".$db->escape(GETPOST('l', 'aZ09'))."'"; $resql = $db->query($sql); if ($resql) @@ -103,7 +112,7 @@ if ($_SERVER['PHP_SELF'] != DOL_URL_ROOT.'/website/index.php') // If we browsing } // Show off line message -if (! defined('USEDOLIBARREDITOR') && empty($website->status)) +if (!defined('USEDOLIBARREDITOR') && empty($website->status)) { $weblangs->load("website"); http_response_code(503); diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index dbf35be905b..245026ab2fb 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -821,8 +821,8 @@ class Cronjob extends CommonObject $this->frequency=''; $this->status=0; $this->processing=0; - $this->fk_user_author=''; - $this->fk_user_mod=''; + $this->fk_user_author=0; + $this->fk_user_mod=0; $this->note=''; $this->nbrun=''; $this->maxrun=100; diff --git a/htdocs/custom/README.md b/htdocs/custom/README.md index 3a486e5a4a8..2fc3067f204 100644 --- a/htdocs/custom/README.md +++ b/htdocs/custom/README.md @@ -1,22 +1,27 @@ -# DOLIBARR ERP & CRM custom directory for external modules. +# DOLIBARR ERP & CRM custom directory for external modules This directory is dedicated to store external modules. To use it, just copy here the directory of the module into this directory. -Note: On linux or MAC systems, it is better to unzip/store the external module directory into +Note: On linux or MAC systems, it is better to unzip/store the external module directory into a different place than this directory and just adding a symbolic link here to the htdocs directory of the module. -For example on Linux OS: Get the module from the command -mkdir ~/git; cd ~/git -git clone https://git.framasoft.org/p/newmodule/newmodule.git +For example on Linux OS: Get the module from the command + +`mkdir ~/git; cd ~/git` + +`git clone https://git.framasoft.org/p/newmodule/newmodule.git` + Then create the symbolic link -ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule + +`ln -fs ~/git/newmodule/htdocs /path_to_dolibarr/htdocs/custom/newmodule` WARNING !!! -Check also that the /custom directory is active by adding into dolibarr conf/conf.php file the following +Check also that the /custom directory is active by adding into dolibarr `conf/conf.php` file the following two lines, so dolibarr will also scan /custom directory to find external external modules: +```php $dolibarr_main_url_root_alt='/custom'; $dolibarr_main_document_root_alt='/path_to_dolibarr/htdocs/custom/'; - +``` diff --git a/htdocs/document.php b/htdocs/document.php index f196cb9eda9..c1ed149649e 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -32,24 +32,24 @@ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); +if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); +if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); +if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // For direct external download link, we don't need to load/check we are into a login session -if (isset($_GET["hashp"]) && ! defined("NOLOGIN")) +if (isset($_GET["hashp"]) && !defined("NOLOGIN")) { - if (! defined("NOLOGIN")) define("NOLOGIN", 1); - if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. - if (! defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip + if (!defined("NOLOGIN")) define("NOLOGIN", 1); + if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } // Some value of modulepart can be used to get resources that are public so no login are required. if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { - if (! defined("NOLOGIN")) define("NOLOGIN", 1); - if (! defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. - if (! defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip + if (!defined("NOLOGIN")) define("NOLOGIN", 1); + if (!defined("NOCSRFCHECK")) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. + if (!defined("NOIPCHECK")) define("NOIPCHECK", 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip } /** @@ -71,30 +71,30 @@ function llxFooter() { } -require 'main.inc.php'; // Load $user and permissions +require 'main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; $encoding = ''; -$action=GETPOST('action', 'alpha'); -$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'); -$entity=GETPOST('entity', 'int')?GETPOST('entity', 'int'):$conf->entity; +$action = GETPOST('action', 'alpha'); +$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'); +$entity = GETPOST('entity', 'int') ?GETPOST('entity', 'int') : $conf->entity; // Security check if (empty($modulepart) && empty($hashp)) accessforbidden('Bad link. Bad value for parameter modulepart', 0, 0, 1); if (empty($original_file) && empty($hashp)) accessforbidden('Bad link. Missing identification to find file (original_file or hashp)', 0, 0, 1); -if ($modulepart == 'fckeditor') $modulepart='medias'; // For backward compatibility +if ($modulepart == 'fckeditor') $modulepart = 'medias'; // For backward compatibility -$socid=0; +$socid = 0; if ($user->socid > 0) $socid = $user->socid; // For some module part, dir may be privates -if (in_array($modulepart, array('facture_paiement','unpaid'))) +if (in_array($modulepart, array('facture_paiement', 'unpaid'))) { - if (! $user->rights->societe->client->voir || $socid) $original_file='private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user + if (!$user->rights->societe->client->voir || $socid) $original_file = 'private/'.$user->id.'/'.$original_file; // If user has no permission to see all, output dir is specific to user } @@ -111,27 +111,27 @@ if (in_array($modulepart, array('facture_paiement','unpaid'))) */ // If we have a hash public (hashp), we guess the original_file. -if (! empty($hashp)) +if (!empty($hashp)) { include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; - $ecmfile=new EcmFiles($db); + $ecmfile = new EcmFiles($db); $result = $ecmfile->fetch(0, '', '', '', $hashp); if ($result > 0) { - $tmp = explode('/', $ecmfile->filepath, 2); // $ecmfile->filepath is relative to document directory + $tmp = explode('/', $ecmfile->filepath, 2); // $ecmfile->filepath is relative to document directory // filepath can be 'users/X' or 'X/propale/PR11111' if (is_numeric($tmp[0])) // If first tmp is numeric, it is subdir of company for multicompany, we take next part. { $tmp = explode('/', $tmp[1], 2); } - $moduleparttocheck = $tmp[0]; // moduleparttocheck is first part of path + $moduleparttocheck = $tmp[0]; // moduleparttocheck is first part of path if ($modulepart) // Not required, so often not defined, for link using public hashp parameter. { if ($moduleparttocheck == $modulepart) { // We remove first level of directory - $original_file = (($tmp[1]?$tmp[1].'/':'').$ecmfile->filename); // this is relative to module dir + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir //var_dump($original_file); exit; } else @@ -142,7 +142,7 @@ if (! empty($hashp)) else { $modulepart = $moduleparttocheck; - $original_file = (($tmp[1]?$tmp[1].'/':'').$ecmfile->filename); // this is relative to module dir + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir } } else @@ -155,13 +155,13 @@ if (! empty($hashp)) // Define attachment (attachment=true to force choice popup 'open'/'save as') $attachment = true; if (preg_match('/\.(html|htm)$/i', $original_file)) $attachment = false; -if (isset($_GET["attachment"])) $attachment = GETPOST("attachment", 'alpha')?true:false; -if (! empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment=false; +if (isset($_GET["attachment"])) $attachment = GETPOST("attachment", 'alpha') ?true:false; +if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment = false; // Define mime type $type = 'application/octet-stream'; -if (GETPOST('type', 'alpha')) $type=GETPOST('type', 'alpha'); -else $type=dol_mimetype($original_file); +if (GETPOST('type', 'alpha')) $type = GETPOST('type', 'alpha'); +else $type = dol_mimetype($original_file); // Security: Force to octet-stream if file is a dangerous file if (preg_match('/\.noexe$/i', $original_file)) $type = 'application/octet-stream'; @@ -169,7 +169,7 @@ if (preg_match('/\.noexe$/i', $original_file)) $type = 'application/octet-stream $original_file = str_replace("../", "/", $original_file); // Find the subdirectory name as the reference -$refname=basename(dirname($original_file)."/"); +$refname = basename(dirname($original_file)."/"); // Security check if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); @@ -178,11 +178,11 @@ if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; -$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name +$fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name -if (! empty($hashp)) +if (!empty($hashp)) { - $accessallowed = 1; // When using hashp, link is public so we force $accessallowed + $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; } else @@ -195,14 +195,14 @@ else $resql = $db->query($sqlprotectagainstexternals); if ($resql) { - $num=$db->num_rows($resql); - $i=0; + $num = $db->num_rows($resql); + $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); if ($user->socid != $obj->fk_soc) { - $accessallowed=0; + $accessallowed = 0; break; } $i++; @@ -214,7 +214,7 @@ else // Security: // Limit access if permissions are wrong -if (! $accessallowed) +if (!$accessallowed) { accessforbidden(); } @@ -236,10 +236,10 @@ $filename = preg_replace('/\.noexe$/i', '', $filename); // Output file on browser dol_syslog("document.php download $fullpath_original_file filename=$filename content-type=$type"); -$fullpath_original_file_osencoded=dol_osencode($fullpath_original_file); // New file name encoded in OS encoding charset +$fullpath_original_file_osencoded = dol_osencode($fullpath_original_file); // New file name encoded in OS encoding charset // This test if file exists should be useless. We keep it to find bug more easily -if (! file_exists($fullpath_original_file_osencoded)) +if (!file_exists($fullpath_original_file_osencoded)) { dol_syslog("ErrorFileDoesNotExists: ".$fullpath_original_file); print "ErrorFileDoesNotExists: ".$original_file; @@ -264,8 +264,8 @@ if (!$attachment && !empty($conf->global->MAIN_USE_EXIF_ROTATION) && image_forma $readfile = !$imgres; } -if($readfile){ - header('Content-Length: ' . dol_filesize($fullpath_original_file)); +if ($readfile) { + header('Content-Length: '.dol_filesize($fullpath_original_file)); readfile($fullpath_original_file_osencoded); } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index d38e19e62f5..22b75cd777b 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -121,14 +121,14 @@ class PaymentDonation extends CommonObject } // Clean parameters - if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); + if (isset($this->fk_donation)) $this->fk_donation = (int) $this->fk_donation; if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); if (isset($this->note_public)) $this->note_public=trim($this->note_public); - if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); - if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat); - if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); + if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank; + if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat; + if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif; $totalamount = 0; foreach ($this->amounts as $key => $value) // How payment is dispatch @@ -275,14 +275,14 @@ class PaymentDonation extends CommonObject // Clean parameters - if (isset($this->fk_donation)) $this->fk_donation=trim($this->fk_donation); + if (isset($this->fk_donation)) $this->fk_donation = (int) $this->fk_donation; if (isset($this->amount)) $this->amount=trim($this->amount); if (isset($this->fk_typepayment)) $this->fk_typepayment=trim($this->fk_typepayment); if (isset($this->num_payment)) $this->num_payment=trim($this->num_payment); if (isset($this->note_public)) $this->note_public=trim($this->note_public); - if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank); - if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat); - if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif); + if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank; + if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat; + if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif; // Check parameters // Put here code to add control on parameters values @@ -300,13 +300,16 @@ class PaymentDonation extends CommonObject $sql.= " fk_bank=".(isset($this->fk_bank)?$this->fk_bank:"null").","; $sql.= " fk_user_creat=".(isset($this->fk_user_creat)?$this->fk_user_creat:"null").","; $sql.= " fk_user_modif=".(isset($this->fk_user_modif)?$this->fk_user_modif:"null").""; - $sql.= " WHERE rowid=".$this->id; + $sql.= " WHERE rowid=".(int) $this->id; $this->db->begin(); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + if (! $resql) { + $error++; + $this->errors[]="Error ".$this->db->lasterror(); + } if (! $error) { @@ -358,7 +361,7 @@ class PaymentDonation extends CommonObject if (! $error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url"; - $sql.= " WHERE type='payment_donation' AND url_id=".$this->id; + $sql.= " WHERE type='payment_donation' AND url_id=".(int) $this->id; dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); @@ -372,7 +375,10 @@ class PaymentDonation extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); - if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + if (! $resql) { + $error++; + $this->errors[]="Error ".$this->db->lasterror(); + } } if (! $error) @@ -609,7 +615,7 @@ class PaymentDonation extends CommonObject public function update_fk_bank($id_bank) { // phpcs:enable - $sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET fk_bank = ".(int) $id_bank." WHERE rowid = ".(int) $this->id; dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 6ca66ad18a5..3fed9dd165f 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -215,7 +215,7 @@ if ($action == 'create') print '
'; print ''; - print ''; + print ''; print ''; print '
+
N° 11580*03
DGFIP diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 7dbd3002e33..18ef68550a4 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -175,12 +175,12 @@ class doc_generic_shipment_odt extends ModelePdfExpedition { $texte.=$file['name'].'
'; } - $texte.='
'; + $texte.='
'; } $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'.$langs->trans('GCP_State').''.$langs->trans('GCP_connectionStatus').''.$langs->trans('GCP_Type').''.$langs->trans("Select").''.$langs->trans("Select").'
'.print_r($list,true).'
'.$langs->trans('STATE_'.$printer_det['connectionStatus']).''.$langs->trans('TYPE_'.$printer_det['type']).''; + $html.= ''; if ($conf->global->PRINTING_GCP_DEFAULT == $printer_det['id']) { $html.= img_picto($langs->trans("Default"), 'on'); diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 37659cec199..b8cc6ac3b4c 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -172,7 +172,7 @@ class printing_printipp extends PrintingDriver //$html.= ''.$langs->trans('IPP_Device').''.$langs->trans('IPP_Media').''.$langs->trans('IPP_Supported').''.$langs->trans("Select").''.$langs->trans("Select").'
'.$printer_det->media_default->_value0.''.$langs->trans('MEDIA_IPP_'.$printer_det->media_type_supported->_value1).''; + $html.= ''; if ($conf->global->PRINTIPP_URI_DEFAULT == $value) { $html.= img_picto($langs->trans("Default"), 'on'); } else { diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 5e0cc4d4076..c0fa4d0f6eb 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -194,7 +194,7 @@ class doc_generic_product_odt extends ModelePDFProduct $texte .= ''; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
  '; + $texte .= '  '; $texte .= ''; $texte .= '
'; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
'; + $texte.= ''; $texte.= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte.= '
pa_ht); ?> pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?>pa_ht == 0)?'n/a':price(price2num($line->marge_tx, 'MT')).'%'); ?> marque_tx, null, null, null, null, $rounding).'%'; ?>marque_tx, 'MT')).'%'; ?>
'.$langs->trans("Comments").'
'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 7ec271c84ec..dba7392a9e4 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2804,15 +2804,70 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $fk_prev_id; + /** + * VAT code + * @var string + */ + public $vat_src_code; + + /** + * VAT % + * @var float + */ public $tva_tx; + + /** + * Local tax 1 % + * @var float + */ public $localtax1_tx; + + /** + * Local tax 2 % + * @var float + */ public $localtax2_tx; + + /** + * Quantity + * @var double + */ public $qty; + + /** + * Percent of discount + * @var float + */ public $remise_percent; + + /** + * Total amount without taxes + * @var float + */ public $total_ht; + + /** + * Total amount with taxes + * @var float + */ public $total_ttc; + + /** + * Total amount of taxes + * @var float + */ public $total_tva; + + /** + * Total local tax 1 amount + * @var float + */ public $total_localtax1; + + /** + * Total local tax 2 amount + * @var float + */ public $total_localtax2; /** @@ -2820,8 +2875,24 @@ class SupplierInvoiceLine extends CommonObjectLine */ public $fk_product; + /** + * Type of the product. 0 for product 1 for service + * @var int + */ public $product_type; + + /** + * Label of the product + * @var string + */ public $product_label; + + /** + * List of cumulative options: + * Bit 0: 0 si TVA normal - 1 si TVA NPR + * Bit 1: 0 si ligne normal - 1 si bit discount (link to line into llx_remise_except) + * @var int + */ public $info_bits; /** @@ -2830,8 +2901,22 @@ class SupplierInvoiceLine extends CommonObjectLine public $fk_parent_line; public $special_code; + + /** + * @var int rank of line + */ public $rang; + + /** + * Total local tax 1 amount + * @var float + */ public $localtax1_type; + + /** + * Total local tax 2 amount + * @var float + */ public $localtax2_type; // Multicurrency diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 55d604afaf9..7e659296908 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -534,6 +534,8 @@ CREATE TABLE llx_mrp_production( fk_product integer NOT NULL, fk_warehouse integer, qty integer NOT NULL DEFAULT 1, + qty_frozen smallint DEFAULT 0, + disable_stock_change smallint DEFAULT 0, batch varchar(30), role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation) fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce' @@ -545,6 +547,8 @@ CREATE TABLE llx_mrp_production( import_key varchar(14) ) ENGINE=innodb; +ALTER TABLE llx_mrp_production ADD COLUMN qty_frozen smallint DEFAULT 0; +ALTER TABLE llx_mrp_production ADD COLUMN disable_stock_change smallint DEFAULT 0; ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_mo FOREIGN KEY (fk_mo) REFERENCES llx_mrp_mo (rowid); ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid); ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_stock_movement FOREIGN KEY (fk_stock_movement) REFERENCES llx_stock_mouvement (rowid); @@ -552,3 +556,5 @@ ALTER TABLE llx_mrp_production ADD CONSTRAINT fk_mrp_production_stock_movement F ALTER TABLE llx_mrp_production ADD INDEX idx_mrp_production_fk_mo (fk_mo); ALTER TABLE llx_emailcollector_emailcollector ADD UNIQUE INDEX uk_emailcollector_emailcollector_ref(ref, entity); + +ALTER TABLE llx_website ADD COLUMN use_manifest integer; diff --git a/htdocs/install/mysql/tables/llx_mrp_production.sql b/htdocs/install/mysql/tables/llx_mrp_production.sql index 275acde6aef..b05e261c65b 100644 --- a/htdocs/install/mysql/tables/llx_mrp_production.sql +++ b/htdocs/install/mysql/tables/llx_mrp_production.sql @@ -21,6 +21,8 @@ CREATE TABLE llx_mrp_production( fk_product integer NOT NULL, fk_warehouse integer, qty integer NOT NULL DEFAULT 1, + qty_frozen smallint DEFAULT 0, + disable_stock_change smallint DEFAULT 0, batch varchar(30), role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation) fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce' diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index fc3100b823d..a98be7912f7 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -52,15 +52,15 @@ create table llx_societe email varchar(128), -- socialnetworks text DEFAULT NULL, -- json with socialnetworks - skype varchar(255), -- - twitter varchar(255), -- - facebook varchar(255), -- - linkedin varchar(255), -- - instagram varchar(255), -- - snapchat varchar(255), -- - googleplus varchar(255), -- - youtube varchar(255), -- - whatsapp varchar(255), -- + skype varchar(255), -- deprecated + twitter varchar(255), -- deprecated + facebook varchar(255), -- deprecated + linkedin varchar(255), -- deprecated + instagram varchar(255), -- deprecated + snapchat varchar(255), -- deprecated + googleplus varchar(255), -- deprecated + youtube varchar(255), -- deprecated + whatsapp varchar(255), -- deprecated fk_effectif integer DEFAULT 0, -- fk_typent integer DEFAULT 0, -- diff --git a/htdocs/install/mysql/tables/llx_website.sql b/htdocs/install/mysql/tables/llx_website.sql index b5764565a34..645343544a4 100644 --- a/htdocs/install/mysql/tables/llx_website.sql +++ b/htdocs/install/mysql/tables/llx_website.sql @@ -27,7 +27,8 @@ CREATE TABLE llx_website maincolor varchar(16), maincolorbis varchar(16), status integer DEFAULT 1, - fk_default_home integer, + fk_default_home integer, + use_manifest integer, virtualhost varchar(255), fk_user_creat integer, fk_user_modif integer, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3e4f1b7ad3d..9a165f6c171 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -178,6 +178,8 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Command to disable foreign keys on import CommandsToDisableForeignKeysForImportWarning=Mandatory if you want to be able to restore your sql dump later ExportCompatibility=Compatibility of generated export file +ExportUseMySQLQuickParameter=Use the --quick parameter +ExportUseMySQLQuickParameterHelp=The '--quick' parameter helps limit RAM consumption for large tables. MySqlExportParameters=MySQL export parameters PostgreSqlExportParameters= PostgreSQL export parameters UseTransactionnalMode=Use transactional mode diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 2eb28366a55..4bed22df445 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -53,3 +53,4 @@ CreateMO=Create MO ToConsume=A consommer Manufactured=Fabriqué TheProductXIsAlreadyTheProductToProduce=The product to add is already the product to produce. +ForAQuantityOf1=For a quantity to produce of 1 \ No newline at end of file diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 39cbe6ce6a9..79b152e0bdc 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -250,6 +250,8 @@ OneLinePerUser=One line per user ServiceToUseOnLines=Service to use on lines InvoiceGeneratedFromTimeSpent=Invoice %s has been generated from time spent on project ProjectBillTimeDescription=Check if you enter timesheet on tasks of project AND you plan to generate invoice(s) from the timesheet to bill the customer of the project (do not check if you plan to create invoice that is not based on entered timesheets). +ProjectFollowOpportunity=Follow opportunity +ProjectFollowTasks=Follow tasks UsageOpportunity=Usage: Opportunity UsageTasks=Usage: Tasks UsageBillTimeShort=Usage: Bill time \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 8fa04de8b11..6feebb43740 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -178,6 +178,8 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Commande pour désactiver les clés étrangères à l'importation CommandsToDisableForeignKeysForImportWarning=Requis si vous voulez être en mesure de restaurer votre « dump » SQL plus tard ExportCompatibility=Compatibilité du fichier d'exportation généré +ExportUseMySQLQuickParameter=Utiliser le paramètre --quick +ExportUseMySQLQuickParameterHelp=permet de limiter la consommation de mémoire vive (utile en cas de tables volumineuses) MySqlExportParameters=Paramètres de l'exportation MySQL PostgreSqlExportParameters= Paramètres de l'exportation PostgreSQL UseTransactionnalMode=Utiliser le mode transactionnel diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index eae61993dd6..3acc10fe9d7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -309,7 +309,7 @@ if (!defined('NOLOGIN') && !defined('NOIPCHECK') && !empty($dolibarr_main_restri } if (!$found) { - print 'Access refused by IP protection'; + print 'Access refused by IP protection. Your detected IP is '.$_SERVER['REMOTE_ADDR']; exit; } } @@ -1137,7 +1137,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) header("X-Content-Type-Options: nosniff"); // With the nosniff option, if the server says the content is text/html, the browser will render it as text/html (note that most browsers now force this option to on) if (!defined('XFRAMEOPTIONS_ALLOWALL')) header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks) else header("X-Frame-Options: ALLOWALL"); - //header("X-XSS-Protection: 1"); // XSS protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. + //header("X-XSS-Protection: 1"); // XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. if (!defined('FORCECSP')) { //if (! isset($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY)) @@ -1656,7 +1656,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead // Link to module builder if (!empty($conf->modulebuilder->enabled)) { - $text = ''; + $text = ''; //$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"'); $text .= ''; $text .= ''; diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index a47acb63eec..f65acb2eeda 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -223,8 +223,6 @@ if ($result) print_liste_field_titre("MarkRate", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right '); print "\n"; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); - if ($num > 0) { $group_list = array(); @@ -291,13 +289,13 @@ if ($result) print ''; print "".$group_array['htmlname']."\n"; - print "".price($pv, null, null, null, null, $rounding)."\n"; - print "".price($pa, null, null, null, null, $rounding)."\n"; - print "".price($marge, null, null, null, null, $rounding)."\n"; + print "".price(price2num($pv, 'MT'))."\n"; + print "".price(price2num($pa, 'MT'))."\n"; + print "".price(price2num($marge, 'MT'))."\n"; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '')?'n/a':price(price2num($marginRate, 'MT'))."%")."\n"; if (! empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '')?'n/a':price(price2num($markRate, 'MT'))."%")."\n"; print "\n"; } } diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 149464ceb2f..d54eee43056 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -277,8 +277,6 @@ if ($result) $cumul_achat = 0; $cumul_vente = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); - if ($num > 0) { while ($i < $num /*&& $i < $conf->liste_limit*/) @@ -317,13 +315,13 @@ if ($result) print "".$companystatic->getNomUrl(1, 'margin')."\n"; } - print "".price($pv, null, null, null, null, $rounding)."\n"; - print "".price($pa, null, null, null, null, $rounding)."\n"; - print "".price($marge, null, null, null, null, $rounding)."\n"; + print "".price(price2num($pv, 'MT'))."\n"; + print "".price(price2num($pa, 'MT'))."\n"; + print "".price(price2num($marge, 'MT'))."\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."\n"; if (!empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."\n"; print "\n"; $i++; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 66f42475548..cc6f7fe0ed9 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -252,7 +252,6 @@ if ($result) $cumul_achat = 0; $cumul_vente = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); if ($num > 0) { @@ -303,13 +302,13 @@ if ($result) print "\n"; //print "".$product_static->getNomUrl(1)."\n"; } - print "".price($pv, null, null, null, null, $rounding)."\n"; - print "".price($pa, null, null, null, null, $rounding)."\n"; - print "".price($marge, null, null, null, null, $rounding)."\n"; + print "".price(price2num($pv, 'MT'))."\n"; + print "".price(price2num($pa, 'MT'))."\n"; + print "".price(price2num($marge, 'MT'))."\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."\n"; if (!empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."\n"; print "\n"; $i++; @@ -331,13 +330,13 @@ if ($result) else print ''; print $langs->trans('TotalMargin').""; - print "".price($cumul_vente, null, null, null, null, $rounding)."\n"; - print "".price($cumul_achat, null, null, null, null, $rounding)."\n"; - print "".price($totalMargin, null, null, null, null, $rounding)."\n"; + print "".price(price2num($cumul_vente, 'MT'))."\n"; + print "".price(price2num($cumul_achat, 'MT'))."\n"; + print "".price(price2num($totalMargin, 'MT'))."\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."\n"; if (!empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."\n"; print "\n"; print ""; @@ -358,9 +357,9 @@ $(document).ready(function() { $("div.fiche form").submit(); }); - $("#totalMargin").html("'.price($totalMargin, null, null, null, null, $rounding).'"); - $("#marginRate").html("'.(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%").'"); - $("#markRate").html("'.(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%").'"); + $("#totalMargin").html("'.price(price2num($totalMargin, 'MT')).'"); + $("#marginRate").html("'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%").'"); + $("#markRate").html("'.(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%").'"); }); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index dcb15ea27db..3b53cea29d2 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -188,7 +188,6 @@ if ($id > 0 || !empty($ref)) $cumul_achat = 0; $cumul_vente = 0; $cumul_qty = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); if ($num > 0) { while ($i < $num /*&& $i < $conf->liste_limit*/) { @@ -207,14 +206,14 @@ if ($id > 0 || !empty($ref)) print "".$objp->code_client."\n"; print ""; print dol_print_date($db->jdate($objp->datef), 'day').""; - print "".price($objp->selling_price, null, null, null, null, $rounding)."\n"; - print "".price($objp->buying_price, null, null, null, null, $rounding)."\n"; - print "".price($objp->qty, null, null, null, null, $rounding)."\n"; - print "".price($objp->marge, null, null, null, null, $rounding)."\n"; + print "".price(price2num($objp->selling_price, 'MT'))."\n"; + print "".price(price2num($objp->buying_price, 'MT'))."\n"; + print "".price(price2num($objp->qty, 'MT'))."\n"; + print "".price(price2num($objp->marge, 'MT'))."\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."\n"; if (!empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."\n"; print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5).''; print "\n"; $i++; @@ -239,14 +238,14 @@ if ($id > 0 || !empty($ref)) } print ''; print ''.$langs->trans('TotalMargin').""; - print ''.price($cumul_vente, null, null, null, null, $rounding)."\n"; - print ''.price($cumul_achat, null, null, null, null, $rounding)."\n"; - print ''.price($cumul_qty, null, null, null, null, $rounding)."\n"; - print ''.price($totalMargin, null, null, null, null, $rounding)."\n"; + print ''.price(price2num($cumul_vente, 'MT'))."\n"; + print ''.price(price2num($cumul_achat, 'MT'))."\n"; + print ''.price(price2num($cumul_qty, 'MT'))."\n"; + print ''.price(price2num($totalMargin, 'MT'))."\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) - print ''.(($marginRate === '') ? 'n/a' : price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print ''.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."\n"; if (!empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '') ? 'n/a' : price(price2num($markRate, 'MT'))."%")."\n"; print ' '; print "\n"; print ""; @@ -264,9 +263,9 @@ if ($id > 0 || !empty($ref)) print ' '; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 1edd5349467..0b4ab1b2da2 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -192,8 +192,6 @@ if ($socid > 0) $cumul_achat = 0; $cumul_vente = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); - if ($num > 0) { while ($i < $num /*&& $i < $conf->liste_limit*/) @@ -216,13 +214,13 @@ if ($socid > 0) print "\n"; print ""; print dol_print_date($db->jdate($objp->datef), 'day').""; - print "".price($objp->selling_price, null, null, null, null, $rounding)."\n"; - print "".price(($objp->type == 2 ? -1 : 1) * $objp->buying_price, null, null, null, null, $rounding)."\n"; - print "".$sign.price($objp->marge, null, null, null, null, $rounding)."\n"; + print "".price(price2num($objp->selling_price, 'MT'))."\n"; + print "".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))."\n"; + print "".$sign.price(price2num($objp->marge, 'MT'))."\n"; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '')?'n/a':$sign.price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '')?'n/a':$sign.price(price2num($marginRate, 'MT'))."%")."\n"; if (! empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '')?'n/a':price(price2num($markRate, 'MT'))."%")."\n"; print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5).''; print "\n"; $i++; @@ -248,13 +246,13 @@ if ($socid > 0) // Total print ''; print ''.$langs->trans('TotalMargin').""; - print "".price($cumul_vente, null, null, null, null, $rounding)."\n"; - print "".price($cumul_achat, null, null, null, null, $rounding)."\n"; - print "".price($totalMargin, null, null, null, null, $rounding)."\n"; + print "".price(price2num($cumul_vente, 'MT'))."\n"; + print "".price(price2num($cumul_achat, 'MT'))."\n"; + print "".price(price2num($totalMargin, 'MT'))."\n"; if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - print "".(($marginRate === '')?'n/a':price($marginRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($marginRate === '')?'n/a':price(price2num($marginRate, 'MT'))."%")."\n"; if (! empty($conf->global->DISPLAY_MARK_RATES)) - print "".(($markRate === '')?'n/a':price($markRate, null, null, null, null, $rounding)."%")."\n"; + print "".(($markRate === '')?'n/a':price(price2num($markRate, 'MT'))."%")."\n"; print ' '; print "\n"; } @@ -277,9 +275,9 @@ else print ' '; diff --git a/htdocs/modulebuilder/README.md b/htdocs/modulebuilder/README.md index e5d9e63d7a3..7bafab32ae3 100644 --- a/htdocs/modulebuilder/README.md +++ b/htdocs/modulebuilder/README.md @@ -7,9 +7,7 @@ has to offer for module development. If you don't need to develop your own module/application, you just don't need this. - -After enabling this module, you should find features to generate or edit modules/application from menu *Home - Admin tools - Module builder* - +After enabling this module, you should find features to generate or edit modules/application from menu *Home - Admin tools - Module builder* Documentation ------------- diff --git a/htdocs/modulebuilder/template/ChangeLog.md b/htdocs/modulebuilder/template/ChangeLog.md index 99f4f673c0c..effcde148d2 100644 --- a/htdocs/modulebuilder/template/ChangeLog.md +++ b/htdocs/modulebuilder/template/ChangeLog.md @@ -1,5 +1,5 @@ -# CHANGELOG MYMODULE FOR DOLIBARR ERP CRM +# CHANGELOG MYMODULE FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) ## 1.0 -Initial version +Initial version diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index 0fcd76f178e..1472929c043 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -1,29 +1,27 @@ -# MYMODULE FOR DOLIBARR ERP CRM +# MYMODULE FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) ## Features + Description... -Other modules are available on Dolistore.com. - - +Other modules are available on [Dolistore.com](https://www.dolistore.com>). ## Translations -Translations can be define manually by editing files into directories *langs*. +Translations can be define manually by editing files into directories *langs*. - - ## Licenses -**Main code** +### Main code GPLv3 or (at your option) any later version. See file COPYING for more information. -**Documentation** +### Documentation All texts and readmes are licensed under GFDL. diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index db6462eb90a..6b1fd839e07 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -175,12 +175,12 @@ class doc_generic_myobject_odt extends ModelePDFMyObject { $texte .= $file['name'].'
'; } - $texte .= '
'; + $texte .= '
'; } $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= $langs->trans("ExampleOfDirectoriesForModelGen"); $texte .= ''; $texte .= ''; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index cf8e45b5901..44b3f4cab4e 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -120,7 +120,15 @@ class Mo extends CommonObject public $qty; public $fk_warehouse; public $fk_soc; + + /** + * @var string public note + */ public $note_public; + + /** + * @var string private note + */ public $note_private; /** @@ -157,32 +165,32 @@ class Mo extends CommonObject /** * @var int Name of subtable line */ - //public $table_element_line = 'mrp_moline'; + public $table_element_line = 'mo_production'; /** * @var int Field with ID of parent key if this field has a parent */ - //public $fk_element = 'fk_mo'; + public $fk_element = 'fk_mo'; /** * @var int Name of subtable class that manage subtable lines */ - //public $class_element_line = 'Moline'; + public $class_element_line = 'MoLine'; /** * @var array List of child tables. To test if we can delete object. */ - //protected $childtables=array(); + protected $childtables=array(); /** * @var array List of child tables. To know object to delete on cascade. */ - //protected $childtablesoncascade=array('mrp_modet'); + protected $childtablesoncascade=array('mrp_production'); /** * @var MoLine[] Array of subtable lines */ - //public $lines = array(); + public $lines = array(); @@ -231,13 +239,57 @@ class Mo extends CommonObject */ public function create(User $user, $notrigger = false) { + global $conf; + + $error = 0; + $this->db->begin(); $result = $this->createCommon($user, $notrigger); + if ($result <= 0) { + $error++; + } // Insert lines in mrp_production table + if (! $error && $this->fk_bom > 0) + { + include_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; + $bom = new Bom($this->db); + $bom->fetch($this->fk_bom); + if ($bom->id > 0) + { + foreach($bom->lines as $line) + { + $moline = new MoLine($this->db); - if ($result > 0) { + $moline->fk_mo = $this->id; + $moline->qty = $line->qty * $this->qty * $bom->efficiency; + if ($moline->qty <= 0) { + $error++; + $this->error = "BadValueForquantityToConsume"; + break; + } + else { + $moline->fk_product = $line->fk_product; + $moline->role = 'toconsume'; + $moline->position = $line->position; + $moline->qty_frozen = $line->qty_frozen; + $moline->disable_stock_change = $line->disable_stock_change; + + $resultline = $moline->create($user); + if ($resultline <= 0) { + $error++; + $this->error = $moline->error; + $this->errors = $moline->errors; + dol_print_error($this->db, $moline->error, $moline->errors); + break; + } + } + } + } + } + + if (! $error) { $this->db->commit(); } else { $this->db->rollback(); @@ -772,7 +824,7 @@ class Mo extends CommonObject { foreach ($this->lines as $line) { - if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + if (is_object($hookmanager)) { if (empty($line->fk_parent_line)) { @@ -838,8 +890,232 @@ class Mo extends CommonObject /** * Class MoLine. You can also remove this and generate a CRUD class for lines objects. */ -class MoLine +class MoLine extends CommonObjectLine { - // To complete with content of an object MoLine - // We should have a field rowid, fk_mo and position + /** + * @var string ID to identify managed object + */ + public $element = 'mrp_production'; + + /** + * @var string Name of table without prefix where object is stored + */ + public $table_element = 'mrp_production'; + + /** + * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + */ + public $ismultientitymanaged = 0; + + /** + * @var int Does moline support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 0; + + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'fk_mo' =>array('type'=>'integer', 'label'=>'Fk mo', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15), + 'position' =>array('type'=>'integer', 'label'=>'Position', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), + 'fk_product' =>array('type'=>'integer', 'label'=>'Fk product', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), + 'fk_warehouse' =>array('type'=>'integer', 'label'=>'Fk warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>30), + 'qty' =>array('type'=>'integer', 'label'=>'Qty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), + 'qty_frozen' => array('type'=>'smallint', 'label'=>'QuantityFrozen', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>105, 'css'=>'maxwidth50imp', 'help'=>'QuantityConsumedInvariable'), + 'disable_stock_change' => array('type'=>'smallint', 'label'=>'DisableStockChange', 'enabled'=>1, 'visible'=>1, 'default'=>0, 'position'=>108, 'css'=>'maxwidth50imp', 'help'=>'DisableStockChangeHelp'), + 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>140), + 'role' =>array('type'=>'varchar(10)', 'label'=>'Role', 'enabled'=>1, 'visible'=>-1, 'position'=>145), + 'fk_mrp_production' =>array('type'=>'integer', 'label'=>'Fk mrp production', 'enabled'=>1, 'visible'=>-1, 'position'=>150), + 'fk_stock_movement' =>array('type'=>'integer', 'label'=>'Fk stock movement', 'enabled'=>1, 'visible'=>-1, 'position'=>155), + 'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>160), + 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>165), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'Fk user creat', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>170), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>-1, 'position'=>175), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportKey', 'enabled'=>1, 'visible'=>-1, 'position'=>180), + ); + + public $rowid; + public $fk_mo; + public $position; + public $fk_product; + public $fk_warehouse; + public $qty; + public $qty_frozen; + public $disable_stock_change; + public $batch; + public $role; + public $fk_mrp_production; + public $fk_stock_movement; + public $date_creation; + public $tms; + public $fk_user_creat; + public $fk_user_modif; + public $import_key; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) + { + if (isset($val['enabled']) && empty($val['enabled'])) + { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) + { + foreach($this->fields as $key => $val) + { + if (is_array($val['arrayofkeyval'])) + { + foreach($val['arrayofkeyval'] as $key2 => $val2) + { + $this->fields[$key]['arrayofkeyval'][$key2]=$langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + return $this->createCommon($user, $notrigger); + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + $result = $this->fetchCommon($id, $ref); + if ($result > 0 && !empty($this->table_element_line)) $this->fetchLines(); + return $result; + } + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { + global $conf; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $records = array(); + + $sql = 'SELECT '; + $sql .= $this->getFieldList(); + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; + else $sql .= ' WHERE 1 = 1'; + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.rowid') { + $sqlwhere[] = $key.'='.$value; + } + elseif (strpos($key, 'date') !== false) { + $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + } + elseif ($key == 'customsql') { + $sqlwhere[] = $value; + } + else { + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= ' AND ('.implode(' '.$filtermode.' ', $sqlwhere).')'; + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if (!empty($limit)) { + $sql .= ' '.$this->db->plimit($limit, $offset); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < min($limit, $num)) + { + $obj = $this->db->fetch_object($resql); + + $record = new self($this->db); + $record->setVarsFromFetchObj($obj); + + $records[$record->id] = $record; + + $i++; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error '.$this->db->lasterror(); + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); + } } diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 5822ce0d170..669102487d5 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -136,8 +136,9 @@ if ($object->id > 0) // ------------------------------------------------------------ $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; + $morehtmlref = ''; /* + $morehtmlref = '
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); @@ -175,9 +176,9 @@ if ($object->id > 0) $morehtmlref.=''; } } - }*/ + } $morehtmlref .= '
'; - + */ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index baa4c09725f..f22c42140f5 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -93,10 +93,13 @@ if (GETPOST('fk_bom', 'int')) { $objectbom->fetch(GETPOST('fk_bom', 'int')); - $_POST['fk_product'] = $objectbom->fk_product; - $_POST['qty'] = $objectbom->qty; - $_POST['fk_warehouse'] = $objectbom->fk_warehouse; - $_POST['note_private'] = $objectbom->note_private; + if ($action != 'add') { + // We force calling parameters if we are not in the submit of creation of MO + $_POST['fk_product'] = $objectbom->fk_product; + $_POST['qty'] = $objectbom->qty; + $_POST['fk_warehouse'] = $objectbom->fk_warehouse; + $_POST['note_private'] = $objectbom->note_private; + } } // Security check - Protection if external user @@ -279,7 +282,7 @@ if ($action == 'create') print '
'; if (GETPOST('fk_bom', 'int') > 0) { - print load_fiche_titre($langs->trans("ToConsume")); + print load_fiche_titre($langs->trans("ToConsume").' ('.$langs->trans("ForAQuantityOf1").')'); print '
'; print ''; @@ -501,9 +504,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { print '
'; + + print ''; } - if (!empty($object->lines)) + /*if (!empty($object->lines)) { $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/mrp/tpl'); } @@ -519,7 +524,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } - } + } */ if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { @@ -527,6 +532,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ''; + print "\n"; } diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 1a9fbe278a9..c177012a201 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -89,8 +89,9 @@ if ($id > 0 || ! empty($ref)) // ------------------------------------------------------------ $linkback = '' . $langs->trans("BackToList") . ''; - $morehtmlref='
'; + $morehtmlref = ''; /* + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); @@ -128,9 +129,9 @@ if ($id > 0 || ! empty($ref)) $morehtmlref.=''; } } - }*/ + } $morehtmlref.='
'; - + */ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 28800d23bd2..0fc427ebea1 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -326,13 +326,19 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } + $object->fetchLines(); + print '
'; if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
TODO...
'; + print '
'; + + print ''; + + //var_dump($object->lines); } - if (!empty($object->lines)) + /*if (!empty($object->lines)) { $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/mrp/tpl'); } @@ -348,7 +354,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $parameters = array(); $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } - } + }*/ if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 7bb775e790e..a9b726a646b 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -993,7 +993,7 @@ for ($i = 0; $i < $nbcolonnes + 1; $i++) // Show line total print ''."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; for ($i = 0; $i < $nbcolonnes; $i++) { $showsumfor = isset($sumfor[$i]) ? $sumfor[$i] : ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b419185d84e..089b71a7d4a 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -995,7 +995,7 @@ SCRIPT; print ''; // Barcode type - print ''; if (!$i) $totalarray['nbfield']++; @@ -972,7 +972,7 @@ if ($resql) // Length if (!empty($arrayfields['p.length']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; @@ -980,7 +980,7 @@ if ($resql) // Surface if (!empty($arrayfields['p.surface']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; @@ -988,7 +988,7 @@ if ($resql) // Volume if (!empty($arrayfields['p.volume']['checked'])) { - print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index c02f2149de0..c102e89898c 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1350,7 +1350,8 @@ if ($action == 'edit_price' && $object->getRights()->creer) { print ''; print ''; // VAT diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index e819110c344..4299a1db53b 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -228,9 +228,9 @@ if ($id > 0 || ! empty($ref)) print "\n"; print ''; print "\n"; - print '"; - print '\n"; + print '\n"; print '\n"; print ''; print "\n"; @@ -241,7 +241,7 @@ if ($id > 0 || ! empty($ref)) if ($num < $limit) print ''; else print ''; print ''; - print ''; + print ''; print ''; print ''; print "
TODO...
'.$langs->trans("Total").''.$langs->trans("Total").''; + print ''; $productfourn->barcode_type = !empty($productfourn->fk_barcode_type) ? $productfourn->fk_barcode_type : 0; $productfourn->fetch_barcode(); print $productfourn->barcode_type_label ? $productfourn->barcode_type_label : ($productfourn->barcode ? '
'.$langs->trans("SetDefaultBarcodeType").'
' : ''); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 05cc5752777..3aba9ba35bb 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -488,7 +488,7 @@ if ($resql) { $oldtype = $type; $params = array(); - if ($type === "") $params['forcenohideoftext']=1; + if ($type === "") $params['forcenohideoftext'] = 1; if ($type === "") { $newcardbutton .= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', 1, $params); $type = Product::TYPE_SERVICE; @@ -853,7 +853,7 @@ if ($resql) $product_static->id = $obj->rowid; $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; // deprecated + $product_static->ref_fourn = $obj->ref_supplier; // deprecated $product_static->ref_supplier = $obj->ref_supplier; $product_static->label = $obj->label; $product_static->type = $obj->fk_product_type; @@ -886,7 +886,7 @@ if ($resql) { $option = 'nobatch'; if (empty($arrayfields['stock_virtual']['checked'])) $option .= ',novirtual'; - $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() + $product_static->load_stock($option); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock() } } @@ -964,7 +964,7 @@ if ($resql) // Weight if (!empty($arrayfields['p.weight']['checked'])) { - print '
'; + print ''; print $obj->weight; print ''; + print ''; print $obj->length; print ''; + print ''; print $obj->surface; print ''; + print ''; print $obj->volume; print '
'; - print $form->textwithpicto($langs->trans('SellingPrice').' '.$i, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); + $text = $langs->trans('SellingPrice').' '.$i; + print $form->textwithpicto($text, $langs->trans("PrecisionUnitIsLimitedToXDecimals", $conf->global->MAIN_MAX_DECIMALS_UNIT), 1, 1); print ''.$societestatic->getNomUrl(1).'".$objp->code_client."'; + print ''; print dol_print_date($db->jdate($objp->date_commande), 'dayhour')."'.$objp->qty."'.$objp->qty."'.price($objp->total_ht)."'.$orderstatic->LibStatut($objp->statut, $objp->facture, 5).'
'.$langs->trans("Total").''.$langs->trans("Totalforthispage").''.$total_qty.''.$total_qty.''.price($total_ht).'
"; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index ae3b642355a..05a86f3e25b 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -236,9 +236,9 @@ if ($id > 0 || ! empty($ref)) { print "\n"; print '' . $societestatic->getNomUrl(1) . ''; print "" . $objp->code_client . "\n"; - print ''; + print ''; print dol_print_date($db->jdate($objp->date_commande), 'dayhour') . ""; - print '' . $objp->qty . "\n"; + print '' . $objp->qty . "\n"; print '' . price($objp->total_ht) . "\n"; print '' . $supplierorderstatic->getLibStatut(4) . ''; print "\n"; @@ -249,7 +249,7 @@ if ($id > 0 || ! empty($ref)) { if ($num < $limit) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; print ''; - print '' . $total_qty . ''; + print '' . $total_qty . ''; print '' . price($total_ht) . ''; print ''; print ""; diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 8a14c3f19a4..7c21fb60a15 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -211,9 +211,9 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($db->jdate($objp->date_contrat), 'dayhour').""; //print "".price($objp->total_ht)."\n"; //print ''; - print ''.($objp->nb_initial>0?$objp->nb_initial:'').''; - print ''.($objp->nb_running+$objp->nb_late>0?$objp->nb_running+$objp->nb_late:'').''; - print ''.($objp->nb_closed>0?$objp->nb_closed:'').''; + print ''.($objp->nb_initial>0?$objp->nb_initial:'').''; + print ''.($objp->nb_running+$objp->nb_late>0?$objp->nb_running+$objp->nb_late:'').''; + print ''.($objp->nb_closed>0?$objp->nb_closed:'').''; //$contratstatic->LibStatut($objp->statut,5).''; print "\n"; $i++; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 6c5379d1ddb..7bb784f5031 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -251,9 +251,9 @@ if ($id > 0 || ! empty($ref)) print "\n"; print ''.$societestatic->getNomUrl(1).''; print "".$objp->code_client."\n"; - print ''; + print ''; print dol_print_date($db->jdate($objp->datef), 'dayhour').""; - print ''.$objp->qty."\n"; + print ''.$objp->qty."\n"; print ''.price($objp->total_ht)."\n"; print ''.$invoicestatic->LibStatut($objp->paye, $objp->statut, 5, $paiement, $objp->type).''; print "\n"; @@ -264,7 +264,7 @@ if ($id > 0 || ! empty($ref)) if ($num < $limit) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; print ''; - print ''.$total_qty.''; + print ''.$total_qty.''; print ''.price($total_ht).''; print ''; print ""; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 70643e9c996..c1caa90a8d3 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -235,9 +235,9 @@ if ($id > 0 || ! empty($ref)) print "\n"; print '' . $societestatic->getNomUrl(1) . ''; print "" . $objp->code_client . "\n"; - print ''; + print ''; print dol_print_date($db->jdate($objp->datef), 'dayhour') . ""; - print '' . $objp->qty . "\n"; + print '' . $objp->qty . "\n"; print '' . price($objp->line_total_ht) . "\n"; print '' . $supplierinvoicestatic->LibStatut($objp->paye, $objp->statut, 5) . ''; print "\n"; @@ -248,7 +248,7 @@ if ($id > 0 || ! empty($ref)) if ($num < $limit) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; print ''; - print '' . $total_qty . ''; + print '' . $total_qty . ''; print '' . price($total_ht) . ''; print ''; print ""; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 4c58a6fb982..f8893dce3e1 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -231,7 +231,7 @@ if ($id > 0 || ! empty($ref)) print $propalstatic->getNomUrl(1); print "\n"; print ''.$societestatic->getNomUrl(1).''; - print ''; + print ''; print dol_print_date($db->jdate($objp->datep), 'dayhour') . ""; print "" . $objp->qty . "\n"; print '' . price($objp->amount) . '' . "\n"; @@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref)) if ($num < $limit) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; print ''; - print '' . $total_qty . ''; + print '' . $total_qty . ''; print '' . price($total_ht) . ''; print ''; print ""; diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 0dc19a47691..9c76cca7c96 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -230,7 +230,7 @@ if ($id > 0 || ! empty($ref)) print $propalstatic->getNomUrl(1); print "\n"; print ''.$societestatic->getNomUrl(1).''; - print ''; + print ''; print dol_print_date($db->jdate($objp->date_valid), 'dayhour') . ""; print "" . $objp->qty . "\n"; print '' . price($objp->amount) . '' . "\n"; @@ -244,7 +244,7 @@ if ($id > 0 || ! empty($ref)) if ($num < $limit) print ''.$langs->trans("Total").''; else print ''.$langs->trans("Totalforthispage").''; print ''; - print '' . $total_qty . ''; + print '' . $total_qty . ''; print '' . price($total_ht) . ''; print ''; print ""; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 96d9fa491ec..d9ebb72308e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -554,21 +554,21 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowOpportunity"); print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext); print '
'; } if (empty($conf->global->PROJECT_HIDE_TASKS)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectFollowTasks"); print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext); print '
'; } if (!empty($conf->global->PROJECT_BILL_TIME_SPENT)) { - print ' '; + print ' '; $htmltext = $langs->trans("ProjectBillTimeDescription"); print $form->textwithpicto($langs->trans("BillTime"), $htmltext); print '
'; @@ -597,7 +597,7 @@ if ($action == 'create' && $user->rights->projet->creer) print $form->textwithtooltip($text.' '.img_help(), $texthelp, 1); } else print $text; - if (!GETPOSTISSET('backtopage')) print ' '.$langs->trans("AddThirdParty").''; + if (!GETPOSTISSET('backtopage')) print ' '; print ''; } @@ -712,6 +712,20 @@ if ($action == 'create' && $user->rights->projet->creer) jQuery("#opp_status").change(function() { change_percent(); }); + + jQuery("#usage_task").change(function() { + console.log("We click on usage task "+jQuery("#usage_task").is(":checked")); + if (! jQuery("#usage_task").is(":checked")) { + jQuery("#usage_bill_time").prop("checked", false); + } + }); + + jQuery("#usage_bill_time").change(function() { + console.log("We click on usage to bill time"); + if (jQuery("#usage_bill_time").is(":checked")) { + jQuery("#usage_task").prop("checked", true); + } + }); }); '; } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index a6e06dfb5ff..72c49b6e9fd 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -4,7 +4,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -567,7 +567,7 @@ $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Moral"); if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) { - print ''.$langs->trans('Nature').' *'."\n"; + print ''.$langs->trans('MemberNature').' *'."\n"; print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print ''."\n"; } diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index a548e849c7a..35e40cf786c 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -640,7 +640,7 @@ for ($i=0; $i < $nbcolonnes; $i++) if ($object->allow_spy) { // Show line total print ''."\n"; - print ''. $langs->trans("Total") .''."\n"; + print ''. $langs->trans("Total") .''."\n"; for ($i = 0; $i < $nbcolonnes; $i++) { $showsumfor = isset($sumfor[$i])?$sumfor[$i]:''; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index e9014e423c6..50f8a0e5d0d 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -243,7 +243,7 @@ if ($result) if (! $i) $totalarray['nbfield']++; // Date payment - print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; + print ''.dol_print_date($db->jdate($obj->datep), 'day')."\n"; if (! $i) $totalarray['nbfield']++; // Type diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 1cc61ebc0b6..6e7a6826760 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -213,7 +213,7 @@ print '

'; print '
'; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index aafcd8ffc69..a76e9aa34cb 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -82,7 +82,7 @@ abstract class ActionsCardCommon public function assign_values(&$action, $id = 0, $ref = '') { // phpcs:enable - global $conf, $langs, $user, $mysoc, $canvas; + global $conf, $langs, $db, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; if ($action == 'add' || $action == 'update') $this->assign_post($action); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 788fc45ee7e..c2017c894c0 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -59,16 +59,51 @@ class Societe extends CommonObject */ public $fk_element = 'fk_soc'; + /** + * @var string Fields for combobox + */ public $fieldsforcombobox = 'nom,name_alias'; /** * @var array List of child tables. To test if we can delete object. */ - protected $childtables = array("supplier_proposal"=>'SupplierProposal', "propal"=>'Proposal', "commande"=>'Order', "facture"=>'Invoice', "facture_rec"=>'RecurringInvoiceTemplate', "contrat"=>'Contract', "fichinter"=>'Fichinter', "facture_fourn"=>'SupplierInvoice', "commande_fournisseur"=>'SupplierOrder', "projet"=>'Project', "expedition"=>'Shipment', "prelevement_lignes"=>'DirectDebitRecord'); + protected $childtables = array( + "supplier_proposal" => 'SupplierProposal', + "propal" => 'Proposal', + "commande" => 'Order', + "facture" => 'Invoice', + "facture_rec" => 'RecurringInvoiceTemplate', + "contrat" => 'Contract', + "fichinter" => 'Fichinter', + "facture_fourn" => 'SupplierInvoice', + "commande_fournisseur" => 'SupplierOrder', + "projet" => 'Project', + "expedition" => 'Shipment', + "prelevement_lignes" => 'DirectDebitRecord', + ); + /** * @var array List of child tables. To know object to delete on cascade. */ - protected $childtablesoncascade = array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_account", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm"); + protected $childtablesoncascade = array( + "societe_prices", + "societe_log", + "societe_address", + "product_fournisseur_price", + "product_customer_price_log", + "product_customer_price", + "socpeople", + "adherent", + "societe_account", + "societe_rib", + "societe_remise", + "societe_remise_except", + "societe_commerciaux", + "categorie", + "notify", + "notify_def", + "actioncomm", + ); /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png @@ -87,8 +122,6 @@ class Societe extends CommonObject */ public $restrictiononfksoc = 1; - - // BEGIN MODULEBUILDER PROPERTIES /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ @@ -123,7 +156,7 @@ class Societe extends CommonObject public $nom; /** - * @var string name + * @var string Thirdparty name */ public $name; @@ -133,6 +166,9 @@ class Societe extends CommonObject */ public $name_alias; + /** + * @var int Physical thirdparty not a company + */ public $particulier; /** @@ -140,7 +176,14 @@ class Societe extends CommonObject */ public $address; + /** + * @var string Zip code of thirdparty + */ public $zip; + + /** + * @var string Town of thirdparty + */ public $town; /** @@ -154,7 +197,15 @@ class Societe extends CommonObject * @var int */ public $state_id; + + /** + * @var string State code + */ public $state_code; + + /** + * @var string State name + */ public $state; /** @@ -162,11 +213,14 @@ class Societe extends CommonObject * @var int */ public $region_code; + + /** + * @var string Region name + */ public $region; /** - * State code - * @var string + * @var string State code * @deprecated Use state_code instead * @see $state_code */ @@ -220,25 +274,27 @@ class Societe extends CommonObject * @deprecated */ public $twitter; + /** * Facebook username * @var string * @deprecated */ public $facebook; + /** * LinkedIn username * @var string * @deprecated */ - public $linkedin; + public $linkedin; + /** * Webpage * @var string */ public $url; - //! barcode /** * Barcode value * @var string @@ -283,9 +339,16 @@ class Societe extends CommonObject */ public $idprof6; + /** + * @var string Prefix comm + */ public $prefix_comm; + /** + * @var int Vat concerned + */ public $tva_assuj = 1; + /** * Intracommunitary VAT ID * @var string @@ -298,8 +361,19 @@ class Societe extends CommonObject public $localtax2_assuj; public $localtax2_value; + /** + * @var string Manager + */ public $managers; + + /** + * @var float Capital + */ public $capital; + + /** + * @var int Type thirdparty + */ public $typent_id = 0; public $typent_code; public $effectif; @@ -317,6 +391,9 @@ class Societe extends CommonObject */ public $fk_prospectlevel; + /** + * @var string second name + */ public $name_bis; //Log data @@ -326,6 +403,7 @@ class Societe extends CommonObject * @var string */ public $date_modification; + /** * User that made last update * @var string @@ -351,11 +429,13 @@ class Societe extends CommonObject * @var int */ public $client = 0; + /** * 0=no prospect, 1=prospect * @var int */ public $prospect = 0; + /** * 0=no supplier, 1=supplier * @var int @@ -416,6 +496,7 @@ class Societe extends CommonObject * @var int */ public $stcomm_id; + /** * Status prospect label * @var int @@ -427,12 +508,20 @@ class Societe extends CommonObject * @var int */ public $price_level; + + /** + * @var string outstanding limit + */ public $outstanding_limit; /** - * Min order amounts + * @var string Min order amount */ public $order_min_amount; + + /** + * @var string Supplier min order amount + */ public $supplier_order_min_amount; /** @@ -440,11 +529,13 @@ class Societe extends CommonObject * @var int */ public $commercial_id; + /** * Id of parent thirdparty (if one) * @var int */ public $parent; + /** * Default language code of thirdparty (en_US, ...) * @var string @@ -456,7 +547,11 @@ class Societe extends CommonObject */ public $ref; + /** + * @var string Internal ref + */ public $ref_int; + /** * External user reference. * This is to allow external systems to store their id and make self-developed synchronizing functions easier to @@ -485,22 +580,49 @@ class Societe extends CommonObject */ public $webservices_key; + /** + * @var string Logo + */ public $logo; + + /** + * @var string logo small + */ public $logo_small; + + /** + * @var string Logo mini + */ public $logo_mini; + + /** + * @var string Logo squarred + */ public $logo_squarred; + + /** + * @var string Logo squarred small + */ public $logo_squarred_small; + + /** + * @var string Logo squarred mini + */ public $logo_squarred_mini; - public $array_options; - - // Incoterms /** - * @var int ID + * @var int ID Incoterms */ public $fk_incoterms; + /** + * @var string Incoterms Location + */ public $location_incoterms; + + /** + * @var string Incoterm label + */ public $label_incoterms; //Used into tooltip // Multicurrency @@ -509,12 +631,11 @@ class Societe extends CommonObject */ public $fk_multicurrency; + /** + * @var string Multicurrency code + */ public $multicurrency_code; - - // END MODULEBUILDER PROPERTIES - - /** * Constructor * diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index a56762ce447..f0206175d0d 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -239,7 +239,7 @@ $sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur"; $sql .= ", s.code_client"; $sql .= ", s.code_fournisseur"; $sql .= ", s.logo"; -$sql .= ", s.canvas, s.tms as datem, s.status as status"; +$sql .= ", s.canvas, s.tms as date_modification, s.status as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ' WHERE s.entity IN ('.getEntity('societe').')'; @@ -279,7 +279,7 @@ if ($result) $thirdparty_static->client = $objp->client; $thirdparty_static->fournisseur = $objp->fournisseur; $thirdparty_static->logo = $objp->logo; - $thirdparty_static->datem = $db->jdate($objp->datem); + $thirdparty_static->date_modification = $db->jdate($objp->date_modification); $thirdparty_static->status = $objp->status; $thirdparty_static->code_client = $objp->code_client; $thirdparty_static->code_fournisseur = $objp->code_fournisseur; @@ -313,7 +313,7 @@ if ($result) print ''; // Last modified date print '"; print ' 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant + $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Bar or Restaurant print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.'&place='.$place.'\'"'; } print '>'; @@ -1220,14 +1220,14 @@ while ($i < min($num, $limit)) } if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - if ($s) $s .= " / "; + if ($s) $s .= ", "; $companystatic->name = $langs->trans("Prospect"); $companystatic->name_alias = ''; $s .= $companystatic->getNomUrl(0, 'prospect', 0, 1); } if ((!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) && $obj->fournisseur) { - if ($s) $s .= " / "; + if ($s) $s .= ", "; $companystatic->name = $langs->trans("Supplier"); $companystatic->name_alias = ''; $s .= $companystatic->getNomUrl(0, 'supplier', 0, 1); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 91cedc4b172..70e960d424a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1521,6 +1521,7 @@ div#id-top { display:none; background: rgb(); + background-image: linear-gradient(-45deg, , rgb()); } @@ -2439,7 +2440,7 @@ div.tabsAction > a { } a.tabTitle { - color:rgba(0,0,0,.5) !important; + color: rgba(0,0,0,0.4) !important; text-shadow:1px 1px 1px #ffffff; font-family: ; font-weight: normal !important; @@ -4017,6 +4018,11 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; } .calendarviewcontainertr { height: 100px; } +td.cal_other_month { + opacity: 0.8; +} + + /* ============================================================================== */ /* Ajax - Liste deroulante de l'autocompletion */ @@ -5965,3 +5971,5 @@ include dol_buildpath($path.'/theme/'.$theme.'/dropdown.inc.php', 0); include dol_buildpath($path.'/theme/'.$theme.'/info-box.inc.php', 0); include dol_buildpath($path.'/theme/'.$theme.'/progress.inc.php', 0); include dol_buildpath($path.'/theme/'.$theme.'/timeline.inc.php', 0); + +if (! empty($conf->global->THEME_CUSTOM_CSS)) print $conf->global->THEME_CUSTOM_CSS; diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php index 372c4aaba90..5f7c8f60233 100644 --- a/htdocs/theme/eldy/theme_vars.inc.php +++ b/htdocs/theme/eldy/theme_vars.inc.php @@ -67,7 +67,7 @@ $colorbacklinepairhover = '230,237,244'; // line hover $colorbacklinepairchecked = '230,237,244'; // line checked $colorbacklinebreak = '233,228,230'; // line break $colorbackbody = '255,255,255'; -$colortexttitlenotab = '140,80,10'; // 140,80,10 or 10,140,80 +$colortexttitlenotab = '0,103,111'; // 140,80,10 or 10,140,80 $colortexttitle = '0,0,0'; $colortext = '0,0,0'; $colortextlink = '10, 20, 100'; @@ -108,7 +108,7 @@ $badgeStatus0 = '#cbd3d3'; $badgeStatus1 = '#bc9526'; $badgeStatus2 = '#e6f0f0'; $badgeStatus3 = '#bca52b'; -$badgeStatus4 = '#277d1e'; +$badgeStatus4 = '#55a590'; $badgeStatus5 = '#cad2d2'; $badgeStatus6 = '#cad2d2'; $badgeStatus7 = '#baa32b'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 02e819496c4..377f18154fd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4156,6 +4156,11 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; } background-size: 24px auto; } +td.cal_other_month { + opacity: 0.8; +} + + /* ============================================================================== */ /* Ajax - Liste deroulante de l'autocompletion */ /* ============================================================================== */ @@ -6071,5 +6076,6 @@ include dol_buildpath($path.'/theme/'.$theme.'/info-box.inc.php', 0); include dol_buildpath($path.'/theme/'.$theme.'/progress.inc.php', 0); include dol_buildpath($path.'/theme/eldy/timeline.inc.php', 0); // actually md use same style as eldy theme +if (! empty($conf->global->THEME_CUSTOM_CSS)) print $conf->global->THEME_CUSTOM_CSS; if (is_object($db)) $db->close(); diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php index 80aff24b9ba..4f425db4f96 100644 --- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php @@ -50,8 +50,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print ' - - + + socid = $objectlink->fk_soc; //$objectlink->fetch_thirdparty(); @@ -77,8 +77,8 @@ if (count($linkedObjectBlock) > 1) - - + + diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f2f6bc00d1f..ffb8c15e3c3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1800,10 +1800,10 @@ class User extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Mise a jour en base de la date de derniere connexion d'un utilisateur - * Fonction appelee lors d'une nouvelle connexion + * Mise a jour en base de la date de derniere connexion d'un utilisateur + * Fonction appelee lors d'une nouvelle connexion * - * @return <0 si echec, >=0 si ok + * @return int <0 si echec, >=0 si ok */ public function update_last_login_date() { @@ -2267,7 +2267,6 @@ class User extends CommonObject } else { - $this->error = $interface->error; dol_syslog(get_class($this)."::RemoveFromGroup ".$this->error, LOG_ERR); $this->db->rollback(); return -2; diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 4f1a2bf64e2..157d34652c1 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -444,10 +444,10 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') 'total' => $order->total_ttc, 'project_id' => $order->fk_project, - 'date' => $order->date_commande ?dol_print_date($order->date_commande, 'dayrfc') : '', - 'date_creation' => $invoice->date_creation ?dol_print_date($invoice->date_creation, 'dayhourrfc') : '', - 'date_validation' => $invoice->date_validation ?dol_print_date($invoice->date_creation, 'dayhourrfc') : '', - 'date_modification' => $invoice->datem ?dol_print_date($invoice->datem, 'dayhourrfc') : '', + 'date' => $order->date ?dol_print_date($order->date, 'dayrfc') : '', + 'date_creation' => $order->date_creation ?dol_print_date($order->date_creation, 'dayhourrfc') : '', + 'date_validation' => $order->date_validation ?dol_print_date($order->date_creation, 'dayhourrfc') : '', + 'date_modification' => $order->date_modification ?dol_print_date($order->date_modification, 'dayhourrfc') : '', 'remise' => $order->remise, 'remise_percent' => $order->remise_percent, @@ -476,13 +476,15 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') else { $error++; - $errorcode = 'NOT_FOUND'; $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; + $errorcode = 'NOT_FOUND'; + $errorlabel = 'Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; } } else { $error++; - $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request'; + $errorcode = 'PERMISSION_DENIED'; + $errorlabel = 'User does not have permission for this request'; } } @@ -529,10 +531,10 @@ function getOrdersForThirdParty($authentication, $idthirdparty) { $linesorders=array(); - $sql.='SELECT c.rowid as orderid'; - $sql.=' FROM '.MAIN_DB_PREFIX.'commande as c'; - $sql.=" WHERE c.entity = ".$conf->entity; - if ($idthirdparty != 'all' ) $sql.=" AND c.fk_soc = ".$db->escape($idthirdparty); + $sql = 'SELECT c.rowid as orderid'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'commande as c'; + $sql .= " WHERE c.entity = ".$conf->entity; + if ($idthirdparty != 'all' ) $sql .= " AND c.fk_soc = ".$db->escape($idthirdparty); $resql=$db->query($sql); @@ -552,7 +554,8 @@ function getOrdersForThirdParty($authentication, $idthirdparty) if( $socid && ( $socid != $order->socid) ) { $error++; - $errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.' User does not have permission for this request'; + $errorcode='PERMISSION_DENIED'; + $errorlabel=$order->socid.' User does not have permission for this request'; } if(!$error) @@ -674,7 +677,8 @@ function createOrder($authentication, $order) // Init and check authentication $objectresp = array(); - $errorcode = ''; $errorlabel = ''; + $errorcode = ''; + $errorlabel = ''; $error = 0; $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -817,7 +821,8 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) // Init and check authentication $objectresp=array(); - $errorcode='';$errorlabel=''; + $errorcode=''; + $errorlabel=''; $error=0; if ($authentication['entity']) $conf->entity=$authentication['entity']; $fuser=check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -848,7 +853,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $db->rollback(); $error++; $errorcode = 'KO'; - $errorlabel = $newobject->error; + $errorlabel = $order->error; } } else @@ -856,7 +861,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $db->rollback(); $error++; $errorcode = 'KO'; - $errorlabel = $newobject->error; + $errorlabel = $order->error; } } else @@ -864,7 +869,7 @@ function validOrder($authentication, $id = '', $id_warehouse = 0) $db->rollback(); $error++; $errorcode = 'KO'; - $errorlabel = $newobject->error; + $errorlabel = $order->error; } } diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index de8c947512d..5c2bf40aa03 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -96,6 +96,11 @@ class Website extends CommonObject */ public $virtualhost; + /** + * @var int + */ + public $use_manifest; + /** * List of containers * @@ -237,6 +242,7 @@ class Website extends CommonObject $sql .= " t.description,"; $sql .= " t.status,"; $sql .= " t.fk_default_home,"; + $sql .= " t.use_manifest,"; $sql .= " t.virtualhost,"; $sql .= " t.fk_user_creat,"; $sql .= " t.fk_user_modif,"; @@ -264,6 +270,7 @@ class Website extends CommonObject $this->status = $obj->status; $this->fk_default_home = $obj->fk_default_home; $this->virtualhost = $obj->virtualhost; + $this->use_manifest = $obj->use_manifest; $this->fk_user_creat = $obj->fk_user_creat; $this->fk_user_modif = $obj->fk_user_modif; $this->date_creation = $this->db->jdate($obj->date_creation); @@ -425,6 +432,7 @@ class Website extends CommonObject $sql .= ' description = '.(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "null").','; $sql .= ' status = '.(isset($this->status) ? $this->status : "null").','; $sql .= ' fk_default_home = '.(($this->fk_default_home > 0) ? $this->fk_default_home : "null").','; + $sql .= ' use_manifest = '.((int) $this->use_manifest).','; $sql .= ' virtualhost = '.(($this->virtualhost != '') ? "'".$this->db->escape($this->virtualhost)."'" : "null").','; $sql .= ' fk_user_modif = '.(!isset($this->fk_user_modif) ? $user->id : $this->fk_user_modif).','; $sql .= ' date_creation = '.(!isset($this->date_creation) || dol_strlen($this->date_creation) != 0 ? "'".$this->db->idate($this->date_creation)."'" : 'null').','; @@ -1153,6 +1161,18 @@ class Website extends CommonObject } } + /** + * Return if web site is a multilanguage web site. Return false if there is only 0 or 1 language. + * + * @return boolean True if web site is a multilanguage web site + */ + public function isMultiLang() + { + // TODO Can edit list of languages of web site. Return false if there is only 0 or 1 language. + + return true; + } + /** * Component to select language inside a container (Full CSS Only) * diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index b6371c14df7..abdb8d323eb 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -74,6 +74,10 @@ class WebsitePage extends CommonObject * @var string keywords */ public $keywords; + /** + * @var string language code ('en', 'fr', 'en-gb', ..) + */ + public $lang; public $htmlheader; public $content; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 1d94eadf626..72fd6d0b70e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -25,7 +25,7 @@ define('NOSCANPOSTFORINJECTION', 1); define('NOSTYLECHECK', 1); define('USEDOLIBARREDITOR', 1); -header('X-XSS-Protection:0'); +//header('X-XSS-Protection:0'); // Disable XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated. require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; @@ -1059,6 +1059,7 @@ if ($action == 'updatecss') if (!$error) { $object->virtualhost = GETPOST('virtualhost', 'alpha'); + $object->use_manifest = GETPOST('use_manifest', 'alpha'); $result = $object->update($user); if ($result < 0) @@ -1504,17 +1505,25 @@ if ($action == 'updatemeta') if ($result) { setEventMessages($langs->trans("Saved"), null, 'mesgs'); - //header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid); - //exit; + + if (!GETPOSTISSET('updateandstay')) // If we click on "Save And Stay", we do not make the redirect + { + //header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid); + //exit; + $action = 'preview'; + } + else + { + $action = 'editmeta'; + } } else { setEventMessages('Failed to write file '.$filetpl, null, 'errors'); //header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid); //exit; + $action = 'preview'; } - - $action = 'preview'; } } @@ -1741,8 +1750,22 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf if ($result) { setEventMessages($langs->trans("Saved"), null, 'mesgs'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid); - exit; + + if (!GETPOSTISSET('updateandstay')) // If we click on "Save And Stay", we do not make the redirect + { + if ($backtopage) { + header("Location: ".$backtopage); + exit; + } else { + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$websitekey.'&pageid='.$pageid); + exit; + } + } + else + { + if ($action == 'updatesource') $action = 'editsource'; + if ($action == 'updatecontent') $action = 'editcontent'; + } } else { @@ -2153,7 +2176,7 @@ if (!GETPOST('hide_websitemenu')) if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm'))) { - if ($action == 'editcss' && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; + if ($action == 'editcss') print ''; if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; if (preg_match('/^edit/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') print ''; if ($action != 'preview') print ''; @@ -2442,9 +2465,10 @@ if (!GETPOST('hide_websitemenu')) } if (!in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesite', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite'))) { + if ($action == 'editsource' || $action == 'editmeta') print ''; if (preg_match('/^create/', $action)) print ''; if (preg_match('/^edit/', $action)) print ''; - if ($action != 'preview') print ''; + if ($action != 'preview') print ''; } print ''; // end websitetools @@ -2738,10 +2762,9 @@ if ($action == 'editcss') $htmlhelp .= dol_htmlentitiesbr($manifestjsoncontentdefault); print $form->textwithpicto($langs->trans('WEBSITE_MANIFEST_JSON'), $htmlhelp, 1, 'help', '', 0, 2, 'manifestjsontooltip'); print ''; // README.md @@ -3343,6 +3366,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print ''; print ''; print ''; + print ''; print ''; foreach ($listofpages['list'] as $answerrecord) @@ -3357,7 +3381,20 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print $answerrecord->getNomUrl(1); print ' ('.($answerrecord->title ? $answerrecord->title : $langs->trans("NoTitle")).')'; print ''; - print ''; + print ''; print ''; } @@ -3387,6 +3424,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm') print ''; print ''; + print ''; print ''; } }
'.$langs->trans("Year").''.$langs->trans("Year").''.$langs->trans("Number").''.$langs->trans("AmountTotal").''.$langs->trans("AmountAverage").''; - print dol_print_date($thirdparty_static->datem, 'day'); + print dol_print_date($thirdparty_static->date_modification, 'day'); print "'; print $thirdparty_static->getLibStatut(3); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ba01b901f9f..828cb4c703b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1030,7 +1030,7 @@ while ($i < min($num, $limit)) print '
getNomUrl(1); ?>ref_client; ?>datec, 'day'); ?>ref_client; ?>datec, 'day'); ?>
trans("Total"); ?> '; - + print $langs->trans("UseManifest").': '.$form->selectyesno('use_manifest', $website->use_manifest, 1).'
'; $doleditor = new DolEditor('WEBSITE_MANIFEST_JSON', $manifestjsoncontent, '', '220', 'ace', 'In', true, false, 'ace', 0, '100%', ''); print $doleditor->Create(1, '', true, $langs->trans("File").' manifest.json', 'text'); - print '
'.$langs->trans("Type").''.$langs->trans("Link").''.$langs->trans("Description").'
'.$answerrecord->description; + print ''.$answerrecord->description.''; + $param = '?action=replacesiteconfirm'; + $param .= '&optioncontent='.GETPOST('optioncontent'); + $param .= '&optionmeta='.GETPOST('optionmeta'); + $param .= '&optionsitefiles='.GETPOST('optionsitefiles'); + $param .= '&searchstring='.$searchkey; + $disabled = ''; + $urltoedithtmlsource = $_SERVER["PHP_SELF"].'?action=editsource&websiteid='.$website->id.'&pageid='.$answerrecord->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].$param); + if (empty($user->rights->website->write)) { + $disabled = ' disabled'; + $urltoedithtmlsource = ''; + } + print ''.img_picto($langs->trans("EditHTMLSource"), 'edit').''; print '
'; print '