diff --git a/README-FR.md b/README-FR.md index 19d4ae25df9..4feb27893e0 100644 --- a/README-FR.md +++ b/README-FR.md @@ -15,37 +15,43 @@ Dolibarr est distribué sous les termes de la licence GNU General Public License ## INSTALLER DOLIBARR -Si vous n'avez pas de connaissances techniques, et que vous recherchez -un programme d'installation qui installe Dolibarr ERP/CRM en quelques clics, -vous devez vous ré-orienter vers DoliWamp (la version tout-en-un -de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou -Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat, -OpenSuse, Mandriva ou Mageia). +### Configuration simple -Vous pouvez les télécharger depuis la rubrique *download* du portail officiel: -https://www.dolibarr.org/ +Si vous avez peu de compétences techniques et que vous souhaitez installer Dolibarr ERP/CRM en quelques clics, vous pouvez utiliser l'une des versions pré-packagées avec les prérequis: -Si vous avez déjà installé un serveur Web avec PHP et une base de données (MariaDb/MySql/PostgreSql), -vous pouvez installer Dolibarr avec cette version de la manière suivante: +- DoliWamp pour Windows +- DoliDeb pour Debian ou Ubuntu +- DoliRpm pour Redhat, Fedora, OpenSuse, Mandriva ou Mageia -- Copiez le répertoire "dolibarr" et son contenu dans la racine de votre serveur - web, ou bien copiez le répertoire sur le serveur et configurez ce serveur pour - utiliser "dolibarr/htdocs" comme racine d'un nouveau virtual host (ce second - choix requiert des compétences et habilitations en administration du serveur - web). - -- Créez un fichier vide "htdocs/conf/conf.php" et attribuez les permissions - en lecture et écriture pour le user du serveur web (les permissions en - écriture seront supprimées une fois l'installation terminée). +Les packages peuvent être téléchargés à partir de [site web officiel] (https://www.dolibarr.org/). -- Depuis votre navigateur, appelez la page "install/" de dolibarr. L'url dépend - du choix fait à la première étape: - http://localhost/dolibarr/htdocs/install/ - ou - http://yourdolibarrvirtualhost/install/ - -- Suivez les instructions fournies par l'installateur... +### Configuration avancée +Vous pouvez aussi utiliser un serveur Web et une base de données prise en charge (MariaDB, MySQL ou PostgreSQL) pour installer la version standard. + +- Décompressez l'archive .zip téléchargée pour copier le répertoire "dolibarr/htdocs" et tous ses fichiers à la racine du serveur Web ou récupérez-les directement à partir de GitHub (recommandé si vous connaissez git): + +  git clone https://github.com/dolibarr/dolibarr -b x.y (où x.y est la version principale comme 3.6, 9.0, ...) + +- Configurez votre serveur Web pour qu'il utilise "*dolibarr/htdocs*" en tant que racine si votre serveur Web ne possède pas déjà de répertoire défini vers lequel pointer. +  +- Créez un fichier `htdocs/conf/conf.php` vide et définissez les autorisations d'*écrire* pour l'utilisateur de votre serveur Web (l'autorisation *écrire* sera supprimée une fois l'installation terminée) + +- Depuis votre navigateur, allez à la page "install/" de dolibarr + +    L’URL dépendra de la façon dont votre configuration Web a été configurée pour pointer vers votre installation de dolibarr. Cela peut ressembler à: + +        http://localhost/dolibarr/htdocs/install/ +         +    ou +     +        http://localhost/dolibarr/install/ +         +    ou +     +    http://yourdolibarrvirtualhost/install/ +    +- Suivez les instructions de l'installateur ## METTRE A JOUR DOLIBARR diff --git a/README.md b/README.md index bcff409035f..9dfd1a8a750 100644 --- a/README.md +++ b/README.md @@ -29,27 +29,6 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git ## INSTALLING -### Download - -Releases can be downloaded from [official website](https://www.dolibarr.org/). - -### Install from composer - -If you do not already have Composer installed, you may do so by following the instructions at [getcomposer.org](https://getcomposer.org/). On Linux and macOS, you may run the following commands: - -```bash -curl -sS https://getcomposer.org/installer | php -mv composer.phar /usr/local/bin/composer -``` - -On Windows, you can download and run https://getcomposer.org/Composer-Setup.exe - -You can then create a new project - -```bash -composer create-project dolibarr/dolibarr erp -``` - ### Simple setup If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: @@ -58,16 +37,23 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM - DoliDeb for Debian or Ubuntu - DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia +Releases can be downloaded from [official website](https://www.dolibarr.org/). + ### Advanced setup You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version. -- Uncompress the downloaded archive -- Copy the "dolibarr" directory and all its files inside your web server root or anywhere you'd like and set up your web server to use "*dolibarr/htdocs*" as root for a new web server virtual host (second choice need to be server administrator) -- Create an empty `htdocs/conf/conf.php` file and set permissions for your web server user (*write* permissions will be removed once install is finished) +- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you known git): + + git clone https://github.com/dolibarr/dolibarr -b x.y (where x.y is main version like 3.6, 9.0, ...) + +- Set up your web server to use "*dolibarr/htdocs*" as root if you'r web server does not have directory to point to already defined. + +- Create an empty `htdocs/conf/conf.php` file and set *write* permissions for your web server user (*write* permission will be removed once install is finished) + - From your browser, go to the dolibarr "install/" page - The URL will depends on choices made in the first step: + The URL will depends on how you web setup was setup to point to your dolibarr installation. It may looks like: http://localhost/dolibarr/htdocs/install/ @@ -81,6 +67,11 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) - Follow the installer instructions +### Saas/Cloud setup + +If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free. + + ## UPGRADING diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 14f28a71edc..bbdfa564183 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -589,7 +589,8 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/dav/tests`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index e405c9256a6..9420e7846f6 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -546,14 +546,14 @@ if (! empty($arrayfields['t.label_operation']['checked'])) // Debit if (! empty($arrayfields['t.debit']['checked'])) { - print ''; + print ''; print ''; print ''; } // Credit if (! empty($arrayfields['t.credit']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -611,9 +611,9 @@ if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($a if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder); -if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); -if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'align="center"', $sortfield, $sortorder); +if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); +if (! empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, 'class="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 1559aa44ec9..33c7deb0cfd 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -295,22 +295,22 @@ print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1); print ''; print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; -print ''; +print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; print ''; print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']); -print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Label"); -print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder); -print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder); +print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); +print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; @@ -340,7 +340,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total par compte comptable if (isset($displayed_account_number)) { - print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; + print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -401,7 +401,7 @@ while ($i < min($num, $limit)) // Affiche un Sous-Total du dernier compte comptable affiché print ''; -print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; +print ''.$langs->trans("SubTotal").':'.price($sous_total_debit).''.price($sous_total_credit).''; print " \n"; print " \n"; print ''; @@ -409,11 +409,11 @@ print ''; // Affiche le Total print ''; -print ''.$langs->trans("Total").':'; -print ''; +print ''.$langs->trans("Total").':'; +print ''; print price($total_debit); print ''; -print ''; +print ''; print price($total_credit); print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 69e1bc2a7b8..9bef7a1c4fc 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -249,7 +249,7 @@ if ($resql) { } print ''; - print ''.$langs->trans("Total").':' . "\n"; + print ''.$langs->trans("Total").':' . "\n"; print '' . price($debit) . ''; print '' . price($credit) . ''; print ''; diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index fb1cc48d3e0..dbd0f680db7 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -316,8 +316,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -336,8 +336,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 42705d343da..873018cf6c9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -405,8 +405,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -504,7 +504,7 @@ if ($result) { // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print ''; diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index ddc4f0d9227..5dbacd501b9 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -269,11 +269,11 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -285,7 +285,7 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder); print_liste_field_titre(''); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index fc5a4d97b08..a026db19c70 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -315,8 +315,8 @@ if ($result) { print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -331,8 +331,8 @@ if ($result) { print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"', $sortfield, $sortorder); print_liste_field_titre("IntoAccount", '', '', '', '', 'align="center"', $sortfield, $sortorder); $checkpicto=''; diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 91a289511c9..1c687fb98cc 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -321,8 +321,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); // print ''; @@ -343,8 +343,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Account", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 4dd9be839fe..f864824c740 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -383,8 +383,8 @@ if ($result) { print ''; //print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', 'code2', 1, 0, 1); //print ''; @@ -406,8 +406,8 @@ if ($result) { print_liste_field_titre("ProductRef", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', 'align="center"'); @@ -498,7 +498,7 @@ if ($result) { // Vat rate if ($objp->vat_tx_l != $objp->vat_tx_p) $code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red'; - print ''; + print ''; print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')); print ''; diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index b7db54ad43a..09f7aa22032 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -43,6 +43,22 @@ $oldtypetonewone=array('texte'=>'text','chaine'=>'string'); // old type to new o $action = GETPOST('action', 'alpha'); +$error = 0; + +// Editing global variables not related to a specific theme +$constantes=array( + 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), + 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ + 'ADHERENT_MAIL_FROM'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', +); + + /* * Actions @@ -133,24 +149,10 @@ $head = member_admin_prepare_head(); dol_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); -print '
'; -print ''; -print ''; - -/* - * Editing global variables not related to a specific theme - */ -$constantes=array( - 'ADHERENT_MAIL_FROM'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', - 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ - 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ - 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ - 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ - 'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))), - 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', -); +// TODO Use global form +//print ''; +//print ''; +//print ''; $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; @@ -159,6 +161,9 @@ $helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, form_constantes($constantes, 0, $helptext); +//print '
'; +//print '
'; + dol_fiche_end(); // End of page diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 884f75f6f2d..70a37f0bf4b 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -136,7 +136,7 @@ if ($conf->use_javascript_ajax) } -print $langs->trans("BlankSubscriptionFormDesc").'

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

'; $enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 738b538540a..a69ab8ec29c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2520,7 +2520,7 @@ class Adherent extends CommonObject /** - * Charge les informations d'ordre info dans l'objet adherent + * Load type info information in the member object * * @param int $id Id of member to load * @return void diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 5bf09ae4b6d..9fd7a9b9d38 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -164,7 +164,7 @@ class AdherentType extends CommonObject } /** - * Met a jour en base donnees du type + * Updating the type in the database * * @param User $user Object user making change * @param int $notrigger 1=do not execute triggers, 0 otherwise @@ -234,9 +234,9 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de supprimer le status de l'adherent + * Function to delete the member's status * - * @return int >0 if OK, 0 if not found, < 0 if KO + * @return int > 0 if OK, 0 if not found, < 0 if KO */ function delete() { @@ -267,7 +267,7 @@ class AdherentType extends CommonObject } /** - * Fonction qui permet de recuperer le status de l'adherent + * Function that retrieves the status of the member * * @param int $rowid Id of member type to load * @return int <0 if KO, >0 if OK diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 3332f6be23a..8828a72df28 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -566,7 +566,7 @@ if (! empty($arrayfields['d.tms']['checked'])) // Status if (! empty($arrayfields['d.statut']['checked'])) { - print ''; + print ''; $liststatus=array( '-1'=>$langs->trans("Draft"), '1'=>$langs->trans("Validated"), @@ -613,7 +613,7 @@ $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // N print $hookmanager->resPrint; if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'], $_SERVER["PHP_SELF"], "d.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); -if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut", "", $param, 'align="right"', $sortfield, $sortorder); +if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -842,7 +842,7 @@ while ($i < min($num, $limit)) // Status if (! empty($arrayfields['d.statut']['checked'])) { - print ''; + print ''; print $memberstatic->LibStatut($obj->statut, $obj->subscription, $datefin, 5); print ''; if (! $i) $totalarray['nbfield']++; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 1e6d6044c75..605a35aef3d 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -570,7 +570,7 @@ if ($rowid > 0) print ''; - if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; + if ($action != 'editthirdparty' && $user->rights->adherent->creer) print ''; print '
'; print $langs->trans("LinkedToDolibarrThirdParty"); print 'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'
'; print ''; if ($action == 'editthirdparty') diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 9786545aa0b..20bda9f50dc 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -355,7 +355,7 @@ if (! empty($arrayfields['d.date_fin']['checked'])) if (! empty($arrayfields['d.amount']['checked'])) { - print ''; + print ''; print ''; print ''; } @@ -380,7 +380,7 @@ if (! empty($arrayfields['d.tms']['checked'])) } // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -427,7 +427,7 @@ if (! empty($arrayfields['d.date_fin']['checked'])) } if (! empty($arrayfields['d.amount']['checked'])) { - print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "c.subscription", $param, "", 'class="right"', $sortfield, $sortorder); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -459,7 +459,7 @@ while ($i < min($num, $limit)) $adherent->statut=$obj->statut; $adherent->login=$obj->login; $adherent->photo=$obj->photo; - + $adht = new AdherentType($db); $adht->fetch($obj->fk_type); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index f220ba50135..6d09ccac022 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -599,7 +599,7 @@ if ($rowid > 0) print ' '; - print ''; + print ''; print ''; print '  '; print ''; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 409707f9f9c..eb2f413b340 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -144,7 +144,7 @@ print ''; print ''; print ''; // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; @@ -179,7 +179,7 @@ if (! empty($triggers)) print ''; print ''.$trigger['code'].''; print ''.$trigger['label'].''; - print ''; + print ''; $key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; $value=$conf->global->$key; print ''; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index b2d5128c910..c9ba17d2461 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -220,7 +220,7 @@ while ($i <= $MAXAGENDA) // Offset TZ print ''; // Color (Possible colors are limited by Google) - print ''; + print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key)?GETPOST("AGENDA_EXT_COLOR".$key):$conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 06594ffe59d..92b1c73060d 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -333,7 +333,7 @@ if (! empty($conf->product->enabled)) print ''; print ''.$langs->trans("SetDefaultBarcodeTypeProducts").''; - print ''; + print ''; print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1); print ''; } @@ -344,7 +344,7 @@ if (! empty($conf->societe->enabled)) print ''; print ''.$langs->trans("SetDefaultBarcodeTypeThirdParties").''; - print ''; + print ''; print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1); print ''; } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index ec814718f0f..f9f4896da79 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -415,7 +415,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ''; print ''; - print ''; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 35366d09697..c5112396404 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -356,7 +356,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 3e8362a99ee..24e5b55d47d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -621,7 +621,7 @@ if ($resql) // There is several pages if ($num > $listlimit) { - print ''; } @@ -657,7 +657,7 @@ if ($resql) } if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print ''; // Action column - print ''; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 614c75aa4b8..a5a0b5fbf3f 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -79,7 +79,7 @@ print ''; print '
'; print ''; - print ''; + print ''; if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 5624d6903fc..720b43a2275 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -304,10 +304,10 @@ print ''; if ($conf->use_javascript_ajax) { print '
'; - print '
'; + print '
'; print ''; print '
'; - print '
'; + print '
'; print ''; print '
'; } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 69bbf006ac3..caa0ba91a97 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1246,7 +1246,7 @@ if ($id) } if ($id == 4) print '
'; + print ''; if ($filterfound) { $searchpicto=$form->showFilterAndCheckAddButtons(0); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 84534362e69..755d44d42ba 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -385,7 +385,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print ''; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'; + print '
'; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
'; + print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'; print ''; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''; @@ -88,13 +88,13 @@ print ''; print ''; if (empty($conf->use_javascript_ajax)) { - print ''; } else { - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").''.$langs->trans("Value").'
'.$langs->trans("UseSearchToSelectResource").''; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print ''; + print ''; $arrval=array( '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')', diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index f54fe886561..9d4d5f88bb9 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -330,7 +330,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){ print '
'; print '
'; - print ''; + print '
'; print ''; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index e07ed924f2b..2d6b68fcb93 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -202,7 +202,7 @@ print ''; print '
'; print ''.$langs->trans("Save").''; print '
'; print ''; print ''; -print ''; +print ''; print "\n"; foreach ($syslogModules as $moduleName) diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index ac39ffbfc7e..113b0029fdd 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -147,7 +147,7 @@ else print ''; if (! $conf->use_javascript_ajax) { - print '"; } diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 28ac80352fa..ab9a86b614f 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -255,7 +255,7 @@ if ($result) //print ''; print ''; - print ''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 622a0f3ad9a..577b15579ed 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -500,7 +500,7 @@ if ($mode == 'searchkey') //} print ''; // Action column - print ''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 00ba76cd0a9..a831a7d4056 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -502,7 +502,7 @@ if ($id) fieldListWebsites($fieldlist, $obj, $tabname[$id], 'add'); - print ''; } else diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 0e69776b50d..138b2634bd6 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -364,7 +364,7 @@ $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index bd9b4c9b176..25e983887df 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -116,7 +116,7 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) { // Example with a yes / no select print ''; print ''; - print ''; -if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) -{ +if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) { // This is version that is faster but require more memory and report errors that are outside the filter range // TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index f70500d3b08..53c027639fc 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -117,11 +117,11 @@ if ($resql) //print ""; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder); - print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder); + print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url","", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Target", '', '', '', '', 'align="center"'); print_liste_field_titre("Owner", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param,'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre(''); print "\n"; @@ -182,7 +182,7 @@ if ($resql) print '"; // Actions - print ''; print '
'.$langs->trans("NbOfUniqueEMails").'
'; //print ''; - print '
'.$langs->trans("Filter").'
'; + print '
'.$langs->trans("Filter").'
'; //print ''; print '
 
'; //print "\n"; @@ -363,7 +363,7 @@ if ($object->fetch($id) >= 0) } print ''; - print '
'; + print '
'; if ($allowaddtarget) { try { @@ -378,7 +378,7 @@ if ($object->fetch($id) >= 0) } print '
'; - print '
'; + print '
'; if ($allowaddtarget) { print ''; @@ -501,11 +501,11 @@ if ($object->fetch($id) >= 0) print ' '; print ''; //Statut - print '
'; // Action column - print ''; @@ -518,15 +518,14 @@ if ($object->fetch($id) >= 0) print_liste_field_titre("OtherInformations", $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", 'align="center"', $sortfield, $sortorder); // Date sending - if ($object->statut < 2) - { + if ($object->statut < 2) { print_liste_field_titre(''); } else { print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, '', 'align="center"', $sortfield, $sortorder); } - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "mc.statut", $param, '', 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "mc.statut", $param, '', 'class="right"', $sortfield, $sortorder); print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); print ''; @@ -590,13 +589,13 @@ if ($object->fetch($id) >= 0) if ($obj->statut == 0) { print ''; - print ''; } else { print ''; - print ''; } diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php new file mode 100644 index 00000000000..5c8dd23a332 --- /dev/null +++ b/htdocs/contact/consumption.php @@ -0,0 +1,657 @@ + + * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2013-2015 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015-2017 Ferran Marcet + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/societe/consumption.php + * \ingroup societe + * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + */ + +require "../main.inc.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + +// Security check +$id = GETPOST('id', 'int'); + +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); +$object = new Contact($db); +if ($id > 0) $object->fetch($id); +if(empty($object->thirdparty)) $object->fetch_thirdparty(); +$socid = $object->thirdparty->id; + +// Sort & Order fields +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder='DESC'; +if (! $sortfield) $sortfield='dateprint'; + +// Search fields +$sref=GETPOST("sref"); +$sprod_fulldescr=GETPOST("sprod_fulldescr"); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); + +// Clean up on purge search criteria ? +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers +{ + $sref=''; + $sprod_fulldescr=''; + $year=''; + $month=''; +} +// Customer or supplier selected in drop box +$thirdTypeSelect = GETPOST("third_select_id"); +$type_element = GETPOST('type_element')?GETPOST('type_element'):''; + +// Load translation files required by the page +$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('consumptioncontact')); + + +/* + * Actions + */ + +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + +/* + * View + */ +$form = new Form($db); +$formother = new FormOther($db); +$productstatic=new Product($db); +$objsoc = new Societe($db); + +$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); +$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('',$title,$help_url); + +if (empty($id)) +{ + dol_print_error($db); + exit; +} + +$head = contact_prepare_head($object); +dol_fiche_head($head, 'consumption', $langs->trans("ContactsAddresses"), -1, 'contact'); + +$linkback = ''.$langs->trans("BackToList").''; + +$morehtmlref='
'; +if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) +{ + $objsoc->fetch($socid); + // Thirdparty + $morehtmlref.=$langs->trans('ThirdParty') . ' : '; + if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1, 'contact'); + else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany"); +} +$morehtmlref.='
'; + +dol_banner_tab($object, 'id', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', $morehtmlref); + +print '
'; + +print '
'; +print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; + print ''; print $langs->trans("NotAvailableWhenAjaxDisabled"); print "'; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); print $searchpicto; print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print ''; + print ''; if ($action != 'edit') { print ''; @@ -585,7 +585,7 @@ if ($id) if (empty($reshook)) fieldListWebsites($fieldlist, $obj, $tabname[$id], 'edit'); - print ' '; + print ' '; print ' '; +print ''; $searchpicto=$form->showFilterButtons(); print $searchpicto; print '
'.$langs->trans("BlockedLogAuthorityUrl").img_info($langs->trans('BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote')).''; + print ''; print '
'; print ''; print ''; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 36553ec2237..8150bae3e78 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -325,7 +325,7 @@ if (GETPOST('withtab', 'alpha')) $param.='&withtab='.urlencode(GETPOST('withtab' print ''; -print '
'; +print '
'; print $langs->trans("RestrictYearToExport").': '; $smonth=GETPOST('monthtoexport', 'int'); // Month @@ -428,7 +428,7 @@ print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"], 'use print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"], 'ref_object', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; -print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="right"', $sortfield, $sortorder, '')."\n"; +print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '')."\n"; print getTitleFieldOfList($langs->trans('Status'), 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder, '')."\n"; @@ -436,8 +436,7 @@ print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="c print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder, '')."\n"; print '
 
