diff --git a/COPYRIGHT b/COPYRIGHT index 46e2f093900..d980219c420 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -23,7 +23,6 @@ Licence of dependencies of third-party components used by Dolibarr (all compatib Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- PHP libraries: -ADOdb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package) EvalMath 1.0 BSD Yes Safe math expressions evaluation Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers GeoIP2 0.2.0 Apache License 2.0 Yes Lib to make geoip convert diff --git a/ChangeLog b/ChangeLog index 031e740e008..2376592a12f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,8 +26,87 @@ Following changes may create regressions for some external modules, but were nec * The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product * Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead. * All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead +* Code standardization: $user->rights->propale is now $user->rights->propal everywhere. +***** ChangeLog for 16.0.1 compared to 16.0.0 ***** + +FIX: #16476 on massaction the pdf generation is not using the t… +FIX: #21416 Filter tag no-categorie in members +FIX: #21543 +FIX: #21799 inactive companies shall not be selectable for new proposals, orders and invoices +FIX: #21859 Don't show html balise on list for private/public note +FIX: #22164 +FIX: #22241 +FIX: #22263 Accountancy - Account number expected in place of a rowid on parent account on export +FIX: #22264 Accountancy - Translation on chart of accounts export +FIX: #22265 Accountancy - Account number expected in place of a rowid on export +FIX: #22334 +FIX: #22360 +FIX: #22379 creating events on supplier order +FIX: #22382 Error on length of supplier reference +FIX: #22386 IBAN not mandatory for International Export Countries +FIX: #22440 Lang Key "UserAccountNotDefined" is missing +FIX: #22482 +FIX: #22507 +FIX: Accountancy - Some manuals operations are displayed in subledger +FIX: API reception return error 500 +FIX: avoid override initial message ($this instead $object) +FIX: avoid some warnings (php8+) +FIX: Bad backtopage and CSRF on link for ticket message +FIX: bad closing select +FIX: broken feature, wrong fk_parent_line after cloning object +FIX: Column label +FIX: compatibility if javascript not actived +FIX: compatibility with Mysql <= 5.7 +FIX: contact deletion: execute trigger before really deleting +FIX: CronJob sendBackup +FIX: CSRF + lost value of constant after use save button +FIX: CSS +FIX: data integrity for llx_delivery table +FIX: default value for partnership status +FIX: deletion of the MO_CHILD link +FIX: Dictionary - Display error on cache_vatrates +FIX: Dolibarr#16476 version 2a +FIX: Duplicate creation of invoice when closing shipment linked to order +FIX: Duplicate in list when filtering on categories +FIX: extrafields with value '0' was '' +FIX: filters lost when sorting on productMargin and customerMargins +FIX: fk_expedition in $line can be usefull for triggers +FIX: Import in upgrade when using a socialnetwork field. +FIX: input hidden with fk_product of line on mo production can be usefull +FIX: inventory code must be different at each transation +FIX: inventory total columns +FIX: Issue #16476 on massaction the pdf generation is not using the thirdparty language settings +FIX: Linked object agenda card +FIX: missing check if category module is enabled +FIX: missing check if incoice as a payment (wrong status) +FIX: missing class "societe" when create another object with workflow +FIX: missing error message if image size too large +FIX: Missing reposition +FIX: missing the management of a constant in the Ticket config +FIX: Missing token in different URLs links +FIX: @ must be allowed into dol_eval to allow rules including external module string 'abc@def' +FIX: - php V8 get number doc saphir +FIX: - php V8 propal index last draft +FIX: Preview button position on documents list (case when the file is too long) +FIX: Project - on global view, missing display of ref customer +FIX: Protection against bad value into accurancy setup +FIX: reading of trackid in emailcollector (when on recipient suffix) +FIX: recruitment linked files +FIX: Remove use of code we should not have +FIX: Restore the option MAIN_OPTIMIZEFORTEXTBROWSER +FIX: Rich text is not diplayed +FIX: same thing in deleteline +FIX: Supplier Reference is lost when page breaks +FIX: support of array parameters in "add to bookmark" feature. +FIX: Test that web dir is correct in install +FIX: the shipment PDF was using the full size logo instead of small +FIX: Token Error : delete stock transfer +FIX: ToOfferALinkForOnlinePayment not translated +FIX: tooltip of technical tables added of a module +FIX: wrong result check when update expensereport line + ***** ChangeLog for 16.0.0 compared to 15.0.0 ***** @@ -236,6 +315,7 @@ Following changes may create regressions for some external modules, but were nec * Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions. * The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced. * The context hook 'suppliercard' when on the supplier tab of a thirdparty has been renamed into 'thirdpartysupplier' +* Because the module Resources highly linked to the Agenda module, the menu for Resources module has been moved into top menu Agenda. ***** ChangeLog for 15.0.3 compared to 15.0.2 ***** diff --git a/README-FR.md b/README-FR.md index a67bf204076..74be3f1754c 100644 --- a/README-FR.md +++ b/README-FR.md @@ -56,6 +56,10 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: +- Faites une sauvegarde de votre instance [voir ce tutorial](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) + +- Vérifiez que la nouvelle version est compatible avec la version PHP de votre serveur [voir PHP support](https://wiki.dolibarr.org/index.php/Releases). + - Ecrasez les vieux fichiers dans le vieux répertoire 'dolibarr' par les fichiers fournis dans ce nouveau package. diff --git a/README.md b/README.md index c476f14a8cc..826955aef92 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ If you don't have time to install it yourself, you can try some commercial 'read Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) -- Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). +- Check that your installed PHP version is supported by the new version [see PHP support](https://wiki.dolibarr.org/index.php/Releases). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process. If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*"). diff --git a/build/debian/control b/build/debian/control index 059325eecb9..b2890253b32 100755 --- a/build/debian/control +++ b/build/debian/control @@ -19,7 +19,6 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php-pear, php-mail-mime, # php-tcpdf, # libfpdf-tpl-php, php-fpdf, -# libphp-adodb, # libnusoap-php, # libphp-pclzip, # Required javascript libraries diff --git a/build/debian/copyright b/build/debian/copyright index 403763544a5..b99b8a65b5d 100644 --- a/build/debian/copyright +++ b/build/debian/copyright @@ -61,31 +61,6 @@ License: GPL-3+ ------------------------------------------------------------ -Files: htdocs/includes/adodbtime/* -Copyright: 2003-2005, John Lim - unknown, jackbbs -License: BSD-3-Clause - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - . - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - Neither the name of the John Lim nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. -Comment: - Those files are not shipped in the binary package since we use - the library as packaged in "libphp-adodb". - - ------------------------------------------------------------- - Files: htdocs/includes/ckeditor/* Copyright: 2003-2012 CKSource - Frederico Knabben License: GPL-2+ diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 26a08a55826..6ba9123ede4 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -146,7 +146,6 @@ case "$1" in #else # File already exist. We add params not found. #echo Add new params to overwrite path to use shared libraries/fonts - #grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config ##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config #grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config #grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "" >> $config diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index 1d10699f1d4..801b1b372af 100644 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -31,7 +31,6 @@ $force_install_distrib='debian'; // - not removed from package (see rm in rules file), // - declared into dependencies (see Depends in control file) //$force_dolibarr_lib_TCPDF_PATH=''; -//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; //$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; diff --git a/build/debian/rules b/build/debian/rules index dab5d84fd11..b63fcffde93 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -89,7 +89,6 @@ override_dh_install: rm -fr build/zip # clean from all PHP embedded libraries (we use package dependencies instead) -# rm -fr htdocs/includes/adodbtime # rm -fr htdocs/includes/geoip # rm -fr htdocs/includes/nusoap # rm -fr htdocs/includes/odtphp/zip/pclzip diff --git a/build/makepack-dolibarrmodule.pl b/build/makepack-dolibarrmodule.pl index 4a9a217b570..8fbb28dc35f 100755 --- a/build/makepack-dolibarrmodule.pl +++ b/build/makepack-dolibarrmodule.pl @@ -293,6 +293,7 @@ foreach my $PROJECT (@PROJECTLIST) { } print "Clean $BUILDROOT\n"; $ret=`rm -fr $BUILDROOT/$PROJECTLC/.cache`; + $ret=`rm -fr $BUILDROOT/$PROJECTLC/.git`; $ret=`rm -fr $BUILDROOT/$PROJECTLC/.project`; $ret=`rm -fr $BUILDROOT/$PROJECTLC/.settings`; $ret=`rm -fr $BUILDROOT/$PROJECTLC/index.php`; diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 1c6716408b7..c94863e8919 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -25,7 +25,7 @@ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-nusoap, dejavu-sans-fonts Requires: mysql-server, mysql #BuildRequires: desktop-file-utils @@ -104,7 +104,6 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name} %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source -%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts @@ -274,7 +273,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index f6d81feaea4..8e71713146e 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -46,7 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml Requires: mysql-server, mysql BuildRequires: desktop-file-utils %else @@ -58,7 +58,7 @@ Requires: mysql, mysql-client %if 0%{?suse_version} # Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros Group: Productivity/Office/Management -Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu +Requires: apache2, apache2-mod_php, php >= 5.3.0, php-gd, php-ldap, php-imap, php-mysql, php-openssl, dejavu Requires: mysql-community-server, mysql-community-server-client BuildRequires: update-desktop-files fdupes %else @@ -169,7 +169,6 @@ cui hai bisogno ed essere facile da usare. %{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name} %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} -%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts %else @@ -425,7 +424,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a371e3ab02f..5c8a8e39aae 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -271,7 +271,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index bd6834582ac..ea79a50af58 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -25,7 +25,7 @@ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Productivity/Office/Management -Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu +Requires: apache2, apache2-mod_php, php >= 5.3.0, php-gd, php-ldap, php-imap, php-mysql, php-openssl, dejavu Requires: mysql-community-server, mysql-community-server-client %if 0%{?suse_version} BuildRequires: update-desktop-files fdupes @@ -66,7 +66,6 @@ ed essere facile da usare. Programmo web, progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare. -%_datadir/dolibarr/htdocs/webhook #---- prep %prep @@ -282,7 +281,6 @@ if [ -s $config ] && grep -q "File generated by" $config then # File already exist. We add params not found. echo Add new params to overwrite path to use shared libraries/fonts - grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "" >> $config #grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "" >> $config grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "" >> $config diff --git a/build/rpm/install.forced.php.fedora b/build/rpm/install.forced.php.fedora index a8bc0d390c6..636514260cf 100644 --- a/build/rpm/install.forced.php.fedora +++ b/build/rpm/install.forced.php.fedora @@ -20,7 +20,6 @@ $force_install_lockinstall='444'; $force_install_distrib='rpmfedora'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; diff --git a/build/rpm/install.forced.php.mandriva b/build/rpm/install.forced.php.mandriva index a254eebbf7b..5471d146391 100644 --- a/build/rpm/install.forced.php.mandriva +++ b/build/rpm/install.forced.php.mandriva @@ -20,7 +20,6 @@ $force_install_lockinstall='444'; $force_install_distrib='rpmmandriva'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; diff --git a/build/rpm/install.forced.php.opensuse b/build/rpm/install.forced.php.opensuse index 24da4417121..ea50180caf4 100644 --- a/build/rpm/install.forced.php.opensuse +++ b/build/rpm/install.forced.php.opensuse @@ -20,7 +20,6 @@ $force_install_lockinstall='444'; $force_install_distrib='rpmopensuse'; // Value to overwrite path to use shared libraries/fonts instead of embedded one -//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; //$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; //$force_dolibarr_lib_GEOIP_PATH=''; //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; diff --git a/dev/examples/ldap/ldapsearch_sample1.txt b/dev/examples/ldap/ldapsearch_sample1.txt index a02ad632cd0..2a30f19ab22 100644 --- a/dev/examples/ldap/ldapsearch_sample1.txt +++ b/dev/examples/ldap/ldapsearch_sample1.txt @@ -1,28 +1,29 @@ # ldapsearch_sample1.txt # ldapsearch is into package ldap-utils on debian. # -# Use this sample to search into a ldap +# Use this samples to test a ldap_bind or to make a search into a ldap # # Anonymous access -# ldapsearch -h hostname -p 389 +# ldapsearch -h hostname -p 389 # # Login access (using a Bind DN) -# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# Such access must succeed to use LDAP as login module. +# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password +# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password # # Login access in SSL (using a Bind DN) -# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local +# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" # If it fails, you may try to use "hostname" that is real name of certificate. # You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt # What to search -# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" -# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra" -# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)" +# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local" +# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra" +# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)" # # Example to test a ldap search: -# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password +# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password diff --git a/dev/resources/iso-normes/accountancy/accountancy_rules.txt b/dev/resources/iso-normes/accountancy/accountancy_rules.txt index a265bcf4f54..918d0f01d3c 100644 --- a/dev/resources/iso-normes/accountancy/accountancy_rules.txt +++ b/dev/resources/iso-normes/accountancy/accountancy_rules.txt @@ -12,3 +12,11 @@ Le client règle rapidement et on lui accorde un escompte de 3% (120 € * 3% = 411xxx 3,60 € TTC Et ça marche à l’inverse avec un fournisseur sauf que l’on est en 775000 au lieu de 665000 pour escompte obtenus. + + + + +Un compte comptable de Tiers vente = Acount Receivable +Un compte comptable de Tiers achat = Acount Payable + + \ No newline at end of file diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf index 45b4a9b8084..2eedad18821 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf @@ -1,8 +1,7 @@ # Fail2Ban configuration file # -# Regexp to catch known spambots and software alike. Please verify -# that it is your intent to block IPs which were driven by -# above mentioned bots. +# Regexp to detect access on public pages so we can add mitigation on IP making too much +# access to your a Dolibarr instance. [Definition] @@ -11,7 +10,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /public/clicktodial/cidlookup.php" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dol-passforgotten +# fail2ban-client status web-dolibarr-limitpublic # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-limitpublic.conf diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf index d5922909ba9..1e126c17693 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf @@ -1,8 +1,7 @@ # Fail2Ban configuration file # -# Regexp to catch known spambots and software alike. Please verify -# that it is your intent to block IPs which were driven by -# above mentioned bots. +# Regexp to detect try to check a couple login/password so we can add mitigation +# on IP making too much tries. [Definition] @@ -11,7 +10,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 functions_dolibarr::check_user_password_abcd Authentication KO" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dol-bruteforce +# fail2ban-client status web-dolibarr-rulesbruteforce # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf diff --git a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf index edc2ca68092..8cc20dd4be4 100644 --- a/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf +++ b/dev/setup/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf @@ -1,8 +1,7 @@ # Fail2Ban configuration file # -# Regexp to catch known spambots and software alike. Please verify -# that it is your intent to block IPs which were driven by -# above mentioned bots. +# Regexp to detect access on passwordforgotten.php page so we can add mitigation on IP making too much +# access to this Dolibarr page. [Definition] @@ -11,7 +10,7 @@ # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log # # then -# fail2ban-client status web-dol-passforgotten +# fail2ban-client status web-dolibarr-rulespassforgotten # # To test rule file on a existing log file # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf diff --git a/dev/tools/github_authors_and_commits_peryear.sh b/dev/tools/github_authors_and_commits_peryear.sh index 7184d6c44ae..bdba2a2a6ed 100755 --- a/dev/tools/github_authors_and_commits_peryear.sh +++ b/dev/tools/github_authors_and_commits_peryear.sh @@ -1,5 +1,8 @@ #!/bin/sh - +# +# Count number of different contributors and number of commits for a given year. +# + if [ "x$1" = "x" ]; then echo "Usage: $0 YEAR" exit diff --git a/dev/tools/github_commits_perversion.sh b/dev/tools/github_commits_perversion.sh index bf76e68bc43..2f3020ff721 100755 --- a/dev/tools/github_commits_perversion.sh +++ b/dev/tools/github_commits_perversion.sh @@ -1,6 +1,10 @@ #/bin/bash -Releases=("3.8" "3.9" "4.0" "5.0" "6.0" " 7.0" "develop") -Dates=("2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01", "2017-02-01", "2017-07-01", "2018-02-01", "2050-01-01") +# +# Count number of commits per user and per versions (using date for version detection) +# + +Releases=("16.0" "develop") +Dates=("2022-01-01" "2022-08-31" "2050-01-01") let "counter = 1" for i in "${Releases[@]}" diff --git a/dev/tools/github_lines_perusers.sh b/dev/tools/github_lines_perusers.sh new file mode 100755 index 00000000000..9a3fad09d62 --- /dev/null +++ b/dev/tools/github_lines_perusers.sh @@ -0,0 +1,16 @@ +#/bin/bash +# +# Count number of lines modified per user for a given branch +# + +if [ "x$2" = "x" ]; then + echo "Usage: $0 tagnamestart|START tagnameend|HEAD" + exit +fi + + +echo "git log $1..$2 --shortstat | grep ... | perl ... > /tmp/github_lines_perusers.tmp" +git log $1..$2 --shortstat | grep -e 'Author:' -e 'Date:' -e ' changed' -e ' insertion' -e ' deletion' | perl -n -e '/^(.*)$/; $line = $1; if ($line =~ /(changed|insertion|deletion)/) { $line =~ s/[^0-9\s]//g; my @arr=split /\s+/, $line; $tot=0; for (1..@arr) { $tot += $arr[$_]; }; print $tot."\n"; } else { print $line."\n"; };' > /tmp/github_lines_perusers.tmp + +cat /tmp/github_lines_perusers.tmp | awk 'BEGIN { FS="\n"; print "user and nb of lines"; lastuser=""; } { if ($1 ~ /Author:/) { lastuser=$1 }; if ($1 ~ /^[0-9]+$/) { aaa[lastuser]+=$1; } } END { for (var in aaa) print var," ",aaa[var]; } ' + diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index e70bc39bfd0..9eabd378e11 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -85,7 +85,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { // Clean code // To manage zero or not at the end of the accounting account - if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) { + if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { $account_number = $account_number; } else { $account_number = clean_account($account_number); @@ -148,7 +148,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { // Clean code // To manage zero or not at the end of the accounting account - if (isset($conf->global->ACCOUNTING_MANAGE_ZERO) && $conf->global->ACCOUNTING_MANAGE_ZERO == 1) { + if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { $account_number = $account_number; } else { $account_number = clean_account($account_number); diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 22d39dea7d0..8236b83eb3d 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -266,6 +266,9 @@ if (!$user->admin) { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { print '
| '.$langs->trans('Label').' | |||
| '.$langs->trans('Description').' | '; - $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ' | ||
| '.$langs->trans('Label').' | |||
| '.$langs->trans('Description').' | '; - $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, ROWS_3, '90%'); $doleditor->Create(); print ' | ||
| '; + print ' | |||
| ';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? ' '."\n".$langs->trans($constname . 'Tooltip2') : ''); print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; @@ -302,7 +302,8 @@ if ($action == 'edit') { foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { $setupnotempty++; - print ' | |||
| '; + print ' | |||
| ';
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? ' '."\n".$langs->trans($constname . 'Tooltip2') : ''); print $form->textwithpicto($langs->trans($constname), $tooltiphelp); @@ -320,12 +321,17 @@ if ($action == 'edit') { $formmail = new FormMail($db); $tmp = explode(':', $val['type']); - - $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); - if ($template < 0) { - setEventMessages(null, $formmail->errors, 'errors'); + $labelemailtemplate = getDolGlobalString($constname); + if ($labelemailtemplate && $labelemailtemplate != '-1') { + $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, getDolGlobalString($constname)); + if (is_numeric($template) && $template < 0) { + setEventMessages($formmail->error, $formmail->errors, 'errors'); + } else { + if ($template->label != 'default') { + print $langs->trans($template->label); + } + } } - print $langs->trans($template->label); } } elseif (preg_match('/category:/', $val['type'])) { if (getDolGlobalString($constname)) { @@ -353,16 +359,21 @@ if ($action == 'edit') { } } elseif ($val['type'] == 'product') { $product = new Product($db); - $resprod = $product->fetch(getDolGlobalString($constname)); - if ($resprod > 0) { - print $product->getNomUrl(1); - } elseif ($resprod < 0) { - setEventMessages($product->error, $product->errors, "errors"); + $idproduct = getDolGlobalString($constname); + if ($idproduct > 0) { + $resprod = $product->fetch($idproduct); + if ($resprod > 0) { + print $product->getNomUrl(1); + } elseif ($resprod < 0) { + setEventMessages($product->error, $product->errors, "errors"); + } } } else { print getDolGlobalString($constname); } - print ' | |||
| '.img_object("", $picto[$const]).' | '; - print ''.$langs->trans($desc).' | '; + print '';
+ print $langs->trans($desc);
+ if ($const == 'DETAILS') {
+ print ' '.$langs->trans("FCKeditorForProductDetails2").''; + } + print ' | ';
print ''; $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0); if ($value == 0) { @@ -185,6 +190,7 @@ if (empty($conf->use_javascript_ajax)) { print ''."\n"; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 4e4438263c3..cf637d37329 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -208,6 +208,32 @@ if ($action == 'updateMask') { $error++; } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") { + $val = GETPOST('FICHINTER_ALLOW_ONLINE_SIGN', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } +} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") { + $val = GETPOST('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); + + if (!($res > 0)) { + $error++; + } + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { @@ -594,6 +620,39 @@ print ''; print ' |
| '.$langs->trans("Type").' | '; print $object->getTypePicto(); print $langs->trans("Action".$object->type_code); print ' | ||||||||||||||||||||||||
| '.$langs->trans("PrivateEventMessage").' | '.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).' | ||||||||||||||||||||||||
| '.$langs->trans("EventOnFullDay").' | '.yn($object->fulldayevent ? 1 : 0, 3).' | ||||||||||||||||||||||||
| '.$langs->trans("MailTitle").' | |
| '.$langs->trans("MailFrom").' | |
| '.$langs->trans("MailErrorsTo").' |
| '.$langs->trans("MailTopic").' | |||||||||||||||||||||||||
| '; - print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string'); print ' | '; - print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string'); print ' | ||||||||||||||||||||||||
| '; - print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); print ' | '; - print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); $email = CMailFile::getValidAddress($object->email_from, 2); if ($email && !isValidEmail($email)) { $langs->load("errors"); @@ -910,9 +915,9 @@ if ($action == 'create') { // Errors to print ' | ||||||||||||||||||||||||
| '; - print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string'); + print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string'); print ' | ';
- print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
+ print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string');
$email = CMailFile::getValidAddress($object->email_errorsto, 2);
if ($email && !isValidEmail($email)) {
$langs->load("errors");
@@ -977,11 +982,11 @@ if ($action == 'create') {
if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) {
print "\n\n \n";
- if (($object->statut == 1) && ($user->rights->mailing->valider || $object->user_validation == $user->id)) {
+ if (($object->statut == 1) && ($user->hasRight('mailing', 'valider') || $object->user_validation == $user->id)) {
print ''.$langs->trans("SetToDraft").'';
}
- if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) {
+ if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->hasRight('mailing', 'creer')) {
if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) {
print ''.$langs->trans("EditWithEditor").'';
} else {
@@ -1011,7 +1016,7 @@ if ($action == 'create') {
}
}
- if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->rights->mailing->valider) {
+ if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->hasRight('mailing', 'valider')) {
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) {
print ''.$langs->trans("SendMailing").'';
} elseif (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) {
@@ -1021,11 +1026,11 @@ if ($action == 'create') {
}
}
- if ($user->rights->mailing->creer) {
+ if ($user->hasRight('mailing', 'creer')) {
print ''.$langs->trans("ToClone").'';
}
- if (($object->statut == 2 || $object->statut == 3) && $user->rights->mailing->valider) {
+ if (($object->statut == 2 || $object->statut == 3) && $user->hasRight('mailing', 'valider')) {
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) {
print ''.$langs->trans("ResetMailing").'';
} else {
@@ -1033,7 +1038,7 @@ if ($action == 'create') {
}
}
- if (($object->statut <= 1 && $user->rights->mailing->creer) || $user->rights->mailing->supprimer) {
+ if (($object->statut <= 1 && $user->hasRight('mailing', 'creer')) || $user->hasRight('mailing', 'supprimer')) {
if ($object->statut > 0 && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->delete)) {
print ''.$langs->trans("DeleteMailing").'';
} else {
@@ -1262,8 +1267,9 @@ if ($action == 'create') {
$out .= ' ';
}
} else {
- $out .= ''.$langs->trans("NoAttachedFiles").''; + //$out .= ''.$langs->trans("NoAttachedFiles").' '; } + // Add link to add file $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; @@ -1272,7 +1278,7 @@ if ($action == 'create') { } $out .= ''; $out .= ' '; - $out .= ''; + $out .= ''; print $out; print ' |
';
- print '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= ' '.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= ' '.$langs->trans('Project').' '; - if ($user->rights->commande->creer) { + $morehtmlref .= ' '; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref .= ' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { if (!empty($object->fk_project)) { $proj = new Project($db); $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 8e38d1ffe78..c9886a176f0 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -471,7 +471,7 @@ class BankAccounts extends DolibarrApi * Add a line to an account * * @param int $id ID of account - * @param int $date Payment date (timestamp) {@from body} {@type timestamp} + * @param string $date Payment date (timestamp) {@from body} {@type timestamp} * @param string $type Payment mode (TYP,VIR,PRE,LIQ,VAD,CB,CHQ...) {@from body} * @param string $label Label {@from body} * @param float $amount Amount (may be 0) {@from body} @@ -480,7 +480,7 @@ class BankAccounts extends DolibarrApi * @param string $cheque_writer Name of cheque writer {@from body} * @param string $cheque_bank Bank of cheque writer {@from body} * @param string $accountancycode Accountancy code {@from body} - * @param int $datev Payment date value (timestamp) {@from body} {@type timestamp} + * @param string $datev Payment date value (timestamp) {@from body} {@type timestamp} * @param string $num_releve Bank statement numero {@from body} * @return int ID of line * diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 49edf3c3a1a..cb10a7310c6 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -657,13 +657,13 @@ if ($result) { if ($user->rights->banque->consolidate) { print ' | '; if ($objp->rappro) { - print 'rappro ? ' disabled' : '').'>'; - print ''; + print 'rappro ? ' disabled' : '').'>'; + print ''; } else { - print 'rappro ? ' disabled' : '').'>'; + print 'rappro ? ' disabled' : '').'>'; } if ($objp->num_releve) { - print ' ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; + print ' ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; } print ' | '; } else { @@ -675,6 +675,28 @@ if ($result) { if ($user->rights->banque->consolidate) { print ''; print 'rappro ? ' checked="checked"' : '')).'">'; + + print ' + + '; + print ' | '; } else { print ''.yn($objp->rappro).' | '; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 5f223450ab7..1f4fc60397e 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -59,9 +59,7 @@ $search_number = GETPOST('search_number', 'alpha'); $search_status = GETPOST('search_status') ?GETPOST('search_status', 'alpha') : 'opened'; // 'all' or ''='opened' $optioncss = GETPOST('optioncss', 'alpha'); -if (isModEnabled('categorie')) { - $search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); -} +$search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); $socid = 0; // Security check @@ -162,6 +160,7 @@ if (empty($reshook)) { $search_label = ''; $search_number = ''; $search_status = ''; + $search_category_list = array(); } // Mass actions @@ -191,17 +190,12 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account as b"; if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)"; } - -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_ACCOUNT, "b.rowid"); -} - $sql .= " WHERE b.entity IN (".getEntity('bank_account').")"; if ($search_status == 'opened') { $sql .= " AND clos = 0"; @@ -209,11 +203,6 @@ if ($search_status == 'opened') { if ($search_status == 'closed') { $sql .= " AND clos = 1"; } - -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_ACCOUNT, "b.rowid", $search_category_list); -} - if ($search_ref != '') { $sql .= natural_search('b.ref', $search_ref); } @@ -223,11 +212,37 @@ if ($search_label != '') { if ($search_number != '') { $sql .= natural_search('b.number', $search_number); } +// Search for tag/category ($searchCategoryBankList is an array of ID) +$searchCategoryBankList = $search_category_list; +$searchCategoryBankOperator = 0; +if (!empty($searchCategoryBankList)) { + $searchCategoryBankSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryBankList as $searchCategoryBank) { + if (intval($searchCategoryBank) == -2) { + $searchCategoryBankSqlList[] = "NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account)"; + } elseif (intval($searchCategoryBank) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryBank); + } + } + if ($listofcategoryid) { + $searchCategoryBankSqlList[] = " EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryBankOperator == 1) { + if (!empty($searchCategoryBankSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryBankSqlList).")"; + } + } else { + if (!empty($searchCategoryBankSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryBankSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -293,7 +308,7 @@ if ($optioncss != '') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $param .= $hookmanager->resPrint; // List of mass actions available @@ -351,7 +366,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire) { // Bank accounts $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; } else { @@ -423,7 +438,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['b.datec']['checked'])) { @@ -487,7 +502,7 @@ if (!empty($arrayfields['toreconcile']['checked'])) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['b.datec']['checked'])) { print_liste_field_titre($arrayfields['b.datec']['label'], $_SERVER["PHP_SELF"], "b.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -637,7 +652,7 @@ foreach ($accounts as $key => $type) { print ''.$langs->trans("ConciliationDisabled").''; } else { $result = $objecttmp->load_board($user, $objecttmp->id); - if ($result < 0) { + if (is_numeric($result) && $result < 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); } else { print ''; @@ -669,7 +684,7 @@ foreach ($accounts as $key => $type) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp, $action); // Note that $action and $objecttmpect may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['b.datec']['checked'])) { diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 0b044f8f806..79f338cef85 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -410,7 +410,7 @@ if ($action == 'create') { // Amount print '||||||||||||||||||||||
| '; print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).' | '; - print ''; + print ''; print ' | '; } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + print ' | '; + print ''; + print ' | '; + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -1366,13 +1420,13 @@ if ($resql) { // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { print ' | '; - print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10, 1, '', 1); + print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1); print ' | '; } // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { print ''; - print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1); + print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100'); print ' | '; } // Module source @@ -1498,7 +1552,7 @@ if ($resql) { // Fields from hook $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['f.datec']['checked'])) { @@ -1586,6 +1640,9 @@ if ($resql) { if (!empty($arrayfields['s.name_alias']['checked'])) { print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER['PHP_SELF'], 's.name_alias', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s2.nom']['checked'])) { + print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER['PHP_SELF'], 's2.nom', '', $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -1680,7 +1737,7 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); - $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['f.datec']['checked'])) { print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); @@ -1715,6 +1772,7 @@ if ($resql) { if ($num > 0) { $i = 0; + $typenArray = $formcompany->typent_array(1); $totalarray = array(); $totalarray['nbfield'] = 0; $totalarray['val'] = array(); @@ -1735,7 +1793,6 @@ if ($resql) { $total_margin = 0; $savnbfield = $totalarray['nbfield']; - $totalarray = array(); $totalarray['nbfield'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { @@ -1989,6 +2046,26 @@ if ($resql) { $totalarray['nbfield']++; } } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + print ''; + if ($obj->fk_parent > 0) { + if (!isset($company_url_list[$obj->fk_parent])) { + $companyparent = new Societe($db); + $res = $companyparent->fetch($obj->fk_parent); + if ($res > 0) { + $company_url_list[$obj->fk_parent] = $companyparent->getNomUrl(1); + } + } + if (isset($company_url_list[$obj->fk_parent])) { + print $company_url_list[$obj->fk_parent]; + } + } + print " | "; + if (!$i) { + $totalarray['nbfield']++; + } + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; @@ -2051,8 +2128,9 @@ if ($resql) { // Payment mode if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ' | '; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + $s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1); + print ' | '; + print $s; print ' | '; if (!$i) { $totalarray['nbfield']++; @@ -2061,8 +2139,9 @@ if ($resql) { // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none'); + $s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 0, '', -1, -1, 1); + print ' | '; + print $s; print ' | '; if (!$i) { $totalarray['nbfield']++; @@ -2358,7 +2437,7 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['f.datec']['checked'])) { @@ -2471,7 +2550,7 @@ if ($resql) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '