diff --git a/.scrutinizer.yml b/.scrutinizer.yml
index 831aa15c68a..60fea392133 100644
--- a/.scrutinizer.yml
+++ b/.scrutinizer.yml
@@ -1,4 +1,7 @@
# .scrutinizer.yml
+build:
+ - php-scrutinizer-run
+
imports:
- javascript
- php
diff --git a/.travis.yml b/.travis.yml
index 63e48a051f0..b710e17c773 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -164,12 +164,6 @@ before_script:
echo
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
- if [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
- # Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0, 7.1, 7.2 and nightly!
- echo
- echo "Enabling Memcached for PHP <= 5.4"
- echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
- fi
phpenv rehash
echo
@@ -350,6 +344,9 @@ script:
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
php upgrade2.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
php step5.php 9.0.0 10.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
+ php upgrade.php 10.0.0 11.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade9001000.log
+ php upgrade2.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-2.log
+ php step5.php 10.0.0 11.0.0 > $TRAVIS_BUILD_DIR/upgrade9001000-3.log
# Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
echo $?
diff --git a/ChangeLog b/ChangeLog
index ba739628d86..472c3ffba81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,21 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
+
+***** ChangeLog for 11.0.0 compared to 10.0.0 *****
+For Users:
+
+
+For Developers:
+
+
+WARNING:
+
+Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* Properties ->libelle_incoterms were renamed into ->label_incoterms
+
+
+
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
For Users:
NEW: Module "Ticket" is available as a stable module.
@@ -57,7 +72,7 @@ NEW: Can generate invoices from the timespent entered on a project
NEW: Can update product supplier price ref
NEW: Can upload files from the edit page of expense report
NEW: Color for hover and for checked line is on by default
-NEW: Column of parent company is available in list of third parties
+NEW: Column of p...arent company is available in list of third parties
NEW: conditionnal add member button by statut
NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN
NEW: Contact related items tab
@@ -484,6 +499,41 @@ Following changes may create regressions for some external modules, but were nec
* Remove the no more used and deprecated dol_print_graph function
+***** ChangeLog for 8.0.6 compared to 8.0.5 *****
+FIX: #11244
+FIX: #11316
+FIX: Add missing end date of subscription in export
+FIX: A user may read holiday and expense report without permissions
+FIX: better syntax
+FIX: condition
+FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
+FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
+FIX: default value for duration of validity can be set from generic
+FIX: do not include tpl from disabled modules
+FIX: Error management when MAILING_NO_USING_PHPMAIL is set
+FIX: Even with permission, can't validate leave once validator defined.
+FIX: extrafield list search: SQL error when field is multiselect
+FIX: if last char of customercode is accent making the truncate of first
+FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
+FIX: invalid link on user.fk_user
+FIX: invoice class: bad SQL request if product type not set
+FIX: mail presend: can overwrite a file previously uploaded
+FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
+FIX: mass send mail
+FIX: missing compatibility with multicompany transverse mode
+FIX: modulebuilder: hardcoded llx_
+FIX: Not showing Contract and Project columns on ficheinter list
+FIX: remove isolated transaction commit
+FIX: security (a user can read leave or holiday of other without perm.
+FIX: situation invoices: bad detailed VAT in situations following the first one
+FIX: situation invoices: block progress percentage change for discount lines
+FIX: syntax error
+FIX: try to use WHERE EXISTS instead DISTINCT
+FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
+FIX: var name
+FIX: we need to fetch fourn invoice with ref in current entity
+FIX: Wrong stock movement on supplier credit notes
+
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
FIX: #10381
FIX: #10460 compatibility with MariaDB 10.4
diff --git a/build/debian/copyright b/build/debian/copyright
index 72e531d7007..a5832aa7754 100644
--- a/build/debian/copyright
+++ b/build/debian/copyright
@@ -52,7 +52,7 @@ License: GPL-3+
details.
.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU General Public
License version 3 can be found in the file
@@ -98,7 +98,7 @@ License: GPL-2+
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 .
+ along with this program. If not, see .
.
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-2 file.
@@ -192,7 +192,7 @@ License: GPL-2+
details.
.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
@@ -212,7 +212,7 @@ License: LGPL-2.1+
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file
@@ -236,7 +236,7 @@ License: GPL-2+ or MIT
details.
.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
@@ -291,7 +291,7 @@ License: GPL-2+
details.
.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
@@ -311,7 +311,7 @@ License: LGPL-2.1+
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file
@@ -358,7 +358,7 @@ License: LGPL-2.1+
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
.
On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file
@@ -378,7 +378,7 @@ License: LGPL-3.0+
See the GNU Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
- along with TCPDF. If not, see .
+ along with TCPDF. If not, see .
.
On Debian systems, the complete text of the GNU Lesser General
Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".
diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php
index 43f3d734a2e..d5af14f9171 100755
--- a/build/generate_filelist_xml.php
+++ b/build/generate_filelist_xml.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php
index 792341f5c79..dbbe9d84c1c 100755
--- a/dev/examples/code/create_invoice.php
+++ b/dev/examples/code/create_invoice.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php
index fa3fa573223..30265d5462e 100755
--- a/dev/examples/code/create_order.php
+++ b/dev/examples/code/create_order.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php
index 7ca09246980..234658388df 100755
--- a/dev/examples/code/create_product.php
+++ b/dev/examples/code/create_product.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php
index 2fed1a51972..96d369085d2 100755
--- a/dev/examples/code/create_user.php
+++ b/dev/examples/code/create_user.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php
index eafc0dfeed5..aec246e9480 100755
--- a/dev/examples/code/get_contracts.php
+++ b/dev/examples/code/get_contracts.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php
index 0f04a4d236f..bfdda2896a1 100755
--- a/dev/initdata/generate-invoice.php
+++ b/dev/initdata/generate-invoice.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/
diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php
index f07905f1edd..b66d3a3abc9 100755
--- a/dev/initdata/generate-order.php
+++ b/dev/initdata/generate-order.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/
diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php
index 9e1b15331d4..e9703fbfd6e 100755
--- a/dev/initdata/generate-product.php
+++ b/dev/initdata/generate-product.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/
diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php
index 4bd9c2c654b..30c9471a281 100755
--- a/dev/initdata/generate-proposal.php
+++ b/dev/initdata/generate-proposal.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/
diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php
index cc2e85e544a..54e17c7f8d7 100755
--- a/dev/initdata/generate-thirdparty.php
+++ b/dev/initdata/generate-thirdparty.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* ATTENTION DE PAS EXECUTER CE SCRIPT SUR UNE INSTALLATION DE PRODUCTION
*/
diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php
index fa9cfd6592b..e55f13c7c82 100755
--- a/dev/initdata/import-products.php
+++ b/dev/initdata/import-products.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php
index 8826ca18544..558745e8d06 100755
--- a/dev/initdata/import-thirdparties.php
+++ b/dev/initdata/import-thirdparties.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php
index 34130890f4b..64af2f9eb64 100755
--- a/dev/initdata/import-users.php
+++ b/dev/initdata/import-users.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php
index 42d6d28eadf..62f41ce825f 100755
--- a/dev/initdata/purge-data.php
+++ b/dev/initdata/purge-data.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*
* THIS SCRIPT DELETE ALL MAIN TABLE CONTENT
* WARNING, DO NOT USE ON A PRODUCTION INSTANCE
diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php
index e261895b617..e5ade3aa2f6 100755
--- a/dev/initdemo/sftpget_and_loaddump.php
+++ b/dev/initdemo/sftpget_and_loaddump.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
* or see http://www.gnu.org/
*
* Get a distant dump file and load it into a mysql database
diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php
index 53ae2251f35..dcaa44c43a6 100755
--- a/dev/initdemo/updatedemo.php
+++ b/dev/initdemo/updatedemo.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
* or see http://www.gnu.org/
*
* Get a distant dump file and load it into a mysql database
diff --git a/dev/resources/licence/Links on GPL.txt b/dev/resources/licence/Links on GPL.txt
index 1bb3053da2a..bb9c1597f68 100644
--- a/dev/resources/licence/Links on GPL.txt
+++ b/dev/resources/licence/Links on GPL.txt
@@ -1,8 +1,8 @@
* Page with licence compatibility
-http://www.gnu.org/licenses/quick-guide-gplv3.fr.html
+https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
* FAQ on GPL licence
-http://www.fsf.org/licensing/licenses/gpl-faq.html
+https://www.fsf.org/licensing/licenses/gpl-faq.html
* Questions/Answers on Fork for using Dolibarr as a SaaS
-http://stackoverflow.com/questions/539291/rebranding-a-gpld-app-as-saas
+https://stackoverflow.com/questions/539291/rebranding-a-gpld-app-as-saas
diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php
index 789bd8173c4..f9657482c86 100644
--- a/dev/translation/autotranslator.class.php
+++ b/dev/translation/autotranslator.class.php
@@ -12,7 +12,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/translation/autotranslator.php b/dev/translation/autotranslator.php
index eb0f53ead65..5e8cc13c3c8 100755
--- a/dev/translation/autotranslator.php
+++ b/dev/translation/autotranslator.php
@@ -13,7 +13,7 @@
* 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 .
+ * along with this program. If not, see .
*/
/**
diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php
index 4db931f7dae..7f095a744db 100755
--- a/dev/translation/sanity_check_en_langfiles.php
+++ b/dev/translation/sanity_check_en_langfiles.php
@@ -15,7 +15,7 @@
* 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 .
+ * along with this program. If not, see .
*/
$sapi_type = php_sapi_name();
diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php
index d439397a512..ce28ca5de63 100755
--- a/dev/translation/strip_language_file.php
+++ b/dev/translation/strip_language_file.php
@@ -14,7 +14,7 @@
* 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 .
+ * along with this program. If not, see .
*
* -----
*
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index 102d268e218..527cb13fcfd 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2010-2016 Juanjo Menent
- * Copyright (C) 2011-2018 Philippe Grand
+ * Copyright (C) 2011-2019 Philippe Grand
* Copyright (C) 2011 Remy Younes
* Copyright (C) 2012-2015 Marcos García
* Copyright (C) 2012 Christophe Battarel
diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php
index dfec49949a3..8a5213f5ab8 100644
--- a/htdocs/accountancy/admin/fiscalyear_info.php
+++ b/htdocs/accountancy/admin/fiscalyear_info.php
@@ -12,7 +12,7 @@
* 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, seehttp://www.gnu.org/licenses/>.
+ * along with this program. If not, see .
*/
/**
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index 4fc30bb0c30..616c8697c61 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("accountancy"));
+$socid = GETPOST('socid', 'int');
+
$action = GETPOST('action', 'aZ09');
$search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
@@ -97,14 +99,15 @@ $pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "t.piece_num,t.rowid";
-
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new BookKeeping($db);
+$hookmanager->initHooks(array('bookkeepinglist'));
$formaccounting = new FormAccounting($db);
$formother = new FormOther($db);
$form = new Form($db);
-if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int'))
+if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && ! GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
{
if (empty($search_date_start) && empty($search_date_end) && ! GETPOSTISSET('restore_lastsearch_values'))
{
@@ -160,147 +163,153 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.let
if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
-include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
+$parameters=array('socid'=>$socid);
+$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');
-if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
+if (empty($reshook))
{
- $search_mvt_num = '';
- $search_doc_type = '';
- $search_doc_ref = '';
- $search_doc_date = '';
- $search_accountancy_code = '';
- $search_accountancy_code_start = '';
- $search_accountancy_code_end = '';
- $search_accountancy_aux_code = '';
- $search_accountancy_aux_code_start = '';
- $search_accountancy_aux_code_end = '';
- $search_mvt_label = '';
- $search_direction = '';
- $search_ledger_code = '';
- $search_date_start = '';
- $search_date_end = '';
- $search_date_creation_start = '';
- $search_date_creation_end = '';
- $search_date_modification_start = '';
- $search_date_modification_end = '';
- $search_date_export_start = '';
- $search_date_export_end = '';
- $search_debit = '';
- $search_credit = '';
- $search_lettering_code = '';
+ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
+
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
+ {
+ $search_mvt_num = '';
+ $search_doc_type = '';
+ $search_doc_ref = '';
+ $search_doc_date = '';
+ $search_accountancy_code = '';
+ $search_accountancy_code_start = '';
+ $search_accountancy_code_end = '';
+ $search_accountancy_aux_code = '';
+ $search_accountancy_aux_code_start = '';
+ $search_accountancy_aux_code_end = '';
+ $search_mvt_label = '';
+ $search_direction = '';
+ $search_ledger_code = '';
+ $search_date_start = '';
+ $search_date_end = '';
+ $search_date_creation_start = '';
+ $search_date_creation_end = '';
+ $search_date_modification_start = '';
+ $search_date_modification_end = '';
+ $search_date_export_start = '';
+ $search_date_export_end = '';
+ $search_debit = '';
+ $search_credit = '';
+ $search_lettering_code = '';
+ }
+
+ // Must be after the remove filter action, before the export.
+ $param = '';
+ $filter = array ();
+ if (! empty($search_date_start)) {
+ $filter['t.doc_date>='] = $search_date_start;
+ $tmp=dol_getdate($search_date_start);
+ $param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
+ }
+ if (! empty($search_date_end)) {
+ $filter['t.doc_date<='] = $search_date_end;
+ $tmp=dol_getdate($search_date_end);
+ $param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
+ }
+ if (! empty($search_doc_date)) {
+ $filter['t.doc_date'] = $search_doc_date;
+ $tmp=dol_getdate($search_doc_date);
+ $param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
+ }
+ if (! empty($search_doc_type)) {
+ $filter['t.doc_type'] = $search_doc_type;
+ $param .= '&search_doc_type=' . urlencode($search_doc_type);
+ }
+ if (! empty($search_doc_ref)) {
+ $filter['t.doc_ref'] = $search_doc_ref;
+ $param .= '&search_doc_ref=' . urlencode($search_doc_ref);
+ }
+ if (! empty($search_accountancy_code)) {
+ $filter['t.numero_compte'] = $search_accountancy_code;
+ $param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
+ }
+ if (! empty($search_accountancy_code_start)) {
+ $filter['t.numero_compte>='] = $search_accountancy_code_start;
+ $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
+ }
+ if (! empty($search_accountancy_code_end)) {
+ $filter['t.numero_compte<='] = $search_accountancy_code_end;
+ $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
+ }
+ if (! empty($search_accountancy_aux_code)) {
+ $filter['t.subledger_account'] = $search_accountancy_aux_code;
+ $param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
+ }
+ if (! empty($search_accountancy_aux_code_start)) {
+ $filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
+ $param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
+ }
+ if (! empty($search_accountancy_aux_code_end)) {
+ $filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
+ $param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
+ }
+ if (! empty($search_mvt_label)) {
+ $filter['t.label_operation'] = $search_mvt_label;
+ $param .= '&search_mvt_label=' . urlencode($search_mvt_label);
+ }
+ if (! empty($search_direction)) {
+ $filter['t.sens'] = $search_direction;
+ $param .= '&search_direction=' . urlencode($search_direction);
+ }
+ if (! empty($search_ledger_code)) {
+ $filter['t.code_journal'] = $search_ledger_code;
+ $param .= '&search_ledger_code=' . urlencode($search_ledger_code);
+ }
+ if (! empty($search_mvt_num)) {
+ $filter['t.piece_num'] = $search_mvt_num;
+ $param .= '&search_mvt_num=' . urlencode($search_mvt_num);
+ }
+ if (! empty($search_date_creation_start)) {
+ $filter['t.date_creation>='] = $search_date_creation_start;
+ $tmp=dol_getdate($search_date_creation_start);
+ $param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
+ }
+ if (! empty($search_date_creation_end)) {
+ $filter['t.date_creation<='] = $search_date_creation_end;
+ $tmp=dol_getdate($search_date_creation_end);
+ $param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
+ }
+ if (! empty($search_date_modification_start)) {
+ $filter['t.tms>='] = $search_date_modification_start;
+ $tmp=dol_getdate($search_date_modification_start);
+ $param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
+ }
+ if (! empty($search_date_modification_end)) {
+ $filter['t.tms<='] = $search_date_modification_end;
+ $tmp=dol_getdate($search_date_modification_end);
+ $param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
+ }
+ if (! empty($search_date_export_start)) {
+ $filter['t.date_export>='] = $search_date_export_start;
+ $tmp=dol_getdate($search_date_export_start);
+ $param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
+ }
+ if (! empty($search_date_export_end)) {
+ $filter['t.date_export<='] = $search_date_export_end;
+ $tmp=dol_getdate($search_date_export_end);
+ $param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
+ }
+ if (! empty($search_debit)) {
+ $filter['t.debit'] = $search_debit;
+ $param .= '&search_debit=' . urlencode($search_debit);
+ }
+ if (! empty($search_credit)) {
+ $filter['t.credit'] = $search_credit;
+ $param .= '&search_credit=' . urlencode($search_credit);
+ }
+ if (! empty($search_lettering_code)) {
+ $filter['t.lettering_code'] = $search_lettering_code;
+ $param .= '&search_lettering_code=' . urlencode($search_lettering_code);
+ }
}
-// Must be after the remove filter action, before the export.
-$param = '';
-$filter = array ();
-if (! empty($search_date_start)) {
- $filter['t.doc_date>='] = $search_date_start;
- $tmp=dol_getdate($search_date_start);
- $param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
-}
-if (! empty($search_date_end)) {
- $filter['t.doc_date<='] = $search_date_end;
- $tmp=dol_getdate($search_date_end);
- $param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
-}
-if (! empty($search_doc_date)) {
- $filter['t.doc_date'] = $search_doc_date;
- $tmp=dol_getdate($search_doc_date);
- $param .= '&doc_datemonth=' . $tmp['mon'] . '&doc_dateday=' . $tmp['mday'] . '&doc_dateyear=' . $tmp['year'];
-}
-if (! empty($search_doc_type)) {
- $filter['t.doc_type'] = $search_doc_type;
- $param .= '&search_doc_type=' . urlencode($search_doc_type);
-}
-if (! empty($search_doc_ref)) {
- $filter['t.doc_ref'] = $search_doc_ref;
- $param .= '&search_doc_ref=' . urlencode($search_doc_ref);
-}
-if (! empty($search_accountancy_code)) {
- $filter['t.numero_compte'] = $search_accountancy_code;
- $param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
-}
-if (! empty($search_accountancy_code_start)) {
- $filter['t.numero_compte>='] = $search_accountancy_code_start;
- $param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
-}
-if (! empty($search_accountancy_code_end)) {
- $filter['t.numero_compte<='] = $search_accountancy_code_end;
- $param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
-}
-if (! empty($search_accountancy_aux_code)) {
- $filter['t.subledger_account'] = $search_accountancy_aux_code;
- $param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
-}
-if (! empty($search_accountancy_aux_code_start)) {
- $filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
- $param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
-}
-if (! empty($search_accountancy_aux_code_end)) {
- $filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
- $param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
-}
-if (! empty($search_mvt_label)) {
- $filter['t.label_operation'] = $search_mvt_label;
- $param .= '&search_mvt_label=' . urlencode($search_mvt_label);
-}
-if (! empty($search_direction)) {
- $filter['t.sens'] = $search_direction;
- $param .= '&search_direction=' . urlencode($search_direction);
-}
-if (! empty($search_ledger_code)) {
- $filter['t.code_journal'] = $search_ledger_code;
- $param .= '&search_ledger_code=' . urlencode($search_ledger_code);
-}
-if (! empty($search_mvt_num)) {
- $filter['t.piece_num'] = $search_mvt_num;
- $param .= '&search_mvt_num=' . urlencode($search_mvt_num);
-}
-if (! empty($search_date_creation_start)) {
- $filter['t.date_creation>='] = $search_date_creation_start;
- $tmp=dol_getdate($search_date_creation_start);
- $param .= '&date_creation_startmonth=' . $tmp['mon'] . '&date_creation_startday=' . $tmp['mday'] . '&date_creation_startyear=' . $tmp['year'];
-}
-if (! empty($search_date_creation_end)) {
- $filter['t.date_creation<='] = $search_date_creation_end;
- $tmp=dol_getdate($search_date_creation_end);
- $param .= '&date_creation_endmonth=' . $tmp['mon'] . '&date_creation_endday=' . $tmp['mday'] . '&date_creation_endyear=' . $tmp['year'];
-}
-if (! empty($search_date_modification_start)) {
- $filter['t.tms>='] = $search_date_modification_start;
- $tmp=dol_getdate($search_date_modification_start);
- $param .= '&date_modification_startmonth=' . $tmp['mon'] . '&date_modification_startday=' . $tmp['mday'] . '&date_modification_startyear=' . $tmp['year'];
-}
-if (! empty($search_date_modification_end)) {
- $filter['t.tms<='] = $search_date_modification_end;
- $tmp=dol_getdate($search_date_modification_end);
- $param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
-}
-if (! empty($search_date_export_start)) {
- $filter['t.date_export>='] = $search_date_export_start;
- $tmp=dol_getdate($search_date_export_start);
- $param .= '&date_export_startmonth=' . $tmp['mon'] . '&date_export_startday=' . $tmp['mday'] . '&date_export_startyear=' . $tmp['year'];
-}
-if (! empty($search_date_export_end)) {
- $filter['t.date_export<='] = $search_date_export_end;
- $tmp=dol_getdate($search_date_export_end);
- $param .= '&date_export_endmonth=' . $tmp['mon'] . '&date_export_endday=' . $tmp['mday'] . '&date_export_endyear=' . $tmp['year'];
-}
-if (! empty($search_debit)) {
- $filter['t.debit'] = $search_debit;
- $param .= '&search_debit=' . urlencode($search_debit);
-}
-if (! empty($search_credit)) {
- $filter['t.credit'] = $search_credit;
- $param .= '&search_credit=' . urlencode($search_credit);
-}
-if (! empty($search_lettering_code)) {
- $filter['t.lettering_code'] = $search_lettering_code;
- $param .= '&search_lettering_code=' . urlencode($search_lettering_code);
-}
-
-
-if ($action == 'delbookkeeping') {
+if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
$import_key = GETPOST('importkey', 'alpha');
@@ -315,7 +324,7 @@ if ($action == 'delbookkeeping') {
exit;
}
}
-if ($action == 'delbookkeepingyearconfirm') {
+if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
$delyear = GETPOST('delyear', 'int');
if ($delyear==-1) {
@@ -346,7 +355,7 @@ if ($action == 'delbookkeepingyearconfirm') {
setEventMessages("NoRecordDeleted", null, 'warnings');
}
}
-if ($action == 'delmouvconfirm') {
+if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) {
$mvt_num = GETPOST('mvt_num', 'int');
@@ -366,7 +375,8 @@ if ($action == 'delmouvconfirm') {
}
// Export into a file with format defined into setup (FEC, CSV, ...)
-if ($action == 'export_file') {
+if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
+
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', $conf->global->ACCOUNTING_REEXPORT);
if ($result < 0)
@@ -514,11 +524,11 @@ if (! empty($conf->global->ACCOUNTING_REEXPORT)) {
}
$newcardbutton.= ''.$langs->trans("IncludeDocsAlreadyExported").'';
-$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''));
+$newcardbutton.= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$conf->global->ACCOUNTING_EXPORT_MODELCSV].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param?'&'.$param:''), $user->rights->accounting->mouvements->export);
$newcardbutton.= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
-$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create');
+$newcardbutton.= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create', '', $user->rights->accounting->mouvements->creer);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
@@ -526,6 +536,11 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
+if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
+else $moreforfilter = $hookmanager->resPrint;
+
print '
';
+}
print '';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index cfe49764c74..cb8c35f0416 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -8,8 +8,8 @@
* Copyright (C) 2013-2014 Florian Henry
* Copyright (C) 2013-2014 Olivier Geffroy
* Copyright (C) 2017-2018 Frédéric France
- * Copyright (C) 2018 Ferran Marcet
- * Copyright (C) 2018 Eric Seigne
+ * Copyright (C) 2018 Ferran Marcet
+ * Copyright (C) 2018 Eric Seigne
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index e4a1fc01355..c6dda99dcb2 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1059,11 +1059,17 @@ else
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
-
- print '';
+ //Hooks here
+ $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ if (empty($reshook))
+ {
+ print $object->showOptionals($extrafields, 'edit');
+ }
+
+ print '';
print "\n";
-
- dol_fiche_end();
+ dol_fiche_end();
print '
';
print '';
@@ -1357,9 +1363,15 @@ else
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
-
+ //Hooks here
+ $reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ if (empty($reshook))
+ {
+ print $object->showOptionals($extrafields, 'edit');
+ }
+
print '';
-
dol_fiche_end();
print '
';
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 115d1fb8ab4..1e940df2e26 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -11,6 +11,7 @@
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2016 Juanjo Menent
* Copyright (C) 2018-2019 Thibault FOUCART
+ * Copyright (C) 2019 Nicolas ZABOURI
*
* 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
@@ -2123,28 +2124,28 @@ class Adherent extends CommonObject
$link.=$linkclose.'>';
$linkend='';
- //if ($withpictoimg == -1) $result.='
';
$result.=$link;
+ if ($withpictoimg) $result.='
';
if ($withpictoimg)
{
$paddafterimage='';
if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"';
// Only picto
- if ($withpictoimg > 0) $picto='
';
if ($action != 'editincoterm')
{
- print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
+ print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
}
else
{
@@ -4651,7 +4654,7 @@ elseif ($id > 0 || ! empty($ref))
&& ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
{
- if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice
+ if ($object->close_code != 'replaced' || (! $objectidnext)) // Not replaced by another invoice or replaced but the replacement invoice has been deleted
{
print '
';
+ if (! $i) $totalarray['nbfield']++;
+
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+
// Status
- print '
';
if ($action != 'editincoterm')
{
- print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
+ print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
}
else
{
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 811c2b8586f..f1877ace179 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -372,7 +372,7 @@ class Reception extends CommonObject
$sql.= ", el.fk_source as origin_id, el.sourcetype as origin";
$sql.= ", e.note_private, e.note_public";
$sql.= ', e.fk_incoterms, e.location_incoterms';
- $sql.= ', i.libelle as libelle_incoterms';
+ $sql.= ', i.libelle as label_incoterms';
$sql.= " FROM ".MAIN_DB_PREFIX."reception as e";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON e.fk_incoterms = i.rowid';
@@ -431,7 +431,7 @@ class Reception extends CommonObject
//Incoterms
$this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms;
- $this->libelle_incoterms = $obj->libelle_incoterms;
+ $this->label_incoterms = $obj->label_incoterms;
$this->db->free($result);
diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php
index 3b0bb7a05e0..97e25ab39e5 100644
--- a/htdocs/reception/index.php
+++ b/htdocs/reception/index.php
@@ -1,8 +1,9 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
- * Copyright (C) 2005-2012 Regis Houssin
- * Copyright (C) 2018 Quentin Vial-Gouteyron
+/* Copyright (C) 2003-2005 Rodolphe Quiedeville
+ * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2018 Quentin Vial-Gouteyron
+ * Copyright (C) 2019 Nicolas ZABOURI
*
* 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
@@ -28,6 +29,11 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
+$hookmanager = new HookManager($db);
+
+// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
+$hookmanager->initHooks(array('receptionindex'));
+
$langs->load("orders");
$langs->load("receptions");
@@ -292,6 +298,8 @@ else dol_print_error($db);
print '';
+$parameters = array('user' => $user);
+$reshook = $hookmanager->executeHooks('dashboardWarehouseReceptions', $parameters, $object); // Note that $action and $object may have been modified by hook
llxFooter();
$db->close();
diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php
index cbffa3ef177..4bc98312902 100644
--- a/htdocs/reception/stats/index.php
+++ b/htdocs/reception/stats/index.php
@@ -88,7 +88,6 @@ $mesg = $px1->isGraphKo();
if (! $mesg)
{
$px1->SetData($data);
- $px1->SetPrecisionY(0);
$i=$startyear;$legend=array();
while ($i <= $endyear)
{
@@ -103,7 +102,6 @@ if (! $mesg)
$px1->SetYLabel($langs->trans("NbOfReceptions"));
$px1->SetShading(3);
$px1->SetHorizTickIncrement(1);
- $px1->SetPrecisionY(0);
$px1->mode='depth';
$px1->SetTitle($langs->trans("NumberOfReceptionsByMonth"));
@@ -144,7 +142,6 @@ if (! $mesg)
$px2->SetYLabel($langs->trans("AmountOfReceptions"));
$px2->SetShading(3);
$px2->SetHorizTickIncrement(1);
- $px2->SetPrecisionY(0);
$px2->mode='depth';
$px2->SetTitle($langs->trans("AmountOfReceptionsByMonthHT"));
@@ -183,7 +180,6 @@ if (! $mesg)
$px3->SetHeight($HEIGHT);
$px3->SetShading(3);
$px3->SetHorizTickIncrement(1);
- $px3->SetPrecisionY(0);
$px3->mode='depth';
$px3->SetTitle($langs->trans("AmountAverage"));
diff --git a/htdocs/reception/stats/month.php b/htdocs/reception/stats/month.php
index 84eb9126464..f2afcfd9267 100644
--- a/htdocs/reception/stats/month.php
+++ b/htdocs/reception/stats/month.php
@@ -60,7 +60,6 @@ if (! $mesg)
$px->SetYLabel($langs->trans("NbOfOrders"));
$px->SetShading(3);
$px->SetHorizTickIncrement(1);
- $px->SetPrecisionY(0);
$px->draw($filename, $fileurl);
}
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index d7034017691..26bfbc89b9f 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2540,7 +2540,7 @@ else
print '
';
if ($action != 'editincoterm')
{
- print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
+ print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
}
else
{
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index b1d037552aa..16b690ecaf7 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -475,7 +475,7 @@ class Societe extends CommonObject
public $fk_incoterms;
public $location_incoterms;
- public $libelle_incoterms; //Used into tooltip
+ public $label_incoterms; //Used into tooltip
// Multicurrency
/**
@@ -1276,7 +1276,7 @@ class Societe extends CommonObject
$sql .= ', d.code_departement as state_code, d.nom as state';
$sql .= ', st.libelle as stcomm';
$sql .= ', te.code as typent_code';
- $sql .= ', i.libelle as libelle_incoterms';
+ $sql .= ', i.libelle as label_incoterms';
$sql .= ', sr.remise_client';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id';
@@ -1435,7 +1435,7 @@ class Societe extends CommonObject
//Incoterms
$this->fk_incoterms = $obj->fk_incoterms;
$this->location_incoterms = $obj->location_incoterms;
- $this->libelle_incoterms = $obj->libelle_incoterms;
+ $this->label_incoterms = $obj->label_incoterms;
// multicurrency
$this->fk_multicurrency = $obj->fk_multicurrency;
@@ -3446,7 +3446,6 @@ class Societe extends CommonObject
$this->address=empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS;
$this->zip=empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP;
$this->town=empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN;
- $this->state_id=empty($conf->global->MAIN_INFO_SOCIETE_STATE)?'':$conf->global->MAIN_INFO_SOCIETE_STATE;
$this->region_code=empty($conf->global->MAIN_INFO_SOCIETE_REGION)?'':$conf->global->MAIN_INFO_SOCIETE_REGION;
$this->object=empty($conf->global->MAIN_INFO_SOCIETE_OBJECT)?'':$conf->global->MAIN_INFO_SOCIETE_OBJECT;
@@ -3467,7 +3466,7 @@ class Societe extends CommonObject
}
else // For backward compatibility
{
- dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_ERR);
+ dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING);
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$country_code=getCountry($country_id, 2, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
$country_label=getCountry($country_id, 0, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
@@ -3478,6 +3477,31 @@ class Societe extends CommonObject
$this->country=$country_label;
if (is_object($langs)) $this->country=($langs->trans('Country'.$country_code)!='Country'.$country_code)?$langs->trans('Country'.$country_code):$country_label;
+ //TODO This could be replicated for region but function `getRegion` didn't exist, so I didn't added it.
+ // We define state_id, state_code and state
+ $state_id=0;$state_code=$state_label='';
+ if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE))
+ {
+ $tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE);
+ $state_id=$tmp[0];
+ if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_STATE is "id:code:label"
+ {
+ $state_code=$tmp[1];
+ $state_label=$tmp[2];
+ }
+ else // For backward compatibility
+ {
+ dol_syslog("Your state setup use an old syntax. Reedit it using setup area.", LOG_ERR);
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
+ $state_code=getState($state_id, 2, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
+ $state_label=getState($state_id, 0, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
+ }
+ }
+ $this->state_id=$state_id;
+ $this->state_code=$state_code;
+ $this->state=$state_label;
+ if (is_object($langs)) $this->state=($langs->trans('State'.$state_code)!='State'.$state_code)?$langs->trans('State'.$state_code):$state_label;
+
$this->phone=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL;
$this->fax=empty($conf->global->MAIN_INFO_SOCIETE_FAX)?'':$conf->global->MAIN_INFO_SOCIETE_FAX;
$this->url=empty($conf->global->MAIN_INFO_SOCIETE_WEB)?'':$conf->global->MAIN_INFO_SOCIETE_WEB;
@@ -3993,7 +4017,7 @@ class Societe extends CommonObject
/**
* Create a document onto disk according to template module.
*
- * @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf') for example.
+ * @param string $modele Generator to use. Caller must set it to obj->modelpdf or GETPOST('modelpdf','alpha') for example.
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index afd3a51ec8e..1c5c4b82a5d 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -595,7 +595,7 @@ if ($sql_select)
print '