'.$obj->position."'; + print ''; if ($user->rights->bookmark->creer) { print "rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()." "; diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 7c09356064c..ce98dcbb6fc 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -169,7 +169,7 @@ foreach($fulltree as $key => $val) 'fk_menu'=>$val['fk_parent'], 'entry'=>''. //''. - ''. + ''. '
color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.''.dolGetFirstLineOfText($desc).''.img_view().''.img_view().'
' ); } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 32199a162e1..b9c93ece52c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -263,7 +263,7 @@ if ($object->fetch($id) >= 0) //print '
'.$langs->trans("NbOfUniqueEMails").''.$langs->trans("Filter").' 
'; + print ''; print $formmailing->selectDestinariesStatus($search_dest_status, 'search_dest_status', 1); print ''; + print ''; $searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1); print $searchpicto; print '
 '.$langs->trans("MailingStatusNotSent"); + print ''.$langs->trans("MailingStatusNotSent"); print ''.$obj->date_envoi.''; + print ''; print $object::libStatutDest($obj->statut, 2, $obj->error_text); print '
'; + +// Civility +print ''; + +if ($object->thirdparty->client) +{ + $thirdTypeArray['customer']=$langs->trans("customer"); + if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->transnoentitiesnoconv('Proposals'); + if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->transnoentitiesnoconv('Orders'); + if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices'); + if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts'); +} + +if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions'); + +if ($object->thirdparty->fournisseur) +{ + $thirdTypeArray['supplier']=$langs->trans("supplier"); + if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice']=$langs->transnoentitiesnoconv('SuppliersInvoices'); + if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders'); + + // There no contact type for supplier proposals +// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals'); +} + +print '
'.$langs->trans("UserTitle").''; +print $object->getCivilityLabel(); +print '
'; + +print ''; + +dol_fiche_end(); +print '
'; + + +print ''; +print ''; + +$sql_select=''; +if ($type_element == 'fichinter') +{ // Customer : show products from invoices + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $documentstatic=new Fichinter($db); + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datec as dateprint, f.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'fichinterdet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'fichinter as f ON d.fk_fichinter=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='fichinter' and tc.source='external' and tc.active=1)"; + $where = ' WHERE f.entity IN ('.getEntity('ficheinter').')'; + $dateprint = 'f.datec'; + $doc_number='f.ref'; +} +if ($type_element == 'invoice') +{ // Customer : show products from invoices + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $documentstatic=new Facture($db); + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, f.type as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'facturedet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture as f ON d.fk_facture=f.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='facture' and tc.source='external' and tc.active=1)"; + $where = " WHERE f.entity IN (".getEntity('invoice').")"; + $dateprint = 'f.datef'; + $doc_number='f.ref'; + $thirdTypeSelect='customer'; +} +if ($type_element == 'propal') +{ + require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; + $documentstatic=new Propal($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.datep as dateprint, c.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'propaldet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propal as c ON d.fk_propal=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity('propal').')'; + $datePrint = 'c.datep'; + $doc_number='c.ref'; + $thirdTypeSelect='customer'; +} +if ($type_element == 'order') +{ + require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $documentstatic=new Commande($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'commandedet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande as c ON d.fk_commande=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='commande' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity('order').')'; + $dateprint = 'c.date_commande'; + $doc_number='c.ref'; + $thirdTypeSelect='customer'; +} +if ($type_element == 'supplier_invoice') +{ // Supplier : Show products from invoices. + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $documentstatic=new FactureFournisseur($db); + $sql_select = 'SELECT f.rowid as doc_id, f.ref as doc_number, \'1\' as doc_type, f.datef as dateprint, f.fk_statut as status, f.paye as paid, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'facture_fourn_det d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn as f ON d.fk_facture_fourn=f.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=f.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='invoice_supplier' and tc.source='external' and tc.active=1)"; + $where = ' WHERE f.entity IN ('.getEntity($documentstatic->element).')'; + $dateprint = 'f.datef'; + $doc_number='f.ref'; + $thirdTypeSelect='supplier'; +} +//if ($type_element == 'supplier_proposal') +//{ +// require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; +// $documentstatic=new SupplierProposal($db); +// $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, '; +// $tables_from = MAIN_DB_PREFIX."supplier_proposal as c,".MAIN_DB_PREFIX."supplier_proposaldet as d"; +// $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; +// $where.= " AND d.fk_supplier_proposal = c.rowid"; +// $where.= " AND c.entity = ".$conf->entity; +// $dateprint = 'c.date_valid'; +// $doc_number='c.ref'; +// $thirdTypeSelect='supplier'; +//} +if ($type_element == 'supplier_order') +{ // Supplier : Show products from orders. + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $documentstatic=new CommandeFournisseur($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'commande_fournisseurdet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseur as c ON d.fk_commande=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='order_supplier' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity($documentstatic->element).')'; + $dateprint = 'c.date_valid'; + $doc_number='c.ref'; + $thirdTypeSelect='supplier'; +} +if ($type_element == 'contract') +{ // Order + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; + $documentstatic=new Contrat($db); + $documentstaticline=new ContratLigne($db); + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_contrat as dateprint, d.statut as status, tc.libelle, '; + $tables_from = MAIN_DB_PREFIX.'contratdet d'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'contrat as c ON d.fk_contrat=c.rowid'; + $tables_from.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product p ON d.fk_product=p.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid'; + $tables_from.= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='contrat' and tc.source='external' and tc.active=1)"; + $where = ' WHERE c.entity IN ('.getEntity('contrat').')'; + $dateprint = 'c.date_valid'; + $doc_number='c.ref'; + $thirdTypeSelect='customer'; +} + +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook + +if (!empty($sql_select)) +{ + $sql = $sql_select; + $sql.= ' d.description as description'; + if ($type_element != 'fichinter' && $type_element != 'contract' && $type_element != 'supplier_proposal') $sql.= ', d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; + if ($type_element == 'supplier_proposal') $sql.= ', d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; + if ($type_element == 'contract') $sql.= ', d.label, d.fk_product as product_id, d.fk_product as fk_product, d.info_bits, d.date_ouverture as date_start, d.date_cloture as date_end, d.qty, d.qty as prod_qty, d.total_ht as total_ht, '; + if ($type_element != 'fichinter') $sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type, p.entity as pentity'; + $sql.= " "; + if ($type_element != 'fichinter') $sql.= ", p.ref as prod_ref, p.label as product_label"; + $sql.= " FROM "/*.MAIN_DB_PREFIX."societe as s, "*/.$tables_from; +// if ($type_element != 'fichinter') $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; + $sql.= $where; + if ($month > 0) { + if ($year > 0) { + $start = dol_mktime(0, 0, 0, $month, 1, $year); + $end = dol_time_plus_duree($start,1,'m') - 1; + $sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; + } else { + $sql.= " AND date_format(".$dateprint.", '%m') = '".sprintf('%02d',$month)."'"; + } + } elseif ($year > 0) { + $start = dol_mktime(0, 0, 0, 1, 1, $year); + $end = dol_time_plus_duree($start,1,'y') - 1; + $sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; + } + if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'"; + if ($sprod_fulldescr) + { + $sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'"; + if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'"; + if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.label LIKE '%".$db->escape($sprod_fulldescr)."%'"; + $sql.=")"; + } + $sql.= $db->order($sortfield,$sortorder); +//print ($sql);exit; + $resql=$db->query($sql); + $totalnboflines = $db->num_rows($resql); + + $sql.= $db->plimit($limit + 1, $offset); + //print $sql; +} + +$disabled=0; +$showempty=2; +if (empty($elementTypeArray) && ! $object->client && ! $object->fournisseur) +{ + $showempty=$langs->trans("ThirdpartyNotCustomerNotSupplierSoNoRef"); + $disabled=1; +} + +// Define type of elements +$typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), $showempty, 0, 0, '', 0, 0, $disabled, '', 'maxwidth150onsmartphone'); +$button = ''; + +$param=''; +$param.="&sref=".urlencode($sref); +$param.="&month=".urlencode($month); +$param.="&year=".urlencode($year); +$param.="&sprod_fulldescr=".urlencode($sprod_fulldescr); +$param.="&socid=".urlencode($socid); +$param.="&type_element=".urlencode($type_element); + +$total_qty=0; + +if ($sql_select) +{ + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); + + $num = $db->num_rows($resql); + + $param="&socid=".$socid."&type_element=".$type_element; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($sprod_fulldescr) $param.= "&sprod_fulldescr=".urlencode($sprod_fulldescr); + if ($sref) $param.= "&sref=".urlencode($sref); + if ($month) $param.= "&month=".$month; + if ($year) $param.= "&year=".$year; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $totalnboflines, '', 0, '', '', $limit); + + print '
'; + print ''."\n"; + + // Filters + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + // Titles with sort buttons + print ''; + print_liste_field_titre('Ref',$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Date',$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder); + print_liste_field_titre('Status',$_SERVER['PHP_SELF'],'fk_statut','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre('Product',$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('ContactType',$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Quantity',$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre('TotalHT',$_SERVER['PHP_SELF'],'total_ht','',$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre('UnitPrice',$_SERVER['PHP_SELF'],'','',$param,'align="right"',$sortfield,$sortorder); + print "\n"; + + + $i = 0; + while (($objp = $db->fetch_object($resql)) && $i < min($num, $limit)) + { + $documentstatic->id=$objp->doc_id; + $documentstatic->ref=$objp->doc_number; + $documentstatic->type=$objp->doc_type; + $documentstatic->fk_statut=$objp->status; + $documentstatic->fk_status=$objp->status; + $documentstatic->statut=$objp->status; + $documentstatic->status=$objp->status; + $documentstatic->paye=$objp->paid; + + if (is_object($documentstaticline)) $documentstaticline->statut=$objp->status; + + print ''; + print ''; + print ''; + + // Status + print ''; + + print ''; + + //print ''; + print ''; + + print ''; + $total_qty+=$objp->prod_qty; + + print ''; + $total_ht+=$objp->total_ht; + + print ''; + + print "\n"; + $i++; + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "
'; + print ''; + print ''; // date + print $formother->select_month($month?$month:-1, 'month', 1, 0, 'valignmiddle'); + $formother->select_year($year?$year:-1,'year',1, 20, 1); + print ''; + print ''; + print ''; + print ''; // TODO: Add filters ! + print ''; + print ''; + print ''; + $searchpicto=$form->showFilterAndCheckAddButtons(0); + print $searchpicto; + print '
'; + print $documentstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->dateprint),'day').''; + if ($type_element == 'contract') + { + print $documentstaticline->getLibStatut(2); + } + else + { + print $documentstatic->getLibStatut(2); + } + print ''; + + // Define text, description and type + $text=''; $description=''; $type=0; + + // Code to show product duplicated from commonobject->printObjectLine + if ($objp->fk_product > 0) + { + $product_static = new Product($db); + + $product_static->type=$objp->fk_product_type; + $product_static->id=$objp->fk_product; + $product_static->ref=$objp->ref; + $product_static->entity=$objp->pentity; + $text=$product_static->getNomUrl(1); + } + + // Product + if ($objp->fk_product > 0) + { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $prod = new Product($db); + $prod->fetch($objp->fk_product); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); + if (empty($newlang)) $newlang=$object->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; + } + else + { + $label = $objp->product_label; + } + + $text.= ' - '.(! empty($objp->label)?$objp->label:$label); + $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description)); + } + + if (($objp->info_bits & 2) == 2) { ?> + + trans("ShowReduc"),'reduc').' '; + if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); + elseif ($objp->description == '(EXCESS RECEIVED)') $txt=$langs->trans("ExcessReceived"); + elseif ($objp->description == '(EXCESS PAID)') $txt=$langs->trans("ExcessPaid"); + //else $txt=$langs->trans("Discount"); + print $txt; + ?> + + description) + { + if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + if ($objp->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessReceived",$discount->getNomUrl(0)); + } + elseif ($objp->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromExcessPaid",$discount->getNomUrl(0)); + } + elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description); + } + } + } + else + { + if ($objp->fk_product > 0) { + + echo $form->textwithtooltip($text,$description,3,'','',$i,0,''); + + // Show range + echo get_date_range($objp->date_start, $objp->date_end); + + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + } else { + + if (! empty($objp->label) || ! empty($objp->description)) + { + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + + if (! empty($objp->label)) { + $text.= ' '.$objp->label.''; + echo $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i,0,''); + } else { + echo $text.' '.dol_htmlentitiesbr($objp->description); + } + } + + // Show range + echo get_date_range($objp->date_start,$objp->date_end); + } + } + + /* + $prodreftxt=''; + if ($objp->prod_id > 0) + { + $productstatic->id = $objp->prod_id; + $productstatic->ref = $objp->prod_ref; + $productstatic->status = $objp->prod_type; + $prodreftxt = $productstatic->getNomUrl(0); + if(!empty($objp->product_label)) $prodreftxt .= ' - '.$objp->product_label; + } + // Show range + $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + */ + print '
'.$prodreftxt.''.$objp->libelle.''.$objp->prod_qty.''.price($objp->total_ht).''.price($objp->total_ht/(empty($objp->prod_qty)?1:$objp->prod_qty)).'
' . $langs->trans('Total') . '' . $total_qty . '' . price($total_ht) . '' . price($total_ht/(empty($total_qty)?1:$total_qty)) . '
"; + print '
'; + + if ($num > $limit) { + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); + } + $db->free($resql); +} +elseif (empty($type_element) || $type_element == -1) +{ + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); + + print ''."\n"; + // Titles with sort buttons + print ''; + print_liste_field_titre('Ref',$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Date',$_SERVER['PHP_SELF'],'dateprint','',$param,'align="center" width="150"',$sortfield,$sortorder); + print_liste_field_titre('Status',$_SERVER['PHP_SELF'],'fk_status','',$param,'align="center"',$sortfield,$sortorder); + print_liste_field_titre('Product',$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre('Quantity',$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); + print "\n"; + + print ''; + + print "
'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'
"; +} +else { + print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); + + print ''."\n"; + + print ''; + + print "
'.$langs->trans("FeatureNotYetAvailable").'
"; +} + +print ""; + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 66cb3cc53f7..dc610854ead 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6355,10 +6355,13 @@ abstract class CommonObject // Show only the key field in params if (is_array($params) && array_key_exists('onlykey', $params) && $key != $params['onlykey']) continue; + // @TODO Add test also on 'enabled' (different than 'list' that is 'visibility') $enabled = 1; - if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) + + $visibility = 1; + if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) { - $enabled = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1); + $visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1); } $perms = 1; @@ -6367,7 +6370,7 @@ abstract class CommonObject $perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1); } - if (($mode == 'create' || $mode == 'edit') && abs($enabled) != 1 && abs($enabled) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list + if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list if (empty($perms)) continue; // Load language if required diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 950a58352ca..39a46ada4e7 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1358,18 +1358,23 @@ function complete_elementList_with_modules(&$elementList) * * @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label) * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... - * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all + * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all (form is output by caller, recommanded) * @param string $helptext Help * @return void */ function form_constantes($tableau, $strictw3c = 0, $helptext = '') { - global $db,$bc,$langs,$conf,$user; + global $db,$langs,$conf,$user; global $_Avery_Labels; $form = new Form($db); - if (! empty($strictw3c) && $strictw3c == 1) print "\n".'
'; + if (! empty($strictw3c) && $strictw3c == 1) + { + print "\n".''; + print ''; + print ''; + } print ''; print ''; @@ -1382,7 +1387,6 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print "\n"; $label=''; - $listofparam=array(); foreach($tableau as $key => $const) // Loop on each param { $label=''; @@ -1550,6 +1554,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ""; } print "\n"; + if (empty($strictw3c)) print "\n"; } } diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index f46b2fda152..92f84d8c2e2 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -58,6 +58,15 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'perso'; $tab++; + // Related items + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled)) + { + $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; + $head[$tab][1] = $langs->trans("Referers"); + $head[$tab][2] = 'consumption'; + $tab++; + } + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 45969d689e4..6a591ee197c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2653,6 +2653,17 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } if (! empty($conf->productbatch->enabled)) $original_file=$conf->productbatch->multidir_output[$entity].'/'.$original_file; } + + // Wrapping pour les mouvements stocks + else if ($modulepart == 'movement' || $modulepart == 'mouvement' ) + { + if (empty($entity) || (empty($conf->stock->multidir_output[$entity]) )) return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); + if (($fuser->rights->stock->{$lire} || $fuser->rights->stock->movement->{$lire} || $fuser->rights->stock->mouvement->{$lire}) || preg_match('/^specimen/i',$original_file)) + { + $accessallowed=1; + } + if (! empty($conf->stock->enabled)) $original_file=$conf->stock->multidir_output[$entity].'/movement/'.$original_file; + } // Wrapping pour les contrats elseif ($modulepart == 'contract' && !empty($conf->contrat->dir_output)) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 63f75e554c9..6956859aa03 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1175,6 +1175,15 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos if (empty($reshook)) { $labelproductservice=pdf_getlinedesc($object, $i, $outputlangs, $hideref, $hidedesc, $issupplierline); + + //var_dump($labelproductservice);exit; + + // Fix bug of some HTML editors that replace links ]*src=")([^"]*)(&)([^"]*")/', '\1\2&\4', $labelproductservice, -1, $nbrep); + + //var_dump($labelproductservice);exit; + // Description $pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1, false, true, 'J', true); $result.=$labelproductservice; diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 1f777256e98..18bf4383200 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -165,7 +165,7 @@ class mod_facture_mars extends ModeleNumRefFactures $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE ref LIKE '".$prefix."____-%'"; $sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")"; - + $resql=$db->query($sql); dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); if ($resql) @@ -189,7 +189,8 @@ class mod_facture_mars extends ModeleNumRefFactures $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")"; - + $sql.= " ORDER BY ref DESC"; + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); if ($resql) diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 1e333c08bbc..5aa8f8e83b3 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -180,7 +180,7 @@ class mod_facture_terre extends ModeleNumRefFactures $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE ref LIKE '".$prefix."____-%'"; $sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")"; - + $resql=$db->query($sql); dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); if ($resql) @@ -204,7 +204,8 @@ class mod_facture_terre extends ModeleNumRefFactures $sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " WHERE ref LIKE '".$prefix."____-".$num."'"; $sql.= " AND entity IN (".getEntity('invoicenumber', 1, $invoice).")"; - + $sql.= " ORDER BY ref DESC"; + dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG); $resql=$db->query($sql); if ($resql) diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 98b010f9439..bef84b3a157 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -216,23 +216,43 @@ class modUser extends DolibarrModules $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; - $this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs'; + $this->export_label[$r]='List of users and attributes'; $this->export_permission[$r]=array(array("user","user","export")); $this->export_fields_array[$r]=array( - 'u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.accountancy_code'=>"UserAccountancyCode", - 'u.office_phone'=>'Phone','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification", - 'u.admin'=>"Administrator",'u.statut'=>'Status','u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion', + 'u.rowid'=>"Id",'u.login'=>"Login",'u.lastname'=>"Lastname",'u.firstname'=>"Firstname",'u.employee'=>"Employee",'u.job'=>"PostOrFunction",'u.gender'=>"Gender", + 'u.accountancy_code'=>"UserAccountancyCode", + 'u.address'=>"Address",'u.zip'=>"Zip",'u.town'=>"Town", + 'u.office_phone'=>'Phone','u.user_mobile'=>"Mobile",'u.office_fax'=>'Fax', + 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature', + 'u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', + 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey', + 'u.birth'=>'BirthdayDate', + 'u.datec'=>"DateCreation",'u.tms'=>"DateLastModification", + 'u.admin'=>"Administrator",'u.statut'=>'Status','u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion', 'u.fk_socpeople'=>"IdContact",'u.fk_soc'=>"IdCompany",'u.fk_member'=>"MemberId" ); $this->export_TypeFields_array[$r]=array( - 'u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.accountancy_code'=>'Text','u.office_phone'=>'Text','u.office_fax'=>'Text', + 'u.login'=>"Text",'u.lastname'=>"Text",'u.firstname'=>"Text",'u.employee'=>'Boolean','u.job'=>'Text', + 'u.accountancy_code'=>'Text', + 'u.address'=>"Text",'u.zip'=>"Text",'u.town'=>"Text", + 'u.office_phone'=>'Text','u.user_mobile'=>'Text','u.office_fax'=>'Text', 'u.email'=>'Text','u.datec'=>"Date",'u.tms'=>"Date",'u.admin'=>"Boolean",'u.statut'=>'Status','u.note'=>"Text",'u.datelastlogin'=>'Date', - 'u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:firstname" + 'u.fk_user'=>"List:user:login", + 'u.birth'=>'Date', + 'u.datepreviouslogin'=>'Date','u.fk_soc'=>"List:societe:nom:rowid",'u.fk_member'=>"List:adherent:firstname" ); $this->export_entities_array[$r]=array( - 'u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.accountancy_code'=>'user','u.office_phone'=>'user', - 'u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.note'=>"user", - 'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user','u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member" + 'u.rowid'=>"user",'u.login'=>"user",'u.lastname'=>"user",'u.firstname'=>"user",'u.employee'=>'user','u.job'=>'user','u.gender'=>'user', + 'u.accountancy_code'=>'user', + 'u.address'=>"user",'u.zip'=>"user",'u.town'=>"user", + 'u.office_phone'=>'user','u.user_mobile'=>'user','u.office_fax'=>'user', + 'u.email'=>'user','u.note'=>"user",'u.signature'=>'user', + 'u.fk_user'=>'user','u.thm'=>'user','u.tjm'=>'user','u.weeklyhours'=>'user', + 'u.dateemployment'=>'user','u.salary'=>'user','u.color'=>'user','u.api_key'=>'user', + 'u.birth'=>'user', + 'u.datec'=>"user",'u.tms'=>"user", + 'u.admin'=>"user",'u.statut'=>'user','u.datelastlogin'=>'user','u.datepreviouslogin'=>'user', + 'u.fk_socpeople'=>"contact",'u.fk_soc'=>"company",'u.fk_member'=>"member" ); if (empty($conf->adherent->enabled)) { @@ -254,11 +274,17 @@ class modUser extends DolibarrModules $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('u'=>MAIN_DB_PREFIX.'user','extra'=>MAIN_DB_PREFIX.'user_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r]=array( - 'u.lastname'=>"Name*",'u.firstname'=>"Firstname",'u.employee'=>"Employee*",'u.job'=>"Job",'u.gender'=>"Gender",'u.login'=>"Login*", + 'u.login'=>"Login*",'u.lastname'=>"Name*",'u.firstname'=>"Firstname",'u.employee'=>"Employee*",'u.job'=>"PostOrFunction",'u.gender'=>"Gender", + 'u.accountancy_code'=>"UserAccountancyCode", 'u.pass_crypted'=>"Password",'u.admin'=>"Administrator",'u.fk_soc'=>"Company*",'u.address'=>"Address",'u.zip'=>"Zip",'u.town'=>"Town", - 'u.fk_state'=>"StateId",'u.fk_country'=>"CountryCode",'u.office_phone'=>"Phone",'u.user_mobile'=>"Mobile",'u.office_fax'=>"Fax", - 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature','u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM', - 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey','u.datec'=>"DateCreation" + 'u.fk_state'=>"StateId",'u.fk_country'=>"CountryCode", + 'u.office_phone'=>"Phone",'u.user_mobile'=>"Mobile",'u.office_fax'=>"Fax", + 'u.email'=>"Email",'u.note'=>"Note",'u.signature'=>'Signature', + 'u.fk_user'=>'Supervisor','u.thm'=>'THM','u.tjm'=>'TJM','u.weeklyhours'=>'WeeklyHours', + 'u.dateemployment'=>'DateEmployment','u.salary'=>'Salary','u.color'=>'Color','u.api_key'=>'ApiKey', + 'u.birth'=>'BirthdayDate', + 'u.datec'=>"DateCreation", + 'u.statut'=>'Status' ); // Add extra fields $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity IN (0,".$conf->entity.")"; @@ -282,13 +308,16 @@ class modUser extends DolibarrModules //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); $this->import_regex_array[$r]=array( 'u.employee'=>'^[0|1]', - 'u.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$' + 'u.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$', + 'u.dateemployment'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$', + 'u.birth'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$' ); $this->import_examplevalues_array[$r]=array( - 'u.lastname'=>"Doe",'u.firstname'=>'John','u.login'=>'jdoe','u.employee'=>'0 or 1','u.status'=>"0 (closed) or 1 (active)", - 'u.fk_soc'=>'0 (internal user) or company name (external user)','u.datec'=>dol_print_date(dol_now(), '%Y-%m-%d'),'u.address'=>"61 jump street", + 'u.lastname'=>"Doe", 'u.firstname'=>'John', 'u.login'=>'jdoe', 'u.employee'=>'0 or 1', + 'u.fk_soc'=>'0 (internal user) or company name (external user)', 'u.datec'=>dol_print_date(dol_now(), '%Y-%m-%d'), 'u.address'=>"61 jump street", 'u.zip'=>"123456",'u.town'=>"Big town",'u.fk_country'=>'US, FR, DE...','u.office_phone'=>"0101010101",'u.office_fax'=>"0101010102", - 'u.email'=>"test@mycompany.com",'u.salary'=>"10000",'u.note'=>"This is an example of note for record",'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00" + 'u.email'=>"test@mycompany.com",'u.salary'=>"10000",'u.note'=>"This is an example of note for record",'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00", + 'u.statut'=>"0 (closed) or 1 (active)", ); $this->import_updatekeys_array[$r]=array('u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>'Login'); } diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 78e7c07b26b..7e05580f77d 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -39,7 +39,7 @@ $langs->load("modulebuilder"); trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; +print ''.$langs->trans("DefineHereComplementaryAttributes", $textobject).'
'."\n"; print '
'; // Load attribute_label diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index fbabb78f122..88e50eccf60 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3293,49 +3293,58 @@ class CommandeFournisseurLigne extends CommonOrderLine { $objp = $this->db->fetch_object($result); - $this->rowid = $objp->rowid; - $this->id = $objp->rowid; - $this->fk_commande = $objp->fk_commande; - $this->desc = $objp->description; - $this->qty = $objp->qty; - $this->ref_fourn = $objp->ref; - $this->ref_supplier = $objp->ref; - $this->subprice = $objp->subprice; - $this->tva_tx = $objp->tva_tx; - $this->localtax1_tx = $objp->localtax1_tx; - $this->localtax2_tx = $objp->localtax2_tx; - $this->localtax1_type = $objp->localtax1_type; - $this->localtax2_type = $objp->localtax2_type; - $this->remise = $objp->remise; - $this->remise_percent = $objp->remise_percent; - $this->fk_product = $objp->fk_product; - $this->info_bits = $objp->info_bits; - $this->total_ht = $objp->total_ht; - $this->total_tva = $objp->total_tva; - $this->total_localtax1 = $objp->total_localtax1; - $this->total_localtax2 = $objp->total_localtax2; - $this->total_ttc = $objp->total_ttc; - $this->product_type = $objp->product_type; - $this->special_code = $objp->special_code; + if (!empty($objp)) + { + $this->rowid = $objp->rowid; + $this->id = $objp->rowid; + $this->fk_commande = $objp->fk_commande; + $this->desc = $objp->description; + $this->qty = $objp->qty; + $this->ref_fourn = $objp->ref; + $this->ref_supplier = $objp->ref; + $this->subprice = $objp->subprice; + $this->tva_tx = $objp->tva_tx; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->localtax1_type = $objp->localtax1_type; + $this->localtax2_type = $objp->localtax2_type; + $this->remise = $objp->remise; + $this->remise_percent = $objp->remise_percent; + $this->fk_product = $objp->fk_product; + $this->info_bits = $objp->info_bits; + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_localtax1 = $objp->total_localtax1; + $this->total_localtax2 = $objp->total_localtax2; + $this->total_ttc = $objp->total_ttc; + $this->product_type = $objp->product_type; + $this->special_code = $objp->special_code; + + $this->ref = $objp->product_ref; + $this->product_ref = $objp->product_ref; + $this->product_libelle = $objp->product_libelle; + $this->product_desc = $objp->product_desc; - $this->ref = $objp->product_ref; - $this->product_ref = $objp->product_ref; - $this->product_libelle = $objp->product_libelle; - $this->product_desc = $objp->product_desc; + $this->date_start = $this->db->jdate($objp->date_start); + $this->date_end = $this->db->jdate($objp->date_end); + $this->fk_unit = $objp->fk_unit; - $this->date_start = $this->db->jdate($objp->date_start); - $this->date_end = $this->db->jdate($objp->date_end); - $this->fk_unit = $objp->fk_unit; + $this->multicurrency_subprice = $objp->multicurrency_subprice; + $this->multicurrency_total_ht = $objp->multicurrency_total_ht; + $this->multicurrency_total_tva = $objp->multicurrency_total_tva; + $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - $this->multicurrency_subprice = $objp->multicurrency_subprice; - $this->multicurrency_total_ht = $objp->multicurrency_total_ht; - $this->multicurrency_total_tva = $objp->multicurrency_total_tva; - $this->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $this->fetch_optionals(); - $this->fetch_optionals(); - - $this->db->free($result); - return 1; + $this->db->free($result); + return 1; + } + else + { + $this->error='Supplier order line with id='.$rowid.' not found'; + dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); + return 0; + } } else { diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 90cd6046765..731695d8d27 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -73,6 +73,11 @@ class ProductFournisseur extends Product public $fourn_remise; // discount for quantity (amount) public $product_fourn_id; // product-supplier id + /** + * @var int ID user_id - user who created/updated supplier price + */ + public $user_id; + /** * @var int ID availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) */ @@ -294,7 +299,32 @@ class ProductFournisseur extends Product if ($this->product_fourn_price_id > 0) { - $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; + // check if price already logged, if not first log current price + $logPrices = $this->listProductFournisseurPriceLog($this->product_fourn_price_id); + if (is_array($logPrices) && count($logPrices) == 0) + { + $currentPfp = new self($this->db); + $result = $currentPfp->fetch_product_fournisseur_price($this->product_fourn_price_id); + if ($result > 0 && $currentPfp->fourn_price != 0) + { + $currentPfpUser = new User($this->db); + $result = $currentPfpUser->fetch($currentPfp->user_id); + if ($result > 0) { + $currentPfp->logPrice( + $currentPfpUser, + $currentPfp->date_creation, + $currentPfp->fourn_price, + $currentPfp->fourn_qty, + $currentPfp->fourn_multicurrency_price, + $currentPfp->fourn_multicurrency_unitprice, + $currentPfp->fourn_multicurrency_tx, + $currentPfp->fourn_multicurrency_id, + $currentPfp->fourn_multicurrency_code + ); + } + } + } + $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql.= " SET fk_user = " . $user->id." ,"; $sql.= " ref_fourn = '" . $this->db->escape($ref_fourn) . "',"; $sql.= " desc_fourn = '" . $this->db->escape($desc_fourn) . "',"; @@ -332,8 +362,9 @@ class ProductFournisseur extends Product $result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_UPDATE', $user); if ($result < 0) $error++; // End call triggers - if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { - $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrency, $multicurrency_code); + if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) + { + $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code); if ($result < 0) { $error++; } @@ -457,7 +488,7 @@ class ProductFournisseur extends Product $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.info_bits as fourn_tva_npr, pfp.fk_availability,"; $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product, pfp.charges, pfp.fk_supplier_price_expression, pfp.delivery_time_days,"; - $sql.= " pfp.supplier_reputation"; + $sql.= " pfp.supplier_reputation, pfp.fk_user, pfp.datec"; $sql.= " ,pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$rowid; @@ -491,7 +522,8 @@ class ProductFournisseur extends Product $this->fk_supplier_price_expression = $obj->fk_supplier_price_expression; $this->supplier_reputation = $obj->supplier_reputation; $this->default_vat_code = $obj->default_vat_code; - + $this->user_id = $obj->fk_user; + $this->date_creation = $this->db->jdate($obj->datec); $this->fourn_multicurrency_price = $obj->multicurrency_price; $this->fourn_multicurrency_unitprice = $obj->multicurrency_unitprice; $this->fourn_multicurrency_tx = $obj->multicurrency_tx; @@ -882,14 +914,14 @@ class ProductFournisseur extends Product /** * List supplier prices log of a supplier price * - * @param int $fourn_id Id of supplier price - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @param int $limit Limit - * @param int $offset Offset - * @return array Array of Log prices + * @param int $product_fourn_price_id Id of supplier price + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit + * @param int $offset Offset + * @return array Array of Log prices */ - function listProductFournisseurPriceLog($fourn_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) + function listProductFournisseurPriceLog($product_fourn_price_id, $sortfield = '', $sortorder = '', $limit = 0, $offset = 0) { global $conf; @@ -902,7 +934,7 @@ class ProductFournisseur extends Product $sql.= " WHERE pfp.entity IN (".getEntity('productprice').")"; $sql.= " AND pfpl.fk_user = u.rowid"; $sql.= " AND pfp.rowid = pfpl.fk_product_fournisseur"; - $sql.= " AND pfpl.fk_product_fournisseur = ".$fourn_id; + $sql.= " AND pfpl.fk_product_fournisseur = ".$product_fourn_price_id; if (empty($sortfield)) $sql.= " ORDER BY pfpl.datec"; else $sql.= $this->db->order($sortfield, $sortorder); $sql.=$this->db->plimit($limit, $offset); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 55e4d2763ad..e4059399b13 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -60,19 +60,19 @@ $search_deliveryday=GETPOST("search_deliveryday", "int"); $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml')); $search_product_category=GETPOST('search_product_category', 'int'); -$search_ref=GETPOST('search_ref'); -$search_refsupp=GETPOST('search_refsupp'); +$search_ref=GETPOST('search_ref', 'alpha'); +$search_refsupp=GETPOST('search_refsupp', 'alpha'); $search_company=GETPOST('search_company', 'alpha'); $search_town=GETPOST('search_town', 'alpha'); $search_zip=GETPOST('search_zip', 'alpha'); -$search_state=trim(GETPOST("search_state")); +$search_state=trim(GETPOST("search_state", 'alpha')); $search_country=GETPOST("search_country", 'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty", 'int'); -$search_user=GETPOST('search_user', 'int'); +$search_user=GETPOST('search_user','int'); $search_request_author=GETPOST('search_request_author', 'alpha'); -$search_ht=GETPOST('search_ht'); -$search_ttc=GETPOST('search_ttc'); -$search_status=(GETPOST('search_status', 'alpha')!=''?GETPOST('search_status', 'alpha'):GETPOST('statut', 'alpha')); // alpha and not intbecause it can be '6,7' +$search_ht=GETPOST('search_ht', 'alpha'); +$search_ttc=GETPOST('search_ttc', 'alpha'); +$search_status=(GETPOST('search_status', 'alpha')!=''?GETPOST('search_status', 'alpha'):GETPOST('statut', 'alpha')); // alpha and not intbecause it can be '6,7' $optioncss = GETPOST('optioncss', 'alpha'); $socid = GETPOST('socid', 'int'); $search_sale=GETPOST('search_sale', 'int'); diff --git a/htdocs/install/medias/background_computer_coffee.jpg b/htdocs/install/medias/background_computer_coffee.jpg deleted file mode 100644 index 0a4c8828a58..00000000000 Binary files a/htdocs/install/medias/background_computer_coffee.jpg and /dev/null differ diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index d93d329ab23..ecb10fb1549 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -126,8 +126,8 @@ ThisIsContentOfYourMembershipWasValidated=We want to let you know that your memb ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.

ThisIsContentOfSubscriptionReminderEmail=We want to let you know that your subscription is about to expire or has already expired (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). We hope you will renew it.

ThisIsContentOfYourCard=This is a summary of the information we have about you. Please contact us if anything is incorrect.

-DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the email received in case of auto-inscription of a guest -DescADHERENT_AUTOREGISTER_NOTIF_MAIL=Email received in case of auto-inscription of a guest +DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the notification email received in case of auto-inscription of a guest +DescADHERENT_AUTOREGISTER_NOTIF_MAIL=Content of the notification email received in case of auto-inscription of a guest DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Email template to use to send email to a member on member autosubscription DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Email template to use to send email to a member on member validation DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Email template to use to send email to a member on new subscription recording diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 6aef75a5746..f8d4669b8e5 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -76,7 +76,7 @@ ListOfMenusEntries=List of menu entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only. Using a negative value means field is not shown by default on list but can be selected for viewing) +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only. Using a negative value means field is not shown by default on list but can be selected for viewing). It can be an expression, for example: preg_match('/public/', $_SERVER['PHP_SELF'])?0:1 IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0) SpecDefDesc=Enter here all documentation you want to provide with your module that is not already defined by other tabs. You can use .md or better, the rich .asciidoc syntax. diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 73e97174e4f..6a24a9a2f64 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -124,7 +124,7 @@ CardContent=Contenu de votre fiche adhérent ThisIsContentOfYourMembershipRequestWasReceived=Nous vous informons que votre demande d'adhésion a bien été reçue.

ThisIsContentOfYourMembershipWasValidated=Nous vous informons que votre adhésion a été validé avec les informations suivantes:

ThisIsContentOfYourSubscriptionWasRecorded=Nous vous informons que votre nouvelle cotisation a été enregistrée.

-ThisIsContentOfSubscriptionReminderEmail=Nous voulons vous informer que votre abonnement est sur le point d'expirer ou a déjà expiré (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). Nous espérons que vous pourrez le renouveler, votre soutien nous ait précieux.

+ThisIsContentOfSubscriptionReminderEmail=Nous voulons vous informer que votre cotisation est sur le point d'expirer ou a déjà expiré (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). Nous espérons que vous pourrez le renouveler, votre soutien nous ait précieux.

ThisIsContentOfYourCard=Ceci est un rappel des informations que nous avons vous concernant. N'hésitez pas à nous contacter en cas d'erreur.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Sujet de l'email reçu en cas d'auto-inscription d'un invité DescADHERENT_AUTOREGISTER_NOTIF_MAIL=Email reçu en cas d'auto-inscription d'un invité diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index be09afd16d2..815a1cdbe4c 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -82,7 +82,7 @@ AttachANewFile=Ajouter un nouveau fichier/document LinkedObject=Objet lié NbOfActiveNotifications=Nombre de notifications (nb de destinataires emails) PredefinedMailTest=__(Hello)__,\nCeci est un mail de test envoyé à __EMAIL__.\nLes deux lignes sont séparées par un saut de ligne.\n\n__USER_SIGNATURE__ -PredefinedMailTestHtml=__(Hello)__\nCeci est un message de test (le mot test doit être en gras).
Les 2 lignes sont séparées par un retour à la ligne.

__SIGNATURE__ +PredefinedMailTestHtml=__(Hello)__
Ceci est un message de test (le mot test doit être en gras).
Les 2 lignes sont séparées par un retour à la ligne.

__SIGNATURE__ PredefinedMailContentContract=__(Hello)__\n\n\n__(Sincerely)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendInvoice=__(Bonjour)__\n\nVeuillez trouver la facture ci-jointe __REF__\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Cordialement)__\n\n__USER_SIGNATURE__ PredefinedMailContentSendInvoiceReminder=__(Bonjour)__\n\nNous tenons à vous avertir que la facture __REF__ ne semble pas avoir été payée. La facture est jointe, à titre de rappel.\n\n__ONLINE_PAYMENT_TEXT_AND_URL__\n\n__(Cordialement)__\n\n__USER_SIGNATURE__ diff --git a/htdocs/product/index.php b/htdocs/product/index.php index d4640415650..91d6f3f4681 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2014-2016 Charlie BENKE * Copyright (C) 2015 Jean-François Ferry + * 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 @@ -172,12 +173,12 @@ $total=0; if ($type == '0') { print $statProducts; - $total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]); + $total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2])+round($prodser[0][3]); } elseif ($type == '1') { print $statServices; - $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2]); + $total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2])+round($prodser[1][3]); } else { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 68aafa040a6..9c9822677a1 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1800,7 +1800,7 @@ if ($action == 'create') } // Create an order - if (! empty($conf->commande->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { + if (! empty($conf->fournisseur->enabled) && $object->statut == SupplierProposal::STATUS_SIGNED) { if ($user->rights->fournisseur->commande->creer) { print ''; } diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index e2d50cfcab0..741ea7e3a88 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -63,8 +63,25 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); get_full_arbo('product'); + +$maincategories = array_filter($categories, function ($item) { + if (($item['level']==1) !== false) { + return true; + } + return false; +}); + +$subcategories = array_filter($categories, function ($item) { + if (($item['level']!=1) !== false) { + return true; + } + return false; +}); ?> + var categories = ; +var subcategories = ; + var currentcat; var pageproducts=0; var pagecategories=0; @@ -109,15 +126,27 @@ function MoreCategories(moreorless){ } } -function LoadProducts(position){ +function LoadProducts(position, issubcat=false){ $('#catimg'+position).animate({opacity: '0.5'}, 1); $('#catimg'+position).animate({opacity: '1'}, 100); - currentcat=$('#catdiv'+position).data('rowid'); + if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid'); + else currentcat=$('#catdiv'+position).data('rowid'); if (currentcat=="") return; pageproducts=0; + ishow=0; //product to show counter + + jQuery.each(subcategories, function(i, val) { + if (currentcat==val.fk_parent){ + $("#prodesc"+ishow).text(val.label); + $("#proimg"+ishow).attr("src","genimg/?query=cat&w=55&h=50&id="+val.rowid); + $("#prodiv"+ishow).data("rowid",val.rowid); + $("#prodiv"+ishow).data("iscat",1); + ishow++; + } + }); + + idata=0; //product data counter $.getJSON('./ajax.php?action=getProducts&category='+currentcat, function(data) { - idata=0; //product data counter - ishow=0; //product to show counter while (idata < 30) { if (typeof (data[idata]) == "undefined") { $("#prodesc"+ishow).text(""); @@ -130,6 +159,7 @@ function LoadProducts(position){ $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); + $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } idata++; //Next data everytime @@ -168,6 +198,7 @@ function MoreProducts(moreorless){ $("#prodesc"+ishow).text(data[parseInt(idata)]['label']); $("#proimg"+ishow).attr("src","genimg/?query=pro&w=55&h=50&id="+data[idata]['id']); $("#prodiv"+ishow).data("rowid",data[idata]['id']); + $("#prodiv"+ishow).data("iscat",0); ishow++; //Next product to show after print data product } idata++; //Next data everytime @@ -178,12 +209,16 @@ function MoreProducts(moreorless){ function ClickProduct(position){ $('#proimg'+position).animate({opacity: '0.5'}, 1); $('#proimg'+position).animate({opacity: '1'}, 100); - idproduct=$('#prodiv'+position).data('rowid'); - if (idproduct=="") return; - $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() { - $('#poslines').scrollTop($('#poslines')[0].scrollHeight); - }); - + if ($('#prodiv'+position).data('iscat')==1){ + LoadProducts(position, true); + } + else{ + idproduct=$('#prodiv'+position).data('rowid'); + if (idproduct=="") return; + $("#poslines").load("invoice.php?action=addline&place="+place+"&idproduct="+idproduct, function() { + $('#poslines').scrollTop($('#poslines')[0].scrollHeight); + }); + } } function deleteline(){ @@ -233,6 +268,7 @@ function Search2(){ $("#prodesc"+i).text(data[parseInt(i)]['label']); $("#proimg"+i).attr("src","genimg/?query=pro&w=55&h=50&id="+data[i]['rowid']); $("#prodiv"+i).data("rowid",data[i]['rowid']); + $("#prodiv"+ishow).data("iscat",0); } }); } diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index 50ff0cc6eed..b52fd6f7e51 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -9,6 +9,8 @@ CKEDITOR.editorConfig = function( config ) // http://docs.cksource.com/CKEditor_3.x/Developers_Guide // http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html config.enterMode = CKEDITOR.ENTER_BR; + //config.forceSimpleAmpersand = true; // When you put a into the textarea, and go into "source", then ckeditor change the & into &. We don't want this. But this option does not fix this. + //config.entities = false; // When you put a into the textarea, and go into "source", then ckeditor change the & into &. We don't want this. But this option does not fix this. config.resize_enabled = false; //config.resize_maxHeight = 3000; //config.resize_maxWidth = 3000;