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("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + print '
' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '
'; + } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '
'; } diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 1520897c4f7..e9836c4efbf 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -985,7 +985,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) { // Code journal if (!empty($arrayfields['t.code_journal']['checked'])) { print ''; - print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth150'); + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth75'); print ''; } // Date document diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index c4b27dce418..7ab6666d4c4 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -743,12 +743,12 @@ print ''; // Movement number if (!empty($arrayfields['t.piece_num']['checked'])) { - print ''; + print ''; } // Code journal if (!empty($arrayfields['t.code_journal']['checked'])) { print ''; - print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1); + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth75'); print ''; } // Date document diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 9dfd94d5729..4def8dfbef6 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -725,7 +725,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; // Column with checkbox diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 7a02d0b4564..b90a8a2c573 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -503,7 +503,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; print ''; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index c278429ba97..0f721a67db7 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -133,7 +133,7 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { $sql .= " WHERE f.fk_statut > 0"; $sql .= " AND fd.fk_code_ventilation > 0"; $sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")"; } else { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")"; @@ -764,7 +764,7 @@ if (empty($action) || $action == 'view') { $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescJournalOnlyBindedVisible").'
'; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { $description .= $langs->trans("DepositsAreIncluded"); diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 8f6297e480a..13ccba0d762 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -202,6 +202,9 @@ if ($object->nature == 2 || $object->nature == 3) { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } } $listofchoices = array('notyet' => $langs->trans("NotYetInGeneralLedger"), 'already' => $langs->trans("AlreadyInGeneralLedger")); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index d14beb84cc2..3c4a9e7f46b 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -342,7 +342,7 @@ if (strlen(trim($search_country))) { if (strlen(trim($search_tvaintra))) { $sql .= natural_search("s.tva_intra", $search_tvaintra); } -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")"; } else { $sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")"; @@ -749,7 +749,7 @@ if ($result) { // Suggested accounting account print ''; - print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); + print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone'); print ''; // Column with checkbox diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index c94084358bd..d20bd784ced 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -100,7 +100,7 @@ if ($action == 'set_default') { } else { dol_print_error($db); } -} elseif ($action == 'updateall') { +} elseif ($action == 'updatemainoptions') { $db->begin(); $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = $res7 = 0; $res1 = dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha') ? 0 : 1, 'chaine', 0, '', $conf->entity); @@ -123,6 +123,35 @@ if ($action == 'set_default') { setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); $db->commit(); } +} elseif ($action == 'updatememberscards') { + $db->begin(); + $res1 = $res2 = $res3 = $res4 = 0; + $res1 = dolibarr_set_const($db, 'ADHERENT_CARD_TYPE', GETPOST('ADHERENT_CARD_TYPE'), 'chaine', 0, '', $conf->entity); + $res2 = dolibarr_set_const($db, 'ADHERENT_CARD_HEADER_TEXT', GETPOST('ADHERENT_CARD_HEADER_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, 'ADHERENT_CARD_TEXT', GETPOST('ADHERENT_CARD_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, 'ADHERENT_CARD_TEXT_RIGHT', GETPOST('ADHERENT_CARD_TEXT_RIGHT', 'alpha'), 'chaine', 0, '', $conf->entity); + $res4 = dolibarr_set_const($db, 'ADHERENT_CARD_FOOTER_TEXT', GETPOST('ADHERENT_CARD_FOOTER_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity); + + if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0) { + setEventMessages('ErrorFailedToSaveDate', null, 'errors'); + $db->rollback(); + } else { + setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); + $db->commit(); + } +} elseif ($action == 'updatememberstickets') { + $db->begin(); + $res1 = $res2 = 0; + $res1 = dolibarr_set_const($db, 'ADHERENT_ETIQUETTE_TYPE', GETPOST('ADHERENT_ETIQUETTE_TYPE'), 'chaine', 0, '', $conf->entity); + $res2 = dolibarr_set_const($db, 'ADHERENT_ETIQUETTE_TEXT', GETPOST('ADHERENT_ETIQUETTE_TEXT', 'alpha'), 'chaine', 0, '', $conf->entity); + + if ($res1 < 0 || $res2 < 0) { + setEventMessages('ErrorFailedToSaveDate', null, 'errors'); + $db->rollback(); + } else { + setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); + $db->commit(); + } } // Action to update or add a constant @@ -130,6 +159,7 @@ if ($action == 'update' || $action == 'add') { $constname = GETPOST('constname', 'alpha'); $constvalue = (GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue')); + if (($constname == 'ADHERENT_CARD_TYPE' || $constname == 'ADHERENT_ETIQUETTE_TYPE' || $constname == 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) { $constvalue = ''; } @@ -195,10 +225,10 @@ print dol_get_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user') print '
'; print ''; -print ''; +print ''; -// Mains options +// Main options print load_fiche_titre($langs->trans("MemberMainOptions"), '', ''); @@ -294,6 +324,8 @@ print '
'; print '
'; +// Document templates for documents generated from member record + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); // Defined model definition table @@ -431,24 +463,12 @@ print ''; -/* -TODO Use a global form instead of embeded form into table + +// Generation of cards for members + print '
'; print ''; -print ''; -*/ - -/* - * Edit info of model document - */ -$constantes = array( - 'ADHERENT_CARD_TYPE', - //'ADHERENT_CARD_BACKGROUND', - 'ADHERENT_CARD_HEADER_TEXT', - 'ADHERENT_CARD_TEXT', - 'ADHERENT_CARD_TEXT_RIGHT', - 'ADHERENT_CARD_FOOTER_TEXT' -); +print ''; print load_fiche_titre($langs->trans("MembersCards"), '', ''); @@ -457,15 +477,65 @@ $helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULL $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; $helptext .= '__YEAR__, __MONTH__, __DAY__'; -form_constantes($constantes, 0, $helptext); +print '
'; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +// Format of cards page +print '\n"; + +// Text printed on top of member cards +print '\n"; + +// Text printed on member cards (align on left) +print '\n"; + +// Text printed on member cards (align on right) +print '\n"; + +// Text printed on bottom of member cards +print '\n"; + +print '
'.$langs->trans("Description").''.$form->textwithpicto($langs->trans("Value"), $helptext, 1, 'help', '', 0, 2, 'idhelptext').'
'.$langs->trans("DescADHERENT_CARD_TYPE").''; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php) +$arrayoflabels = array(); +foreach (array_keys($_Avery_Labels) as $codecards) { + $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; +} +print $form->selectarray('ADHERENT_CARD_TYPE', $arrayoflabels, getDolGlobalString('ADHERENT_CARD_TYPE') ? getDolGlobalString('ADHERENT_CARD_TYPE') : 'CARD', 1, 0, 0); + +print "
'.$langs->trans("DescADHERENT_CARD_HEADER_TEXT").''; +print ''; +print "
'.$langs->trans("DescADHERENT_CARD_TEXT").''; +print ''; +print "
'.$langs->trans("DescADHERENT_CARD_TEXT_RIGHT").''; +print ''; +print "
'.$langs->trans("DescADHERENT_CARD_FOOTER_TEXT").''; +print ''; +print "
'; +print '
'; + +print '
'; +print ''; +print '
'; + +print '
'; print '
'; +// Membership address sheet -/* - * Edit info of model document - */ -$constantes = array('ADHERENT_ETIQUETTE_TYPE', 'ADHERENT_ETIQUETTE_TEXT'); +print '
'; +print ''; +print ''; print load_fiche_titre($langs->trans("MembersTickets"), '', ''); @@ -474,9 +544,42 @@ $helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULL $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; $helptext .= '__YEAR__, __MONTH__, __DAY__'; -form_constantes($constantes, 0, $helptext); +print '
'; +print ''; +print ''; +print ''; +print ''; +print "\n"; -//print ''; +// Format of labels page +print '\n"; + +// Text printed on member address sheets +print '\n"; + +print '
'.$langs->trans("Description").''.$form->textwithpicto($langs->trans("Value"), $helptext, 1, 'help', '', 0, 2, 'idhelptext').'
'.$langs->trans("DescADHERENT_ETIQUETTE_TYPE").''; + +require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'; // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php) +$arrayoflabels = array(); +foreach (array_keys($_Avery_Labels) as $codecards) { + $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; +} +print $form->selectarray('ADHERENT_ETIQUETTE_TYPE', $arrayoflabels, getDolGlobalString('ADHERENT_ETIQUETTE_TYPE') ? getDolGlobalString('ADHERENT_ETIQUETTE_TYPE') : 'CARD', 1, 0, 0); + +print "
'.$langs->trans("DescADHERENT_ETIQUETTE_TEXT").''; +print ''; +print "
'; +print '
'; + +print '
'; +print ''; +print '
'; + +print ''; + +print '
'; print "
"; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index e0f6b693eb7..35829b5dcbf 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -585,7 +585,10 @@ if (empty($reshook)) { $db->commit(); $rowid = $object->id; $id = $object->id; + + $backtopage = preg_replace('/__ID__/', $id, $backtopage); } else { + $error++; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -1041,8 +1044,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.img_picto('', 'object_email').' '; // Website - print ''.$form->editfieldkey('Web', 'member_url', '', $object, 0).''; - print ''.img_picto('', 'globe').' '; + print ''.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).''; + print ''.img_picto('', 'globe').' '; // Address print ''.$langs->trans("Address").''; @@ -1725,7 +1728,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // Morphy - print ''.$langs->trans("MemberNature").''.$object->getmorphylib().''; + print ''.$langs->trans("MemberNature").''.$object->getmorphylib('', 1).''; print ''; // Company @@ -1894,7 +1897,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Send if (empty($user->socid)) { if (Adherent::STATUS_VALIDATED == $object->statut) { - print ''.$langs->trans('SendMail').''."\n"; + print ''.$langs->trans('SendMail').''."\n"; } } @@ -1914,7 +1917,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Modify if ($user->hasRight('adherent', 'creer')) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans("Modify").''."\n"; } @@ -1922,7 +1925,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Validate if (Adherent::STATUS_DRAFT == $object->statut) { if ($user->hasRight('adherent', 'creer')) { - print ''.$langs->trans("Validate").''."\n"; + print ''.$langs->trans("Validate").''."\n"; } else { print ''.$langs->trans("Validate").''."\n"; } @@ -1931,7 +1934,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Reactivate if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) { if ($user->hasRight('adherent', 'creer')) { - print ''.$langs->trans("Reenable")."\n"; + print ''.$langs->trans("Reenable")."\n"; } else { print ''.$langs->trans("Reenable").''."\n"; } @@ -1940,7 +1943,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Resiliate if (Adherent::STATUS_VALIDATED == $object->statut) { if ($user->rights->adherent->supprimer) { - print ''.$langs->trans("Resiliate")."\n"; + print ''.$langs->trans("Resiliate")."\n"; } else { print ''.$langs->trans("Resiliate").''."\n"; } @@ -1949,7 +1952,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Exclude if (Adherent::STATUS_VALIDATED == $object->statut) { if ($user->rights->adherent->supprimer) { - print ''.$langs->trans("Exclude")."\n"; + print ''.$langs->trans("Exclude")."\n"; } else { print ''.$langs->trans("Exclude").''."\n"; } @@ -1959,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (isModEnabled('societe') && !$object->socid) { if ($user->rights->societe->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { - print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; + print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; } else { print ''.$langs->trans("CreateDolibarrThirdParty").''."\n"; } @@ -1972,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!$user->socid && !$object->user_id) { if ($user->rights->user->user->creer) { if (Adherent::STATUS_DRAFT != $object->statut) { - print ''.$langs->trans("CreateDolibarrLogin").''."\n"; + print ''.$langs->trans("CreateDolibarrLogin").''."\n"; } else { print ''.$langs->trans("CreateDolibarrLogin").''."\n"; } @@ -1986,16 +1989,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $isinspip = $mailmanspip->is_in_spip($object); if ($isinspip == 1) { - print ''.$langs->trans("DeleteIntoSpip").''."\n"; + print ''.$langs->trans("DeleteIntoSpip").''."\n"; } if ($isinspip == 0) { - print ''.$langs->trans("AddIntoSpip").''."\n"; + print ''.$langs->trans("AddIntoSpip").''."\n"; } } // Delete if ($user->rights->adherent->supprimer) { - print ''.$langs->trans("Delete").''."\n"; + print ''.$langs->trans("Delete").''."\n"; } else { print ''.$langs->trans("Delete").''."\n"; } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0aa1af68afc..dd9d58eb7d3 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -520,21 +520,45 @@ class Adherent extends CommonObject * Return translated label by the nature of a adherent (physical or moral) * * @param string $morphy Nature of the adherent (physical or moral) + * @param int $addbadge Add badge (1=Full label, 2=First letter only) * @return string Label */ - public function getmorphylib($morphy = '') + public function getmorphylib($morphy = '', $addbadge = 0) { global $langs; + + // Clean var if (!$morphy) { $morphy = $this->morphy; } - if ($morphy == 'phy') { - return $langs->trans("Physical"); + + if ($addbadge) { + $s = ''; + if ($morphy == 'phy') { + if ($addbadge == 2) { + $labeltoshow = dol_substr($langs->trans("Physical"), 0, 1); + } else { + $labeltoshow = $langs->trans("Physical"); + } + $s .= ''.$labeltoshow.''; + } + if ($morphy == 'mor') { + if ($addbadge == 2) { + $labeltoshow = dol_substr($langs->trans("Moral"), 0, 1); + } else { + $labeltoshow = $langs->trans("Moral"); + } + $s .= ''.$labeltoshow.''; + } + } else { + if ($morphy == 'phy') { + $s = $langs->trans("Physical"); + } elseif ($morphy == 'mor') { + $s = $langs->trans("Moral"); + } } - if ($morphy == 'mor') { - return $langs->trans("Moral"); - } - return $morphy; + + return $s; } /** @@ -2352,8 +2376,8 @@ class Adherent extends CommonObject $statusType = 'status1'; $labelStatus = $langs->trans("MemberStatusActive"); $labelStatusShort = $langs->trans("MemberStatusActiveShort"); - } elseif ($date_end_subscription < dol_now()) { - $statusType = 'status3'; + } elseif ($date_end_subscription < dol_now()) { // expired + $statusType = 'status8'; $labelStatus = $langs->trans("MemberStatusActiveLate"); $labelStatusShort = $langs->trans("MemberStatusActiveLateShort"); } else { diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 35ab65e9d82..8308c71fac0 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -480,11 +480,11 @@ class Members extends DolibarrApi /** * Add a subscription for a member * - * @param int $id ID of member - * @param int $start_date Start date {@from body} {@type timestamp} - * @param int $end_date End date {@from body} {@type timestamp} - * @param float $amount Amount (may be 0) {@from body} - * @param string $label Label {@from body} + * @param int $id ID of member + * @param string $start_date Start date {@from body} {@type timestamp} + * @param string $end_date End date {@from body} {@type timestamp} + * @param float $amount Amount (may be 0) {@from body} + * @param string $label Label {@from body} * @return int ID of subscription * * @url POST {id}/subscriptions diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 388d51be376..a5f9c26f192 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -87,7 +87,9 @@ print load_fiche_titre($langs->trans("MembersArea"), $resultboxes['selectboxlist $MembersValidated = array(); $MembersToValidate = array(); +$MembersWaitingSubscription = array(); $MembersUpToDate = array(); +$MembersExpired = array(); $MembersExcluded = array(); $MembersResiliated = array(); @@ -137,13 +139,36 @@ if ($resql) { $now = dol_now(); +// Members waiting subscription +$sql = "SELECT count(*) as somme , d.fk_adherent_type"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; +$sql .= " WHERE d.entity IN (".getEntity('adherent').")"; +$sql .= " AND d.statut = 1"; // validated +$sql .= " AND (d.datefin IS NULL AND t.subscription = '1')"; +$sql .= " AND t.rowid = d.fk_adherent_type"; +$sql .= " GROUP BY d.fk_adherent_type"; + +dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $MembersWaitingSubscription[$objp->fk_adherent_type] = $objp->somme; + $i++; + } + $db->free($resql); +} + // Members up to date list -// current rule: uptodate = the end date is in future whatever is type +// current rule: uptodate = the end date is in future or no subcription required // old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future) $sql = "SELECT count(*) as somme , d.fk_adherent_type"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")"; -$sql .= " AND d.statut = 1 AND (d.datefin >= '".$db->idate($now)."' OR t.subscription = 0)"; +$sql .= " AND d.statut = 1"; // validated +$sql .= " AND (d.datefin >= '".$db->idate($now)."' OR t.subscription = '0')"; // end date in future $sql .= " AND t.rowid = d.fk_adherent_type"; $sql .= " GROUP BY d.fk_adherent_type"; @@ -160,6 +185,28 @@ if ($resql) { $db->free($resql); } +// Members expired list +$sql = "SELECT count(*) as somme , d.fk_adherent_type"; +$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; +$sql .= " WHERE d.entity IN (".getEntity('adherent').")"; +$sql .= " AND d.statut = 1"; // validated +$sql .= " AND (d.datefin < '".$db->idate($now)."' AND t.subscription = '1')"; +$sql .= " AND t.rowid = d.fk_adherent_type"; +$sql .= " GROUP BY d.fk_adherent_type"; + +dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + $MembersExpired[$objp->fk_adherent_type] = $objp->somme; + $i++; + } + $db->free($resql); +} + /* * Statistics */ @@ -172,8 +219,9 @@ if ($conf->use_javascript_ajax) { $boxgraph .=''; $SumToValidate = 0; - $SumValidated = 0; + $SumWaitingSubscription = 0; $SumUpToDate = 0; + $SumExpired = 0; $SumResiliated = 0; $SumExcluded = 0; @@ -182,23 +230,26 @@ if ($conf->use_javascript_ajax) { $i = 0; foreach ($AdherentType as $key => $adhtype) { $dataval['draft'][] = array($i, isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0); + $dataval['waitingsubscription'][] = array($i, isset($MembersWaitingSubscription[$key]) ? $MembersWaitingSubscription[$key] : 0); $dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0); - $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0); + $dataval['expired'][] = array($i, isset($MembersExpired[$key]) ? $MembersExpired[$key] : 0); $dataval['excluded'][] = array($i, isset($MembersExcluded[$key]) ? $MembersExcluded[$key] : 0); $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; - $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; + $SumWaitingSubscription += isset($MembersWaitingSubscription[$key]) ? $MembersWaitingSubscription[$key] : 0; $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumExpired += isset($MembersExpired[$key]) ? $MembersExpired[$key] : 0; $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; $i++; } - $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated; + $total = $SumToValidate + $SumWaitingSubscription + $SumUpToDate + $SumExpired + $SumExcluded + $SumResiliated; $dataseries = array(); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SumToValidate)); // Draft, not yet validated + $dataseries[] = array($langs->transnoentitiesnoconv("WaitingSubscription"), round($SumWaitingSubscription)); $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SumUpToDate)); - $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumValidated)); + $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumExpired)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), round($SumExcluded)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SumResiliated)); @@ -207,7 +258,7 @@ if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->SetDataColor(array('-'.$badgeStatus0, $badgeStatus4, '-'.$badgeStatus1, '-'.$badgeStatus8, $badgeStatus6)); + $dolgraph->SetDataColor(array('-'.$badgeStatus0, $badgeStatus1, $badgeStatus4, $badgeStatus8, '-'.$badgeStatus8, $badgeStatus6)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); @@ -217,7 +268,7 @@ if ($conf->use_javascript_ajax) { $boxgraph .= ''; $boxgraph .= ''.$langs->trans("Total").''; - $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated; + $boxgraph .= $SumToValidate + $SumWaitingSubscription + $SumUpToDate + $SumExpired + $SumExcluded + $SumResiliated; $boxgraph .= ''; $boxgraph .= ''; $boxgraph .= ''; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 4c80627d70e..4b3a5cdb82c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -142,31 +142,31 @@ if ($db->type == 'pgsql') { unset($fieldstosearchall['d.rowid']); } $arrayfields = array( - 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0), - 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), - 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'd.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0), - 'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1), - 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), - 'd.morphy'=>array('label'=>$langs->trans("MemberNature"), 'checked'=>1), - 't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1), - 'd.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1), - 'd.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0), - 'd.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), - 'd.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), - 'd.phone'=>array('label'=>$langs->trans("Phone"), 'checked'=>0), - 'd.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0), - 'd.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>0), - 'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0), - 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), - /*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0), - 'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/ - 'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500), - 'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), - 'd.birth'=>array('label'=>$langs->trans("Birthday"), 'checked'=>0, 'position'=>500), - 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + 'd.ref'=>array('label'=>"Ref", 'checked'=>1), + 'd.civility'=>array('label'=>"Civility", 'checked'=>0), + 'd.lastname'=>array('label'=>"Lastname", 'checked'=>1), + 'd.firstname'=>array('label'=>"Firstname", 'checked'=>1), + 'd.gender'=>array('label'=>"Gender", 'checked'=>0), + 'd.company'=>array('label'=>"Company", 'checked'=>1), + 'd.login'=>array('label'=>"Login", 'checked'=>1), + 'd.morphy'=>array('label'=>"MemberNature", 'checked'=>1), + 't.libelle'=>array('label'=>"Type", 'checked'=>1), + 'd.email'=>array('label'=>"Email", 'checked'=>1), + 'd.address'=>array('label'=>"Address", 'checked'=>0), + 'd.zip'=>array('label'=>"Zip", 'checked'=>0), + 'd.town'=>array('label'=>"Town", 'checked'=>0), + 'd.phone'=>array('label'=>"Phone", 'checked'=>0), + 'd.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), + 'd.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>0), + 'state.nom'=>array('label'=>"State", 'checked'=>0), + 'country.code_iso'=>array('label'=>"Country", 'checked'=>0), + /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), + 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ + 'd.datefin'=>array('label'=>"EndSubscription", 'checked'=>1, 'position'=>500), + 'd.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), + 'd.birth'=>array('label'=>"Birthday", 'checked'=>0, 'position'=>500), + 'd.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 'd.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100), ); // Extra fields @@ -350,27 +350,43 @@ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; if (!empty($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 (d.rowid = ef.fk_object)"; } -if ((!empty($search_categ) && ($search_categ > 0 || $search_categ == -2)) || !empty($catid)) { - // We need this table joined to the select in order to filter by categ - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d.country)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)"; $sql .= ", ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE d.fk_adherent_type = t.rowid"; -if ($catid > 0) { - $sql .= " AND cm.fk_categorie = ".((int) $catid); + +if ($catid && empty($search_categ)) { + $search_categ = $catid; } -if ($catid == -2) { - $sql .= " AND cm.fk_categorie IS NULL"; -} -if ($search_categ > 0) { - $sql .= " AND cm.fk_categorie = ".((int) $search_categ); -} -if ($search_categ == -2) { - $sql .= " AND cm.fk_categorie IS NULL"; + +$searchCategoryContactList = $search_categ ? array($search_categ) : array(); +$searchCategoryContactOperator = 0; +// Search for tag/category ($searchCategoryContactList is an array of ID) +if (!empty($searchCategoryContactList)) { + $searchCategoryContactSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryContactList as $searchCategoryContact) { + if (intval($searchCategoryContact) == -2) { + $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member)"; + } elseif (intval($searchCategoryContact) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + } + } + if ($listofcategoryid) { + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryContactOperator == 1) { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryContactSqlList).")"; + } + } else { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryContactSqlList).")"; + } + } } + $sql .= " AND d.entity IN (".getEntity('adherent').")"; if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); @@ -379,7 +395,10 @@ if ($search_type > 0) { $sql .= " AND t.rowid=".((int) $search_type); } if ($search_filter == 'withoutsubscription') { - $sql .= " AND (datefin IS NULL OR t.subscription = '0')"; + $sql .= " AND (datefin IS NULL)"; +} +if ($search_filter == 'waitingsubscription') { + $sql .= " AND (datefin IS NULL AND t.subscription = '1')"; } if ($search_filter == 'uptodate') { $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')"; @@ -391,7 +410,7 @@ if ($search_status != '') { // Peut valoir un nombre ou liste de nombre separes par virgules $sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")"; } -if ($search_morphy != '') { +if ($search_morphy != '' && $search_morphy != '-1') { $sql .= natural_search("d.morphy", $search_morphy); } if ($search_ref) { @@ -498,35 +517,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros'; llxHeader('', $title, $help_url); -if (GETPOSTISSET("search_status")) { - if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED - $title = $langs->trans("MembersListQualified"); - } - if ($search_status == Adherent::STATUS_DRAFT) { - $title = $langs->trans("MembersListToValid"); - } - if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') { - $title = $langs->trans("MenuMembersValidated"); - } - if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') { - $title = $langs->trans("MembersWithSubscriptionToReceive"); - } - if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') { - $title = $langs->trans("MembersListUpToDate"); - } - if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') { - $title = $langs->trans("MembersListNotUpToDate"); - } - if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is '' - $title = $langs->trans("MembersListResiliated"); - } - if ($search_status == Adherent::STATUS_EXCLUDED) { - $title = $langs->trans("MembersListExcluded"); - } -} elseif ($action == 'search') { - $title = $langs->trans("MembersListQualified"); -} - if ($search_type > 0) { $membertype = new AdherentType($db); $result = $membertype->fetch($search_type); @@ -670,7 +660,7 @@ $moreforfilter = ''; if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1); + $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); $moreforfilter .= '
'; } $parameters = array(); @@ -741,10 +731,11 @@ if (!empty($arrayfields['d.login']['checked'])) { print ''; print ''; } +// Nature if (!empty($arrayfields['d.morphy']['checked'])) { - print ''; + print ''; $arraymorphy = array('mor'=>$langs->trans("Moral"), 'phy'=>$langs->trans("Physical")); - print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1); + print $form->selectarray('search_morphy', $arraymorphy, $search_morphy, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100'); print ''; } if (!empty($arrayfields['t.libelle']['checked'])) { @@ -805,7 +796,8 @@ if (!empty($arrayfields['d.email']['checked'])) { // End of subscription date if (!empty($arrayfields['d.datefin']['checked'])) { print ''; - $selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); + //$selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); + $selectarray = array('-1'=>'', 'waitingsubscription'=>$langs->trans("WaitingSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate")); print $form->selectarray('search_filter', $selectarray, $search_filter); print ''; } @@ -919,7 +911,7 @@ if (!empty($arrayfields['d.email']['checked'])) { print_liste_field_titre($arrayfields['d.email']['label'], $_SERVER["PHP_SELF"], 'd.email', '', $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['d.datefin']['checked'])) { - print_liste_field_titre($arrayfields['d.datefin']['label'], $_SERVER["PHP_SELF"], 'd.datefin', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['d.datefin']['label'], $_SERVER["PHP_SELF"], 'd.datefin,t.subscription', '', $param, '', $sortfield, $sortorder, 'center '); } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; @@ -938,7 +930,7 @@ if (!empty($arrayfields['d.tms']['checked'])) { print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); } if (!empty($arrayfields['d.statut']['checked'])) { - print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut", "", $param, 'class="right"', $sortfield, $sortorder); + print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut,t.subscription,d.datefin", "", $param, 'class="right"', $sortfield, $sortorder); } if (!empty($arrayfields['d.import_key']['checked'])) { print_liste_field_titre($arrayfields['d.import_key']['label'], $_SERVER["PHP_SELF"], "d.import_key", "", $param, '', $sortfield, $sortorder, 'center '); @@ -955,6 +947,7 @@ while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); $datefin = $db->jdate($obj->datefin); + $memberstatic->id = $obj->rowid; $memberstatic->ref = $obj->ref; $memberstatic->civility_id = $obj->civility; @@ -970,6 +963,7 @@ while ($i < min($num, $limit)) { $memberstatic->morphy = $obj->morphy; $memberstatic->note_public = $obj->note_public; $memberstatic->note_private = $obj->note_private; + $memberstatic->need_subscription = $obj->subscription; if (!empty($obj->fk_soc)) { $memberstatic->fetch_thirdparty(); @@ -1070,14 +1064,7 @@ while ($i < min($num, $limit)) { // Nature (Moral/Physical) if (!empty($arrayfields['d.morphy']['checked'])) { print ''; - $s = ''; - if ($obj->morphy == 'phy') { - $s .= ''.dol_substr($langs->trans("Physical"), 0, 1).''; - } - if ($obj->morphy == 'mor') { - $s .= ''.dol_substr($langs->trans("Moral"), 0, 1).''; - } - print $s; + print $memberstatic->getmorphylib('', 2); print "\n"; if (!$i) { $totalarray['nbfield']++; @@ -1183,7 +1170,7 @@ while ($i < min($num, $limit)) { } } else { if (!empty($obj->subscription)) { - print $langs->trans("SubscriptionNotReceived"); + print ''.$langs->trans("SubscriptionNotReceived").''; if ($obj->statut > 0) { print " ".img_warning(); } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index c26a9d13536..fcdb643a006 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -145,6 +145,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle='".$db->escape($object->label)."'"; $sql .= " WHERE entity IN (".getEntity('member_type').")"; $result = $db->query($sql); + $num = null; if ($result) { $num = $db->num_rows($result); } @@ -720,7 +721,7 @@ if ($rowid > 0) { */ // Moral/Physique - print "".$adh->getmorphylib($objp->morphy)."\n"; + print "".$adh->getmorphylib($objp->morphy, 1)."\n"; // EMail print "".dol_print_email($objp->email, 0, 0, 1)."\n"; @@ -740,9 +741,9 @@ if ($rowid > 0) { } print ''; } else { - print ''; + print ''; if (!empty($objp->subscription)) { - print $langs->trans("SubscriptionNotReceived"); + print ''.$langs->trans("SubscriptionNotReceived").''; if ($objp->status > 0) { print " ".img_warning(); } @@ -758,7 +759,7 @@ if ($rowid > 0) { print ''.img_edit().''; } if ($user->rights->adherent->supprimer) { - print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; + print ''.img_picto($langs->trans("Resiliate"), 'disable.png').''; } print ""; @@ -845,7 +846,7 @@ if ($rowid > 0) { print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%'); + $doleditor = new DolEditor('comment', $object->note_public, '', 220, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%'); $doleditor->Create(); print ""; diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 5e1db1233b8..33c93704b80 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -226,7 +226,7 @@ if ($action == 'edit') { print ''; print ''; print ''; print ''; @@ -289,7 +289,7 @@ if ($action == 'create' && $user->rights->adherent->configurer) { print ''; print ''; print ''; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 075ece751ce..3be38cca113 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -dol_include_once('/emailcollector/class/emailcollector.class.php'); +require_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollector.class.php'; // Load translation files required by page $langs->loadLangs(array("admin", "other")); @@ -50,7 +50,7 @@ $mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 40c86d79e13..cc9b8d7bca8 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -220,7 +220,7 @@ if ($action == 'edit') { foreach ($arrayofparameters as $constname => $val) { if ($val['enabled']==1) { $setupnotempty++; - print ''; + print ''; + print ''; + + print ''; } } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index dd4748a99f1..f43ddb281bd 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -51,7 +51,7 @@ $modules = array( 'NOTE_PUBLIC' => 'FCKeditorForNotePublic', 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate', 'SOCIETE' => 'FCKeditorForCompany', - 'PRODUCTDESC' => 'FCKeditorForProduct', + //'PRODUCTDESC' => 'FCKeditorForProduct', 'DETAILS' => 'FCKeditorForProductDetails', 'USERSIGN' => 'FCKeditorForUserSignature', 'MAILING' => 'FCKeditorForMailing', @@ -93,7 +93,7 @@ foreach ($modules as $const => $desc) { if ($action == 'enable_'.strtolower($const)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // If fckeditor is active in the product/service description, it is activated in the forms - if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if ($const == 'PRODUCTDESC' && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity); } header("Location: ".$_SERVER["PHP_SELF"]); @@ -166,7 +166,12 @@ if (empty($conf->use_javascript_ajax)) { print ''."\n"; print ''; print ''; - print ''; + print ''; print ''; print ''; +// Allow online signing +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +// Allow external download +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + 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]).''.$langs->trans($desc).''; + print $langs->trans($desc); + if ($const == 'DETAILS') { + print '
'.$langs->trans("FCKeditorForProductDetails2").''; + } + 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"; print ''; + print ''; // Skins show_skin(null, 1); @@ -219,7 +225,7 @@ if (empty($conf->use_javascript_ajax)) { print $conf->global->FCKEDITOR_TEST; print ''; } - print $form->buttonsSaveCancel("Save", ''); + print $form->buttonsSaveCancel("Save", '', null, 0, 'reposition'); print '
'; 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 '
'; +print $langs->trans("AllowOnlineSign"); +print ''; +print ''; +print ''; +print ''; +print '
'; +print $langs->trans("AllowExternalDownload"); +print ''; +print ''; +print ''; +print ''; +print '
'; print ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index ff24a708797..dfa0bccb06b 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -34,14 +34,15 @@ $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "err $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); +$trackid = GETPOST('trackid'); + if (!$user->admin) { accessforbidden(); } $usersignature = $user->signature; -// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html. - -if ($action == 'test' || $action == 'send') { +// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html. +if ($action == 'test' || ($action == 'send' && $trackid = 'test')) { $usersignature = dol_string_nohtmltag($usersignature, 2); } @@ -118,6 +119,11 @@ if ($action == 'update' && !$cancel) { } } +if ($action == 'disablephpmailwarning' && !$cancel) { + dolibarr_set_const($db, 'MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP', 1, 'chaine', 1, 0, $conf->entity); + + setEventMessages($langs->trans("WarningDisabled"), null, 'mesgs'); +} // Actions to send emails $id = 0; @@ -125,7 +131,7 @@ $actiontypecode = ''; // Not an event for agenda $triggersendname = ''; // Disable triggers $paramname = 'id'; $mode = 'emailfortest'; -$trackid = (($action == 'testhtml') ? "testhtml" : "test"); +$trackid = ($action == 'send' ? GETPOST('trackid', 'aZ09') : $action); $sendcontext = ''; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; @@ -138,7 +144,6 @@ if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') { - /* * View */ @@ -375,7 +380,7 @@ if ($action == 'edit') { // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE); + print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')); } else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) { @@ -383,13 +388,13 @@ if ($action == 'edit') { } $htmltext = $langs->trans("ContactSuperAdminForChange"); print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); - print ''; + print ''; } print ''; // Host server print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { print ''; print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); print ''; @@ -423,7 +428,7 @@ if ($action == 'edit') { // Port print ''; - if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (!$conf->use_javascript_ajax && $linuxlike && getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); print ''; print ''.$langs->trans("SeeLocalSendMailSetup").''; @@ -451,7 +456,7 @@ if ($action == 'edit') { print ''; // ID - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { $mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID) ? $conf->global->MAIN_MAIL_SMTPS_ID : ''); print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''; // SuperAdministrator access only @@ -467,7 +472,7 @@ if ($action == 'edit') { // OAUTH - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''; if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) { print ' '; @@ -485,7 +490,7 @@ if ($action == 'edit') { } // PW - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { $mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW) ? $conf->global->MAIN_MAIL_SMTPS_PW : ''); print ''; print $form->textwithpicto($langs->trans("MAIN_MAIL_SMTPS_PW"), $langs->trans("WithGMailYouCanCreateADedicatedPassword")); @@ -502,7 +507,7 @@ if ($action == 'edit') { } // OAUTH service provider - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").''; // SuperAdministrator access only @@ -521,7 +526,7 @@ if ($action == 'edit') { } // TLS print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (!empty($conf->global->MAIN_MAIL_EMAIL_TLS) ? $conf->global->MAIN_MAIL_EMAIL_TLS : 0), 1); } else { @@ -534,7 +539,7 @@ if ($action == 'edit') { // STARTTLS print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (!empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) ? $conf->global->MAIN_MAIL_EMAIL_STARTTLS : 0), 1); } else { @@ -547,7 +552,7 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED', (!empty($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED) ? $conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED : 0), 1); } else { @@ -560,7 +565,7 @@ if ($action == 'edit') { // DKIM print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; - if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer')))) { + if (!empty($conf->use_javascript_ajax) || (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer')))) { if (function_exists('openssl_open')) { print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (!empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED) ? $conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED : 0), 1); } else { @@ -671,20 +676,21 @@ if ($action == 'edit') { // Method print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail')]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); } print $text; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - print $form->textwithpicto('', $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 1, 'warning'); + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + $textwarning = $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"); + print $form->textwithpicto('', $textwarning, 1, 'warning'); } print ''; // Host server - if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { print ''.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').''; @@ -692,31 +698,31 @@ if ($action == 'edit') { // Port - if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'mail')) { + if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").''; } else { print ''.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').''; } // SMTPS ID - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { print ''.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.''; } // AUTH method - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { $authtype = getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE', 'LOGIN'); $text = ($authtype === "LOGIN") ? $langs->trans("UsePassword") : ($authtype === "XOAUTH2" ? $langs->trans("UseOauth") : '') ; print ''.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").''.$text.''; } // SMTPS PW - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') != "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') != "XOAUTH2") { print ''.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).''; } // SMTPS oauth service - if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") { $text = $oauthservices[$conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); @@ -726,7 +732,7 @@ if ($action == 'edit') { // TLS print ''.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_TLS); } else { @@ -739,7 +745,7 @@ if ($action == 'edit') { // STARTTLS print ''.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS); } else { @@ -752,7 +758,7 @@ if ($action == 'edit') { // SMTP_ALLOW_SELF_SIGNED print ''.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED); } else { @@ -767,7 +773,7 @@ if ($action == 'edit') { if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') { // DKIM print ''.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) { + if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('swiftmailer'))) { if (function_exists('openssl_open')) { print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_DKIM_ENABLED')); } else { @@ -797,8 +803,14 @@ if ($action == 'edit') { print ''; print ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - print info_admin($langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning'); + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + $messagetoshow = $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"); + $messagetoshow .= ' '.$langs->trans("WarningPHPMailDbis", '{s1}', '{s2}'); + $linktosetvar1 = ''; + $linktosetvar2 = ''; + $messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow); + $messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow); + print info_admin($messagetoshow, 0, 0, 'warning'); } print '
'; @@ -903,7 +915,7 @@ if ($action == 'edit') { print ''.$langs->trans("Modify").''; if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { - if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') != 'mail' || !$linuxlike) { if (function_exists('fsockopen') && $port && $server) { print ''.$langs->trans("DoTestServerAvailability").''; } @@ -921,7 +933,7 @@ if ($action == 'edit') { print ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) { /* // Warning 1 if ($linuxlike) @@ -938,11 +950,11 @@ if ($action == 'edit') { if (!in_array($action, array('testconnect', 'test', 'testhtml'))) { $text = ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { //$text .= $langs->trans("WarningPHPMail"); // To encourage to use SMTPS } - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail') { if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) { // List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com' $text .= ($text ? '

' : '').''.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 1b5f8353f12..5a4eac7bcca 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1173,7 +1173,7 @@ if ($num) { $class .= ' tdoverflowmax100'; } if ($value == 'topic') { - $class .= 'tdoverflowmax200 small'; + $class .= ' tdoverflowmax200 small'; } if ($value == 'type_template') { $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 014d3844368..6bf59508d11 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -282,10 +282,9 @@ if (count($listinsetup) > 0) { } print ''; + // Delete print ''; - $label = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array); - print ''; print img_picto('', 'delete'); print ''; @@ -300,41 +299,53 @@ if (count($listinsetup) > 0) { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''; - print ''; + print ''; + print ''; + print ''; if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { print ''; print ''.$langs->trans("URLOfServiceForAuthorization").''; print ''; - print ''; + print ''; + print ''; + print ''; } } else { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''.$langs->trans("FeatureNotYetSupported").''; - print ''; + print ''; + print ''; + print ''; } // Api Id print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; // Api Secret print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; - // TODO Move this into token generation + // TODO Move this into token generation ? if ($supported) { if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') { print ''; print ''.$langs->trans("Scopes").''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; } else { $availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes'])); $currentscopes = explode(',', getDolGlobalString($key[4])); @@ -354,13 +365,17 @@ if (count($listinsetup) > 0) { print ''; print ''; } - print ''; + print ''; + print ''; + print ''; } } else { print ''; print ''.$langs->trans("UseTheFollowingUrlAsRedirectURI").''; print ''.$langs->trans("FeatureNotYetSupported").''; - print ''; + print ''; + print ''; + print ''; } print ''."\n"; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index bec69a7a6e4..d4c5a3e034a 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -193,7 +193,7 @@ print ''; print ''.$langs->trans("MaxNumberOfPostOnPublicPagesByIP").''; print ''; print ''; -print ' '.strtolower($langs->trans("Posts")); +print ''; print ''; print ''; diff --git a/htdocs/admin/stocktransfer.php b/htdocs/admin/stocktransfer.php index 099312ef491..3bcd00c1fe8 100644 --- a/htdocs/admin/stocktransfer.php +++ b/htdocs/admin/stocktransfer.php @@ -24,19 +24,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php"; -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); +require '../main.inc.php'; global $langs, $user; @@ -56,6 +44,8 @@ $action = GETPOST('action', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $arrayofparameters = array( 'STOCKTRANSFER_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), @@ -70,9 +60,8 @@ $setupnotempty = 0; * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; + if ($action == 'updateMask') { $maskconststocktransfer = GETPOST('maskconststocktransfer', 'alpha'); @@ -131,7 +120,9 @@ if ($action == 'updateMask') { $ret = delDocumentModel($value, 'stocktransfer'); if ($ret > 0) { $constforval = strtoupper($tmpobjectkey).'_ADDON_PDF'; - if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity); + if (getDolGlobalString($constforval) == "$value") { + dolibarr_del_const($db, $constforval, $conf->entity); + } } } elseif ($action == 'setdoc') { // Set default model $tmpobjectkey = 'StockTransfer'; @@ -294,7 +285,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { print ''; $constforvar = 'STOCKTRANSFER_'.strtoupper($myTmpObjectKey).'_ADDON'; - if ($conf->global->$constforvar == $file) { + if (getDolGlobalString($constforvar) == $file) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; @@ -428,7 +419,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { // Default print ''; $constforvar = strtoupper($myTmpObjectKey).'_ADDON_PDF'; - if ($conf->global->$constforvar == $name) { + if (getDolGlobalString($constforvar) == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 4acb8e0ff59..dcf41aacf25 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -73,7 +73,6 @@ $configfileparameters = array( '?dolibarr_main_auth_ldap_admin_pass', '?dolibarr_main_auth_ldap_debug', 'separator', - '?dolibarr_lib_ADODB_PATH', '?dolibarr_lib_FPDF_PATH', '?dolibarr_lib_TCPDF_PATH', '?dolibarr_lib_FPDI_PATH', @@ -122,7 +121,6 @@ $configfilelib = array( 'dolibarr_main_auth_ldap_admin_pass', 'dolibarr_main_auth_ldap_debug', 'separator', - 'dolibarr_lib_ADODB_PATH', 'dolibarr_lib_TCPDF_PATH', 'dolibarr_lib_FPDI_PATH', 'dolibarr_lib_NUSOAP_PATH', diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 86c76ca1604..7fa1ef252cb 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -342,7 +342,6 @@ $configfileparameters = array( '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass', '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug', 'separator3' => '', - '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH', '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH', '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH', '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH', diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b0ea7571a2d..1ea81cd5dd3 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -570,9 +570,10 @@ print 'For a higher security, we also recommend to implement limits and mitigati print ''; print '
'; -print 'Login process -> This can be done using a fail2ban rule (see example into dev/setup)'."
"; -print DOL_URL_ROOT.'/passwordforgotten.php (see example into dev/setup)'."
"; -print DOL_URL_ROOT.'/public/* (see example into dev/setup)'."
"; +$urlexamplebase = 'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/fail2ban/filter.d/'; +print '- Login process (see fail2ban example on GitHub)
'; +print '- '.DOL_URL_ROOT.'/passwordforgotten.php (see fail2ban example on GitHub)
'; +print '- '.DOL_URL_ROOT.'/public/* (see fail2ban example on GitHub)
'; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 84186e4e226..05938e27d49 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -419,7 +419,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; @@ -431,7 +431,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { print ''.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").''; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70); + $doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_2, 70); $doleditor->Create(); print ''; print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 779db36fb2f..d01efa0ea5b 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -212,10 +212,10 @@ function hideoptions(){ if (div.style.display === "none") { div.style.display = "block"; - lnk.innerText="'.$langs->trans("HideAdvancedoptions").'"; + lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'"; } else { div.style.display = "none"; - lnk.innerText="'.$langs->trans("ShowAdvancedOptions").'..."; + lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'..."; } } '; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 8299e2198ee..8e7643ffc5d 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -35,7 +35,7 @@ $langs->load("admin"); $action = GETPOST('action', 'aZ09'); $what = GETPOST('what', 'alpha'); $export_type = GETPOST('export_type', 'alpha'); -$file = GETPOST('filename_template', 'alpha'); +$file = dol_sanitizeFileName(GETPOST('filename_template', 'alpha')); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index fa5e2ff1de8..e0acc8faac8 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -113,9 +113,8 @@ class DolibarrApi unset($object->pass); unset($object->pass_indatabase); - // Remove linkedObjects. We should already have linkedObjectsIds that avoid huge responses + // Remove linkedObjects. We should already have and keep only linkedObjectsIds that avoid huge responses unset($object->linkedObjects); - unset($object->linkedObjectsFullLoaded); //unset($object->lines[$i]->linked_objects); // This is the array to create linked object during create unset($object->fields); diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 45f90101adc..5e00c2d2433 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -307,7 +307,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords++; }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 1d85a982e5d..aa80b4e5426 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -307,7 +307,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords = $db->num_rows($result); */ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 7f04c6d1005..c94e464a762 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -247,7 +247,7 @@ if ($user->rights->categorie->creer) { // Description print ''.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_5, '90%'); + $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index acdf2e71a32..d9a7eb4b1c7 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1981,6 +1981,7 @@ class Categorie extends CommonObject * @param string $type The category type (e.g Categorie::TYPE_WAREHOUSE) * @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid") * @return string A additional SQL JOIN query + * @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN. @TODO Replace with getWhereQuery($type, $searchCategoryList) */ public static function getFilterJoinQuery($type, $rowIdName) { @@ -1998,6 +1999,7 @@ class Categorie extends CommonObject * @param string $rowIdName The name of the row id inside the whole sql query (e.g. "e.rowid") * @param Array $searchList A list with the selected categories * @return string A additional SQL SELECT query + * @deprecated search on some categories must be done using a WHERE EXISTS or NOT EXISTS and not a LEFT JOIN */ public static function getFilterSelectQuery($type, $rowIdName, $searchList) { diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 8aecdde63ea..f0f40b4401b 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -267,7 +267,7 @@ if ($action == 'edit') { // Desc $desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']); print ''.$langs->trans('Description').''; - $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ''; @@ -327,7 +327,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''.$langs->trans('Label').''; print ''; print ''.$langs->trans('Description').''; - $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 2c008202348..3aa6a16d3ef 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -75,6 +75,7 @@ $offsetunit = GETPOST('offsetunittype_duration', 'aZ09'); $remindertype = GETPOST('selectremindertype', 'aZ09'); $modelmail = GETPOST('actioncommsendmodel_mail', 'int'); $complete = GETPOST('complete', 'alpha'); // 'na' must be allowed +$private = GETPOST('private', 'alphanohtml'); if ($complete == 'na' || $complete == -2) { $complete = -1; } @@ -89,6 +90,14 @@ if ($fulldayevent) { $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); } +$reg = array(); +if (GETPOST('datep')) { + if (GETPOST('datep') == 'now') { + $datep = dol_now(); + } elseif (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { // Try to not use this. Use insteead '&datep=now' + $datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1], 'tzuser'); + } +} // Security check $socid = GETPOST('socid', 'int'); @@ -150,6 +159,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); + /* * Actions @@ -695,7 +706,15 @@ if (empty($reshook) && $action == 'update') { $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser'); } - $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + if ($object->elementtype == 'ticket') { + if ($private) { + $object->type_code = 'TICKET_MSG_PRIVATE'; + } else { + $object->type_id = dol_getIdFromCode($db, 'AC_EMAIL', 'c_actioncomm'); + } + } else { + $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); + } $object->label = GETPOST("label", "alphanohtml"); $object->datep = $datep; $object->datef = $datef; @@ -1059,7 +1078,6 @@ if (empty($reshook)) { } - /* * View */ @@ -1172,9 +1190,10 @@ if ($action == 'create') { // Type of event if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.$langs->trans("Type").''; - $default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT); + $default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV'); print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); - print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot + $selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default); + print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot print ''; } @@ -1486,11 +1505,6 @@ if ($action == 'create') { } } - $reg = array(); - if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { - $object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); - } - // Priority if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) { print ''.$langs->trans("Priority").''; @@ -1694,7 +1708,7 @@ if ($id > 0) { if ($backtopage) { print ''; } - if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->code != "TICKET_MSG_PRIVATE") { print ''; } @@ -1706,7 +1720,7 @@ if ($id > 0) { print ''.$langs->trans("Ref").''.$object->id.''; // Type of event - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != "ticket") { print ''.$langs->trans("Type").''; if ($object->type_code != 'AC_OTH_AUTO') { print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"'); @@ -1719,6 +1733,9 @@ if ($id > 0) { print ''; } + // Private + if ($object->elementtype == 'ticket') print ''.$langs->trans("PrivateEventMessage").'code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'>'; + // Title print 'global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").''; @@ -1865,7 +1882,7 @@ if ($id > 0) { // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { - print ''.$langs->trans("Location").''; + print ''.$langs->trans("Location").''; } // Status @@ -1997,7 +2014,7 @@ if ($id > 0) { print ''; // Reminders - if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) { + if (getDolGlobalString('AGENDA_REMINDER_EMAIL') || getDolGlobalString('AGENDA_REMINDER_BROWSER')) { $filteruserid = $user->id; if ($user->rights->agenda->allactions->read) { $filteruserid = 0; @@ -2139,34 +2156,21 @@ if ($id > 0) { // Project if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
'.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').' '; - if ($user->rights->agenda->allactions->create || - (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { + //$morehtmlref .= '
'; + if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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 .= ''; } } } @@ -2184,13 +2188,16 @@ if ($id > 0) { print ''; // Type - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { + if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != 'ticket') { print ''; } + // Private + if ($object->elementtype == 'ticket') print ''; + // Full day event print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 45dbbbf12c0..228ff397607 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1591,16 +1591,16 @@ class ActionComm extends CommonObject $tooltip = img_picto('', $this->picto).' '.$langs->trans('Action').''; if (!empty($this->ref)) { - $tooltip .= '
'.$langs->trans('Ref').': '.$this->ref; + $tooltip .= '
'.$langs->trans('Ref').': '.dol_escape_htmltag($this->ref); } if (!empty($label)) { - $tooltip .= '
'.$langs->trans('Title').': '.$label; + $tooltip .= '
'.$langs->trans('Title').': '.dol_escape_htmltag($label); } if (!empty($labeltype)) { - $tooltip .= '
'.$langs->trans('Type').': '.$labeltype; + $tooltip .= '
'.$langs->trans('Type').': '.dol_escape_htmltag($labeltype); } if (!empty($this->location)) { - $tooltip .= '
'.$langs->trans('Location').': '.$this->location; + $tooltip .= '
'.$langs->trans('Location').': '.dol_escape_htmltag($this->location); } if (isset($this->transparency)) { $tooltip .= '
'.$langs->trans('Busy').': '.yn($this->transparency); @@ -1609,7 +1609,7 @@ class ActionComm extends CommonObject $langs->load("mails"); $tooltip .= '
'; //$tooltip .= '
'.img_picto('', 'email').' '.$langs->trans("Email").''; - $tooltip .= '
'.$langs->trans('MailTopic').': '.$this->email_subject; + $tooltip .= '
'.$langs->trans('MailTopic').': '.dol_escape_htmltag($this->email_subject); $tooltip .= '
'.$langs->trans('MailFrom').': '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_from); $tooltip .= '
'.$langs->trans('MailTo').': '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_to); if (!empty($this->email_tocc)) { @@ -1697,7 +1697,7 @@ class ActionComm extends CommonObject if ($withpicto) { $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); } - $result .= $labelshort; + $result .= dol_escape_htmltag($labelshort); $result .= $linkend; global $action; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 0942e1554a8..049b70737e8 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -204,7 +204,7 @@ class CActionComm if ($obj->module == 'order' && isModEnabled('commande') && empty($user->rights->commande->lire)) { $qualified = 1; } - if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propale->lire)) { + if ($obj->module == 'propal' && isModEnabled("propal") && !empty($user->rights->propal->lire)) { $qualified = 1; } if ($obj->module == 'invoice_supplier' && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (isModEnabled('supplier_invoice') && !empty($user->rights->supplier_invoice->lire)))) { diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9a4a4e6a869..b02b2850346 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -89,7 +89,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$permissiontoadd = $user->rights->agenda->myactions->read; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php +$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$permissiontoadd = $usercancreate; /* @@ -162,17 +163,22 @@ if ($object->id > 0) { // Project if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
'.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').': '; - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); - if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + //$morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $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 { - $morehtmlref .= ''; + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } } } $morehtmlref .= ''; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f46b0adc3cb..bfb5ca991b9 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1272,9 +1272,9 @@ if (count($listofextcals)) { $event->datef = $dateend + $usertime; if ($icalevent['SUMMARY']) { - $event->label = $icalevent['SUMMARY']; + $event->label = dol_string_nohtmltag($icalevent['SUMMARY']); } elseif ($icalevent['DESCRIPTION']) { - $event->label = dol_nl2br($icalevent['DESCRIPTION'], 1); + $event->label = dol_nl2br(dol_string_nohtmltag($icalevent['DESCRIPTION']), 1); } else { $event->label = $langs->trans("ExtSiteNoLabel"); } @@ -1985,7 +1985,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa // Show title $titletoshow = $daterange; - $titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle); + $titletoshow .= ($titletoshow ? ' ' : '').dol_escape_htmltag($event->label ? $event->label : $event->libelle); if ($event->type_code != 'ICALEVENT') { $savlabel = $event->label ? $event->label : $event->libelle; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 807a8e6f412..749ca6a0c62 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -50,6 +50,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); + /* * View @@ -89,17 +91,22 @@ $morehtmlref = '
'; // Project if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
'.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').': '; - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); - if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + //$morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $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 { - $morehtmlref .= ''; + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } } } $morehtmlref .= '
'; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index a5aca966530..4532e49b622 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -573,7 +573,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords++; }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index f6ae06b1f7f..4d59a75fb1b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1165,7 +1165,7 @@ if ($object->id > 0) { $late = ''; foreach ($contrat->lines as $line) { if ($contrat->statut == Contrat::STATUS_VALIDATED && $line->statut == ContratLigne::STATUS_OPEN) { - if (((!empty($line->date_fin_validite) ? $line->date_fin_validite : 0) + $conf->contrat->services->expires->warning_delay) < $now) { + if (((!empty($line->date_end) ? $line->date_end : 0) + $conf->contrat->services->expires->warning_delay) < $now) { $late = img_warning($langs->trans("Late")); } } diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 27f9b91a9d7..15f94043b1c 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -321,7 +321,7 @@ if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) /* - * Draft customer orders + * Draft sales orders */ if (isModEnabled('commande') && $user->rights->commande->lire) { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 2372f24a929..72ec408524c 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -84,6 +84,8 @@ if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_ accessforbidden(); } +$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); + /* * Actions @@ -124,8 +126,6 @@ if (empty($reshook)) { setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings'); $action = ''; } else { - $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); - if ($object->statut == 0) { dol_print_error('', 'ErrorMailIsNotValidated'); exit; @@ -318,7 +318,8 @@ if (empty($reshook)) { // Mail making $trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid; - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing'); + $upload_dir_tmp = $upload_dir; + $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp); if ($mail->error) { $res = 0; @@ -478,7 +479,8 @@ if (empty($reshook)) { } $trackid = 'emailing-test'; - $mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing'); + $upload_dir_tmp = $upload_dir; + $mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', '', $upload_dir_tmp); $result = $mailfile->sendfile(); if ($result) { @@ -729,8 +731,11 @@ if ($action == 'create') { print dol_get_fiche_head(); 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).'
'; + print ''; + print ''; + print ''; // Other attributes @@ -742,7 +747,7 @@ if ($action == 'create') { } print '
'.$langs->trans("MailTitle").'
'.$langs->trans("MailFrom").'
'.$langs->trans("MailErrorsTo").'
'; - print '

'; + print '

'; print ''; print ''; @@ -887,16 +892,16 @@ if ($action == 'create') { // Description print ''; // From print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 1beefca8cf6..ed3cfce4163 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -544,7 +544,7 @@ if ($object->fetch($id) >= 0) { if ($allowaddtarget) { $morehtmlcenter = ''.$langs->trans("ToClearAllRecipientsClickHere").'id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").''; } - $morehtmlcenter .= '   id.'">'.$langs->trans("Download").''; + $morehtmlcenter .= '   id.'">'.img_picto('', 'download', 'class="pictofixedwidth"').$langs->trans("Download").''; $massactionbutton = ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f835ae3ae29..648fc6e18c4 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2297,39 +2297,28 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').''; + $morehtmlref .= '
'; if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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 .= ''; } } } @@ -2343,7 +2332,7 @@ if ($action == 'create') { print '
'; print '
'; - print '
'.$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 '
'; // Link for thirdparty discounts if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { @@ -2403,7 +2392,7 @@ if ($action == 'create') { // Date end proposal print ''; print ''; } else { @@ -675,6 +675,28 @@ if ($result) { if ($user->rights->banque->consolidate) { print ''; } else { print ''; 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 ''; // Bank diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3e3ada6e8cf..10cf7b624fc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4363,39 +4363,28 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' (
'.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'; if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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 .= ''; } } } @@ -5667,7 +5656,7 @@ if ($action == 'create') { && $usercancreate && !$objectidnext && $object->is_last_in_cycle() - && $conf->global->INVOICE_USE_SITUATION_CREDIT_NOTE + && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') ) { if ($usercanunvalidate) { print ''.$langs->trans("CreateCreditNote").''; @@ -5719,32 +5708,32 @@ if ($action == 'create') { $isErasable = $object->is_erasable(); $params = array( 'attr' => array( - 'title' => '', 'class' => 'classfortooltip' ) ); if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) $enableDelete = false; $deleteHref = '#'; + $htmltooltip = ''; if ($isErasable == -4) { - $params['attr']['title'] = $langs->trans('DisabledBecausePayments'); + $htmltooltip = $langs->trans('DisabledBecausePayments'); } elseif ($isErasable == -3) { - $params['attr']['title'] = $langs->trans('DisabledBecauseNotLastSituationInvoice'); + $htmltooltip = $langs->trans('DisabledBecauseNotLastSituationInvoice'); } elseif ($isErasable == -2) { - $params['attr']['title'] = $langs->trans('DisabledBecauseNotLastInvoice'); + $htmltooltip = $langs->trans('DisabledBecauseNotLastInvoice'); } elseif ($isErasable == -1) { - $params['attr']['title'] = $langs->trans('DisabledBecauseDispatchedInBookkeeping'); + $htmltooltip = $langs->trans('DisabledBecauseDispatchedInBookkeeping'); } elseif ($isErasable <= 0) { // Any other cases - $params['attr']['title'] = $langs->trans('DisabledBecauseNotErasable'); + $htmltooltip = $langs->trans('DisabledBecauseNotErasable'); } elseif ($objectidnext) { - $params['attr']['title'] = $langs->trans('DisabledBecauseReplacedInvoice'); + $htmltooltip = $langs->trans('DisabledBecauseReplacedInvoice'); } else { $deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken(); $enableDelete = true; } - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $deleteHref, '', $enableDelete, $params); + print dolGetButtonAction($htmltooltip, $langs->trans('Delete'), 'delete', $deleteHref, '', $enableDelete, $params); } else { - print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', '', false); + print dolGetButtonAction($langs->trans('Delete'), $langs->trans('Delete'), 'delete', '#', '', false); } } print ''; diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 51c094d898e..4c1392e28eb 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1452,7 +1452,6 @@ class Invoices extends DolibarrApi $multicurrency_amounts[$id] = $newvalue; } - // Creation of payment line $paymentobj = new Paiement($this->db); $paymentobj->datepaye = $datepaye; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index da72411528d..532140481ab 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1272,6 +1272,8 @@ class FactureRec extends CommonInvoice $tmparray = dol_getdate($now); $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day + $this->output = null; + dol_syslog("createRecurringInvoices restrictioninvoiceid=".$restrictioninvoiceid." forcevalidation=".$forcevalidation); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec'; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b88f34e681e..183ee457c32 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5526,12 +5526,20 @@ class Facture extends CommonInvoice $sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1); // Recipient - $to = ''; + $to = array(); $res = $tmpinvoice->fetch_thirdparty(); $recipient = $tmpinvoice->thirdparty; if ($res > 0) { - if (!empty($recipient->email)) { - $to = $recipient->email; + $tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING'); + if (is_array($tmparraycontact) && count($tmparraycontact) > 0) { + foreach ($tmparraycontact as $data_email) { + if (!empty($data_email['email'])) { + $to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email'); + } + } + } + if (empty($to) && !empty($recipient->email)) { + $to[] = $recipient->email; } else { $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for user."; $error++; @@ -5548,9 +5556,11 @@ class Facture extends CommonInvoice $error++; } - if (!$error && $to) { + if (!$error && !empty($to)) { $this->db->begin(); + $to = implode(',', $to); + // Errors Recipient $errors_to = $conf->global->MAIN_MAIL_ERRORS_TO; @@ -5802,6 +5812,11 @@ class FactureLigne extends CommonInvoiceLine if ($result) { $objp = $this->db->fetch_object($result); + if (!$objp) { + $this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql; + return 0; + } + $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_facture = $objp->fk_facture; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 522fe9aa2e2..5637fd740a0 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -97,10 +97,19 @@ class FactureStats extends Stats if ($this->userid > 0) { $this->where .= ' AND f.fk_user_author = '.((int) $this->userid); } - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $this->where .= " AND f.type IN (0,1,2,5)"; - } else { - $this->where .= " AND f.type IN (0,1,2,3,5)"; + if ($mode == 'customer') { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $this->where .= " AND f.type IN (0,1,2,5)"; + } else { + $this->where .= " AND f.type IN (0,1,2,3,5)"; + } + } + if ($mode == 'supplier') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $this->where .= " AND f.type IN (0,1,2,5)"; + } else { + $this->where .= " AND f.type IN (0,1,2,3,5)"; + } } if ($typentid) { @@ -109,9 +118,7 @@ class FactureStats extends Stats } if ($categid) { - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = f.fk_soc'; - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; - $this->where .= ' AND c.rowid = '.((int) $categid); + $this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 62705ffd876..b367301911d 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -58,6 +58,8 @@ if ($id > 0 || !empty($ref)) { $result = restrictedArea($user, 'facture', $object->id); +$usercancreate = $user->hasRight("facture", "creer"); + /* * Add a new contact @@ -136,37 +138,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/facture/document.php b/htdocs/compta/facture/document.php index ee3700fd67e..5cec55e2439 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -81,6 +81,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'facture', $object->id, ''); +$usercancreate = $user->hasRight("facture", "creer"); + /* * Actions @@ -140,37 +142,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/facture/info.php b/htdocs/compta/facture/info.php index 0d70f095d31..1ea28b295c3 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -59,6 +59,8 @@ $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +$usercancreate = $user->hasRight("facture", "creer"); + /* * View @@ -96,37 +98,25 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); +$morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/facture/list.php b/htdocs/compta/facture/list.php index 1d6dbd9f03b..b5b9687686b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -73,15 +73,15 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicelist'; if ($contextpage == 'poslist') { - $_GET['optioncss'] = 'print'; + $optioncss = 'print'; } $lineid = GETPOST('lineid', 'int'); $userid = GETPOST('userid', 'int'); -$search_product_category = GETPOST('search_product_category', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); $search_type = GETPOST('search_type', 'int'); @@ -89,6 +89,7 @@ $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $search_company_alias = GETPOST('search_company_alias', 'alpha'); +$search_parent_name = trim(GETPOST('search_parent_name', 'alphanohtml')); $search_montant_ht = GETPOST('search_montant_ht', 'alpha'); $search_montant_vat = GETPOST('search_montant_vat', 'alpha'); $search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha'); @@ -137,10 +138,10 @@ $search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); $search_categ_cus = GETPOST("search_categ_cus", 'int'); +$search_product_category = GETPOST('search_product_category', 'int'); $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); -$optioncss = GETPOST('optioncss', 'alpha'); $option = GETPOST('search_option'); if ($option == 'late') { @@ -220,6 +221,7 @@ $arrayfields = array( 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>41), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), + 's2.nom'=>array('label'=>'ParentCompany', 'position'=>32, 'checked'=>0), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>65), @@ -251,8 +253,8 @@ $arrayfields = array( 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502), - 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), - 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), + 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'f.fk_fac_rec_source'=>array('label'=>'GeneratedFromTemplate', 'checked'=>0, 'position'=>520, 'enabled'=>'1'), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); @@ -317,6 +319,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_project = ''; $search_company = ''; $search_company_alias = ''; + $search_parent_name = ''; $search_montant_ht = ''; $search_montant_vat = ''; $search_montant_localtax1 = ''; @@ -336,7 +339,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_town = ''; $search_zip = ""; $search_state = ""; - $search_type = ''; $search_country = ''; $search_type_thirdparty = ''; $search_date_startday = ''; @@ -553,6 +555,8 @@ $bankaccountstatic = new Account($db); $facturestatic = new Facture($db); $formcompany = new FormCompany($db); $companystatic = new Societe($db); +$companyparent = new Societe($db); +$company_url_list = array(); $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { @@ -567,6 +571,8 @@ $sql .= ' f.paye as paye, f.fk_statut, f.close_code,'; $sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,'; $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; $sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; +$sql .= " s.parent as fk_parent,"; +$sql .= " s2.nom as name2,"; $sql .= ' typent.code as typent_code,'; $sql .= ' state.code_departement as state_code, state.nom as state_name,'; $sql .= ' country.code as country_code,'; @@ -581,9 +587,6 @@ if (!$sall) { $sql .= ', SUM(pf.amount) as dynamount_payed, SUM(pf.multicurrency_amount) as multicurrency_dynamount_payed'; } */ -if ($search_categ_cus && $search_categ_cus != -1) { - $sql .= ", cc.fk_categorie, cc.fk_soc"; -} // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -592,16 +595,13 @@ 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.'societe as s'; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus) && $search_categ_cus != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ -} - $sql .= ', '.MAIN_DB_PREFIX.'facture as f'; if ($sortfield == "f.datef") { $sql .= $db->hintindex('idx_facture_datef'); @@ -619,10 +619,6 @@ if (!$sall) { if ($sall || $search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} - if (!empty($search_fac_rec_source_title)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_rec as facrec ON f.fk_fac_rec_source=facrec.rowid'; } @@ -646,9 +642,6 @@ $sql .= ' AND f.entity IN ('.getEntity('invoice').')'; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } @@ -680,6 +673,9 @@ if ($search_company) { if ($search_company_alias) { $sql .= natural_search('s.name_alias', $search_company_alias); } +if ($search_parent_name) { + $sql .= natural_search('s2.nom', $search_parent_name); +} if ($search_town) { $sql .= natural_search('s.town', $search_town); } @@ -746,12 +742,6 @@ if ($search_multicurrency_montant_ttc != '') { if ($search_login) { $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } -if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); -} -if ($search_categ_cus == -2) { - $sql .= " AND cc.fk_categorie IS NULL"; -} if ($search_status != '-1' && $search_status != '') { if (is_numeric($search_status) && $search_status >= 0) { if ($search_status == '0') { @@ -813,11 +803,63 @@ if ($search_user > 0) { if (!empty($search_fac_rec_source_title)) { $sql .= natural_search('facrec.titre', $search_fac_rec_source_title); } +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductList = $search_product_category ? array($search_product_category) : array(); +$searchCategoryProductOperator = 0; +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } +} +$searchCategoryCustomerList = $search_categ_cus ? array($search_categ_cus) : array();; +$searchCategoryCustomerOperator = 0; +// Search for tag/category ($searchCategoryCustomerList is an array of ID) +if (!empty($searchCategoryCustomerList)) { + $searchCategoryCustomerSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { + if (intval($searchCategoryCustomer) == -2) { + $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategoryCustomer) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } + } + if ($listofcategoryid) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryCustomerOperator == 1) { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryCustomerSqlList).")"; + } + } else { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryCustomerSqlList).")"; + } + } +} // 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; // We disable this. It create a bug when searching with sall and sorting on status. Also it create performance troubles. @@ -869,9 +911,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { */ /* The fast and low memory method to get and count full list converts the sql into a sql count */ if ($sall || $search_product_category > 0 || $search_user > 0) { - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords FROM', $sql); } else { - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(f.rowid) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(f.rowid) as nbtotalofrecords FROM', $sql); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid/', '', $sqlforcount); } $sqlforcount = preg_replace('/GROUP BY.*$/', '', $sqlforcount); @@ -1008,10 +1050,13 @@ if ($resql) { $param .= '&search_type='.urlencode($search_type); } if ($search_company) { - $param .= '&search_societe='.urlencode($search_company); + $param .= '&search_company='.urlencode($search_company); } if ($search_company_alias) { - $param .= '&search_societe_alias='.urlencode($search_company_alias); + $param .= '&search_company_alias='.urlencode($search_company_alias); + } + if ($search_parent_name != '') { + $param .= '&search_parent_name='.urlencode($search_parent_name); } if ($search_town) { $param .= '&search_town='.urlencode($search_town); @@ -1022,6 +1067,9 @@ if ($resql) { if ($search_country) { $param .= "&search_country=".urlencode($search_country); } + if ($search_type_thirdparty != '') { + $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); + } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); } @@ -1099,7 +1147,7 @@ if ($resql) { 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; $arrayofmassactions = array( @@ -1217,7 +1265,7 @@ if ($resql) { $moreforfilter .= '
'; } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // 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 { @@ -1337,6 +1385,12 @@ if ($resql) { if (!empty($arrayfields['s.name_alias']['checked'])) { print ''; } + // Parent company + if (!empty($arrayfields['s2.nom']['checked'])) { + 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 ''; } // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { 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 (!$i) { + $totalarray['nbfield']++; + } + } // Town if (!empty($arrayfields['s.town']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -2061,8 +2139,9 @@ if ($resql) { // Payment terms if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - 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 '
'; - print ''; print ''; print ''; } // Town @@ -1621,7 +1621,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 @@ -1727,7 +1727,7 @@ if ($resql) { 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, 'center '); + 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); @@ -1826,7 +1826,7 @@ if ($resql) { 'sortorder' => $sortorder, 'totalarray' => &$totalarray, ); - $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['c.datec']['checked'])) { print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -2032,7 +2032,7 @@ if ($resql) { // Parent company if (!empty($arrayfields['s2.nom']['checked'])) { - print '
'; + print ''; if ($action != 'editecheance' && $usercancreate && $caneditfield) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index f9fd5d8ac7e..d9b7147fefa 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1102,6 +1102,7 @@ class Propal extends CommonObject $sql .= ", fk_mode_reglement"; $sql .= ", fk_account"; $sql .= ", ref_client"; + $sql .= ", ref_ext"; $sql .= ", date_livraison"; $sql .= ", fk_shipping_method"; $sql .= ", fk_warehouse"; @@ -1136,6 +1137,7 @@ class Propal extends CommonObject $sql .= ", ".($this->mode_reglement_id > 0 ? ((int) $this->mode_reglement_id) : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? ((int) $this->fk_account) : 'NULL'); $sql .= ", '".$this->db->escape($this->ref_client)."'"; + $sql .= ", '".$this->db->escape($this->ref_ext)."'"; $sql .= ", ".(empty($delivery_date) ? "NULL" : "'".$this->db->idate($delivery_date)."'"); $sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL'); $sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL'); @@ -1520,7 +1522,7 @@ class Propal extends CommonObject $sql .= ", p.datep as dp"; $sql .= ", p.fin_validite as dfv"; $sql .= ", p.date_livraison as delivery_date"; - $sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams"; + $sql .= ", p.model_pdf, p.last_main_doc, p.ref_client, ref_ext, p.extraparams"; $sql .= ", p.note_private, p.note_public"; $sql .= ", p.fk_projet as fk_project, p.fk_statut"; $sql .= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture"; @@ -1572,6 +1574,7 @@ class Propal extends CommonObject $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; + $this->ref_ext = $obj->ref_ext; $this->remise = $obj->remise; $this->remise_percent = $obj->remise_percent; $this->remise_absolue = $obj->remise_absolue; @@ -2107,11 +2110,11 @@ class Propal extends CommonObject * Define end validity date * * @param User $user Object user that modify - * @param int $date_fin_validite End of validity date + * @param int $date_end_validity End of validity date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - public function set_echeance($user, $date_fin_validite, $notrigger = 0) + public function set_echeance($user, $date_end_validity, $notrigger = 0) { // phpcs:enable if (!empty($user->rights->propal->creer)) { @@ -2119,8 +2122,8 @@ class Propal extends CommonObject $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite != '' ? "'".$this->db->idate($date_fin_validite)."'" : 'null'); - $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT; + $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_end_validity != '' ? "'".$this->db->idate($date_end_validity)."'" : 'null'); + $sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".((int) self::STATUS_DRAFT); dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); @@ -2132,7 +2135,7 @@ class Propal extends CommonObject if (!$error) { $this->oldcopy = clone $this; - $this->fin_validite = $date_fin_validite; + $this->fin_validite = $date_end_validity; } if (!$notrigger && empty($error)) { diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 1e688457623..81d49bb87ad 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -109,9 +109,7 @@ class PropaleStats extends Stats } if ($categid) { - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = p.fk_soc'; - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; - $this->where .= ' AND c.rowid = '.((int) $categid); + $this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = p.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 97fceb99f9e..42f3f34f8d4 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -69,12 +69,14 @@ if (!empty($user->socid)) { } restrictedArea($user, 'propal', $object->id); +$usercancreate = $user->hasRight("propal", "creer"); + /* * Add a new contact */ -if ($action == 'addcontact' && $user->rights->propale->creer) { +if ($action == 'addcontact' && $user->rights->propal->creer) { if ($object->id > 0) { $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); @@ -92,12 +94,12 @@ if ($action == 'addcontact' && $user->rights->propale->creer) { setEventMessages($object->error, $object->errors, 'errors'); } } -} elseif ($action == 'swapstatut' && $user->rights->propale->creer) { +} elseif ($action == 'swapstatut' && $user->rights->propal->creer) { // Toggle the status of a contact if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne', 'int')); } -} elseif ($action == 'deletecontact' && $user->rights->propale->creer) { +} elseif ($action == 'deletecontact' && $user->rights->propal->creer) { // Deletes a contact $result = $object->delete_contact($lineid); @@ -137,37 +139,25 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->propal->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/comm/propal/document.php b/htdocs/comm/propal/document.php index f58ed518517..f1d1d7ef644 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -81,7 +81,7 @@ if (!$sortfield) { $object = new Propal($db); $object->fetch($id, $ref); -$permissiontoadd = $user->rights->propale->creer; +$permissiontoadd = $user->rights->propal->creer; // Security check if (!empty($user->socid)) { @@ -90,6 +90,8 @@ if (!empty($user->socid)) { } restrictedArea($user, 'propal', $object->id); +$usercancreate = $user->hasRight("propal", "creer"); + /* * Actions @@ -135,37 +137,25 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->propal->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/comm/propal/index.php b/htdocs/comm/propal/index.php index edb8e48405e..4a6d9ec63ed 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -227,7 +227,7 @@ if ($resql) { /* * Open (validated) proposals */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 933791bbec2..986601a91bc 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -53,6 +53,8 @@ if (!empty($user->socid)) { } restrictedArea($user, 'propal', $object->id); +$usercancreate = $user->hasRight("propal", "creer"); + /* * View @@ -82,37 +84,25 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
'.$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->propal->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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/comm/propal/list.php b/htdocs/comm/propal/list.php index a5d85633bee..0d560d741ce 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -244,8 +244,8 @@ $arrayfields = array( 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), - 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), - 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), + 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); @@ -578,7 +578,7 @@ 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 = preg_replace('/, $/', '', $sql); $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; @@ -755,12 +755,12 @@ 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; // Add HAVING from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -987,7 +987,7 @@ if ($resql) { 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 @@ -1104,7 +1104,7 @@ if ($resql) { $moreforfilter .= '
'; } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // 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 { @@ -1362,7 +1362,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['p.datec']['checked'])) { @@ -1543,7 +1543,7 @@ if ($resql) { 'totalarray' => &$totalarray, ); - $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['p.datec']['checked'])) { print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); @@ -2140,7 +2140,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['p.datec']['checked'])) { @@ -2232,7 +2232,7 @@ if ($resql) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // 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 '
'; print $langs->trans('DateEndPropal'); print '
'."\n"; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index d2e453eac9e..fe4895ad2f8 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -59,12 +59,14 @@ $hookmanager->initHooks(array('propalnote')); restrictedArea($user, 'propal', $object->id, 'propal'); +$usercancreate = $user->hasRight("propal", "creer"); + /* * Actions */ -$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php +$permissionnote = $user->rights->propal->creer; // Used by the include of actions_setnotes.inc.php $reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -107,37 +109,25 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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->propal->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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index af5247fb10f..9e2e485c92a 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -60,7 +60,7 @@ $endyear = $year; // Load translation files required by the page $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_proposal')); -if ($mode == 'customer' && !$user->rights->propale->lire) { +if ($mode == 'customer' && !$user->rights->propal->lire) { accessforbidden(); } if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) { diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 613f06a6feb..37c0f8d5e58 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print '
'.$objectlink->ref_client.''.dol_print_date($objectlink->date, 'day').''; - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $total = $total + $objectlink->total_ht; echo price($objectlink->total_ht); } diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 83c30743c77..19bde7072ad 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -119,7 +119,7 @@ if ($resql) { /* * Liste des propal brouillons */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -177,7 +177,7 @@ if (isModEnabled('agenda')) { /* * Dernieres propales ouvertes */ -if (isModEnabled("propal") && $user->rights->propale->lire) { +if (isModEnabled("propal") && $user->rights->propal->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql .= " p.rowid as propalid, p.total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index b28af96527e..fe8c630fc10 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -53,6 +53,9 @@ if ($user->socid > 0) { } $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); +$permissiontocreate = ($user->rights->societe->creer || $user->rights->facture->creer); + + /* * Actions @@ -63,7 +66,7 @@ if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { exit; } -if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && ($user->rights->societe->creer || $user->rights->facture->creer)) { +if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permissiontocreate) { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) @@ -154,16 +157,17 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && ($user } } -if ($action == 'setremise' && ($user->rights->societe->creer || $user->rights->facture->creer)) { +if ($action == 'setremise' && $permissiontocreate) { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) - $amount_ht = price2num(GETPOST('amount_ht', 'alpha')); + $amount = price2num(GETPOST('amount', 'alpha'), '', 2); $desc = GETPOST('desc', 'alpha'); $tva_tx = GETPOST('tva_tx', 'alpha'); $discount_type = GETPOSTISSET('discount_type') ? GETPOST('discount_type', 'alpha') : 0; + $price_base_type = GETPOST('price_base_type', 'alpha'); - if ($amount_ht > 0) { + if ($amount > 0) { $error = 0; if (empty($desc)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReasonDiscount")), null, 'errors'); @@ -173,14 +177,14 @@ if ($action == 'setremise' && ($user->rights->societe->creer || $user->rights->f if (!$error) { $soc = new Societe($db); $soc->fetch($id); - $discountid = $soc->set_remise_except($amount_ht, $user, $desc, $tva_tx, $discount_type); + $discountid = $soc->set_remise_except($amount, $user, $desc, $tva_tx, $discount_type, $price_base_type); if ($discountid > 0) { if (!empty($backtopage)) { - header("Location: ".$backtopage.'&discountid='.$discountid); + header("Location: ".$backtopage.'&discountid='.((int) $discountid)); exit; } else { - header("Location: remx.php?id=".$id); + header("Location: remx.php?id=".((int) $id)); exit; } } else { @@ -193,7 +197,7 @@ if ($action == 'setremise' && ($user->rights->societe->creer || $user->rights->f } } -if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' && ($user->rights->societe->creer || $user->rights->facture->creer)) { +if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' && $permissiontocreate) { //if ($user->rights->societe->creer) //if ($user->rights->facture->creer) @@ -231,9 +235,8 @@ if ($socid > 0) { $isCustomer = $object->client == 1 || $object->client == 3; $isSupplier = $object->fournisseur == 1; - /* - * Display tabs - */ + // Display tabs + $head = societe_prepare_head($object); print '
'; @@ -262,6 +265,7 @@ if ($socid > 0) { } + print '
'; print ''; if ($isCustomer) { // Calcul avoirs client en cours @@ -324,9 +328,10 @@ if ($socid > 0) { } print '
'; - print '
'; + print ''; // close fichecenter + print dol_get_fiche_end(); @@ -346,6 +351,8 @@ if ($socid > 0) { print dol_get_fiche_head(); + + print '
'; print ''; if ($isCustomer && $isSupplier) { print ''; @@ -353,9 +360,19 @@ if ($socid > 0) { print '   '; print ''; } - print ''; - print ''; + print ''; + + // Price base (HT / TTC) + print ''; + print ''; + + // VAT print ''; print ''; print "
'.$langs->trans('DiscountType').'
'.$langs->trans("AmountHT").''; + + // Amount + print '
'.$langs->trans("Amount").''; print ' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("PriceBase").''; + print $form->selectPriceBaseType(GETPOST("price_base_type"), "price_base_type"); + print '
'.$langs->trans("VAT").''; print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : 0, $mysoc, $object, 0, 0, '', 0, 1); @@ -364,6 +381,7 @@ if ($socid > 0) { print '
"; + print '
'; print dol_get_fiche_end(); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 2afc01914e0..786fb1a2ad2 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -32,7 +32,7 @@ /** * \file htdocs/commande/card.php * \ingroup commande - * \brief Page to show customer order + * \brief Page to show sales order */ // Load Dolibarr environment @@ -2326,39 +2326,28 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$soc->getNomUrl(1, 'customer'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; + $morehtmlref .= '
'; if ($usercancreate) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); - $morehtmlref .= ''; - $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/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index aa7a7f11a55..d3fbe41312c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3395,7 +3395,7 @@ class Commande extends CommonOrder } /** - * Delete the customer order + * Delete the sales order * * @param User $user User object * @param int $notrigger 1=Does not execute triggers, 0= execute triggers @@ -4062,7 +4062,7 @@ class Commande extends CommonOrder } /** - * Is the customer order delayed? + * Is the sales order delayed? * * @return bool true if late, false if not */ @@ -4200,6 +4200,12 @@ class OrderLine extends CommonOrderLine $result = $this->db->query($sql); if ($result) { $objp = $this->db->fetch_object($result); + + if (!$objp) { + $this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql; + return 0; + } + $this->rowid = $objp->rowid; $this->id = $objp->rowid; $this->fk_commande = $objp->fk_commande; diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index d02d56175ff..5f13cf780f4 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -109,9 +109,7 @@ class CommandeStats extends Stats } if ($categid) { - $this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc'; - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie'; - $this->where .= ' AND cat.rowid = '.((int) $categid); + $this->where .= ' AND EXISTS (SELECT rowid FROM '.$this->categ_link.' as cats WHERE cats.fk_soc = c.fk_soc AND cats.fk_categorie = '.((int) $categid).')'; } } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index c353287962e..04c16e68aa0 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -47,8 +47,11 @@ if ($user->socid) { } $result = restrictedArea($user, 'commande', $id, ''); +$usercancreate = $user->hasRight("commande", "creer"); + $object = new Commande($db); + /* * Ajout d'un nouveau contact */ @@ -130,37 +133,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/commande/document.php b/htdocs/commande/document.php index c341ae59b4e..0c35c3489f7 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -73,7 +73,8 @@ if (!$sortfield) { $object = new Commande($db); -$permissiontoadd = $user->rights->commande->creer; +$usercancreate = $user->hasRight("commande", "creer"); +$permissiontoadd = $usercancreate; // Security check if ($user->socid) { @@ -129,37 +130,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/commande/index.php b/htdocs/commande/index.php index 9ee103911f7..9b653b90e65 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -22,7 +22,7 @@ /** * \file htdocs/commande/index.php * \ingroup commande - * \brief Home page of customer order module + * \brief Home page of sales order module */ diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 4442af6a679..0acc5b793aa 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -50,6 +50,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'commande', $comid, ''); +$usercancreate = $user->hasRight("commande", "creer"); + $object = new Commande($db); if (!$object->fetch($id, $ref) > 0) { dol_print_error($db); @@ -82,37 +84,25 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
'.$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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/commande/list.php b/htdocs/commande/list.php index 208889ba1a2..455420ce90a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -208,8 +208,8 @@ $arrayfields = array( 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), - 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), - 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), + 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135), + 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140), 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), @@ -823,7 +823,7 @@ 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.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s2.rowid = s.parent"; @@ -857,7 +857,7 @@ if ($search_user > 0) { // Add table from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= ' WHERE c.fk_soc = s.rowid'; @@ -1012,12 +1012,12 @@ if ($search_fk_input_reason > 0) { 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; // Add HAVING from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -1224,7 +1224,7 @@ if ($resql) { // 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 @@ -1393,7 +1393,7 @@ if ($resql) { $moreforfilter .= '
'; } $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // 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 { @@ -1466,8 +1466,8 @@ if ($resql) { } // Parent company if (!empty($arrayfields['s2.nom']['checked'])) { - print '
'; - print ''; + print ''; + print ''; print ''; + print ''; if ($obj->fk_parent > 0) { if (!isset($company_url_list[$obj->fk_parent])) { $companyparent = new Societe($db); @@ -2372,7 +2372,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 @@ -2446,7 +2446,7 @@ if ($resql) { // Get local and virtual stock and store it into cache if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) { - $generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock() + $generic_product->load_stock('nobatch,warehouseopen'); // ->load_virtual_stock() is already included into load_stock() $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel; $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique; } else { @@ -2595,7 +2595,7 @@ if ($resql) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // 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 '
'."\n"; diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 452e58076c7..e84dd5ad6e1 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -52,6 +52,10 @@ $hookmanager->initHooks(array('ordernote')); $result = restrictedArea($user, 'commande', $id, ''); +$usercancreate = $user->hasRight("commande", "creer"); + +$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php + $object = new Commande($db); if (!$object->fetch($id, $ref) > 0) { @@ -59,8 +63,6 @@ if (!$object->fetch($id, $ref) > 0) { exit; } -$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php - /* * Actions @@ -101,37 +103,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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 ''; print 'rappro ? ' checked="checked"' : '')).'">'; + + print ' + + '; + print ''.yn($objp->rappro).'
'; print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).''; - print ''; + print ''; print '
'; + print ''; + 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 ''; - print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1); + print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100'); 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 "'; @@ -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 ''; - $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 '
'."\n"; diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 451ccbab8c4..af08c6163e2 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -59,6 +59,8 @@ $hookmanager->initHooks(array('invoicenote')); $result = restrictedArea($user, 'facture', $id, ''); +$usercancreate = $user->hasRight("facture", "creer"); + /* * Actions @@ -118,37 +120,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index c36b205b8fb..d475e83c55b 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -114,11 +114,7 @@ if (empty($reshook)) { } $paymentservice = GETPOST('paymentservice'); - if (preg_match('/stripesepa/', $paymentservice)) { - $result = $object->demande_prelevement_stripe($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype); - } else { - $result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype); - } + $result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype); if ($result > 0) { $db->commit(); @@ -142,6 +138,14 @@ if (empty($reshook)) { } } + // Payment with Direct Debit Stripe + if ($action == 'sepastripepayment' && $usercancreate) { + $result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'direct-debit', 'facture'); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + // payments conditions if ($action == 'setconditions' && $usercancreate) { $object->fetch($id); @@ -260,7 +264,7 @@ if ($object->id > 0) { $resteapayeraffiche = $resteapayer; if ($type == 'bank-transfer') { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { // Not recommended $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { @@ -273,7 +277,7 @@ if ($object->id > 0) { $absolute_discount = price2num($absolute_discount, 'MT'); $absolute_creditnote = price2num($absolute_creditnote, 'MT'); } else { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Not recommended $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { @@ -345,7 +349,7 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); } // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); if ($type == 'bank-transfer') { if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; @@ -359,33 +363,20 @@ if ($object->id > 0) { if (isModEnabled('project')) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($usercancreate) { + 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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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 .= ''; } } } @@ -871,7 +862,8 @@ if ($object->id > 0) { print ''; if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { - print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("SendToStripe").''; + $langs->load("stripe"); + print 'rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequestDirectDebitWithStripe").''; } print ''; diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 2c7c5d42156..28eee624db2 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -95,7 +95,7 @@ $periodlink = ''; $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescPurchasesJournal").'
'; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= $langs->trans("DepositsAreNotIncluded"); } else { $description .= $langs->trans("DepositsAreIncluded"); @@ -119,7 +119,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; $sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn"; $sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; $sql .= " WHERE f.fk_statut > 0 AND f.entity IN (".getEntity('invoice').")"; -if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 0dfb0ab3c6d..9e03f156848 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -194,6 +194,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') $description.='
'.$lan if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description.='
'.$langs->trans("DepositsAreNotIncluded"); } +if (! empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description.='
'.$langs->trans("SupplierDepositsAreNotIncluded"); +} */ if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= $langs->trans("ThisIsAnEstimatedValue"); diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index c03a2eea6b5..8be48493d08 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -285,7 +285,7 @@ if ($id > 0 || $ref) { print ''.$langs->trans("TransMetod").''; print $form->selectarray("methode", $object->methodes_trans); print ''; - print '
'; + print ''; print '
'; print ''; print '
'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index f6b31386215..8aaf8010dd2 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -353,7 +353,8 @@ class BonPrelevement extends CommonObject if ($this->fetched == 1) { if ($date < $this->date_trans) { - $this->error = 'DateOfMovementLowerThanDateOfFileTransmission'; + $langs->load("errors"); + $this->error = $langs->trans('ErrorDateOfMovementLowerThanDateOfFileTransmission'); dol_syslog("bon-prelevment::set_infocredit 1027 ".$this->error); return -1027; } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index cd2106e50a4..908d0ae4ac2 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -189,6 +189,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -637,7 +640,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; @@ -1341,7 +1344,7 @@ if ($modecompta == 'BOOKKEEPING') { $sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 5b2ca11be54..4012994be58 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -165,6 +165,9 @@ if ($modecompta == 'CREANCES-DETTES') { } else { $description .= "
".$langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -330,7 +333,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; @@ -438,7 +441,7 @@ if (isModEnabled('tax') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " $sql = "SELECT sum(f.total_tva) as amount, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " WHERE f.fk_statut IN (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND f.type IN (0,1,2)"; } else { $sql .= " AND f.type IN (0,1,2,3)"; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 9a5a8325448..15c369b7a52 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -205,6 +205,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -231,8 +234,6 @@ if ($modecompta == "CREANCES-DETTES") { $exportlink = ''; $description = $langs->trans("RulesResultBookkeepingPersonalized"); $description .= ' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'&mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->transnoentitiesnoconv("AccountingCategory")).')'; - //if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded"); - //else $description.= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); } diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index c65b731109d..0f85b6ddf06 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { $proj->fetch($object->fk_project); $morehtmlref .= ' : '.$proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.dol_escape_htmltag($proj->title); + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } } else { $morehtmlref .= ''; diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index f19c37fb84a..fb8ad4de1a5 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -225,7 +225,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } - +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} // Customers invoices $elementcust = $langs->trans("CustomersInvoices"); $productcust = $langs->trans("ProductOrService"); @@ -256,6 +258,9 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); + } $builddate = dol_now(); } elseif ($modecompta == "RECETTES-DEPENSES") { @@ -406,7 +411,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql2 .= " WHERE ff.datef >= '".$db->idate($date_start)."'"; $sql2 .= " AND ff.datef <= '".$db->idate($date_end)."'"; $sql .= " AND ff.fk_statut in (1,2)"; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql .= " AND ff.type IN (0,1,2,5)"; } else { $sql .= " AND ff.type IN (0,1,2,3,5)"; diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 80a0a47538d..dc0fa94030c 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -247,7 +247,6 @@ if ($modecompta == "CREANCES-DETTES") { } else { $description .= $langs->trans("DepositsAreIncluded"); } - $builddate = dol_now(); } elseif ($modecompta == "RECETTES-DEPENSES") { $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices"); diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index aa639804ba0..d0ed3032684 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -154,6 +154,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 16b24361160..f0efe305d8c 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -211,6 +211,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 18b3c9c6b86..997c90e083c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -164,6 +164,9 @@ if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') { if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $description .= '
'.$langs->trans("DepositsAreNotIncluded"); } +if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $description .= $langs->trans("SupplierDepositsAreNotIncluded"); +} if (!empty($conf->global->MAIN_MODULE_ACCOUNTING)) { $description .= '
'.$langs->trans("ThisIsAnEstimatedValue"); } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index fbe8b4d0c04..8e9c6f2a321 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1473,39 +1473,38 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Categories if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) { print ''.$langs->trans("Categories").''; - print ''; + print ''; print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); print ''; } if (!empty($object->socid)) { print ''.$langs->trans("ContactByDefaultFor").''; - print ''; + print ''; print $formcompany->showRoles("roles", $object, 'view', $object->roles); print ''; } // Other attributes - $cols = 3; $parameters = array('socid'=>$socid); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; $object->load_ref_elements(); if (isModEnabled("propal")) { - print ''.$langs->trans("ContactForProposals").''; + print ''.$langs->trans("ContactForProposals").''; print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal"); print ''; } if (isModEnabled('commande') || isModEnabled("expedition")) { - print ''; + print ''; if (isModEnabled("expedition")) { print $langs->trans("ContactForOrdersOrShipments"); } else { print $langs->trans("ContactForOrders"); } - print ''; + print ''; $none = $langs->trans("NoContactForAnyOrder"); if (isModEnabled("expedition")) { $none = $langs->trans("NoContactForAnyOrderOrShipments"); @@ -1515,18 +1514,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (isModEnabled('contrat')) { - print ''.$langs->trans("ContactForContracts").''; + print ''.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print ''; } if (isModEnabled('facture')) { - print ''.$langs->trans("ContactForInvoices").''; + print ''.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); print ''; } - print ''.$langs->trans("DolibarrLogin").''; + print ''.$langs->trans("DolibarrLogin").''; if ($object->user_id) { $dolibarr_user = new User($db); $result = $dolibarr_user->fetch($object->user_id); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index fcab597d43a..bbd5bf005d2 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -520,7 +520,7 @@ if ($sql_select) { } $text .= ' - '.(!empty($objp->label) ? $objp->label : $label); - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); } if (($objp->info_bits & 2) == 2) { @@ -571,7 +571,7 @@ if ($sql_select) { echo get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product_label) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } } else { @@ -608,7 +608,7 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 572bf85da3f..e8396a4299c 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -399,15 +399,6 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_stcommcontact as st ON st.id = p.fk_stcommcontact"; -if (!empty($search_categ) && $search_categ != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cc ON p.rowid = cc.fk_socpeople"; // We need this table joined to the select in order to filter by categ -} -if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ -} -if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc"; // We need this table joined to the select in order to filter by categ -} if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; } @@ -437,23 +428,83 @@ if ($search_priv != '0' && $search_priv != '1') { } } -if ($search_categ > 0) { - $sql .= " AND cc.fk_categorie = ".((int) $search_categ); +$searchCategoryContactList = $search_categ ? array($search_categ) : array(); +$searchCategoryContactOperator = 0; +// Search for tag/category ($searchCategoryContactList is an array of ID) +if (!empty($searchCategoryContactList)) { + $searchCategoryContactSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryContactList as $searchCategoryContact) { + if (intval($searchCategoryContact) == -2) { + $searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople)"; + } elseif (intval($searchCategoryContact) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact); + } + } + if ($listofcategoryid) { + $searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryContactOperator == 1) { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryContactSqlList).")"; + } + } else { + if (!empty($searchCategoryContactSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryContactSqlList).")"; + } + } } -if ($search_categ == -2) { - $sql .= " AND cc.fk_categorie IS NULL"; +$searchCategoryCustomerList = $search_categ_thirdparty ? array($search_categ_thirdparty) : array(); +$searchCategoryCustomerOperator = 0; +// Search for tag/category ($searchCategoryCustomerList is an array of ID) +if (!empty($searchCategoryCustomerList)) { + $searchCategoryCustomerSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { + if (intval($searchCategoryCustomer) == -2) { + $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategoryCustomer) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } + } + if ($listofcategoryid) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryCustomerOperator == 1) { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryCustomerSqlList).")"; + } + } else { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryCustomerSqlList).")"; + } + } } -if ($search_categ_thirdparty > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ_thirdparty); -} -if ($search_categ_thirdparty == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; -} -if ($search_categ_supplier > 0) { - $sql .= " AND cs2.fk_categorie = ".((int) $search_categ_supplier); -} -if ($search_categ_supplier == -2) { - $sql .= " AND cs2.fk_categorie IS NULL"; +$searchCategorySupplierList = $search_categ_supplier ? array($search_categ_supplier) : array(); +$searchCategorySupplierOperator = 0; +// Search for tag/category ($searchCategorySupplierList is an array of ID) +if (!empty($searchCategorySupplierList)) { + $searchCategorySupplierSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategorySupplierList as $searchCategorySupplier) { + if (intval($searchCategorySupplier) == -2) { + $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategorySupplier) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } + } + if ($listofcategoryid) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategorySupplierOperator == 1) { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategorySupplierSqlList).")"; + } + } else { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategorySupplierSqlList).")"; + } + } } if ($sall) { @@ -502,7 +553,15 @@ if (strlen($search_fax)) { if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { if ($value['active'] && strlen($search_[$key])) { - $sql .= " AND p.socialnetworks LIKE '%\"".$key."\":\"".$search_[$key]."%'"; + $searchkeyinjsonformat = preg_replace('/"$/', '', preg_replace('/^"/', '', json_encode($search_[$key]))); + if (in_array($db->type, array('mysql', 'mysqli'))) { + $sql .= " AND p.socialnetworks REGEXP '\"".$db->escapeforlike($db->escape($key))."\":\"[^\"]*".$db->escapeforlike($db->escape($searchkeyinjsonformat))."'"; + } elseif ($db->type == 'pgsql') { + $sql .= " AND p.socialnetworks ~ '\"".$db->escapeforlike($db->escape($key))."\":\"[^\"]*".$db->escapeforlike($db->escape($searchkeyinjsonformat))."'"; + } else { + // Works with all database but not reliable because search only for social network code starting with earched value + $sql .= " AND p.socialnetworks LIKE '%\"".$db->escapeforlike($db->escape($key))."\":\"".$db->escapeforlike($db->escape($searchkeyinjsonformat))."%'"; + } } } } @@ -557,6 +616,7 @@ if ($view == "recent") { } else { $sql .= $db->order($sortfield, $sortorder); } +//print $sql; // Count total nb of records $nbtotalofrecords = ''; diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index d46f2cb24a7..3a3c5440b30 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -76,6 +76,8 @@ if (!$sortorder) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agendacontract', 'globalcard')); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + /* * Actions @@ -166,40 +168,28 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->contrat->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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/contrat/card.php b/htdocs/contrat/card.php index 0b8ec8d1ad6..b691524ad92 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -98,7 +98,8 @@ $extralabelslines = $extrafields->fetch_name_optionals_label($object->table_elem $permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->contrat->creer; // Used by the include of actions_dellink.inc.php $permissiontodelete = ($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer; - +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontoedit = $permissiontoadd; $error = 0; @@ -139,6 +140,8 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once + if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) { $result = $object->active_line($user, GETPOST('ligne', 'int'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment')); @@ -351,7 +354,8 @@ if (empty($reshook)) { $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $array_options, - $lines[$i]->fk_unit + $lines[$i]->fk_unit, + $num+1 ); if ($result < 0) { @@ -403,6 +407,8 @@ if (empty($reshook)) { $price_ttc = ''; $price_ttc_devise = ''; + $rang = count($object->lines) + 1; + if (GETPOST('price_ht') !== '') { $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); } @@ -610,7 +616,8 @@ if (empty($reshook)) { $fk_fournprice, $pa_ht, $array_options, - $fk_unit + $fk_unit, + $rang ); } @@ -687,16 +694,18 @@ if (empty($reshook)) { $error++; } $objectline->fetch_optionals(); + + $objectline->oldcopy = dol_clone($objectline); } $db->begin(); if (!$error) { if ($date_start_real_update == '') { - $date_start_real_update = $objectline->date_ouverture; + $date_start_real_update = $objectline->date_start_real; } if ($date_end_real_update == '') { - $date_end_real_update = $objectline->date_cloture; + $date_end_real_update = $objectline->date_end_real; } $vat_rate = GETPOST('eltva_tx'); @@ -740,13 +749,14 @@ if (empty($reshook)) { $objectline->vat_src_code = $vat_src_code; $objectline->localtax1_tx = is_numeric($localtax1_tx) ? $localtax1_tx : 0; $objectline->localtax2_tx = is_numeric($localtax2_tx) ? $localtax2_tx : 0; - $objectline->date_ouverture_prevue = $date_start_update; - $objectline->date_ouverture = $date_start_real_update; - $objectline->date_fin_validite = $date_end_update; - $objectline->date_cloture = $date_end_real_update; + $objectline->date_start = $date_start_update; + $objectline->date_start_real = $date_start_real_update; + $objectline->date_end = $date_end_update; + $objectline->date_end_real = $date_end_real_update; $objectline->fk_user_cloture = $user->id; $objectline->fk_fournprice = $fk_fournprice; $objectline->pa_ht = $pa_ht; + $objectline->rang = $objectline->rang; if ($fk_unit > 0) { $objectline->fk_unit = GETPOST('unit'); @@ -969,7 +979,6 @@ if (empty($reshook)) { // Actions to build doc $upload_dir = $conf->contrat->multidir_output[$object->entity]; - $permissiontoadd = $user->rights->contrat->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; // Actions to send emails @@ -1364,39 +1373,28 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->contrat->creer) { + $morehtmlref .= '
'; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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 .= ''; } } } @@ -1483,7 +1481,9 @@ if ($action == 'create') { // Title line for service $cursorline = 1; - print '
'; + + + print '
'; while ($cursorline <= $nbofservices) { print '
'; print '
'; @@ -1498,11 +1498,12 @@ if ($action == 'create') { $sql = "SELECT cd.rowid, cd.statut, cd.label as label_det, cd.fk_product, cd.product_type, cd.description, cd.price_ht, cd.qty,"; $sql .= " cd.tva_tx, cd.vat_src_code, cd.remise_percent, cd.info_bits, cd.subprice, cd.multicurrency_subprice,"; - $sql .= " cd.date_ouverture_prevue as date_debut, cd.date_ouverture as date_debut_reelle,"; - $sql .= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,"; + $sql .= " cd.date_ouverture_prevue as date_start, cd.date_ouverture as date_start_real,"; + $sql .= " cd.date_fin_validite as date_end, cd.date_cloture as date_end_real,"; $sql .= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,"; $sql .= " cd.fk_unit,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity, p.tosell, p.tobuy, p.tobatch"; + $sql .= " ,cd.rang"; $sql .= " FROM ".MAIN_DB_PREFIX."contratdet as cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql .= " WHERE cd.rowid = ".((int) $object->lines[$cursorline - 1]->id); @@ -1511,6 +1512,8 @@ if ($action == 'create') { if ($result) { $total = 0; + $objp = $db->fetch_object($result); + print ''; print ''.$langs->trans("ServiceNb", $cursorline).''; print ''.$langs->trans("VAT").''; @@ -1526,10 +1529,28 @@ if ($action == 'create') { if (isModEnabled('margin') && !empty($conf->global->MARGIN_SHOW_ON_CONTRACT)) { print ''.$langs->trans("BuyingPrice").''; } - print ' '; + // + + if ($nbofservices > 1 && $conf->browser->layout != 'phone' && !empty($user->rights->contrat->creer)) { + print ''; + if ($cursorline > 1) { + print 'rowid.'">'; + echo img_up('default', 0, 'imgupforline'); + print ''; + } + if ($cursorline < $nbofservices) { + print 'rowid.'">'; + echo img_down('default', 0, 'imgdownforline'); + print ''; + } + print ''; + } else { + print ' '; + } + print "\n"; - $objp = $db->fetch_object($result); + // Line in view mode if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { @@ -1558,7 +1579,7 @@ if ($action == 'create') { $description = $objp->description; // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $text .= (!empty($objp->description) && $objp->description != $objp->plabel) ? '
'.dol_htmlentitiesbr($objp->description) : ''; $description = ''; // Already added into main visible desc } @@ -1634,10 +1655,10 @@ if ($action == 'create') { // Date planned print $langs->trans("DateStartPlanned").': '; - if ($objp->date_debut) { - print dol_print_date($db->jdate($objp->date_debut), 'day'); + if ($objp->date_start) { + print dol_print_date($db->jdate($objp->date_start), 'day'); // Warning si date prevu passee et pas en service - if ($objp->statut == 0 && $db->jdate($objp->date_debut) < ($now - $conf->contrat->services->inactifs->warning_delay)) { + if ($objp->statut == 0 && $db->jdate($objp->date_start) < ($now - $conf->contrat->services->inactifs->warning_delay)) { $warning_delay = $conf->contrat->services->inactifs->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); print " ".img_warning($textlate); @@ -1647,9 +1668,9 @@ if ($action == 'create') { } print '  -  '; print $langs->trans("DateEndPlanned").': '; - if ($objp->date_fin) { - print dol_print_date($db->jdate($objp->date_fin), 'day'); - if ($objp->statut == 4 && $db->jdate($objp->date_fin) < ($now - $conf->contrat->services->expires->warning_delay)) { + if ($objp->date_end) { + print dol_print_date($db->jdate($objp->date_end), 'day'); + if ($objp->statut == 4 && $db->jdate($objp->date_end) < ($now - $conf->contrat->services->expires->warning_delay)) { $warning_delay = $conf->contrat->services->expires->warning_delay / 3600 / 24; $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($warning_delay) >= 0 ? '+' : '').ceil($warning_delay).' '.$langs->trans("days"); print " ".img_warning($textlate); @@ -1761,9 +1782,9 @@ if ($action == 'create') { print ''; print ''; print $langs->trans("DateStartPlanned").' '; - print $form->selectDate($db->jdate($objp->date_debut), "date_start_update", $usehm, $usehm, ($db->jdate($objp->date_debut) > 0 ? 0 : 1), "update"); + print $form->selectDate($db->jdate($objp->date_start), "date_start_update", $usehm, $usehm, ($db->jdate($objp->date_start) > 0 ? 0 : 1), "update"); print '   '.$langs->trans("DateEndPlanned").' '; - print $form->selectDate($db->jdate($objp->date_fin), "date_end_update", $usehm, $usehm, ($db->jdate($objp->date_fin) > 0 ? 0 : 1), "update"); + print $form->selectDate($db->jdate($objp->date_end), "date_end_update", $usehm, $usehm, ($db->jdate($objp->date_end) > 0 ? 0 : 1), "update"); print ''; print ''; @@ -1883,26 +1904,26 @@ if ($action == 'create') { print ''; // Si pas encore active - if (!$objp->date_debut_reelle) { + if (!$objp->date_start_real) { print $langs->trans("DateStartReal").': '; - if ($objp->date_debut_reelle) { - print dol_print_date($db->jdate($objp->date_debut_reelle), 'day'); + if ($objp->date_start_real) { + print dol_print_date($db->jdate($objp->date_start_real), 'day'); } else { print $langs->trans("ContractStatusNotRunning"); } } // Si active et en cours - if ($objp->date_debut_reelle && !$objp->date_fin_reelle) { + if ($objp->date_start_real && !$objp->date_end_real) { print $langs->trans("DateStartReal").': '; - print dol_print_date($db->jdate($objp->date_debut_reelle), 'day'); + print dol_print_date($db->jdate($objp->date_start_real), 'day'); } // Si desactive - if ($objp->date_debut_reelle && $objp->date_fin_reelle) { + if ($objp->date_start_real && $objp->date_end_real) { print $langs->trans("DateStartReal").': '; - print dol_print_date($db->jdate($objp->date_debut_reelle), 'day'); + print dol_print_date($db->jdate($objp->date_start_real), 'day'); print '  -  '; print $langs->trans("DateEndReal").': '; - print dol_print_date($db->jdate($objp->date_fin_reelle), 'day'); + print dol_print_date($db->jdate($objp->date_end_real), 'day'); } if (!empty($objp->comment)) { print "  -  ".$objp->comment; @@ -1923,14 +1944,14 @@ if ($action == 'create') { print ''; // Definie date debut et fin par defaut - $dateactstart = $objp->date_debut; + $dateactstart = $objp->date_start; if (GETPOST('remonth')) { $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); } elseif (!$dateactstart) { $dateactstart = time(); } - $dateactend = $objp->date_fin; + $dateactend = $objp->date_end; if (GETPOST('endmonth')) { $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); } elseif (!$dateactend) { @@ -1979,14 +2000,14 @@ if ($action == 'create') { print '
'; // Definie date debut et fin par defaut - $dateactstart = $objp->date_debut_reelle; + $dateactstart = $objp->date_start_real; if (GETPOST('remonth')) { $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); } elseif (!$dateactstart) { $dateactstart = time(); } - $dateactend = $objp->date_fin_reelle; + $dateactend = $objp->date_end_real; if (GETPOST('endmonth')) { $dateactend = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); } elseif (!$dateactend) { @@ -2005,7 +2026,7 @@ if ($action == 'create') { if ($objp->statut >= 4) { if ($objp->statut == 4) { print $langs->trans("DateEndReal").' '; - print $form->selectDate($dateactend, "end", $usehm, $usehm, ($objp->date_fin_reelle > 0 ? 0 : 1), "closeline", 1, 1); + print $form->selectDate($dateactend, "end", $usehm, $usehm, ($objp->date_end_real > 0 ? 0 : 1), "closeline", 1, 1); } } print ''; diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index ea228550cae..f38fa4758d9 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -290,8 +290,8 @@ class Contracts extends DolibarrApi $request_data->localtax2_tx, $request_data->fk_product, $request_data->remise_percent, - $request_data->date_start, // date_start = date planned start, date ouverture = date_start_real - $request_data->date_end, // date_end = date planned end, date_cloture = date_end_real + $request_data->date_start, + $request_data->date_end, $request_data->price_base_type ? $request_data->price_base_type : 'HT', $request_data->subprice_excl_tax, $request_data->info_bits, @@ -345,13 +345,13 @@ class Contracts extends DolibarrApi $request_data->subprice, $request_data->qty, $request_data->remise_percent, - $request_data->date_ouveture_prevue, - $request_data->date_fin_validite, + $request_data->date_start, + $request_data->date_end, $request_data->tva_tx, $request_data->localtax1_tx, $request_data->localtax2_tx, - $request_data->date_ouverture, - $request_data->date_cloture, + $request_data->date_start_real, + $request_data->date_end_real, $request_data->price_base_type ? $request_data->price_base_type : 'HT', $request_data->info_bits, $request_data->fk_fourn_price, @@ -662,14 +662,10 @@ class Contracts extends DolibarrApi unset($object->address); - unset($object->date_ouverture_prevue); - unset($object->date_ouverture); - unset($object->date_fin_validite); - unset($object->date_cloture); - unset($object->date_debut_prevue); - unset($object->date_debut_reel); - unset($object->date_fin_prevue); - unset($object->date_fin_reel); + unset($object->date_start); + unset($object->date_start_real); + unset($object->date_end); + unset($object->date_end_real); unset($object->civility_id); return $object; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2a8d1b815a7..7d43da46b37 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -788,19 +788,22 @@ class Contrat extends CommonObject $sql .= " d.total_localtax2,"; $sql .= " d.total_ttc,"; $sql .= " d.info_bits, d.fk_product,"; - $sql .= " d.date_ouverture_prevue, d.date_ouverture,"; - $sql .= " d.date_fin_validite, d.date_cloture,"; + $sql .= " d.date_ouverture_prevue as date_start,"; + $sql .= " d.date_ouverture as date_start_real,"; + $sql .= " d.date_fin_validite as date_end,"; + $sql .= " d.date_cloture as date_end_real,"; $sql .= " d.fk_user_author,"; $sql .= " d.fk_user_ouverture,"; $sql .= " d.fk_user_cloture,"; $sql .= " d.fk_unit,"; - $sql .= " d.product_type as type"; + $sql .= " d.product_type as type,"; + $sql .= " d.rang"; $sql .= " FROM ".MAIN_DB_PREFIX."contratdet as d LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid"; $sql .= " WHERE d.fk_contrat = ".((int) $this->id); if ($only_services == 1) { $sql .= " AND d.product_type = 1"; } - $sql .= " ORDER by d.rowid ASC"; + $sql .= " ORDER by d.rang ASC"; dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $result = $this->db->query($sql); @@ -855,19 +858,21 @@ class Contrat extends CommonObject $line->description = $objp->description; - $line->date_start = $this->db->jdate($objp->date_ouverture_prevue); - $line->date_start_real = $this->db->jdate($objp->date_ouverture); - $line->date_end = $this->db->jdate($objp->date_fin_validite); - $line->date_end_real = $this->db->jdate($objp->date_cloture); + $line->date_start = $this->db->jdate($objp->date_start); + $line->date_start_real = $this->db->jdate($objp->date_start_real); + $line->date_end = $this->db->jdate($objp->date_end); + $line->date_end_real = $this->db->jdate($objp->date_end_real); // For backward compatibility - $line->date_ouverture_prevue = $this->db->jdate($objp->date_ouverture_prevue); - $line->date_ouverture = $this->db->jdate($objp->date_ouverture); - $line->date_fin_validite = $this->db->jdate($objp->date_fin_validite); - $line->date_cloture = $this->db->jdate($objp->date_cloture); - $line->date_debut_prevue = $this->db->jdate($objp->date_ouverture_prevue); - $line->date_debut_reel = $this->db->jdate($objp->date_ouverture); - $line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); - $line->date_fin_reel = $this->db->jdate($objp->date_cloture); + //$line->date_ouverture_prevue = $this->db->jdate($objp->date_ouverture_prevue); + //$line->date_ouverture = $this->db->jdate($objp->date_ouverture); + //$line->date_fin_validite = $this->db->jdate($objp->date_fin_validite); + //$line->date_cloture = $this->db->jdate($objp->date_cloture); + //$line->date_debut_prevue = $this->db->jdate($objp->date_ouverture_prevue); + //$line->date_debut_reel = $this->db->jdate($objp->date_ouverture); + //$line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); + //$line->date_fin_reel = $this->db->jdate($objp->date_cloture); + + $line->rang = $objp->rang; // Retrieve all extrafields for contract line // fetch optionals attributes and labels @@ -892,10 +897,10 @@ class Contrat extends CommonObject if ($line->statut == ContratLigne::STATUS_INITIAL) { $this->nbofserviceswait++; } - if ($line->statut == ContratLigne::STATUS_OPEN && (empty($line->date_fin_prevue) || $line->date_fin_prevue >= $now)) { + if ($line->statut == ContratLigne::STATUS_OPEN && (empty($line->date_end) || $line->date_end >= $now)) { $this->nbofservicesopened++; } - if ($line->statut == ContratLigne::STATUS_OPEN && (!empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) { + if ($line->statut == ContratLigne::STATUS_OPEN && (!empty($line->date_end) && $line->date_end < $now)) { $this->nbofservicesexpired++; } if ($line->statut == ContratLigne::STATUS_CLOSED) { @@ -1492,6 +1497,9 @@ class Contrat extends CommonObject if (empty($remise_percent)) { $remise_percent = 0; } + if (empty($rang)) { + $rang = 0; + } if ($date_start && $date_end && $date_start > $date_end) { $langs->load("errors"); @@ -1555,6 +1563,7 @@ class Contrat extends CommonObject $sql .= ",date_fin_validite"; } $sql .= ", fk_unit"; + $sql .= ", rang"; $sql .= ") VALUES ("; $sql .= $this->id.", '', '".$this->db->escape($desc)."',"; $sql .= ($fk_product > 0 ? $fk_product : "null").","; @@ -1587,6 +1596,7 @@ class Contrat extends CommonObject $sql .= ",'".$this->db->idate($date_end)."'"; } $sql .= ", ".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null"); + $sql .= ", ".(!empty($rang) ? (int) $rang : "0"); $sql .= ")"; $resql = $this->db->query($sql); @@ -1644,17 +1654,18 @@ class Contrat extends CommonObject * @param float $tvatx Taux TVA * @param float $localtax1tx Local tax 1 rate * @param float $localtax2tx Local tax 2 rate - * @param int|string $date_debut_reel Date de debut reelle - * @param int|string $date_fin_reel Date de fin reelle + * @param int|string $date_start_real Date de debut reelle + * @param int|string $date_end_real Date de fin reelle * @param string $price_base_type HT or TTC * @param int $info_bits Bits of type of lines * @param int $fk_fournprice Fourn price id * @param int $pa_ht Buying price HT * @param array $array_options extrafields array * @param string $fk_unit Code of the unit to use. Null to use the default one + * @param string $rang Position * @return int < 0 si erreur, > 0 si ok */ - public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx = 0.0, $localtax2tx = 0.0, $date_debut_reel = '', $date_fin_reel = '', $price_base_type = 'HT', $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null) + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx = 0.0, $localtax2tx = 0.0, $date_start_real = '', $date_end_real = '', $price_base_type = 'HT', $info_bits = 0, $fk_fournprice = null, $pa_ht = 0, $array_options = 0, $fk_unit = null, $rang = 0) { global $user, $conf, $langs, $mysoc; @@ -1672,6 +1683,9 @@ class Contrat extends CommonObject if (empty($fk_fournprice)) { $fk_fournprice = 0; } + if (empty($rang)) { + $rang = 0; + } $subprice = $price; $remise = 0; @@ -1688,7 +1702,7 @@ class Contrat extends CommonObject return -1; } - dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $date_debut_reel, $date_fin_reel, $tvatx, $localtax1tx, $localtax2tx, $price_base_type, $info_bits"); + dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $date_start_real, $date_end_real, $tvatx, $localtax1tx, $localtax2tx, $price_base_type, $info_bits, $rang"); $this->db->begin(); @@ -1707,8 +1721,8 @@ class Contrat extends CommonObject $total_localtax1 = $tabprice[9]; $total_localtax2 = $tabprice[10]; - $localtax1_type = $localtaxes_type[0]; - $localtax2_type = $localtaxes_type[2]; + $localtax1_type = (empty($localtaxes_type[0]) ? '' : $localtaxes_type[0]); + $localtax2_type = (empty($localtaxes_type[2]) ? '' : $localtaxes_type[2]); // TODO A virer // Anciens indicateurs: $price, $remise (a ne plus utiliser) @@ -1741,8 +1755,8 @@ class Contrat extends CommonObject $sql .= ",tva_tx = ".((float) price2num($tvatx)); $sql .= ",localtax1_tx = ".((float) price2num($localtax1tx)); $sql .= ",localtax2_tx = ".((float) price2num($localtax2tx)); - $sql .= ",localtax1_type='".$this->db->escape($localtax1_type); - $sql .= ",localtax2_type='".$this->db->escape($localtax2_type); + $sql .= ",localtax1_type='".$this->db->escape($localtax1_type)."'"; + $sql .= ",localtax2_type='".$this->db->escape($localtax2_type)."'"; $sql .= ", total_ht = ".((float) price2num($total_ht)); $sql .= ", total_tva = ".((float) price2num($total_tva)); $sql .= ", total_localtax1 = ".((float) price2num($total_localtax1)); @@ -1760,17 +1774,18 @@ class Contrat extends CommonObject } else { $sql .= ",date_fin_validite = null"; } - if ($date_debut_reel > 0) { - $sql .= ",date_ouverture = '".$this->db->idate($date_debut_reel)."'"; + if ($date_start_real > 0) { + $sql .= ",date_ouverture = '".$this->db->idate($date_start_real)."'"; } else { $sql .= ",date_ouverture = null"; } - if ($date_fin_reel > 0) { - $sql .= ",date_cloture = '".$this->db->idate($date_fin_reel)."'"; + if ($date_end_real > 0) { + $sql .= ",date_cloture = '".$this->db->idate($date_end_real)."'"; } else { $sql .= ",date_cloture = null"; } $sql .= ", fk_unit = ".($fk_unit > 0 ? ((int) $fk_unit) : "null"); + $sql .= ", rang = ".(!empty($rang) ? ((int) $rang) : "0"); $sql .= " WHERE rowid = ".((int) $rowid); dol_syslog(get_class($this)."::updateline", LOG_DEBUG); @@ -2426,18 +2441,15 @@ class Contrat extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @param null|array $moreparams Array to provide more information + * @return int < 0 if KO, 0 = no doc generated, > 0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf, $langs; - $langs->load("contracts"); - $outputlangs->load("products"); - if (!dol_strlen($modele)) { - $modele = 'strato'; + $modele = ''; // No doc template/generation by default if (!empty($this->model_pdf)) { $modele = $this->model_pdf; @@ -2448,9 +2460,15 @@ class Contrat extends CommonObject } } - $modelpath = "core/modules/contract/doc/"; + if (empty($modele)) { + return 0; + } else { + $langs->load("contracts"); + $outputlangs->load("products"); - return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + $modelpath = "core/modules/contract/doc/"; + return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + } } /** @@ -2565,7 +2583,7 @@ class Contrat extends CommonObject if (!$error) { foreach ($this->lines as $line) { - $result = $clonedObj->addline($line->description, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit); + $result = $clonedObj->addline($line->description, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit, $line->rang); if ($result < 0) { $error++; $this->error = $clonedObj->error; @@ -2790,7 +2808,8 @@ class ContratLigne extends CommonObjectLine public $table_element = 'contratdet'; /** - * @var string Name to use for 'features' parameter to check module permissions with restrictedArea() + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. */ public $element_for_permission = 'contrat'; @@ -2850,19 +2869,19 @@ class ContratLigne extends CommonObjectLine /** * @deprecated Use date_start */ - public $date_ouverture_prevue; // date start planned + //public $date_ouverture_prevue; // date start planned /** * @deprecated Use date_start_real */ - public $date_ouverture; // date start real + //public $date_ouverture; // date start real /** * @deprecated Use date_end */ - public $date_fin_validite; // date end planned + //public $date_fin_validite; // date end planned /** * @deprecated Use date_end_real */ - public $date_cloture; // date end real + //public $date_cloture; // date end real public $tva_tx; public $vat_src_code; @@ -2923,6 +2942,12 @@ class ContratLigne extends CommonObjectLine public $commentaire; + /** + * @var int line rank + */ + public $rang = 0; + + const STATUS_INITIAL = 0; const STATUS_OPEN = 4; const STATUS_CLOSED = 5; @@ -2952,7 +2977,8 @@ class ContratLigne extends CommonObjectLine //'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>125), 'fk_user_ouverture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserStartingService', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>135), 'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosingService', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>135), - 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 4=>'Open', 5=>'Closed')) + 'statut' =>array('type'=>'smallint(6)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'position'=>500, 'arrayofkeyval'=>array(0=>'Draft', 4=>'Open', 5=>'Closed')), + 'rang' =>array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>500, 'default' =>0) ); // END MODULEBUILDER PROPERTIES @@ -2976,7 +3002,7 @@ class ContratLigne extends CommonObjectLine */ public function getLibStatut($mode) { - return $this->LibStatut($this->statut, $mode, ((!empty($this->date_fin_validite)) ? ($this->date_fin_validite < dol_now() ? 1 : 0) : -1)); + return $this->LibStatut($this->statut, $mode, ((!empty($this->date_end)) ? ($this->date_end < dol_now() ? 1 : 0) : -1)); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -3091,10 +3117,10 @@ class ContratLigne extends CommonObjectLine $sql .= " p.fk_product_type as product_type,"; $sql .= " t.description,"; $sql .= " t.date_commande,"; - $sql .= " t.date_ouverture_prevue as date_ouverture_prevue,"; - $sql .= " t.date_ouverture as date_ouverture,"; - $sql .= " t.date_fin_validite as date_fin_validite,"; - $sql .= " t.date_cloture as date_cloture,"; + $sql .= " t.date_ouverture_prevue as date_start,"; + $sql .= " t.date_ouverture as date_start_real,"; + $sql .= " t.date_fin_validite as date_end,"; + $sql .= " t.date_cloture as date_end_real,"; $sql .= " t.tva_tx,"; $sql .= " t.vat_src_code,"; $sql .= " t.localtax1_tx,"; @@ -3119,7 +3145,8 @@ class ContratLigne extends CommonObjectLine $sql .= " t.fk_user_ouverture,"; $sql .= " t.fk_user_cloture,"; $sql .= " t.commentaire,"; - $sql .= " t.fk_unit"; + $sql .= " t.fk_unit,"; + $sql .= " t.rang"; $sql .= " FROM ".MAIN_DB_PREFIX."contratdet as t LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = t.fk_product"; if ($id) { $sql .= " WHERE t.rowid = ".((int) $id); @@ -3149,15 +3176,15 @@ class ContratLigne extends CommonObjectLine $this->description = $obj->description; $this->date_commande = $this->db->jdate($obj->date_commande); - $this->date_start = $this->db->jdate($obj->date_ouverture_prevue); - $this->date_start_real = $this->db->jdate($obj->date_ouverture); - $this->date_end = $this->db->jdate($obj->date_fin_validite); - $this->date_end_real = $this->db->jdate($obj->date_cloture); + $this->date_start = $this->db->jdate($obj->date_start); + $this->date_start_real = $this->db->jdate($obj->date_start_real); + $this->date_end = $this->db->jdate($obj->date_end); + $this->date_end_real = $this->db->jdate($obj->date_end_real); // For backward compatibility - $this->date_ouverture_prevue = $this->db->jdate($obj->date_ouverture_prevue); - $this->date_ouverture = $this->db->jdate($obj->date_ouverture); - $this->date_fin_validite = $this->db->jdate($obj->date_fin_validite); - $this->date_cloture = $this->db->jdate($obj->date_cloture); + //$this->date_ouverture_prevue = $this->db->jdate($obj->date_ouverture_prevue); + //$this->date_ouverture = $this->db->jdate($obj->date_ouverture); + //$this->date_fin_validite = $this->db->jdate($obj->date_fin_validite); + //$this->date_cloture = $this->db->jdate($obj->date_cloture); $this->tva_tx = $obj->tva_tx; $this->vat_src_code = $obj->vat_src_code; @@ -3186,6 +3213,8 @@ class ContratLigne extends CommonObjectLine $this->pa_ht = $marginInfos[0]; $this->fk_unit = $obj->fk_unit; + $this->rang = $obj->rang; + $this->fetch_optionals(); } @@ -3237,6 +3266,7 @@ class ContratLigne extends CommonObjectLine $this->fk_user_ouverture = (int) $this->fk_user_ouverture; $this->fk_user_cloture = (int) $this->fk_user_cloture; $this->commentaire = trim($this->commentaire); + $this->rang = (int) $this->rang; //if (empty($this->subprice)) $this->subprice = 0; if (empty($this->price_ht)) { $this->price_ht = 0; @@ -3261,16 +3291,16 @@ class ContratLigne extends CommonObjectLine } // For backward compatibility if (empty($this->date_start)) { - $this->date_start = $this->date_ouverture_prevue; + $this->date_start = $this->date_start; } if (empty($this->date_start_real)) { - $this->date_start = $this->date_ouverture; + $this->date_start_real = $this->date_start_real; } if (empty($this->date_end)) { - $this->date_start = $this->date_fin_validite; + $this->date_end = $this->date_end; } if (empty($this->date_end_real)) { - $this->date_start = $this->date_cloture; + $this->date_end_real = $this->date_end_real; } @@ -3312,40 +3342,41 @@ class ContratLigne extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET"; - $sql .= " fk_contrat=".((int) $this->fk_contrat).","; - $sql .= " fk_product=".($this->fk_product ? "'".$this->db->escape($this->fk_product)."'" : 'null').","; - $sql .= " statut=".((int) $this->statut).","; - $sql .= " label='".$this->db->escape($this->label)."',"; - $sql .= " description='".$this->db->escape($this->description)."',"; - $sql .= " date_commande=".($this->date_commande != '' ? "'".$this->db->idate($this->date_commande)."'" : "null").","; - $sql .= " date_ouverture_prevue=".($this->date_ouverture_prevue != '' ? "'".$this->db->idate($this->date_ouverture_prevue)."'" : "null").","; - $sql .= " date_ouverture=".($this->date_ouverture != '' ? "'".$this->db->idate($this->date_ouverture)."'" : "null").","; - $sql .= " date_fin_validite=".($this->date_fin_validite != '' ? "'".$this->db->idate($this->date_fin_validite)."'" : "null").","; - $sql .= " date_cloture=".($this->date_cloture != '' ? "'".$this->db->idate($this->date_cloture)."'" : "null").","; - $sql .= " vat_src_code='".$this->db->escape($this->vat_src_code)."',"; - $sql .= " tva_tx=".price2num($this->tva_tx).","; - $sql .= " localtax1_tx=".price2num($this->localtax1_tx).","; - $sql .= " localtax2_tx=".price2num($this->localtax2_tx).","; - $sql .= " qty=".price2num($this->qty).","; - $sql .= " remise_percent=".price2num($this->remise_percent).","; - $sql .= " remise=".($this->remise ?price2num($this->remise) : "null").","; - $sql .= " fk_remise_except=".($this->fk_remise_except > 0 ? $this->fk_remise_except : "null").","; - $sql .= " subprice=".($this->subprice != '' ? $this->subprice : "null").","; - $sql .= " price_ht=".($this->price_ht != '' ? $this->price_ht : "null").","; - $sql .= " total_ht=".$this->total_ht.","; - $sql .= " total_tva=".$this->total_tva.","; - $sql .= " total_localtax1=".$this->total_localtax1.","; - $sql .= " total_localtax2=".$this->total_localtax2.","; - $sql .= " total_ttc=".$this->total_ttc.","; - $sql .= " fk_product_fournisseur_price=".(!empty($this->fk_fournprice) ? $this->fk_fournprice : "NULL").","; - $sql .= " buy_price_ht='".price2num($this->pa_ht)."',"; - $sql .= " info_bits='".$this->db->escape($this->info_bits)."',"; - $sql .= " fk_user_author=".($this->fk_user_author >= 0 ? $this->fk_user_author : "NULL").","; - $sql .= " fk_user_ouverture=".($this->fk_user_ouverture > 0 ? $this->fk_user_ouverture : "NULL").","; - $sql .= " fk_user_cloture=".($this->fk_user_cloture > 0 ? $this->fk_user_cloture : "NULL").","; - $sql .= " commentaire='".$this->db->escape($this->commentaire)."',"; - $sql .= " fk_unit=".(!$this->fk_unit ? 'NULL' : $this->fk_unit); - $sql .= " WHERE rowid=".((int) $this->id); + $sql .= " fk_contrat = ".((int) $this->fk_contrat).","; + $sql .= " fk_product = ".($this->fk_product ? ((int) $this->fk_product) : 'null').","; + $sql .= " statut = ".((int) $this->statut).","; + $sql .= " label = '".$this->db->escape($this->label)."',"; + $sql .= " description = '".$this->db->escape($this->description)."',"; + $sql .= " date_commande = ".($this->date_commande != '' ? "'".$this->db->idate($this->date_commande)."'" : "null").","; + $sql .= " date_ouverture_prevue = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null").","; + $sql .= " date_ouverture = ".($this->date_start_real != '' ? "'".$this->db->idate($this->date_start_real)."'" : "null").","; + $sql .= " date_fin_validite = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null").","; + $sql .= " date_cloture = ".($this->date_end_real != '' ? "'".$this->db->idate($this->date_end_real)."'" : "null").","; + $sql .= " vat_src_code = '".$this->db->escape($this->vat_src_code)."',"; + $sql .= " tva_tx = ".price2num($this->tva_tx).","; + $sql .= " localtax1_tx = ".price2num($this->localtax1_tx).","; + $sql .= " localtax2_tx = ".price2num($this->localtax2_tx).","; + $sql .= " qty = ".price2num($this->qty).","; + $sql .= " remise_percent = ".price2num($this->remise_percent).","; + $sql .= " remise = ".($this->remise ?price2num($this->remise) : "null").","; + $sql .= " fk_remise_except = ".($this->fk_remise_except > 0 ? $this->fk_remise_except : "null").","; + $sql .= " subprice = ".($this->subprice != '' ? $this->subprice : "null").","; + $sql .= " price_ht = ".($this->price_ht != '' ? $this->price_ht : "null").","; + $sql .= " total_ht = ".$this->total_ht.","; + $sql .= " total_tva = ".$this->total_tva.","; + $sql .= " total_localtax1 = ".$this->total_localtax1.","; + $sql .= " total_localtax2 = ".$this->total_localtax2.","; + $sql .= " total_ttc = ".$this->total_ttc.","; + $sql .= " fk_product_fournisseur_price = ".(!empty($this->fk_fournprice) ? $this->fk_fournprice : "NULL").","; + $sql .= " buy_price_ht = '".price2num($this->pa_ht)."',"; + $sql .= " info_bits = '".$this->db->escape($this->info_bits)."',"; + $sql .= " fk_user_author = ".($this->fk_user_author >= 0 ? $this->fk_user_author : "NULL").","; + $sql .= " fk_user_ouverture = ".($this->fk_user_ouverture > 0 ? $this->fk_user_ouverture : "NULL").","; + $sql .= " fk_user_cloture = ".($this->fk_user_cloture > 0 ? $this->fk_user_cloture : "NULL").","; + $sql .= " commentaire = '".$this->db->escape($this->commentaire)."',"; + $sql .= " fk_unit = ".(!$this->fk_unit ? 'NULL' : $this->fk_unit).","; + $sql .= " rang = ".(empty($this->rang) ? '0' : (int) $this->rang); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); @@ -3361,13 +3392,13 @@ class ContratLigne extends CommonObjectLine } } - // If we change a planned date (start or end), sync dates for all services + // If we change a planned date (start or end) of one contract line, sync dates for all other services too if (!$error && !empty($conf->global->CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES)) { dol_syslog(get_class($this)."::update CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES is on so we update date for all lines", LOG_DEBUG); - if ($this->date_ouverture_prevue != $this->oldcopy->date_ouverture_prevue) { + if ($this->date_start != $this->oldcopy->date_start) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'contratdet SET'; - $sql .= " date_ouverture_prevue = ".($this->date_ouverture_prevue != '' ? "'".$this->db->idate($this->date_ouverture_prevue)."'" : "null"); + $sql .= " date_ouverture_prevue = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : "null"); $sql .= " WHERE fk_contrat = ".((int) $this->fk_contrat); $resql = $this->db->query($sql); @@ -3376,9 +3407,9 @@ class ContratLigne extends CommonObjectLine $this->error = "Error ".$this->db->lasterror(); } } - if ($this->date_fin_validite != $this->oldcopy->date_fin_validite) { + if ($this->date_end != $this->oldcopy->date_end) { $sql = 'UPDATE '.MAIN_DB_PREFIX.'contratdet SET'; - $sql .= " date_fin_validite = ".($this->date_fin_validite != '' ? "'".$this->db->idate($this->date_fin_validite)."'" : "null"); + $sql .= " date_fin_validite = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : "null"); $sql .= " WHERE fk_contrat = ".((int) $this->fk_contrat); $resql = $this->db->query($sql); @@ -3463,11 +3494,12 @@ class ContratLigne extends CommonObjectLine $sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, remise_percent, subprice,"; $sql .= " total_ht, total_tva, total_localtax1, total_localtax2, total_ttc,"; $sql .= " info_bits,"; + $sql .= " rang,"; $sql .= " price_ht, remise, fk_product_fournisseur_price, buy_price_ht"; - if ($this->date_ouverture_prevue > 0) { + if ($this->date_start > 0) { $sql .= ",date_ouverture_prevue"; } - if ($this->date_fin_validite > 0) { + if ($this->date_end > 0) { $sql .= ",date_fin_validite"; } $sql .= ") VALUES ($this->fk_contrat, '', '".$this->db->escape($this->description)."',"; @@ -3482,6 +3514,7 @@ class ContratLigne extends CommonObjectLine $sql .= " ".price2num($this->remise_percent).",".price2num($this->subprice).","; $sql .= " ".price2num($this->total_ht).",".price2num($this->total_tva).",".price2num($this->total_localtax1).",".price2num($this->total_localtax2).",".price2num($this->total_ttc).","; $sql .= " '".$this->db->escape($this->info_bits)."',"; + $sql .= " ".(empty($this->rang) ? '0' : (int) $this->rang).","; $sql .= " ".price2num($this->price_ht).",".price2num($this->remise).","; if ($this->fk_fournprice > 0) { $sql .= ' '.((int) $this->fk_fournprice).','; @@ -3493,11 +3526,11 @@ class ContratLigne extends CommonObjectLine } else { $sql .= ' null'; } - if ($this->date_ouverture > 0) { - $sql .= ",'".$this->db->idate($this->date_ouverture)."'"; + if ($this->date_start > 0) { + $sql .= ",'".$this->db->idate($this->date_start)."'"; } - if ($this->date_cloture > 0) { - $sql .= ",'".$this->db->idate($this->date_cloture)."'"; + if ($this->date_end > 0) { + $sql .= ",'".$this->db->idate($this->date_end)."'"; } $sql .= ")"; @@ -3554,12 +3587,19 @@ class ContratLigne extends CommonObjectLine $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".ContratLigne::STATUS_OPEN.","; - $sql .= " date_ouverture = ".(dol_strlen($date) != 0 ? "'".$this->db->idate($date)."'" : "null").","; + $this->statut = ContratLigne::STATUS_OPEN; + $this->date_start = $date; + $this->date_end = $date_end; + $this->fk_user_ouverture = $user->id; + $this->date_end_real = null; + $this->commentaire = $comment; + + $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".$this->statut.","; + $sql .= " date_ouverture = ".(dol_strlen($this->date_start_real) != 0 ? "'".$this->db->idate($this->date_start_real)."'" : "null").","; if ($date_end >= 0) { - $sql .= " date_fin_validite = ".(dol_strlen($date_end) != 0 ? "'".$this->db->idate($date_end)."'" : "null").","; + $sql .= " date_fin_validite = ".(dol_strlen($this->date_end) != 0 ? "'".$this->db->idate($this->date_end)."'" : "null").","; } - $sql .= " fk_user_ouverture = ".((int) $user->id).","; + $sql .= " fk_user_ouverture = ".((int) $this->fk_user_ouverture).","; $sql .= " date_cloture = null,"; $sql .= " commentaire = '".$this->db->escape($comment)."'"; $sql .= " WHERE rowid = ".((int) $this->id)." AND (statut = ".ContratLigne::STATUS_INITIAL." OR statut = ".ContratLigne::STATUS_CLOSED.")"; @@ -3575,13 +3615,6 @@ class ContratLigne extends CommonObjectLine // End call triggers if (!$error) { - $this->statut = ContratLigne::STATUS_OPEN; - $this->date_ouverture = $date; - $this->date_fin_validite = $date_end; - $this->fk_user_ouverture = $user->id; - $this->date_cloture = null; - $this->commentaire = $comment; - $this->db->commit(); return 1; } else { @@ -3600,18 +3633,18 @@ class ContratLigne extends CommonObjectLine * Close a contract line * * @param User $user Objet User who close contract - * @param int $date_end Date end + * @param int $date_end_real Date end * @param string $comment A comment typed by user * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - public function close_line($user, $date_end, $comment = '', $notrigger = 0) + public function close_line($user, $date_end_real, $comment = '', $notrigger = 0) { // phpcs:enable global $langs, $conf; // Update object - $this->date_cloture = $date_end; + $this->date_cloture = $date_end_real; $this->fk_user_cloture = $user->id; $this->commentaire = $comment; @@ -3622,7 +3655,7 @@ class ContratLigne extends CommonObjectLine $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".((int) ContratLigne::STATUS_CLOSED).","; - $sql .= " date_cloture = '".$this->db->idate($date_end)."',"; + $sql .= " date_cloture = '".$this->db->idate($date_end_real)."',"; $sql .= " fk_user_cloture = ".((int) $user->id).","; $sql .= " commentaire = '".$this->db->escape($comment)."'"; $sql .= " WHERE rowid = ".((int) $this->id)." AND statut = ".((int) ContratLigne::STATUS_OPEN); diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 8ceefe2f168..e5557c28a5b 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -54,6 +54,8 @@ $object = new Contrat($db); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('contractcard', 'globalcard')); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + /* * Actions @@ -153,37 +155,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$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->contrat->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/contrat/document.php b/htdocs/contrat/document.php index 19248769ef8..652738f10b5 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -139,40 +139,28 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->contrat->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/contrat/list.php b/htdocs/contrat/list.php index 8c24c4e65ee..c1b97e65e98 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -251,7 +251,7 @@ 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."societe as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; @@ -329,7 +329,7 @@ if ($search_user > 0) { 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 .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,"; $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.status, s.logo,'; @@ -347,7 +347,7 @@ $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $obj $sql .= $hookmanager->resPrint; // Add HAVING from hooks $parameters = array('search_dfyear' => $search_dfyear, 'search_op2df'=>$search_op2df); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($search_dfyear > 0 && $search_op2df) { if ($search_op2df == '<=') { @@ -376,7 +376,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } } } else { - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'contratdet as cd ON c.rowid = cd.fk_contrat/', '', $sqlforcount); $sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product/', '', $sqlforcount); $sqlforcount = preg_replace('/AND cp.fk_categorie = '.((int) $search_product_category).'/', '', $sqlforcount); @@ -582,7 +582,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->right } $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // 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 { @@ -674,7 +674,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); // 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['c.datec']['checked'])) { @@ -748,7 +748,7 @@ if (!empty($arrayfields['c.date_contrat']['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['c.datec']['checked'])) { print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); @@ -943,7 +943,7 @@ while ($i < min($num, $limit)) { 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['c.datec']['checked'])) { @@ -1011,7 +1011,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // 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 '
'; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 391b10718ce..f17cc11f748 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -54,6 +54,7 @@ $result = restrictedArea($user, 'contrat', $id); $object = new Contrat($db); $object->fetch($id, $ref); +$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php @@ -110,37 +111,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty - $morehtmlref .= '
'.$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->contrat->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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
'; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $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/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index b89d5bf6cb0..4e2cd2873b6 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -160,7 +160,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } if (is_object($object) && $object->id > 0) { - if ($backtopage) { + if (!empty($backtopage)) { header('Location: '.$backtopage); exit; } else { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index de586e80e9f..49cc6fa873c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -41,6 +41,9 @@ if (empty($objectclass) || empty($uploaddir)) { dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined'); exit; } +if (empty($massaction)) { + $massaction = ''; +} // For backward compatibility if (!empty($permtoread) && empty($permissiontoread)) { @@ -53,14 +56,13 @@ if (!empty($permtodelete) && empty($permissiontodelete)) { $permissiontodelete = $permtodelete; } - // Mass actions. Controls on number of lines checked. $maxformassaction = (empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS) ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); -if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) { +if ($massaction && is_array($toselect) && count($toselect) < 1) { $error++; setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); } -if (!$error && is_array($toselect) && count($toselect) > $maxformassaction) { +if (!$error && isset($toselect) && is_array($toselect) && count($toselect) > $maxformassaction) { setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors'); $error++; } @@ -1238,6 +1240,45 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd } } +if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) { + $db->begin(); + $supervisortoset=GETPOST('supervisortoset'); + if (!empty($supervisortoset)) { + foreach ($toselect as $toselectid) { + $result = $object->fetch($toselectid); + //var_dump($contcats);exit; + if ($result > 0) { + $object->fk_user = $supervisortoset; + $res = $object->update($user); + if ($res > 0) { + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } else { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + break; + } + } + } else { + setEventMessage('UserNotFound', 'errors'); + $error++; + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } else { + setEventMessages($langs->trans("RecordsModified", $nbok), null); + } + $db->commit(); + $toselect=array(); + } else { + $db->rollback(); + } +} + if (!$error && ($massaction == 'enable' || ($action == 'enable' && $confirm == 'yes')) && $permissiontoadd) { $db->begin(); @@ -1564,7 +1605,7 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday } } -$parameters['toselect'] = $toselect; +$parameters['toselect'] = (empty($toselect) ? array() : $toselect); $parameters['uploaddir'] = $uploaddir; $parameters['massaction'] = $massaction; $parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 3749b403469..772d2b7ed5d 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -108,6 +108,10 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $trackid = GETPOST('trackid', 'aZ09'); } + // Set tmp user directory (used to convert images embedded as img src=data:image) + $vardir = $conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path + $subject = ''; //$actionmsg = ''; $actionmsg2 = ''; @@ -359,7 +363,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO if (empty($sendcontext)) { $sendcontext = 'standard'; } - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid, '', $sendcontext); + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid, '', $sendcontext, '', $upload_dir_tmp); if (!empty($mailfile->error) || !empty($mailfile->errors)) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 7daa715bbb9..c8b42bbf0e8 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -275,9 +275,14 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_ print '
'; // Nb of docs - print ''; } + // Note private + if (!empty($arrayfields['t.note_private']['checked'])) { + print ''; + } + // Role if (!empty($arrayfields['sc.role']['checked'])) { print ''; // Customer proposals - if (isModEnabled("propal") && $user->rights->propale->lire) { + if (isModEnabled("propal") && $user->rights->propal->lire) { $nblines++; $ret = $product->load_stats_propale($socid); if ($ret < 0) { @@ -448,7 +448,7 @@ function show_stats_for_company($product, $socid) print ''; print ''; } - // Customer orders + // Sales orders if (isModEnabled('commande') && $user->rights->commande->lire) { $nblines++; $ret = $product->load_stats_commande($socid); diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 110dcabb0f0..6d9598a04ae 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -341,14 +341,14 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $product_static->status_batch = $objp->product_tobatch; $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); // Show range print_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 070cbe0801f..9cc8f1f03a9 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -131,6 +131,21 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) } else { $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); } + } elseif ($type == 'fichinter') { + $securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN : ''; + $out = $urltouse.'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ? '' : ''); + if ($mode == 1) { + $out .= 'fichinter_ref'; + } + if ($mode == 0) { + $out .= urlencode($ref); + } + $out .= ($mode ? '' : ''); + if ($mode == 1) { + $out .= "hash('".$securekeyseed."' + '".$type."' + fichinter_ref)"; + } else { + $out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0'); + } } // For multicompany diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index a0602dfd74e..29ced3591a1 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -174,10 +174,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -222,10 +230,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -359,10 +375,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -407,10 +431,18 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } $sql .= " AND f.rowid = d.".$fk_facture; $sql .= " AND s.rowid = f.fk_soc"; @@ -730,10 +762,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND f.datef >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -776,10 +816,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -915,10 +963,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Validated or paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND f.datef >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; @@ -961,10 +1017,18 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on d.fk_product = p.rowid"; $sql .= " WHERE f.entity IN (".getEntity($invoicetable).")"; $sql .= " AND f.fk_statut in (1,2)"; // Paid (partially or completely) - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { - $sql .= " AND f.type IN (0,1,2,5)"; + if ($direction == 'buy') { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } else { - $sql .= " AND f.type IN (0,1,2,3,5)"; + if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + $sql .= " AND f.type IN (0,1,2,5)"; + } else { + $sql .= " AND f.type IN (0,1,2,3,5)"; + } } if ($y && $m) { $sql .= " AND pa.datep >= '".$db->idate(dol_get_first_day($y, $m, false))."'"; diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 5d0d691228e..f82c57a0418 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -268,3 +268,4 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
'; } + diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 868a5af0d51..273e7285273 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -157,7 +157,10 @@ function user_prepare_head(User $object) if (empty($user->socid)) { // Notes $nbNote = 0; - if (!empty($object->note)) { + if (!empty($object->note_public)) { + $nbNote++; + } + if (!empty($object->note_private)) { $nbNote++; } $head[$h][0] = DOL_URL_ROOT.'/user/note.php?id='.$object->id; diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index cd4ed16eae6..faf0024d801 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -77,7 +77,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $ldapdn = $dolibarr_main_auth_ldap_dn; $ldapadminlogin = $dolibarr_main_auth_ldap_admin_login; $ldapadminpass = $dolibarr_main_auth_ldap_admin_pass; - $ldapdebug = (empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false" ? false : true); + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); if ($ldapdebug) { print "DEBUG: Logging LDAP steps
\n"; @@ -94,9 +94,9 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($ldapdebug) { dol_syslog("functions_ldap::check_user_password_ldap Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType); - dol_syslog("functions_ldap::check_user_password_ldap uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword); + dol_syslog("functions_ldap::check_user_password_ldap uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)); print "DEBUG: Server:".join(',', $ldap->server).", Port:".$ldap->serverPort.", Protocol:".$ldap->ldapProtocolVersion.", Type:".$ldap->serverType."
\n"; - print "DEBUG: uid/samacountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".$ldap->searchPassword."
\n"; + print "DEBUG: uid/samaccountname=".$ldapuserattr.", dn=".$ldapdn.", Admin:".$ldap->searchUser.", Pass:".dol_trunc($ldap->searchPassword, 3)."
\n"; } $resultFetchLdapUser = 0; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 8dc3f1b1374..10c50ca99ee 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -157,15 +157,15 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->reception->enabled && $leftmenu=="receptions"', __HANDLER__, 'left', 1353__+MAX_llx_menu__, 'commercial', '', 1350__+MAX_llx_menu__, '/reception/stats/index.php?mainmenu=commercial&leftmenu=receptions', 'Statistics', 1, 'receptions', '$user->rights->reception->lire', '', 2, 2, __ENTITY__); -- Commercial - Proposals -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propale->creer', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propale->lire', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propale->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propale->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propale->lire', '', 2, 5, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propale->lire', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propale->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1100__+MAX_llx_menu__, 'commercial', 'propals', 5__+MAX_llx_menu__, '/comm/propal/index.php?mainmenu=commercial&leftmenu=propals', 'Proposals', 0, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1101__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/card.php?mainmenu=commercial&action=create&leftmenu=propals', 'NewPropal', 1, 'propal', '$user->rights->propal->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1102__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', 'List', 1, 'propal', '$user->rights->propal->lire', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1103__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=0', 'PropalsDraft', 1, 'propal', '$user->rights->propal->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1104__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=1', 'PropalsOpened', 1, 'propal', '$user->rights->propal->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1105__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=2', 'PropalStatusSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1106__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=3', 'PropalStatusNotSigned', 1, 'propal', '$user->rights->propal->lire', '', 2, 5, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled && $leftmenu=="propals"', __HANDLER__, 'left', 1107__+MAX_llx_menu__, 'commercial', '', 1102__+MAX_llx_menu__, '/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&search_status=4', 'PropalStatusBilled', 1, 'propal', '$user->rights->propal->lire', '', 2, 6, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->propal->enabled', __HANDLER__, 'left', 1110__+MAX_llx_menu__, 'commercial', '', 1100__+MAX_llx_menu__, '/comm/propal/stats/index.php?mainmenu=commercial&leftmenu=propals', 'Statistics', 1, 'propal', '$user->rights->propal->lire', '', 2, 4, __ENTITY__); -- Commercial - Customer's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1200__+MAX_llx_menu__, 'commercial', 'orders', 5__+MAX_llx_menu__, '/commande/index.php?mainmenu=commercial&leftmenu=orders', 'CustomersOrders', 0, 'orders', '$user->rights->commande->lire', '', 2, 5, __ENTITY__); @@ -450,7 +450,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4202__+MAX_llx_menu__, 'members', '', 4200__+MAX_llx_menu__, '/adherents/list.php', 'List', 1, 'members', '$user->rights->adherent->lire', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4203__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=-1', 'MenuMembersToValidate', 2, 'members', '$user->rights->adherent->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4204__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1', 'MenuMembersValidated', 2, 'members', '$user->rights->adherent->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=withoutsubscription', 'WithoutSubscription', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4205__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=waitingsubscription', 'WaitingSubscription', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4206__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=outofdate', 'UpToDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 4, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4207__+MAX_llx_menu__, 'members', '', 4204__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=1&filter=uptodate', 'OutOfDate', 2, 'members', '$user->rights->adherent->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled', __HANDLER__, 'left', 4208__+MAX_llx_menu__, 'members', '', 4202__+MAX_llx_menu__, '/adherents/list.php?mainmenu=members&leftmenu=members&statut=0', 'MenuMembersResiliated', 2, 'members', '$user->rights->adherent->lire', '', 2, 6, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7fccf290d1a..4a6636942c4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1115,7 +1115,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1); $warnpicto = ''; - if (!empty($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + if (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningPHPMailD")); } @@ -2405,7 +2405,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1", $langs->trans("MenuMembersToValidate"), 2, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1", $langs->trans("MenuMembersValidated"), 2, $user->hasRight('adherent', 'read')); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=withoutsubscription", $langs->trans("WithoutSubscription"), 3, $user->hasRight('adherent', 'read')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=waitingsubscription", $langs->trans("WaitingSubscription"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read')); diff --git a/htdocs/core/modules/asset/mod_asset_standard.php b/htdocs/core/modules/asset/mod_asset_standard.php index af28c0f9c5b..2e3ee3938e1 100644 --- a/htdocs/core/modules/asset/mod_asset_standard.php +++ b/htdocs/core/modules/asset/mod_asset_standard.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/asset/modules_asset.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Asset */ class mod_asset_standard extends ModeleNumRefAsset { diff --git a/htdocs/core/modules/bom/mod_bom_standard.php b/htdocs/core/modules/bom/mod_bom_standard.php index f5a9fb75976..db2d0f2ed7f 100644 --- a/htdocs/core/modules/bom/mod_bom_standard.php +++ b/htdocs/core/modules/bom/mod_bom_standard.php @@ -25,7 +25,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/bom/modules_bom.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for BOM */ class mod_bom_standard extends ModeleNumRefboms { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 50071b029e0..e0dff278f96 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -871,7 +871,7 @@ class pdf_einstein extends ModelePDFCommandes // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index d1683f91ee7..131e159196b 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1088,7 +1088,7 @@ class pdf_eratosthene extends ModelePDFCommandes // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index 8c9ef0385eb..71a41d0b3c4 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -20,12 +20,12 @@ /** * \file htdocs/core/modules/commande/mod_commande_marbre.php * \ingroup commande - * \brief File of class to manage customer order numbering rules Marbre + * \brief File of class to manage Sales Order numbering rules Marbre */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; /** - * Class to manage customer order numbering rules Marbre + * Class to manage Sales Order numbering rules Marbre */ class mod_commande_marbre extends ModeleNumRefCommandes { diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index ad2b109f2d1..07dcfdced9e 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -23,14 +23,14 @@ /** * \file htdocs/core/modules/commande/mod_commande_saphir.php * \ingroup commande - * \brief Fichier contenant la classe du modele de numerotation de reference de commande Saphir + * \brief File of class to manage Sales Order numbering rules Saphir */ require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; /** - * Class to manage customer order numbering rules Saphir + * Class to manage Sales Order numbering rules Saphir */ class mod_commande_saphir extends ModeleNumRefCommandes { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4ce7b3b3aa5..3d7da995e6f 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1134,10 +1134,10 @@ class pdf_crabe extends ModelePDFFactures // Check a payment mode is defined if (empty($object->mode_reglement_code) && empty($conf->global->FACTURE_CHQ_NUMBER) - && empty($conf->global->FACTURE_RIB_NUMBER)) { + && !getDolGlobalInt('FACTURE_RIB_NUMBER')) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { + || ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) { // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); @@ -1247,7 +1247,7 @@ class pdf_crabe extends ModelePDFFactures // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index e8269039aa8..da278cb45ac 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1242,10 +1242,10 @@ class pdf_sponge extends ModelePDFFactures // Check a payment mode is defined if (empty($object->mode_reglement_code) && empty($conf->global->FACTURE_CHQ_NUMBER) - && empty($conf->global->FACTURE_RIB_NUMBER)) { + && !getDolGlobalInt('FACTURE_RIB_NUMBER')) { $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { + || ($object->mode_reglement_code == 'VIR' && !getDolGlobalInt('FACTURE_RIB_NUMBER') && empty($object->fk_account) && empty($object->fk_bank))) { // Avoid having any valid PDF with setup that is not complete $outputlangs->load("errors"); @@ -1358,7 +1358,7 @@ class pdf_sponge extends ModelePDFFactures // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/hrm/mod_evaluation_standard.php b/htdocs/core/modules/hrm/mod_evaluation_standard.php index 4c5bb083870..b6b517b8fb9 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_standard.php +++ b/htdocs/core/modules/hrm/mod_evaluation_standard.php @@ -26,7 +26,7 @@ dol_include_once('/core/modules/hrm/modules_evaluation.php'); /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for HR evaluation */ class mod_evaluation_standard extends ModeleNumRefEvaluation { diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 594ab96d955..09f93a436ea 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -458,17 +458,27 @@ class ImportCsv extends ModeleImports $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } - call_user_func_array(array($classinstance, $method), $param_array); + $result = call_user_func_array(array($classinstance, $method), $param_array); + + // If duplicate record found + if (!($classinstance->id != '') && $result == -2) { + $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval); + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + // If not found, try the fetch from label if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] = $classinstance->id; + //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') { // id may be 0, it is a found value $newval = $classinstance->id; - } else { + } elseif (! $error) { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', num2Alpha($key - 1), $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { @@ -729,9 +739,13 @@ class ImportCsv extends ModeleImports if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array + $listvalues[$socialkey] = ''; } + //var_dump($newval); var_dump($arrayrecord[($key - 1)]['type']); if (!empty($newval) && $arrayrecord[($key - 1)]['type'] > 0) { - $socialkey = array_search("socialnetworks", $listfields); + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array + //var_dump('sk='.$socialkey); // socialkey=19 $socialnetwork = explode("_", $fieldname)[1]; if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $json = new stdClass(); @@ -833,7 +847,6 @@ class ImportCsv extends ModeleImports if (empty($lastinsertid)) { // No insert done yet for a parent table $sqlSelect = "SELECT ".$fname." FROM ".$tablename; - $data = array_combine($listfields, $listvalues); $where = array(); // filters to forge SQL request $filters = array(); // filters to forge output error message diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 3637ce105c1..ecf7d8b4a77 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -502,17 +502,28 @@ class ImportXlsx extends ModeleImports }*/ $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart. } - call_user_func_array(array($classinstance, $method), $param_array); + + $result = call_user_func_array(array($classinstance, $method), $param_array); + + // If duplicate record found + if (!($classinstance->id != '') && $result == -2) { + $this->errors[$error]['lib'] = $langs->trans('ErrorMultipleRecordFoundFromRef', $newval); + $this->errors[$error]['type'] = 'FOREIGNKEY'; + $errorforthistable++; + $error++; + } + // If not found, try the fetch from label if (!($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule'] == 'fetchidfromcodeorlabel') { $param_array = array('', '', $newval); call_user_func_array(array($classinstance, $method), $param_array); } $this->cacheconvert[$file . '_' . $class . '_' . $method . '_'][$newval] = $classinstance->id; + //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. '; if ($classinstance->id != '') { // id may be 0, it is a found value $newval = $classinstance->id; - } else { + } elseif (! $error) { if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) { $this->errors[$error]['lib'] = $langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict'])); } elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) { @@ -770,12 +781,14 @@ class ImportXlsx extends ModeleImports } // Define $listfields and $listvalues to build SQL request - if ($conf->socialnetworks->enabled && strpos($fieldname, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($fieldname, "socialnetworks") !== false) { if (!in_array("socialnetworks", $listfields)) { $listfields[] = "socialnetworks"; + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19 + $listvalues[$socialkey] = ''; } if (!empty($newval) && $arrayrecord[($key)]['type'] > 0) { - $socialkey = array_search("socialnetworks", $listfields); + $socialkey = array_search("socialnetworks", $listfields); // Return position of 'socialnetworks' key in array. Example socialkey=19 $socialnetwork = explode("_", $fieldname)[1]; if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $json = new stdClass(); @@ -797,7 +810,7 @@ class ImportXlsx extends ModeleImports } elseif (empty($newval) && $arrayrecord[($key)]['type'] == 0) { $listvalues[] = "''"; } else { - $listvalues[] = "'" . $this->db->escape($newval) . "'"; + $listvalues[] = "'".$this->db->escape($newval)."'"; } } } @@ -810,7 +823,7 @@ class ImportXlsx extends ModeleImports if (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0])) { // Loop on each hidden fields to add them into listfields/listvalues foreach ($objimport->array_import_fieldshidden[0] as $key => $val) { - if (!preg_match('/^' . preg_quote($alias, '/') . '\./', $key)) { + if (!preg_match('/^'.preg_quote($alias, '/').'\./', $key)) { continue; // Not a field of current table } if ($val == 'user->id') { @@ -876,17 +889,17 @@ class ImportXlsx extends ModeleImports if (!empty($updatekeys)) { // We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields) - $where = array(); - if (empty($lastinsertid)) { // No insert done yet for a parent table $sqlSelect = "SELECT ".$fname." FROM " . $tablename; $data = array_combine($listfields, $listvalues); - $filters = array(); + + $where = array(); // filters to forge SQL request + $filters = array(); // filters to forge output error message foreach ($updatekeys as $key) { $col = $objimport->array_import_updatekeys[0][$key]; $key = preg_replace('/^.*\./i', '', $key); - if ($conf->socialnetworks->enabled && strpos($key, "socialnetworks") !== false) { + if (isModEnabled("socialnetworks") && strpos($key, "socialnetworks") !== false) { $tmp = explode("_", $key); $key = $tmp[0]; $socialnetwork = $tmp[1]; diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 979782e61a5..9083b643900 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -108,7 +108,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $now = dol_now(); // La requete doit retourner: id, email, name - $sql = "SELECT s.rowid as id, s.email, s.nom as name, cd.rowid as cdid, cd.date_ouverture, cd.date_fin_validite, cd.fk_contrat"; + $sql = "SELECT s.rowid as id, s.email, s.nom as name, cd.rowid as cdid, cd.date_ouverture as date_start_real, cd.date_fin_validite as date_end, cd.fk_contrat"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; @@ -135,8 +135,8 @@ class mailing_thirdparties_services_expired extends MailingTargets 'lastname' => $obj->name, // For thirdparties, lastname must be name 'firstname' => '', // For thirdparties, firstname is '' 'other' => - ('DateStart='.dol_print_date($this->db->jdate($obj->date_ouverture), 'day')).';'. - ('DateEnd='.dol_print_date($this->db->jdate($obj->date_fin_validite), 'day')).';'. + ('DateStart='.dol_print_date($this->db->jdate($obj->date_start_real), 'day')).';'. // date start real + ('DateEnd='.dol_print_date($this->db->jdate($obj->date_end), 'day')).';'. // date end planned ('Contract='.$obj->fk_contrat).';'. ('ContactLine='.$obj->cdid), 'source_url' => $this->url($obj->id), diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 48420a264d3..5eaae25a67c 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -107,7 +107,7 @@ class modApi extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index fbe6134c797..a0fb405887e 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -137,7 +137,7 @@ class modAsset extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index d39affa4d78..6f2cc7ac4b2 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -156,7 +156,7 @@ class modBom extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 6a88c14271b..f0486b5cb58 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -34,11 +34,10 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** - * Class to describe module customer orders + * Class to describe module Sales Orders */ class modCommande extends DolibarrModules { - /** * Constructor. Define names, constants, directories, boxes, permissions * diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 2768e7d1d7a..93f3e6f4024 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -162,7 +162,7 @@ class modDataPolicy extends DolibarrModules { // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index aeea231fd1e..356f043cea0 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -131,7 +131,7 @@ class modDav extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 03c668910ce..514fe1be667 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -131,7 +131,7 @@ class modEmailCollector extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 6708eb4192a..437fa691713 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -169,7 +169,7 @@ class modEventOrganization extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view @@ -327,7 +327,7 @@ class modEventOrganization extends DolibarrModules */ public function init($options = '') { - global $conf, $langs; + global $conf, $langs, $user; // Permissions $this->remove($options); @@ -370,6 +370,28 @@ class modEventOrganization extends DolibarrModules $init = $this->_init($sql, $options); + + // Insert some vars + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($this->db); + + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskConf)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF', $template->id, 'chaine', 0, '', $conf->entity); + } + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailAskBooth)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH', $template->id, 'chaine', 0, '', $conf->entity); + } + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailBoothPayment)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH', $template->id, 'chaine', 0, '', $conf->entity); + } + $template = $formmail->getEMailTemplate($this->db, 'conferenceorbooth', $user, $langs, 0, 1, '(EventOrganizationEmailRegistrationPayment)'); + if ($template->id > 0) { + dolibarr_set_const($this->db, 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT', $template->id, 'chaine', 0, '', $conf->entity); + } + return $init; } diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 339e02cf393..85072c90cee 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2021 Alexandre Spangaro + * Copyright (C) 2022 Frédéric France * * 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 @@ -238,7 +239,7 @@ class modFacture extends DolibarrModules $this->import_fields_array[$r] = array( 'f.ref' => 'InvoiceRef*', 'f.ref_ext' => 'ExternalRef', - 'f.ref_client' => 'CutomerRef', + 'f.ref_client' => 'CustomerRef', 'f.type' => 'Type*', 'f.fk_soc' => 'Customer*', 'f.datec' => 'InvoiceDateCreation', @@ -350,7 +351,7 @@ class modFacture extends DolibarrModules ) ); - //Import Supplier Invoice Lines + // Import Invoice Lines $r++; $this->import_code[$r] = $this->rights_class.'_'.$r; $this->import_label[$r] = "InvoiceLine"; // Translation key diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 8c30d8a0a51..fa3a66c37cc 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -70,10 +70,9 @@ class modFckeditor extends DolibarrModules // Constants $this->const = array(); $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE", "yesno", "1", "WYSIWIG for the fields descriptions of elements (except products/services)"); - $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC", "yesno", "1", "WYSIWIG for the fields description of products/services"); - $this->const[2] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); - $this->const[3] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); - $this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); + $this->const[2] = array("FCKEDITOR_ENABLE_DETAILS", "yesno", "1", "WYSIWIG for products details lines for all entities"); + $this->const[3] = array("FCKEDITOR_ENABLE_USERSIGN", "yesno", "1", "WYSIWIG for user signature"); + $this->const[4] = array("FCKEDITOR_ENABLE_MAILING", "yesno", "1", "WYSIWIG for mass emailings"); $this->const[5] = array("FCKEDITOR_ENABLE_MAIL", "yesno", "1", "WYSIWIG for products details lines for all entities"); $this->const[6] = array("FCKEDITOR_SKIN", "string", "moono-lisa", "Skin by default for fckeditor"); diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 0da5663d452..09ff03cae9b 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -141,7 +141,7 @@ class modHRM extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index 634f36406a2..b331c56a917 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -184,7 +184,7 @@ class modKnowledgeManagement extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index f93ce224662..fb836c8393b 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -168,7 +168,7 @@ class modMrp extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 54297d5e77c..f08c9a4b021 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -113,7 +113,7 @@ class modMultiCurrency extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index ccd67542830..8e8421540c7 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -199,7 +199,7 @@ class modPartnership extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index f1fe6f2072c..8b2db1a115a 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -177,7 +177,7 @@ class modRecruitment extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index ab73c8828b4..59dc7878161 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -120,7 +120,7 @@ class modResource extends DolibarrModules // 'order_supplier' to add a tab in supplier order view // 'invoice_supplier' to add a tab in supplier invoice view // 'invoice' to add a tab in customer invoice view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'product' to add a tab in product view // 'stock' to add a tab in stock view // 'propal' to add a tab in propal view diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index a90b28be5aa..6c8f068adf6 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -51,7 +51,7 @@ class modStockTransfer extends DolibarrModules $this->rights_class = 'stocktransfer'; // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' // It is used to group modules by family in module setup page - $this->family = "other"; + $this->family = "products"; // Module position in the family on 2 digits ('01', '10', '20', ...) $this->module_position = '90'; // Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) @@ -125,7 +125,6 @@ class modStockTransfer extends DolibarrModules $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->langfiles = array("stocktransfer@stocktransfer"); $this->phpmin = array(7, 0); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) //$this->automatic_activation = array('FR'=>'StockTransferWasAutomaticallyActivatedBecauseOfYourCountryChoice'); @@ -138,12 +137,6 @@ class modStockTransfer extends DolibarrModules // ); $this->const = array(); - // Some keys to add into the overwriting translation tables - /*$this->overwrite_translation = array( - 'en_US:ParentCompany'=>'Parent company or reseller', - 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' - )*/ - if (!isset($conf->stocktransfer) || !isset($conf->stocktransfer->enabled)) { $conf->stocktransfer = new stdClass(); $conf->stocktransfer->enabled = 0; @@ -166,7 +159,7 @@ class modStockTransfer extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view @@ -435,15 +428,6 @@ class modStockTransfer extends DolibarrModules $result = $this->_load_tables('/install/mysql/tables/', 'stocktransfer'); if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') - // Create extrafields during init - //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - //$extrafields = new ExtraFields($this->db); - //$result1=$extrafields->addExtraField('stocktransfer_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result2=$extrafields->addExtraField('stocktransfer_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result3=$extrafields->addExtraField('stocktransfer_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result4=$extrafields->addExtraField('stocktransfer_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - //$result5=$extrafields->addExtraField('stocktransfer_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled'); - // Permissions $this->remove($options); diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 8096629c9a4..b06bf0fe8b0 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -142,7 +142,7 @@ class modTakePos extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index b1aaea23929..225f09659c2 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -183,7 +183,7 @@ class modWebhook extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index 51094439df0..a8be0f23226 100644 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -166,7 +166,7 @@ class modWorkstation extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index 6d05aa7b283..b14419e0982 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -172,7 +172,7 @@ class modZapier extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index ee4e17ae19e..8b1261f35f0 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -943,7 +943,7 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListProposalsAssociatedProject", 'class' => 'Propal', 'table' => 'propal', - 'test' => $conf->propal->enabled && $user->rights->propale->lire + 'test' => $conf->propal->enabled && $user->rights->propal->lire ), 'order' => array( 'title' => "ListOrdersAssociatedProject", diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index c60f2c4bb66..9947bb49b0b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -374,7 +374,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Propal', 'table'=>'propal', 'datefieldname'=>'datep', - 'test'=>$conf->propal->enabled && $user->rights->propale->lire, + 'test'=>$conf->propal->enabled && $user->rights->propal->lire, 'lang'=>'propal'), 'order'=>array( 'name'=>"CustomersOrders", diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 3d507f816dc..231d8c1ddff 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1053,7 +1053,7 @@ class pdf_azur extends ModelePDFPropales // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if (!empty($object->fk_account) || !empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if (!empty($object->fk_bank)) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 0da947cdd95..9bffe9009fb 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1172,7 +1172,7 @@ class pdf_cyan extends ModelePDFPropales // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if ($object->fk_bank > 0) { $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php index 28d66dfc40a..54dd0096b2e 100644 --- a/htdocs/core/modules/propale/mod_propale_marbre.php +++ b/htdocs/core/modules/propale/mod_propale_marbre.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; /** - * Class to manage customer order numbering rules Marbre + * Class to manage business proposition rules Marbre */ class mod_propale_marbre extends ModeleNumRefPropales { diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index a7ae44323a1..19a5309a374 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -151,7 +151,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode } $date = dol_now(); - $yymm = strftime("%y%m", $date); + $yymm = dol_print_date($date, "%y%m", 'tzuserrel'); if ($max >= (pow(10, 5) - 1)) { $num = $max + 1; // If counter > 99999, we do not format on 5 chars, we take number as it is diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 381710e2697..ef73d526ed6 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -978,7 +978,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (!empty($object->fk_account) || !empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if (!empty($object->fk_account) || !empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = (empty($object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account); if (!empty($object->fk_bank)) $bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank $account = new Account($this->db); diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php index 6a6c7c556e6..fc647d3135c 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_standard.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktrans /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Stock */ class mod_stocktransfer_standard extends ModeleNumRefStockTransfer { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 5ed82f597fb..fe439ea0790 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -872,7 +872,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // If payment mode not forced or forced to VIR, show payment with BAN if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') { - if (!empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) { + if (!empty($object->fk_bank) || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $bankid = (empty($object->fk_bank) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_bank); $account = new Account($this->db); $account->fetch($bankid); diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php index 2e618b3ece3..cb4f76fa727 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier /** - * Class to manage customer order numbering rules Marbre + * Class to manage the Marbre numbering rule for Request for quotation */ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal { diff --git a/htdocs/core/modules/workstation/mod_workstation_standard.php b/htdocs/core/modules/workstation/mod_workstation_standard.php index 7bef21a8599..758783316e4 100644 --- a/htdocs/core/modules/workstation/mod_workstation_standard.php +++ b/htdocs/core/modules/workstation/mod_workstation_standard.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/modules/workstation/modules_workstation.php'; /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Workstation */ class mod_workstation_standard extends ModeleNumRefWorkstation { diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index be91d7b28a5..24fddc2fda4 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -35,7 +35,7 @@ if (empty($conf) || !is_object($conf)) { $object->fields = dol_sort_array($object->fields, 'position'); foreach ($object->fields as $key => $val) { - // Discard if extrafield is a hidden field on form + // Discard if field is a hidden field on form if (abs($val['visible']) != 1 && abs($val['visible']) != 3) { continue; } diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 5f463e44846..9d9bd226fd6 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -41,7 +41,7 @@ $module = $object->element; // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->rights->propal->creer; } elseif ($module == 'fichinter') { $permission = $user->rights->ficheinter->creer; } elseif ($module == 'order_supplier') { diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 67d41199594..267ca6803c9 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -23,7 +23,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield $tmpkey = 'options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && isset($obj->$tmpkey) && !is_numeric($obj->$tmpkey)) { $datenotinstring = $obj->$tmpkey; if (!is_numeric($obj->$tmpkey)) { // For backward compatibility $datenotinstring = $db->jdate($datenotinstring); diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index 2c4b2f5dea8..83bb06a8abb 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -269,7 +269,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { // Show the link to "Root" if ($showroot) { - print '
'; } - print ' - global->PRODUCT_USE_UNITS)) { @@ -432,11 +435,12 @@ if ($nolinesbefore) { } $coldisplay++; ?> - + + situation_cycle_ref) && $this->situation_cycle_ref) { $coldisplay++; - print ''; + print ''; $coldisplay++; print ''; } @@ -454,11 +458,11 @@ if ($nolinesbefore) { global->DISPLAY_MARGIN_RATES)) { - echo ''; + echo ''; $coldisplay++; } if (!empty($conf->global->DISPLAY_MARK_RATES)) { - echo ''; + echo ''; $coldisplay++; } } @@ -496,7 +500,6 @@ if ((isModEnabled("service") || ($object->element == 'contrat')) && $dateSelecto } } - if (!empty($object->element) && $object->element == 'contrat') { print $langs->trans("DateStartPlanned").' '; print $form->selectDate($date_start, "date_start", $usehm, $usehm, 1, "addproduct"); @@ -519,8 +522,8 @@ if ((isModEnabled("service") || ($object->element == 'contrat')) && $dateSelecto ?> function prefill_service_dates() { - $('#date_start').val("").trigger('change'); - $('#date_end').val("").trigger('change'); + $('#date_start').val("").trigger('change'); + $('#date_end').val("").trigger('change'); return false; // Prevent default link behaviour (which is go to href URL) } @@ -712,7 +715,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { - console.log("Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); + console.log("objectline_create.tpl Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva jQuery('#trlinefordates').show(); @@ -725,7 +728,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0) { - console.log("We are in a price per qty context, we do not call ajax/product, init of fields is done few lines later"); + console.log("objectline_create.tpl We are in a price per qty context, we do not call ajax/product, init of fields is done few lines later"); } else { global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { ?> if (isNaN(pbq)) { console.log("We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we could not get the id of pbq from product combo list, so load of price may be 0 if product has differet prices"); } @@ -733,9 +736,9 @@ if (!empty($usemargins) && $user->rights->margins->creer) { // Get the HT price for the product and display it console.log("Load unit price without tax and set it into #price_ht for product id="+$(this).val()+" socid=socid; ?>"); $.post('/product/ajax/products.php?action=fetch', - { 'id': $(this).val(), 'socid': socid; ?> }, + { 'id': $(this).val(), 'socid': socid; ?>, 'token': '' }, function(data) { - console.log("Load unit price end, we got value ht="+data.price_ht+" ttc="+data.price_ttc+" pricebasetype="+data.pricebasetype); + console.log("objectline_create.tpl Load unit price end, we got value ht="+data.price_ht+" ttc="+data.price_ttc+" pricebasetype="+data.pricebasetype); $('#date_start').removeAttr('type'); $('#date_end').removeAttr('type'); @@ -757,8 +760,10 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } if ( == 1 && data.pricebasetype == 'TTC') { + console.log("objectline_create.tpl set content of price_ttc"); jQuery("#price_ttc").val(data.price_ttc); } else { + console.log("objectline_create.tpl set content of price_ht"); jQuery("#price_ht").val(data.price_ht); } rights->margins->creer) { var proddesc = data.desc; - console.log("Load desciption into text area : "+proddesc); + console.log("objectline_create.tpl Load desciption into text area : "+proddesc); global->FCKEDITOR_ENABLE_DETAILS)) { ?> if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") @@ -790,7 +795,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { global->PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES)) { ?> jQuery.each(data.array_options, function( key, value ) { - jQuery('div[class$="det'+key.replace('options_','_extras_')+'"] > #'+key).val(value); + jQuery('div[class*="det'+key.replace('options_','_extras_')+'"] > #'+key).val(value); }); @@ -834,7 +839,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { print 'costprice'; } } ?>'; - console.log("we will set the field for margin. defaultbuyprice="+defaultbuyprice); + console.log("objectline_create.tpl we will set the field for margin. defaultbuyprice="+defaultbuyprice); var i = 0; $(data).each(function() { @@ -871,7 +876,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } options += ''; }); - options += ''; + options += ''; console.log("finally selected defaultkey="+defaultkey+" defaultprice for buying price="+defaultprice); @@ -945,11 +950,16 @@ if (!empty($usemargins) && $user->rights->margins->creer) { - //Deal with supplier - if (jQuery('#idprodfournprice').val() >0) + // Deal with supplier + if (jQuery('#idprodfournprice').val() > 0) { + console.log("objectline_create.tpl #idprodfournprice is > 0, so we set some properties into page"); + var up = parseFloat($('option:selected', this).attr('data-up')); // When select is done from HTML select - if (isNaN(up)) { up = parseFloat(jQuery('#idprodfournprice').attr('data-up'));} // When select is done from HTML input with autocomplete + if (isNaN(up)) { up = parseFloat(jQuery('#idprodfournprice').attr('data-up'));} // When select is done from HTML input with ajax autocomplete + + var up_locale = $('option:selected', this).attr('data-up-locale'); // When select is done from HTML select + if (typeof up_locale === 'undefined') { up_locale = jQuery('#idprodfournprice').attr('data-up-locale');} // When select is done from HTML input with ajax autocomplete var qty = parseFloat($('option:selected', this).attr('data-qty')); if (isNaN(qty)) { qty = parseFloat(jQuery('#idprodfournprice').attr('data-qty'));} @@ -958,11 +968,15 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if (isNaN(discount)) { discount = parseFloat(jQuery('#idprodfournprice').attr('data-discount'));} var tva_tx = parseFloat($('option:selected', this).attr('data-tvatx')); // When select is done from HTML select - if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery('#idprodfournprice').attr('data-tvatx'));} // When select is done from HTML input with autocomplete + if (isNaN(tva_tx)) { tva_tx = parseFloat(jQuery('#idprodfournprice').attr('data-tvatx'));} // When select is done from HTML input with ajax autocomplete - console.log("We find supplier price :"+up+" qty: "+qty+" tva_tx="+tva_tx+" discount: "+discount+" for product "+jQuery('#idprodfournprice').val()); + console.log("objectline_create.tpl We find supplier price : up = "+up+", up_locale = "+up_locale+", qty = "+qty+", tva_tx = "+tva_tx+", discount = "+discount+" for product "+jQuery('#idprodfournprice').val()); - jQuery("#price_ht").val(up); + if (typeof up_locale === 'undefined') { + jQuery("#price_ht").val(up); + } else { + jQuery("#price_ht").val(up_locale); + } /* $('#tva_tx option').removeAttr('selected').filter('[value='+tva_tx+']').prop('selected', true); */ $('#tva_tx option').val(tva_tx); @@ -970,8 +984,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { if (jQuery("#qty").val() < qty) { jQuery("#qty").val(qty); } - if (jQuery("#remise_percent").val() < discount) - { + if (jQuery("#remise_percent").val() < discount) { jQuery("#remise_percent").val(discount); } @@ -1038,7 +1051,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { /* Function to set fields from choice */ function setforfree() { - console.log("Call setforfree. We show most fields"); + console.log("objectline_create.tpl::setforfree. We show most fields"); jQuery("#idprodfournprice").val('0'); // Set cursor on not selected product jQuery("#prod_entry_mode_free").prop('checked',true).change(); jQuery("#prod_entry_mode_predef").prop('checked',false).change(); @@ -1049,7 +1062,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { } function setforpredef() { - console.log("Call setforpredef. We hide some fields and show dates"); + console.log("objectline_create.tpl::setforpredef We hide some fields, show dates"); jQuery("#select_type").val(-1); jQuery("#prod_entry_mode_free").prop('checked',false).change(); jQuery("#prod_entry_mode_predef").prop('checked',true).change(); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index c8188c82bb8..1a9f028c263 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -200,9 +200,12 @@ $coldisplay++; '.$form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : ($line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : '')), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1).''; + print ''; } else { print ''; } @@ -266,24 +269,29 @@ $coldisplay++; ?> + situation_cycle_ref) { $coldisplay++; print ''; $coldisplay++; print ''; } + if (!empty($usemargins)) { if (!empty($user->rights->margins->creer)) { $coldisplay++; @@ -303,9 +311,9 @@ $coldisplay++; $margin_rate = (GETPOSTISSET("np_marginRate") ? GETPOST("np_marginRate", "alpha", 2) : (($line->pa_ht == 0) ? '' : price($line->marge_tx))); // if credit note, dont allow to modify margin if ($line->subprice < 0) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } $coldisplay++; } @@ -313,9 +321,9 @@ $coldisplay++; $mark_rate = (GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); // if credit note, dont allow to modify margin if ($line->subprice < 0) { - echo ''; + echo ''; } else { - echo ''; + echo ''; } $coldisplay++; } diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 6d8238cd885..7fe63613ea1 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -49,19 +49,19 @@ print ''; // Adds a line numbering column if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { - print ''; + print ''; } // Description -print ''; +print ''; // Supplier ref if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') { - print ''; + print ''; } // VAT -print ''; // Price HT -print ''; +print ''; // Multicurrency if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { - print ''; + print ''; } if ($inputalsopricewithtax) { - print ''; + print ''; } // Qty -print ''; +print ''; // Unit if (!empty($conf->global->PRODUCT_USE_UNITS)) { - print ''; + print ''; } // Reduction short -print ''; // Fields for situation invoice if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { - print ''; - print ''; + print ''; + print ''; } // Purchase price if ($usemargins && isModEnabled('margin') && empty($user->socid)) { if (!empty($user->rights->margins->creer)) { if ($conf->global->MARGIN_TYPE == "1") { - print ''; + print ''; } else { - print ''; + print ''; } } if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { - print ''; + print ''; } if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) { - print ''; + print ''; } } // Total HT -print ''; +print ''; // Multicurrency if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) { - print ''; + print ''; } if ($outputalsopricetotalwithtax) { - print ''; + print ''; } if (isModEnabled('asset') && $object->element == 'invoice_supplier') { - print ''; + print ''; } -print ''; // No width to allow autodim +print ''; // No width to allow autodim -print ''; +print ''; -print ''; +print ''; if ($action == 'selectlines') { - print ''; } print "\n"; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 11104f61798..03e98e1147d 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -213,7 +213,7 @@ if (($line->info_bits & 2) == 2) { } // Add description in form - if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if ($line->fk_product > 0 && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { if ($line->element == 'facturedetrec') { print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start_fill || $line->date_end_fill) ? '' : '
').'
'.dol_htmlentitiesbr($line->description) : ''; } elseif ($line->element == 'invoice_supplier_det_rec') { diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index ccd7a607d3a..7c16599f039 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -203,7 +203,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers // case 'MYECMDIR_CREATE': // case 'MYECMDIR_MODIFY': - // Customer orders + // Sales orders case 'ORDER_CREATE': $resql = $this->db->query($sql); while ($resql && $obj = $this->db->fetch_array($resql)) { diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 87a054c699f..5de627a9a9a 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -473,6 +473,16 @@ if (($action == "create") || ($action == "edit")) { } $input .= ""; print $input; + + $input = " unitfrequency == "2678400") { + $input .= ' checked />'; + } else { + $input .= ' />'; + } + $input .= ""; + print $input; + print ""; print ""; @@ -664,6 +674,9 @@ if (($action == "create") || ($action == "edit")) { if ($object->unitfrequency == "604800") { print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Weeks'); } + if ($object->unitfrequency == "2678400") { + print $langs->trans('CronEach')." ".($object->frequency)." ".$langs->trans('Month'); + } print ""; print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; + // Location event + print ''; + // Other attributes $cols = 2; $objectconf = $object; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 20d7e588bf3..9bab2a7f49d 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -234,7 +234,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
'.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 167a79959f5..1bc9c12d4f6 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -413,7 +413,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
'.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -474,8 +474,15 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { } print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; + // Location event + print ''; + // Other attributes $cols = 2; $objectconf = $object; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 17173088eed..ab8c4a28cbc 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -224,6 +224,8 @@ if (empty($reshook)) { $object->size_units = GETPOST('size_units', 'int'); $object->weight_units = GETPOST('weight_units', 'int'); + $product = new Product($db); + // We will loop on each line of the original document to complete the shipping object with various info and quantity to deliver $classname = ucfirst($object->origin); $objectsrc = new $classname($db); @@ -259,7 +261,17 @@ if (empty($reshook)) { $stockLocation = "ent1".$i."_0"; $qty = "qtyl".$i; - if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { // If product need a batch number + $is_batch_or_serial=0; + if (!empty($objectsrc->lines[$i]->fk_product)) { + $resultFetch = $product->fetch($objectsrc->lines[$i]->fk_product, '', '', '', 1, 1, 1); + if ($resultFetch < 0) { + setEventMessages($product->error, $product->errors, 'errors'); + } + $is_batch_or_serial = $product->status_batch; + } + + // If product need a batch or serial number + if (isModEnabled('productbatch') && $objectsrc->lines[$i]->product_tobatch) { if (GETPOSTISSET($batch)) { //shipment line with batch-enable product $qty .= '_'.$j; @@ -274,6 +286,12 @@ if (empty($reshook)) { //var_dump($sub_qty[$j]['q']); //var_dump($sub_qty[$j]['id_batch']); + //var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']); + if ($is_batch_or_serial==2 && $sub_qty[$j]['q']>1) { + setEventMessages($langs->trans("TooManyQtyForSerialNumber", $product->ref, ''), null, 'errors'); + $totalqty=0; + break 2; + } $j++; $batch = "batchl".$i."_".$j; $qty = "qtyl".$i.'_'.$j; @@ -328,7 +346,6 @@ if (empty($reshook)) { } //var_dump($batch_line[2]); - if ($totalqty > 0 && !$error) { // There is at least one thing to ship and no error for ($i = 0; $i < $num; $i++) { $qty = "qtyl".$i; @@ -1143,7 +1160,7 @@ if ($action == 'create') { $product_static->status_buy = $line->product_tobuy; $product_static->status_batch = $line->product_tobatch; - $showdescinproductdesc = (getDolGlobalString('PRODUIT_DESC_IN_FORM') == 2 ? 1 : 0); + $showdescinproductdesc = getDolGlobalString('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE'); $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); @@ -1742,39 +1759,25 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if (0) { // Do not change on shipment + $morehtmlref .= '
'; + if (0) { // Do not change on shipment + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } @@ -2202,10 +2205,10 @@ if ($action == 'create') { $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : '', !empty($lines[$i]->date_end) ? $lines[$i]->date_end : ''); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->description) && $lines[$i]->description != $lines[$i]->product) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; } print "\n"; diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 4c540adcd9e..48822121fa3 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -148,39 +148,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if (0) { // Do not change on shipment + $morehtmlref .= '
'; + if (0) { // Do not change on shipment + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->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/expedition/document.php b/htdocs/expedition/document.php index 71e325677e6..517c1cea8d2 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -66,8 +66,26 @@ if (!$sortfield) { $object = new Expedition($db); -if ($object->fetch($id, $ref)) { +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); $object->fetch_thirdparty(); + + if (!empty($object->origin)) { + $typeobject = $object->origin; + $origin = $object->origin; + $object->fetch_origin(); + } + + // Linked documents + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + $objectsrc = new Commande($db); + $objectsrc->fetch($object->$typeobject->id); + } + if ($typeobject == 'propal' && $object->$typeobject->id && isModEnabled("propal")) { + $objectsrc = new Propal($db); + $objectsrc->fetch($object->$typeobject->id); + } + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); } @@ -118,43 +136,29 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if (0) { // Do not change on shipment + $morehtmlref .= '
'; + if (0) { // Do not change on shipment + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->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/expedition/note.php b/htdocs/expedition/note.php index d23bb0298ea..4401af0b20c 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -109,39 +109,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefCustomer", '', $object->ref_customer, $object, $user->rights->expedition->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if (0) { // Do not change on shipment + $morehtmlref .= '
'; + if (0) { // Do not change on shipment + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->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/expedition/shipment.php b/htdocs/expedition/shipment.php index 769642d305a..9394269a03a 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -283,39 +283,28 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); + $morehtmlref .= '
'.$soc->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($user->rights->commande->creer) { + $morehtmlref .= '
'; + if (0) { // Do not change on shipment + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - if (!empty($object->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $proj->fetch($objectsrc->fk_project); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } @@ -733,7 +722,7 @@ if ($id > 0 || !empty($ref)) { $text = $product_static->getNomUrl(1); $text .= ' - '.$label; - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($objp->description)).'
'; + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)).'
'; $description .= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80); print $form->textwithtooltip($text, $description, 3, '', '', $i); @@ -741,7 +730,7 @@ if ($id > 0 || !empty($ref)) { print_date_range($db->jdate($objp->date_start), $db->jdate($objp->date_end)); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print ($objp->description && $objp->description != $objp->product_label) ? '
'.dol_htmlentitiesbr($objp->description) : ''; } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index bb4f41861ec..4bb9bf378ee 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1694,44 +1694,6 @@ if ($action == 'create') { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (isModEnabled('project')) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->commande->creer) - { - if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ $morehtmlref .= '
'; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index cef3f737c53..89205de02d5 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1159,7 +1159,7 @@ if ($action == 'create') { $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', 0, 1); $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'customer'); // Project if (isModEnabled('project')) { $langs->load("projects"); @@ -1713,6 +1713,19 @@ if ($action == 'create') { $linktoelem = $form->showLinkToObjectBlock($object, null, array('fichinter')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + // Show direct download link + if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) { + print '
'."\n"; + print showDirectDownloadLink($object).'
'; + } + + // Show online signature link + if ($object->statut != Fichinter::STATUS_DRAFT && !empty($conf->global->FICHINTER_ALLOW_ONLINE_SIGN)) { + print '
'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; + + print showOnlineSignatureUrl('fichinter', $object->ref).'
'; + } print '
'; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7a5f3bc73ad..e36598d04bc 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -442,7 +442,7 @@ class Fichinter extends CommonObject $sql .= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,"; $sql .= " f.date_valid as datev,"; $sql .= " f.tms as datem,"; - $sql .= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat, f.entity as entity"; + $sql .= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.last_main_doc, f.extraparams, fk_contrat, f.entity as entity"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if ($ref) { $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; @@ -482,6 +482,8 @@ class Fichinter extends CommonObject $this->extraparams = (array) json_decode($obj->extraparams, true); + $this->last_main_doc = $obj->last_main_doc; + if ($this->statut == 0) { $this->brouillon = 1; } diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 731442695d2..174196a23a5 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -126,8 +126,8 @@ $arrayfields = array( 'f.description'=>array('label'=>'Description', 'checked'=>1), 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>'DateModificationShort', 'checked'=>0, 'position'=>500), - 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), - 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), + 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES'))), + 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES'))), 'f.fk_statut'=>array('label'=>'Status', 'checked'=>1, 'position'=>1000), 'fd.description'=>array('label'=>"DescriptionOfLine", 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), 'fd.date'=>array('label'=>'DateOfLine', 'checked'=>1, 'enabled'=>empty($conf->global->FICHINTER_DISABLE_DETAILS) ? 1 : 0), @@ -328,7 +328,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); /* The fast and low memory method to get and count full list converts the sql into a sql count */ - /*$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + /*$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index ccd85e47810..54c7885e080 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -311,9 +311,6 @@ define('MAIN_DB_PREFIX', $dolibarr_main_db_prefix); * To use other version than embeded libraries, define here constant to path. Use '' to use include class path autodetect. */ // Path to root libraries -if (!defined('ADODB_PATH')) { - define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/adodbtime/' : (empty($dolibarr_lib_ADODB_PATH) ? '' : $dolibarr_lib_ADODB_PATH.'/')); -} if (!defined('TCPDF_PATH')) { define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH)) ?DOL_DOCUMENT_ROOT.'/includes/tecnickcom/tcpdf/' : $dolibarr_lib_TCPDF_PATH.'/'); } @@ -354,10 +351,6 @@ if (!defined('DOL_DEFAULT_TTF_BOLD')) { * Include functions */ -if (!defined('ADODB_DATE_VERSION')) { - include_once ADODB_PATH.'adodb-time.inc.php'; -} - // If password is encoded, we decode it. Note: When page is called for install, $dolibarr_main_db_pass may not be defined yet. if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) { if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 770276e96b8..3e58ceddfce 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1398,7 +1398,7 @@ class CommandeFournisseur extends CommonOrder $sql .= ", '".$this->db->escape($this->ref_supplier)."'"; $sql .= ", '".$this->db->escape($this->note_private)."'"; $sql .= ", '".$this->db->escape($this->note_public)."'"; - $sql .= ", ".((int) $conf->entity); + $sql .= ", ".setEntity($this); $sql .= ", ".((int) $this->socid); $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : "null"); $sql .= ", '".$this->db->idate($date)."'"; @@ -1832,7 +1832,7 @@ class CommandeFournisseur extends CommonOrder // If we want a dedicated supplier price, we must provide $fk_prod_fourn_price. $result = $prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', (isset($this->fk_soc) ? $this->fk_soc : $this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc - // If supplier order created from customer order, we take best supplier price + // If supplier order created from sales order, we take best supplier price // If $pu (defined previously from pu_ht or pu_ttc) is not defined at all, we also take the best supplier price if ($result > 0 && ($origin == 'commande' || $pu === '')) { $pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice @@ -2608,11 +2608,11 @@ class CommandeFournisseur extends CommonOrder } /** - * Update a supplier order from a customer order + * Update a supplier order from a sales order * * @param User $user User that create - * @param int $idc Id of supplier order to update - * @param int $comclientid Id of customer order to use as template + * @param int $idc Id of purchase order to update + * @param int $comclientid Id of sale order to use as template * @return int <0 if KO, >0 if OK */ public function updateFromCommandeClient($user, $idc, $comclientid) @@ -3187,26 +3187,28 @@ class CommandeFournisseur extends CommonOrder * @param int $hidedesc Hide description * @param int $hideref Hide ref * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK + * @return int < 0 if KO, 0 = no doc generated, > 0 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { global $conf, $langs; - $langs->load("suppliers"); - $outputlangs->load("products"); - if (!dol_strlen($modele)) { - $modele = ''; - if ($this->model_pdf) { + $modele = ''; // No doc template/generation by default + + if (!empty($this->model_pdf)) { $modele = $this->model_pdf; } elseif (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) { $modele = $conf->global->COMMANDE_SUPPLIER_ADDON_PDF; } } + if (empty($modele)) { return 0; } else { + $langs->load("suppliers"); + $outputlangs->load("products"); + $modelpath = "core/modules/supplier_order/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 16bc43474d8..ec923f91118 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -419,7 +419,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } @@ -506,6 +510,7 @@ class ProductFournisseur extends Product if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX."product_fournisseur_price"); } else { + $this->error = $this->db->lasterror(); $error++; } @@ -518,7 +523,11 @@ class ProductFournisseur extends Product $productfournisseurprice->array_options[$key] = $value; } $res = $productfournisseurprice->update($user); - if ($res < 0) $error++; + if ($res < 0) { + $this->error = $productfournisseurprice->error; + $this->errors = $productfournisseurprice->errors; + $error++; + } } } } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 834ef4031c0..5dbe81ca4a4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2033,9 +2033,8 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty'); + $morehtmlref .= '
'; if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && !empty($usercancreate) && $action == 'edit_thirdparty') { - $morehtmlref .= ' : '; $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; @@ -2047,7 +2046,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER) && $object->statut == CommandeFournisseur::STATUS_DRAFT) { $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty')).''; } - $morehtmlref .= ' : '.$object->thirdparty->getNomUrl(1, 'supplier'); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } @@ -2056,32 +2055,21 @@ if ($action == 'create') { // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($usercancreate) { + $morehtmlref .= '
'; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify' && $caneditproject) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 1, 1, 0, 0, '', 1, 0, 'maxwidth500'); - $morehtmlref .= ''; - $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, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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 .= ''; } } } @@ -2121,7 +2109,7 @@ if ($action == 'create') { print ''; // Relative and absolute discounts - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 92859d2eb1f..3ca1eca77bf 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -50,9 +50,12 @@ $hookmanager->initHooks(array('ordersuppliercardcontact')); $object = new CommandeFournisseur($db); +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php + /* - * Add a new contact + * Actions */ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) { @@ -100,6 +103,7 @@ if ($action == 'addcontact' && ($user->rights->fournisseur->commande->creer || $ /* * View */ + $form = new Form($db); $formcompany = new FormCompany($db); $contactstatic = new Contact($db); @@ -134,37 +138,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 1a8834941c9..41c15dabb68 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -100,6 +100,9 @@ if (!isModEnabled('stock')) { accessforbidden(); } +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php + /* * Actions @@ -541,37 +544,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 0eba3dbc601..b3dfb8b9ece 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -130,37 +130,25 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 698fead1a43..fc3918a32f3 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -84,6 +84,8 @@ if (empty($user->rights->fournisseur->commande->lire)) { // Init Hooks $hookmanager->initHooks(array('ordersuppliercardinfo')); +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* @@ -141,37 +143,25 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
'.$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->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 82e36af6943..e0434378573 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -196,8 +196,8 @@ $arrayfields = array( 'country.code_iso'=>array('label'=>"Country", 'enabled'=>1, 'position'=>49), 'typent.code'=>array('label'=>"ThirdPartyType", 'enabled'=>$checkedtypetiers, 'position'=>50), 'u.login'=>array('label'=>"AuthorRequest", 'enabled'=>1, 'position'=>51), - 'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>100), - 'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>110), + 'cf.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>100), + 'cf.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>110), ); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field @@ -527,7 +527,7 @@ if (empty($reshook)) { } } - $cmd->classifyBilled($user); // TODO Move this in workflow like done for customer orders + $cmd->classifyBilled($user); // TODO Move this in workflow like done for sales orders if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) { $TFactThird[$cmd->socid] = $objecttmp; diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 167c506b651..33648dd9817 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -56,6 +56,8 @@ $object->fetch($id, $ref); // Permissions $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php +$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php /* @@ -110,37 +112,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$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->fournisseur->commande->creer || $user->rights->supplier_order->creer) { - 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 .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= '
'; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $caneditproject) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 31cec906b0f..1738dd69868 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2641,7 +2641,7 @@ if ($action == 'create') { } $resteapayeraffiche = $resteapayer; - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { @@ -2873,39 +2873,28 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'supplier'); + $morehtmlref .= '
'.$object->thirdparty->getNomUrl(1, 'supplier'); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project').' '; - if ($usercancreate) { + $morehtmlref .= '
'; + if ($permissiontoadd) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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 .= ''; } } } @@ -2919,7 +2908,7 @@ if ($action == 'create') { print '
'; print '
'; - print '
'; + print ''; + + print ''; + print ''; + + print ''; print ''; // Info + print ''; print '';*/ // Nb of docs + print ''; print ''; + + print ''; print ''; // Edit link + print ''; print ''; print ''; print ''; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 99003f00276..6342e08a34e 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -165,9 +165,10 @@ class FormActions * @param int $max Max number of record * @param string $moreparambacktopage More param for the backtopage * @param string $morehtmlcenter More html text on center of title line + * @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions) * @return int <0 if KO, >=0 if OK */ - public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '') + public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0) { global $langs, $conf, $user; @@ -225,9 +226,21 @@ class FormActions $taskid = $object->id; } + $usercanaddaction = 0; + if (empty($assignedtouser) || $assignedtouser == $user->id) { + $usercanaddaction = $user->hasRight('agenda', 'myactions', 'create'); + $assignedtouser = 0; + } else { + $usercanaddaction = $user->hasRight('agenda', 'allactions', 'create'); + } + $newcardbutton = ''; - if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) { - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage); + if (isModEnabled('agenda') && $usercanaddaction) { + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')); + $url .= '&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')); + $url .= ($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : ''); + $url .= ($assignedtouser > 0 ? '&assignedtouser='.$assignedtouser : ''); + $url .= '&backtopage='.urlencode($urlbacktopage); $newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url); } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 010e03e6b3b..1b684fdc236 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -837,18 +837,27 @@ class FormFile } // Show file name with link to download + $imgpreview = $this->showPreview($file, $modulepart, $relativepath, 0, $param);; + $out .= ''; // Show file size diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index debfbbf1b8e..41cf2482f9a 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1193,7 +1193,7 @@ class FormMail extends Form $out .= "\n"; } else { $out = '\n"; } return $out; @@ -1284,7 +1284,7 @@ class FormMail extends Form * @param int $id Id of template to get, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $active 1=Only active template, 0=Only disabled, -1=All * @param string $label Label of template to get - * @return ModelMail|integer One instance of ModelMail or -1 if error + * @return ModelMail|integer One instance of ModelMail or < 0 if error */ public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '') { diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 38ec91ff143..513d964014a 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -100,7 +100,7 @@ class FormMargin $pv = $line->total_ht; $pa_ht = ($pv < 0 ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) - || ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && $conf->global->INVOICE_USE_SITUATION_CREDIT_NOTE && $object->situation_counter > 0)) { + || ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) { $pa = $line->qty * $pa_ht * ($line->situation_percent / 100); } else { $pa = $line->qty * $pa_ht; @@ -108,7 +108,7 @@ class FormMargin // calcul des marges if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise - if ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '1') { // remise globale considérée comme produit + if (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '1') { // remise globale considérée comme produit $marginInfos['pa_products'] += $pa; $marginInfos['pv_products'] += $pv; $marginInfos['pa_total'] += $pa; @@ -120,7 +120,7 @@ class FormMargin //} //else $marginInfos['margin_on_products'] += $pv - $pa; - } elseif ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '2') { // remise globale considérée comme service + } elseif (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '2') { // remise globale considérée comme service $marginInfos['pa_services'] += $pa; $marginInfos['pv_services'] += $pv; $marginInfos['pa_total'] += $pa; @@ -130,7 +130,7 @@ class FormMargin // $marginInfos['margin_on_services'] += -1 * (abs($pv) - $pa); //else $marginInfos['margin_on_services'] += $pv - $pa; - } elseif ($conf->global->MARGIN_METHODE_FOR_DISCOUNT == '3') { // remise globale prise en compte uniqt sur total + } elseif (getDolGlobalString('MARGIN_METHODE_FOR_DISCOUNT') == '3') { // remise globale prise en compte uniqt sur total $marginInfos['pa_total'] += $pa; $marginInfos['pv_total'] += $pv; } diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index aef01514eba..c57ee0c5106 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -1079,7 +1079,7 @@ class FormSetupItem $tmp = explode(':', $this->type); $template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue); - if ($template<0) { + if (is_numeric($template) && $template < 0) { $this->setErrors($formmail->errors); } $out.= $this->langs->trans($template->label); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 12b70731896..0e5e6ff9e7c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -670,23 +670,25 @@ class FormTicket /** * Return html list of tickets type * - * @param string $selected Id du type pre-selectionne - * @param string $htmlname Nom de la zone select - * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info - * @param int $maxlength Max length of label - * @param string $morecss More CSS + * @param string|array $selected Id of preselected field or array of Ids + * @param string $htmlname Nom de la zone select + * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) + * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code + * @param int $empty 1=peut etre vide, 0 sinon + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param string $morecss More CSS + * @param int $multiselect Is multiselect ? * @return void */ - public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') + public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $multiselect = 0) { global $langs, $user; + $selected = is_array($selected) ? $selected : (!empty($selected) ? array($selected) : array()); $ticketstat = new Ticket($this->db); - dol_syslog(get_class($this)."::select_types_tickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); + dol_syslog(get_class($this) . "::select_types_tickets " . implode(';', $selected) . ", " . $htmlname . ", " . $filtertype . ", " . $format . ", " . $multiselect, LOG_DEBUG); $filterarray = array(); @@ -696,7 +698,7 @@ class FormTicket $ticketstat->loadCacheTypesTickets(); - print ''; if ($empty) { print ''; } @@ -730,9 +732,9 @@ class FormTicket } // If text is selected, we compare with code, otherwise with id - if (preg_match('/[a-z]/i', $selected) && $selected == $arraytypes['code']) { + if (in_array($arraytypes['code'], $selected)) { print ' selected="selected"'; - } elseif ($selected == $id) { + } elseif (in_array($id, $selected)) { print ' selected="selected"'; } elseif ($arraytypes['use_default'] == "1" && !$selected && !$empty) { print ' selected="selected"'; @@ -1406,6 +1408,12 @@ class FormTicket $ticketstat = new Ticket($this->db); $res = $ticketstat->fetch('', '', $this->track_id); + print ''; + // Private message (not visible by customer/external user) if (!$user->socid) { print ''; } - print ''; - // Zone to select its email template if (count($modelmail_array) > 0) { print ''; @@ -1608,7 +1610,7 @@ class FormTicket print '
'; print $val['cachenbofdoc']; print ''; if ($nbofsubdir && $nboffilesinsubdir) { print '+'.$nboffilesinsubdir.' '; @@ -285,6 +290,7 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_ print ''; $userstatic->id = $val['fk_user_c']; $userstatic->lastname = $val['login_c']; @@ -412,15 +418,17 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, if (preg_match('/^'.preg_quote($val['fullrelativename'].'/', '/').'/', $preopened)) { $collapsedorexpanded = 'expanded'; } - print '
  • '; // collapsed is opposite if expanded + print '
  • '; // collapsed is opposite if expanded - print "'; // Disabled, this break the javascrip component + print '"; print dol_escape_htmltag($file); - print ""; + print ''; + //print ''; print '
    '; @@ -431,9 +439,12 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print '
  • '; print (isset($val['cachenbofdoc']) && $val['cachenbofdoc'] >= 0) ? $val['cachenbofdoc'] : ' '; print ''; if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) { print '+'.$nboffilesinsubdir.' '; @@ -441,6 +452,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, print ''; print ''; $userstatic->id = isset($val['fk_user_c']) ? $val['fk_user_c'] : 0; $userstatic->lastname = isset($val['login_c']) ? $val['login_c'] : 0; diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index a38b353519f..3a8ffda3ae6 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); $entity = GETPOST('entity', 'int'); -$value = ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1); +$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : 1); /* diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 7866b972db1..c71fed19f6d 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -314,6 +314,93 @@ if ($action == "importSignature") { // We should just create an image file with the signature. } } + } elseif ($mode == 'fichinter') { + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; + $object = new Fichinter($db); + $object->fetch(0, $ref); + + $upload_dir = !empty($conf->ficheinter->multidir_output[$object->entity])?$conf->ficheinter->multidir_output[$object->entity]:$conf->ficheinter->dir_output; + $upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/'; + $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S"); + $filename = "signatures/".$date."_signature.png"; + if (!is_dir($upload_dir."signatures/")) { + if (!dol_mkdir($upload_dir."signatures/")) { + $response ="Error mkdir. Failed to create dir ".$upload_dir."signatures/"; + $error++; + } + } + + if (!$error) { + $return = file_put_contents($upload_dir.$filename, $data); + if ($return == false) { + $error++; + $response = 'Error file_put_content: failed to create signature file.'; + } + } + + if (!$error) { + // Defined modele of doc + $last_main_doc_file = $object->last_main_doc; + $directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc + if (preg_match('/\.pdf/i', $last_main_doc_file)) { + // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile + $newpdffilename = $upload_dir.$ref."_signed-".$date.".pdf"; + $sourcefile = $upload_dir.$ref.".pdf"; + + if (dol_is_file($sourcefile)) { + // We build the new PDF + $pdf = pdf_getInstance(); + if (class_exists('TCPDF')) { + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); + } + $pdf->SetFont(pdf_getPDFFont($langs)); + + if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) { + $pdf->SetCompression(false); + } + + + //$pdf->Open(); + $pagecount = $pdf->setSourceFile($sourcefile); // original PDF + $s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297); + for ($i=1; $i<($pagecount+1); $i++) { + try { + $tppl = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tppl); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tppl); + } catch (Exception $e) { + dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR); + $response = $e->getMessage(); + $error++; + } + } + + // A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF + // TODO Get position of box from PDF template + $xforimgstart = 105; + $yforimgstart = (empty($s['h']) ? 250 : $s['h'] - 57); + $wforimg = $s['w']/1 - ($xforimgstart + 16); + $pdf->Image($upload_dir.$filename, $xforimgstart, $yforimgstart, $wforimg, round($wforimg / 4)); + //$pdf->Close(); + $pdf->Output($newpdffilename, "F"); + + // Index the new file and update the last_main_doc property of object. + $object->indexFile($newpdffilename, 1); + } + if (!$error) { + $response = "success"; + } + } elseif (preg_match('/\.odt/i', $last_main_doc_file)) { + // Adding signature on .ODT not yet supported + // TODO + } else { + // Document format not supported to insert online signature. + // We should just create an image file with the signature. + } + } } } else { $error++; diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 3aa429ee89e..0254a7502f8 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -114,6 +114,8 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) { $perm = 1; + } elseif ($table_element_line == 'contratdet' && $fk_element == 'fk_contrat' && $user->hasRight('contrat', 'creer')) { + $perm = 1; } else { $tmparray = explode('_', $table_element_line); $tmpmodule = $tmparray[0]; $tmpobject = preg_replace('/line$/', '', $tmparray[1]); @@ -152,7 +154,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) // Reorder line to have position of children lines sharing same counter than parent lines // This should be useless because there is no need to have children sharing same counter than parent, but well, it's cleaner into database. - if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande'))) { + if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande','fk_contrat'))) { $result = $row->line_order(true); } } else { diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 19f7523fd21..f2e44577260 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -21,12 +21,9 @@ * \brief This script returns content of possible search */ - // This script is called with a POST method or as an include. if (!isset($usedbyinclude) || empty($usedbyinclude)) { - top_httphead('application/json'); - if (!defined('NOTOKENRENEWAL')) { define('NOTOKENRENEWAL', 1); // Disables token renewal } @@ -45,6 +42,9 @@ if (!isset($usedbyinclude) || empty($usedbyinclude)) { } $res = @include '../../main.inc.php'; + + top_httphead('application/json'); + if ($res == 'ERROR_NOT_LOGGED') { $langs->load("other"); $arrayresult['jumptologin'] = array('img'=>'object_generic', 'label'=>$langs->trans("JumpToLogin"), 'text'=>' '.$langs->trans("JumpToLogin"), 'url'=>DOL_URL_ROOT.'/index.php'); @@ -90,7 +90,6 @@ if (((isModEnabled('product') && $user->hasRight('product', 'read')) || (isModEn if (isModEnabled('mrp') && $user->hasRight('mrp', 'read') && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) { $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } - if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->hasRight('projet', 'lire')) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index fb0a60b567f..56fa8172bcb 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes // list the summary of the propals - if (isModEnabled("propal") && $user->rights->propale->lire) { + if (isModEnabled("propal") && $user->rights->propal->lire) { include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propalstatic = new Propal($this->db); diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 6138664db2d..df8e51f348f 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -104,7 +104,6 @@ class box_birthdays_members extends ModeleBoxes $memberstatic->id = $objp->rowid; $memberstatic->firstname = $objp->firstname; $memberstatic->lastname = $objp->lastname; - $memberstatic->email = $objp->email; $dateb = $this->db->jdate($objp->birth); $age = date('Y', dol_now()) - date('Y', $dateb); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 6b8177e5ed4..3ef8a3daddf 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -62,7 +62,7 @@ class box_graph_product_distribution extends ModeleBoxes $this->hidden = !( (isModEnabled('facture') && !empty($user->rights->facture->lire)) || (isModEnabled('commande') && !empty($user->rights->commande->lire)) - || (isModEnabled('propal') && !empty($user->rights->propale->lire)) + || (isModEnabled('propal') && !empty($user->rights->propal->lire)) ); } @@ -110,7 +110,7 @@ class box_graph_product_distribution extends ModeleBoxes if (!isModEnabled('facture') || empty($user->rights->facture->lire)) { $showinvoicenb = 0; } - if (isModEnabled('propal') || empty($user->rights->propale->lire)) { + if (isModEnabled('propal') || empty($user->rights->propal->lire)) { $showpropalnb = 0; } if (!isModEnabled('commande') || empty($user->rights->commande->lire)) { @@ -152,7 +152,7 @@ class box_graph_product_distribution extends ModeleBoxes $WIDTH = ($nbofgraph >= 2 || !empty($conf->dol_optimize_smallscreen)) ? '300' : '320'; $HEIGHT = '150'; // Height require to have 5+1 entries into legend visible. - if (isModEnabled("propal") && !empty($user->rights->propale->lire)) { + if (isModEnabled("propal") && !empty($user->rights->propal->lire)) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showpropalnb) { $langs->load("propal"); @@ -365,7 +365,7 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ''; $stringtoshow .= ''; $stringtoshow .= ''; - if (isModEnabled("propal") || !empty($user->rights->propale->lire)) { + if (isModEnabled("propal") || !empty($user->rights->propal->lire)) { $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 13f3a29ec16..ff62473c969 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -56,7 +56,7 @@ class box_graph_propales_permonth extends ModeleBoxes $this->db = $db; - $this->hidden = empty($user->rights->propale->lire); + $this->hidden = empty($user->rights->propal->lire); } /** @@ -105,7 +105,7 @@ class box_graph_propales_permonth extends ModeleBoxes $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user } - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; $param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb'; $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot'; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 7114fdb5399..1a3344eedfe 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -83,7 +83,7 @@ class box_propales extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max)); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.logo, s.email, s.entity"; diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 9ec279fe2d0..3d1e640f34b 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -169,12 +169,6 @@ class box_services_contracts extends ModeleBoxes } $description = $objp->description; - // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - //$text .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; - $description = ''; // Already added into main visible desc - } - $s = $form->textwithtooltip($text, $description, 3, '', '', '', 0, (!empty($objp->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { $s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 769f74da1a1..1a29c8e1389 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -495,7 +495,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box } // We set info of modules - $widget[$j]['picto'] = $objMod->picto ? img_object('', $objMod->picto) : img_object('', 'generic'); + $widget[$j]['picto'] = (empty($objMod->picto) ? (empty($objMod->boximg) ? img_object('', 'generic') : $objMod->boximg) : img_object('', $objMod->picto)); $widget[$j]['file'] = $files[$key]; $widget[$j]['fullpath'] = $fullpath[$key]; $widget[$j]['relpath'] = $relpath[$key]; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index b3ff0aae930..ed2bcef8034 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -120,6 +120,10 @@ class CMailFile * @var array filenames list (List of attached file name in message) */ public $mimefilename_list = array(); + /** + * @var array filenames cid + */ + public $cid_list = array(); // Image public $html; @@ -159,8 +163,9 @@ class CMailFile * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'mail' and 'smtps' for the moment) * @param string $sendcontext 'standard', 'emailing', ... (used to define which sending mode and parameters to use) * @param string $replyto Reply-to email (will be set to same value than From by default if not provided) + * @param string $upload_dir_tmp Temporary directory (used to convert images embedded as img src=data:image) */ - public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '') + public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '') { global $conf, $dolibarr_main_data_root, $user; @@ -171,6 +176,8 @@ class CMailFile } } + $cid_list = array(); + $this->sendcontext = $sendcontext; // Define this->sendmode ('mail', 'smtps', 'siwftmailer', ...) according to $sendcontext ('standard', 'emailing', 'ticket') @@ -248,26 +255,41 @@ class CMailFile $findimg = 0; if (!empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS)) { + // Search into the body for ]*>/", " ", $strContent); - $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); + // TODO We could replace with [Filename.ext] like Gmail do. + $strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags $strContentAltText = trim(wordwrap($strContentAltText, 75, empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA) ? "\r\n" : "\n")); // Check if html header already in message, if not complete the message @@ -1447,9 +1470,10 @@ class CMailFile * @param array $filename_list Tableau * @param array $mimetype_list Tableau * @param array $mimefilename_list Tableau - * @return string Chaine fichiers encodes + * @param array $cidlist Array of CID if file must be completed with CID code + * @return string String with files encoded */ - public function write_files($filename_list, $mimetype_list, $mimefilename_list) + private function write_files($filename_list, $mimetype_list, $mimefilename_list, $cidlist) { // phpcs:enable $out = ''; @@ -1472,6 +1496,10 @@ class CMailFile $out .= "Content-Type: ".$mimetype_list[$i]."; name=\"".$filename_list[$i]."\"".$this->eol; $out .= "Content-Transfer-Encoding: base64".$this->eol; $out .= "Content-Description: ".$filename_list[$i].$this->eol; + if (!empty($cidlist) && is_array($cidlist) && $cidlist[$i]) { + $out .= "X-Attachment-Id: ".$cidlist[$i].$this->eol; + $out .= "Content-ID: <".$cidlist[$i].'>'.$this->eol; + } $out .= $this->eol; $out .= $encoded; $out .= $this->eol; @@ -1628,41 +1656,46 @@ class CMailFile /** * Seearch images into html message and init array this->images_encoded if found * - * @param string $images_dir Location of physical images files + * @param string $images_dir Location of physical images files. For example $dolibarr_main_data_root.'/medias' * @return int >0 if OK, <0 if KO */ - public function findHtmlImages($images_dir) + private function findHtmlImages($images_dir) { - // Build the list of image extensions + // Build the array of image extensions $extensions = array_keys($this->image_types); + // We search (into mail body this->html), if we find some strings like "... file=xxx.img" + // For example when: + // $matches = array(); preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found if (!empty($matches)) { $i = 0; + // We are interested in $matches[1] only (the second set of parenthesis into regex) foreach ($matches[1] as $full) { + $regs = array(); if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i', $full, $regs)) { // If xxx is 'file=aaa' $img = $regs[1]; if (file_exists($images_dir.'/'.$img)) { // Image path in src $src = preg_quote($full, '/'); - // Image full path $this->html_images[$i]["fullpath"] = $images_dir.'/'.$img; - // Image name $this->html_images[$i]["name"] = $img; - // Content type - if (preg_match('/^.+\.(\w{3,4})$/', $img, $reg)) { - $ext = strtolower($reg[1]); + $regext = array(); + if (preg_match('/^.+\.(\w{3,4})$/', $img, $regext)) { + $ext = strtolower($regext[1]); $this->html_images[$i]["content_type"] = $this->image_types[$ext]; } - // cid $this->html_images[$i]["cid"] = dol_hash(uniqid(time()), 3); // Force md5 hash (does not contains special chars) + // type + $this->html_images[$i]["type"] = 'cidfromurl'; + $this->html = preg_replace("/src=\"$src\"|src='$src'/i", "src=\"cid:".$this->html_images[$i]["cid"]."\"", $this->html); } $i++; @@ -1682,6 +1715,7 @@ class CMailFile // Read image file if ($image = file_get_contents($fullpath)) { // On garde que le nom de l'image + $regs = array(); preg_match('/([A-Za-z0-9_-]+[\.]?[A-Za-z0-9]+)?$/i', $img["name"], $regs); $imgName = $regs[1]; @@ -1706,6 +1740,85 @@ class CMailFile } } + /** + * Seearch images with data:image format into html message + * + * @param string $images_dir Location of where to store physicaly images files. For example $dolibarr_main_data_root.'/medias' + * @return int >0 if OK, <0 if KO + */ + private function findHtmlImagesIsSrcData($images_dir) + { + global $conf; + + // Build the array of image extensions + $extensions = array_keys($this->image_types); + + if ($images_dir && !dol_is_dir($images_dir)) { + dol_mkdir($images_dir, DOL_DATA_ROOT); + } + + // Uncomment this for debug + /* + global $dolibarr_main_data_root; + $outputfile = $dolibarr_main_data_root."/dolibarr_mail.log"; + $fp = fopen($outputfile, "w"); + fwrite($fp, $this->html); + fclose($fp); + */ + + // We search (into mail body this->html), if we find some strings like "... file=xxx.img" + // For example when: + // + $matches = array(); + preg_match_all('/src="data:image\/('.implode('|', $extensions).');base64,([^"]+)"/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found + + if (!empty($matches) && !empty($matches[1])) { + if (empty($images_dir)) { + // No temp directory provided, so we are not able to support convertion of data:image into physical images. + $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; + return -1; + } + + $i = 0; + foreach ($matches[1] as $key => $ext) { + // We save the image to send in disk + $filecontent = $matches[2][$key]; + $cid = dol_hash(uniqid(time()), 3); + $destfiletmp = $images_dir.'/'.$cid.'.'.$ext; + + $fhandle = @fopen($destfiletmp, 'w'); + if ($fhandle) { + $nbofbyteswrote = fwrite($fhandle, base64_decode($filecontent)); + fclose($fhandle); + @chmod($destfiletmp, octdec($conf->global->MAIN_UMASK)); + } else { + $this->errors[] = "Failed to open file '".$destfiletmp."' for write"; + return -1; + } + + if (file_exists($destfiletmp)) { + // Image full path + $this->html_images[$i]["fullpath"] = $destfiletmp; + // Image name + $this->html_images[$i]["name"] = basename($destfiletmp); + // Content type + $this->html_images[$i]["content_type"] = $this->image_types[strtolower($ext)]; + // cid + $this->html_images[$i]["cid"] = $cid; + // type + $this->html_images[$i]["type"] = 'cidfromdata'; + + $this->html = preg_replace('/src="data:image\/'.$ext.';base64,'.preg_quote($filecontent, '/').'"/', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html); + } + $i++; + } + + return 1; + } else { + return 0; + } + } + /** * Return a formatted address string for SMTP protocol * diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index d0b64fdca77..82012400f68 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -950,7 +950,7 @@ abstract class CommonDocGenerator } } - if (array_key_exists('option_'.$key, $object->array_options)) { + if (array_key_exists('options_'.$key, $object->array_options)) { $array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); } else { $array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => '')); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 41dec1e8fb7..2d63347c029 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -175,7 +175,7 @@ abstract class CommonInvoice extends CommonObject /** * Return amount (with tax) of all deposits invoices used by invoice. * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended), - * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). + * of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended). * * @param int $multicurrency Return multicurrency_amount instead of amount * @return float <0 and set ->error if KO, Sum of deposits amount otherwise @@ -183,7 +183,7 @@ abstract class CommonInvoice extends CommonObject public function getSumDepositsUsed($multicurrency = 0) { /*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') { - // FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. + // FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case. return 0.0; }*/ @@ -379,7 +379,7 @@ abstract class CommonInvoice extends CommonObject $sql = "SELECT rc.amount_ttc as amount, rc.multicurrency_amount_ttc as multicurrency_amount, rc.datec as date, f.ref as ref, rc.description as type"; $sql .= ' FROM '.$this->db->prefix().'societe_remise_except as rc, '.$this->db->prefix().'facture_fourn as f'; $sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.((int) $this->id); - $sql .= ' AND (f.type = 2 OR f.type = 0 OR f.type = 3)'; // Find discount coming from credit note or excess received or deposits (payments from deposits are always null except if FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is set) + $sql .= ' AND (f.type = 2 OR f.type = 0 OR f.type = 3)'; // Find discount coming from credit note or excess received or deposits (payments from deposits are always null except if FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is set) } if ($sql) { @@ -848,20 +848,18 @@ abstract class CommonInvoice extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Create a withdrawal request for a direct debit order or a credit transfer order. * Use the remain to pay excluding all existing open direct debit requests. * * @param User $fuser User asking the direct debit transfer - * @param float $amount Amount we request direct debit for + * @param int $did ID of payment request * @param string $type 'direct-debit' or 'bank-transfer' * @param string $sourcetype Source ('facture' or 'supplier_invoice') * @return int <0 if KO, >0 if OK */ - public function demande_prelevement_stripe($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture') + public function makeStripeSepaRequest($fuser, $did = 0, $type = 'direct-debit', $sourcetype = 'facture') { - // phpcs:enable global $conf, $mysoc, $user, $langs; if (empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { @@ -871,753 +869,755 @@ abstract class CommonInvoice extends CommonObject $error = 0; - dol_syslog(get_class($this)."::demande_prelevement_stripe 0", LOG_DEBUG); + dol_syslog(get_class($this)."::makeStripeSepaRequest 0", LOG_DEBUG); if ($this->statut > self::STATUS_DRAFT && $this->paye == 0) { require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; $bac = new CompanyBankAccount($this->db); - $bac->fetch(0, $this->socid); + $result = $bac->fetch(0, $this->socid, 1, 'ban'); + if ($result <= 0 || empty($bac->id)) { + $this->error = $langs->trans("ThirdpartyHasNoDefaultBanAccount"); + $this->errors[] = $this->error; + dol_syslog(get_class($this)."::makeStripeSepaRequest ".$this->error); + return -1; + } - $sql = "SELECT count(*)"; + $sql = "SELECT rowid, date_demande, amount, fk_facture, fk_facture_fourn"; $sql .= " FROM ".$this->db->prefix()."prelevement_facture_demande"; - $sql .= " WHERE fk_facture = ".((int) $this->id); - $sql .= " AND ext_payment_id IS NULL"; // To exclude record done for some online payments - $sql .= " AND traite = 0"; + $sql .= " WHERE rowid = ".((int) $did); - dol_syslog(get_class($this)."::demande_prelevement_stripe 1", LOG_DEBUG); + dol_syslog(get_class($this)."::makeStripeSepaRequest 1", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $row = $this->db->fetch_row($resql); + $obj = $this->db->fetch_object($resql); + if (!$obj) { + dol_print_error($this->db, 'CantFindRequestWithId'); + return -2; + } - if ($row[0] == 0) { - $now = dol_now(); + // + $amount = $obj->amount; - $totalpaye = $this->getSommePaiement(); - $totalcreditnotes = $this->getSumCreditNotesUsed(); - $totaldeposits = $this->getSumDepositsUsed(); - //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits; + $now = dol_now(); - // We can also use bcadd to avoid pb with floating points - // For example print 239.2 - 229.3 - 9.9; does not return 0. - //$resteapayer=bcadd($this->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); - //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); - if (empty($amount)) { - $amount = price2num($this->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + $totalpaye = $this->getSommePaiement(); + $totalcreditnotes = $this->getSumCreditNotesUsed(); + $totaldeposits = $this->getSumDepositsUsed(); + //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits; + + // We can also use bcadd to avoid pb with floating points + // For example print 239.2 - 229.3 - 9.9; does not return 0. + //$resteapayer=bcadd($this->total_ttc,$totalpaye,$conf->global->MAIN_MAX_DECIMALS_TOT); + //$resteapayer=bcadd($resteapayer,$totalavoir,$conf->global->MAIN_MAX_DECIMALS_TOT); + $amounttocheck = price2num($this->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT'); + + // TODO We can compare $amount and $amounttocheck + + if (is_numeric($amount) && $amount != 0) { + require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; + $companypaymentmode = new CompanyPaymentMode($this->db); + $companypaymentmode->fetch($bac->id); + + // Start code for Stripe + $service = 'StripeTest'; + $servicestatus = 0; + if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { + $service = 'StripeLive'; + $servicestatus = 1; } - if (is_numeric($amount) && $amount != 0) { - require_once DOL_DOCUMENT_ROOT.'/societe/class/companypaymentmode.class.php'; - $companypaymentmode = new CompanyPaymentMode($this->db); - $companypaymentmode->fetch($bac->id); + dol_syslog("makeStripeSepaRequest amount = ".$amount." service=" . $service . " servicestatus=" . $servicestatus . " thirdparty_id=" . $this->socid . " companypaymentmode=" . $companypaymentmode->id); - dol_syslog(get_class($this)."::demande_prelevement_stripe amount=$amount, companypaymentmode = " . $companypaymentmode->id, LOG_DEBUG); + $this->stripechargedone = 0; + $this->stripechargeerror = 0; + $now = dol_now(); - //Start code from sellyoursaas - $service = 'StripeTest'; - $servicestatus = 0; - if (!empty($conf->global->STRIPE_LIVE) && !GETPOST('forcesandbox', 'alpha')) { - $service = 'StripeLive'; - $servicestatus = 1; - } + $currency = $conf->currency; - $langs->load("agenda"); - dol_syslog("doTakePaymentStripeForThirdparty service=" . $service . " servicestatus=" . $servicestatus . " thirdparty_id=" . $this->socid . " companypaymentmode=" . $companypaymentmode->id . " noemailtocustomeriferror=" . $noemailtocustomeriferror . " nocancelifpaymenterror=" . $nocancelifpaymenterror . " calledinmyaccountcontext=" . $calledinmyaccountcontext); + global $stripearrayofkeysbyenv; + global $savstripearrayofkeysbyenv; - $this->stripechargedone = 0; - $this->stripechargeerror = 0; - $now = dol_now(); + $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop - $currency = $conf->currency; + $this->fetch_thirdparty(); - global $stripearrayofkeysbyenv; - global $savstripearrayofkeysbyenv; + dol_syslog("--- Process invoice thirdparty_id=" . $this->id . ", thirdparty_name=" . $this->thirdparty->name . " id=" . $this->id . ", ref=" . $this->ref . ", datef=" . dol_print_date($this->date, 'dayhourlog'), LOG_DEBUG); - $errorforinvoice = 0; // We reset the $errorforinvoice at each invoice loop + $alreadypayed = $this->getSommePaiement(); + $amount_credit_notes_included = $this->getSumCreditNotesUsed(); + $amounttopay = $this->total_ttc - $alreadypayed - $amount_credit_notes_included; - $this->fetch_thirdparty(); + // Correct the amount according to unit of currency + // See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support + $arrayzerounitcurrency = ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']; + $amountstripe = $amounttopay; + if (!in_array($currency, $arrayzerounitcurrency)) { + $amountstripe = $amountstripe * 100; + } - dol_syslog("--- Process invoice thirdparty_id=" . $this->id . ", thirdparty_name=" . $this->thirdparty->name . " id=" . $this->id . ", ref=" . $this->ref . ", datef=" . dol_print_date($this->date, 'dayhourlog'), LOG_DEBUG); + if ($amountstripe > 0) { + try { + //var_dump($companypaymentmode); + dol_syslog("We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG); - $alreadypayed = $this->getSommePaiement(); - $amount_credit_notes_included = $this->getSumCreditNotesUsed(); - $amounttopay = $this->total_ttc - $alreadypayed - $amount_credit_notes_included; + $thirdparty = new Societe($this->db); + $resultthirdparty = $thirdparty->fetch($this->socid); - // Correct the amount according to unit of currency - // See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support - $arrayzerounitcurrency = ['BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF']; - $amountstripe = $amounttopay; - if (!in_array($currency, $arrayzerounitcurrency)) { - $amountstripe = $amountstripe * 100; - } + include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php + // So it inits or erases the $stripearrayofkeysbyenv + $stripe = new Stripe($this->db); - if ($amountstripe > 0) { - try { - //var_dump($companypaymentmode); - dol_syslog("We will try to pay with companypaymentmodeid=" . $companypaymentmode->id . " stripe_card_ref=" . $companypaymentmode->stripe_card_ref . " mode=" . $companypaymentmode->status, LOG_DEBUG); + if (empty($savstripearrayofkeysbyenv)) { + $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; + } + dol_syslog("makeStripeSepaRequest Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); + dol_syslog("makeStripeSepaRequest Current Saved Stripe environment is " . $savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); - $thirdparty = new Societe($this->db); - $resultthirdparty = $thirdparty->fetch($this->socid); + $foundalternativestripeaccount = ''; - include_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php'; // This include the include of htdocs/stripe/config.php - // So it inits or erases the $stripearrayofkeysbyenv - $stripe = new Stripe($this->db); + // Force stripe to another value (by default this value is empty) + if (!empty($thirdparty->array_options['options_stripeaccount'])) { + dol_syslog("makeStripeSepaRequest The thirdparty id=" . $thirdparty->id . " has a dedicated Stripe Account, so we switch to it."); - if (empty($savstripearrayofkeysbyenv)) { - $savstripearrayofkeysbyenv = $stripearrayofkeysbyenv; - } - dol_syslog("Current Stripe environment is " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']); - dol_syslog("Current Saved Stripe environment is " . $savstripearrayofkeysbyenv[$servicestatus]['publishable_key']); + $tmparray = explode('@', $thirdparty->array_options['options_stripeaccount']); + if (!empty($tmparray[1])) { + $tmparray2 = explode(':', $tmparray[1]); + if (!empty($tmparray2[3])) { + $stripearrayofkeysbyenv = [ + 0 => [ + "publishable_key" => $tmparray2[0], + "secret_key" => $tmparray2[1] + ], + 1 => [ + "publishable_key" => $tmparray2[2], + "secret_key" => $tmparray2[3] + ] + ]; - $foundalternativestripeaccount = ''; - - // Force stripe to another value (by default this value is empty) - if (!empty($thirdparty->array_options['options_stripeaccount'])) { - dol_syslog("The thirdparty id=" . $thirdparty->id . " has a dedicated Stripe Account, so we switch to it."); - - $tmparray = explode('@', $thirdparty->array_options['options_stripeaccount']); - if (!empty($tmparray[1])) { - $tmparray2 = explode(':', $tmparray[1]); - if (!empty($tmparray2[3])) { - $stripearrayofkeysbyenv = [ - 0 => [ - "publishable_key" => $tmparray2[0], - "secret_key" => $tmparray2[1] - ], - 1 => [ - "publishable_key" => $tmparray2[2], - "secret_key" => $tmparray2[3] - ] - ]; - - $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus]; - \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); - - $foundalternativestripeaccount = $tmparray[0]; // Store the customer id - - dol_syslog("We use now customer=" . $foundalternativestripeaccount . " publishable_key=" . $stripearrayofkeys['publishable_key'], LOG_DEBUG); - } - } - - if (!$foundalternativestripeaccount) { - $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; - - $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; + $stripearrayofkeys = $stripearrayofkeysbyenv[$servicestatus]; \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); - dol_syslog("We found a bad value for Stripe Account for thirdparty id=" . $thirdparty->id . ", so we ignore it and keep using the global one, so " . $stripearrayofkeys['publishable_key'], LOG_WARNING); + + $foundalternativestripeaccount = $tmparray[0]; // Store the customer id + + dol_syslog("We use now customer=" . $foundalternativestripeaccount . " publishable_key=" . $stripearrayofkeys['publishable_key'], LOG_DEBUG); } - } else { + } + + if (!$foundalternativestripeaccount) { $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); - dol_syslog("The thirdparty id=" . $thirdparty->id . " has no dedicated Stripe Account, so we use global one, so " . json_encode($stripearrayofkeys), LOG_DEBUG); + dol_syslog("We found a bad value for Stripe Account for thirdparty id=" . $thirdparty->id . ", so we ignore it and keep using the global one, so " . $stripearrayofkeys['publishable_key'], LOG_WARNING); } + } else { + $stripearrayofkeysbyenv = $savstripearrayofkeysbyenv; + + $stripearrayofkeys = $savstripearrayofkeysbyenv[$servicestatus]; + \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); + dol_syslog("The thirdparty id=" . $thirdparty->id . " has no dedicated Stripe Account, so we use global one, so " . json_encode($stripearrayofkeys), LOG_DEBUG); + } - dol_syslog("get stripe account", LOG_DEBUG); - $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) - dol_syslog("get stripe account return " . json_encode($stripeacc), LOG_DEBUG); + dol_syslog("makeStripeSepaRequest get stripe account", LOG_DEBUG); + $stripeacc = $stripe->getStripeAccount($service, $this->socid); // Get Stripe OAuth connect account if it exists (no network access here) + dol_syslog("makeStripeSepaRequest get stripe account return " . json_encode($stripeacc), LOG_DEBUG); - if ($foundalternativestripeaccount) { - if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources']); - } else { - $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources'], ["stripe_account" => $stripeacc]); - } + if ($foundalternativestripeaccount) { + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources']); } else { - $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); - if (empty($customer) && !empty($stripe->error)) { - $this->errors[] = $stripe->error; - } - /*if (!empty($customer) && empty($customer->sources)) { - $customer = null; - $this->errors[] = '\Stripe\Customer::retrieve did not returned the sources'; - }*/ + $customer = \Stripe\Customer::retrieve(['id' => "$foundalternativestripeaccount", 'expand[]' => 'sources'], ["stripe_account" => $stripeacc]); + } + } else { + $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); + if (empty($customer) && !empty($stripe->error)) { + $this->errors[] = $stripe->error; + } + /*if (!empty($customer) && empty($customer->sources)) { + $customer = null; + $this->errors[] = '\Stripe\Customer::retrieve did not returned the sources'; + }*/ + } + + // $nbhoursbetweentries = (empty($conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES) ? 49 : $conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES); // Must have more that 48 hours + 1 between each try (so 1 try every 3 daily batch) + // $nbdaysbeforeendoftries = (empty($conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES) ? 35 : $conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES); + $labeltouse = ''; + $postactionmessages = []; + + if ($resultthirdparty > 0 && !empty($customer)) { + if (!$error && !empty($this->array_options['options_delayautopayment']) && $this->array_options['options_delayautopayment'] > $now && empty($calledinmyaccountcontext)) { + $errmsg = 'Payment try was canceled (invoice qualified by the automatic payment was delayed after the ' . dol_print_date($this->array_options['options_delayautopayment'], 'day') . ')'; + dol_syslog($errmsg, LOG_DEBUG); + + $error++; + $errorforinvoice++; + $this->errors[] = $errmsg; } - // $nbhoursbetweentries = (empty($conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES) ? 49 : $conf->global->SELLYOURSAAS_NBHOURSBETWEENTRIES); // Must have more that 48 hours + 1 between each try (so 1 try every 3 daily batch) - // $nbdaysbeforeendoftries = (empty($conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES) ? 35 : $conf->global->SELLYOURSAAS_NBDAYSBEFOREENDOFTRIES); - $labeltouse = ''; - $postactionmessages = []; - - if ($resultthirdparty > 0 && !empty($customer)) { - if (!$error && !empty($this->array_options['options_delayautopayment']) && $this->array_options['options_delayautopayment'] > $now && empty($calledinmyaccountcontext)) { - $errmsg = 'Payment try was canceled (invoice qualified by the automatic payment was delayed after the ' . dol_print_date($this->array_options['options_delayautopayment'], 'day') . ')'; - dol_syslog($errmsg, LOG_DEBUG); - - $error++; - $errorforinvoice++; - $this->errors[] = $errmsg; + if (!$error) { // Payment was not canceled + //erics card or sepa ? + $sepaMode = false; + if ($companypaymentmode->type == 'ban') { + $sepaMode = true; + $stripecard = $stripe->sepaStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); + } else { + $stripecard = $stripe->cardStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); } - if (!$error) { // Payment was not canceled - //erics card or sepa ? - $sepaMode = false; - if ($companypaymentmode->type == 'ban') { - $sepaMode = true; - $stripecard = $stripe->sepaStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); - } else { - $stripecard = $stripe->cardStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); - } + if ($stripecard) { // Can be card_... (old mode) or pm_... (new mode) + $FULLTAG = 'INV=' . $this->id . '-CUS=' . $thirdparty->id; + $description = 'Stripe payment from doTakePaymentStripeForThirdparty: ' . $FULLTAG . ' ref=' . $this->ref; - if ($stripecard) { // Can be card_... (old mode) or pm_... (new mode) - $FULLTAG = 'INV=' . $this->id . '-CUS=' . $thirdparty->id; - $description = 'Stripe payment from doTakePaymentStripeForThirdparty: ' . $FULLTAG . ' ref=' . $this->ref; + $stripefailurecode = ''; + $stripefailuremessage = ''; + $stripefailuredeclinecode = ''; - $stripefailurecode = ''; - $stripefailuremessage = ''; - $stripefailuredeclinecode = ''; + if (preg_match('/^card_/', $stripecard->id)) { // Using old method + dol_syslog("* Create charge on card " . $stripecard->id . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); - if (preg_match('/^card_/', $stripecard->id)) { // Using old method - dol_syslog("* Create charge on card " . $stripecard->id . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); + $ipaddress = getUserRemoteIP(); - $ipaddress = getUserRemoteIP(); + $charge = null; // Force reset of $charge, so, if already set from a previous fetch, it will be empty even if there is an exception at next step + try { + $charge = \Stripe\Charge::create([ + 'amount' => price2num($amountstripe, 'MU'), + 'currency' => $currency, + 'capture' => true, // Charge immediatly + 'description' => $description, + 'metadata' => ["FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress], + 'customer' => $customer->id, + //'customer' => 'bidon_to_force_error', // To use to force a stripe error + 'source' => $stripecard, + 'statement_descriptor' => dol_trunc('INV=' . $this->id, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) + ]); + } catch (\Stripe\Error\Card $e) { + // Since it's a decline, Stripe_CardError will be caught + $body = $e->getJsonBody(); + $err = $body['error']; - $charge = null; // Force reset of $charge, so, if already set from a previous fetch, it will be empty even if there is an exception at next step - try { - $charge = \Stripe\Charge::create([ - 'amount' => price2num($amountstripe, 'MU'), - 'currency' => $currency, - 'capture' => true, // Charge immediatly - 'description' => $description, - 'metadata' => ["FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name, 'dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress], - 'customer' => $customer->id, - //'customer' => 'bidon_to_force_error', // To use to force a stripe error - 'source' => $stripecard, - 'statement_descriptor' => dol_trunc('INV=' . $this->id, 10, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt (company + description) - ]); - } catch (\Stripe\Error\Card $e) { - // Since it's a decline, Stripe_CardError will be caught - $body = $e->getJsonBody(); - $err = $body['error']; - - $stripefailurecode = $err['code']; - $stripefailuremessage = $err['message']; - $stripefailuredeclinecode = $err['decline_code']; - } catch (Exception $e) { - $stripefailurecode = 'UnknownChargeError'; - $stripefailuremessage = $e->getMessage(); - } - } else { // Using new SCA method - if ($sepaMode) { - dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); - } else { - dol_syslog("* Create payment on card " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); - } - - // Create payment intent and charge payment (confirmnow = true) - $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1); - - $charge = new stdClass(); - //erics add processing sepa is like success ? - if ($paymentintent->status === 'succeeded' || $paymentintent->status === 'processing') { - $charge->status = 'ok'; - $charge->id = $paymentintent->id; - $charge->customer = $customer->id; - } elseif ($paymentintent->status === 'requires_action') { - //paymentintent->status may be => 'requires_action' (no error in such a case) - dol_syslog(var_export($paymentintent, true), LOG_DEBUG); - - $charge->status = 'failed'; - $charge->customer = $customer->id; - $charge->failure_code = $stripe->code; - $charge->failure_message = $stripe->error; - $charge->failure_declinecode = $stripe->declinecode; - $stripefailurecode = $stripe->code; - $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; - $stripefailuredeclinecode = $stripe->declinecode; - } else { - dol_syslog(var_export($paymentintent, true), LOG_DEBUG); - - $charge->status = 'failed'; - $charge->customer = $customer->id; - $charge->failure_code = $stripe->code; - $charge->failure_message = $stripe->error; - $charge->failure_declinecode = $stripe->declinecode; - $stripefailurecode = $stripe->code; - $stripefailuremessage = $stripe->error; - $stripefailuredeclinecode = $stripe->declinecode; - } - - //var_dump("stripefailurecode=".$stripefailurecode." stripefailuremessage=".$stripefailuremessage." stripefailuredeclinecode=".$stripefailuredeclinecode); - //exit; + $stripefailurecode = $err['code']; + $stripefailuremessage = $err['message']; + $stripefailuredeclinecode = $err['decline_code']; + } catch (Exception $e) { + $stripefailurecode = 'UnknownChargeError'; + $stripefailuremessage = $e->getMessage(); + } + } else { // Using new SCA method + if ($sepaMode) { + dol_syslog("* Create payment on SEPA " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); + } else { + dol_syslog("* Create payment on card " . $stripecard->id . ", amounttopay=" . $amounttopay . ", amountstripe=" . $amountstripe . ", FULLTAG=" . $FULLTAG, LOG_DEBUG); } - // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) - if (empty($charge) || $charge->status == 'failed') { - dol_syslog('Failed to charge card or payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING); + // Create payment intent and charge payment (confirmnow = true) + $paymentintent = $stripe->getPaymentIntent($amounttopay, $currency, $FULLTAG, $description, $invoice, $customer->id, $stripeacc, $servicestatus, 0, 'automatic', true, $stripecard->id, 1); - // Save a stripe payment was in error - $this->stripechargeerror++; + $charge = new stdClass(); + //erics add processing sepa is like success ? + if ($paymentintent->status === 'succeeded' || $paymentintent->status === 'processing') { + $charge->status = 'ok'; + $charge->id = $paymentintent->id; + $charge->customer = $customer->id; + } elseif ($paymentintent->status === 'requires_action') { + //paymentintent->status may be => 'requires_action' (no error in such a case) + dol_syslog(var_export($paymentintent, true), LOG_DEBUG); + $charge->status = 'failed'; + $charge->customer = $customer->id; + $charge->failure_code = $stripe->code; + $charge->failure_message = $stripe->error; + $charge->failure_declinecode = $stripe->declinecode; + $stripefailurecode = $stripe->code; + $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; + $stripefailuredeclinecode = $stripe->declinecode; + } else { + dol_syslog(var_export($paymentintent, true), LOG_DEBUG); + + $charge->status = 'failed'; + $charge->customer = $customer->id; + $charge->failure_code = $stripe->code; + $charge->failure_message = $stripe->error; + $charge->failure_declinecode = $stripe->declinecode; + $stripefailurecode = $stripe->code; + $stripefailuremessage = $stripe->error; + $stripefailuredeclinecode = $stripe->declinecode; + } + + //var_dump("stripefailurecode=".$stripefailurecode." stripefailuremessage=".$stripefailuremessage." stripefailuredeclinecode=".$stripefailuredeclinecode); + //exit; + } + + // Return $charge = array('id'=>'ch_XXXX', 'status'=>'succeeded|pending|failed', 'failure_code'=>, 'failure_message'=>...) + if (empty($charge) || $charge->status == 'failed') { + dol_syslog('Failed to charge card or payment mode ' . $stripecard->id . ' stripefailurecode=' . $stripefailurecode . ' stripefailuremessage=' . $stripefailuremessage . ' stripefailuredeclinecode=' . $stripefailuredeclinecode, LOG_WARNING); + + // Save a stripe payment was in error + $this->stripechargeerror++; + + $error++; + $errorforinvoice++; + $errmsg = $langs->trans("FailedToChargeCard"); + if (!empty($charge)) { + if ($stripefailuredeclinecode == 'authentication_required') { + $errauthenticationmessage = $langs->trans("ErrSCAAuthentication"); + $errmsg = $errauthenticationmessage; + } elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) { + $errmsg .= ': ' . $charge->failure_code; + $errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message; + if (empty($stripefailurecode)) { + $stripefailurecode = $charge->failure_code; + } + if (empty($stripefailuremessage)) { + $stripefailuremessage = $charge->failure_message; + } + } else { + $errmsg .= ': failure_code=' . $charge->failure_code; + $errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message; + if (empty($stripefailurecode)) { + $stripefailurecode = $charge->failure_code; + } + if (empty($stripefailuremessage)) { + $stripefailuremessage = $charge->failure_message; + } + } + } else { + $errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage; + $errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : ''); + } + + $description = 'Stripe payment ERROR from doTakePaymentStripeForThirdparty: ' . $FULLTAG; + $postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')'; + $this->errors[] = $errmsg; + } else { + dol_syslog('Successfuly charge card ' . $stripecard->id); + + $postactionmessages[] = 'Success to charge card (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; + + // Save a stripe payment was done in realy life so later we will be able to force a commit on recorded payments + // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. + $this->stripechargedone++; + + // Default description used for label of event. Will be overwrite by another value later. + $description = 'Stripe payment OK (' . $charge->id . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; + + $db = $this->db; + + $ipaddress = getUserRemoteIP(); + + $TRANSACTIONID = $charge->id; + $currency = $conf->currency; + $paymentmethod = 'stripe'; + $emetteur_name = $charge->customer; + + // Same code than into paymentok.php... + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') { + $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + } + if (empty($paymentTypeId)) { + //erics + if ($sepaMode) { + $paymentType = 'PRE'; + } else { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) { + $paymentType = 'CB'; + } + } + $paymentTypeId = dol_getIdFromCode($this->db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $currency; + + $ispostactionok = 1; + + // Creation of payment line + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($this->db); + $paiement->datepaye = $now; + $paiement->date = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = [$this->id => $amounttopay]; // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = [$this->id => $amounttopay]; // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; + $ispostactionok = -1; + // Not yet supported, so error $error++; $errorforinvoice++; - $errmsg = $langs->trans("FailedToChargeCard"); - if (!empty($charge)) { - if ($stripefailuredeclinecode == 'authentication_required') { - $errauthenticationmessage = $langs->trans("ErrSCAAuthentication"); - $errmsg = $errauthenticationmessage; - } elseif (in_array($stripefailuredeclinecode, ['insufficient_funds', 'generic_decline'])) { - $errmsg .= ': ' . $charge->failure_code; - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' ' . $charge->failure_message; - if (empty($stripefailurecode)) { - $stripefailurecode = $charge->failure_code; - } - if (empty($stripefailuremessage)) { - $stripefailuremessage = $charge->failure_message; - } - } else { - $errmsg .= ': failure_code=' . $charge->failure_code; - $errmsg .= ($charge->failure_message ? ' - ' : '') . ' failure_message=' . $charge->failure_message; - if (empty($stripefailurecode)) { - $stripefailurecode = $charge->failure_code; - } - if (empty($stripefailuremessage)) { - $stripefailuremessage = $charge->failure_message; - } - } - } else { - $errmsg .= ': ' . $stripefailurecode . ' - ' . $stripefailuremessage; - $errmsg .= ($stripefailuredeclinecode ? ' - ' . $stripefailuredeclinecode : ''); - } + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_paiement = ''; + $paiement->num_payment = ''; + // Add a comment with keyword 'SellYourSaas' in text. Used by trigger. + $paiement->note_public = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; + $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; + $paiement->ext_payment_id = $charge->id . ':' . $customer->id . '@' . $stripearrayofkeys['publishable_key']; + $paiement->ext_payment_site = 'stripe'; - $description = 'Stripe payment ERROR from doTakePaymentStripeForThirdparty: ' . $FULLTAG; - $postactionmessages[] = $errmsg . ' (' . $stripearrayofkeys['publishable_key'] . ')'; - $this->errors[] = $errmsg; - } else { - dol_syslog('Successfuly charge card ' . $stripecard->id); + if (!$errorforinvoice) { + dol_syslog('* Record payment for invoice id ' . $this->id . '. It includes closing of invoice and regenerating document'); - $postactionmessages[] = 'Success to charge card (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; - - // Save a stripe payment was done in realy life so later we will be able to force a commit on recorded payments - // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. - $this->stripechargedone++; - - // Default description used for label of event. Will be overwrite by another value later. - $description = 'Stripe payment OK (' . $charge->id . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; - - $db = $this->db; - - $ipaddress = getUserRemoteIP(); - - $TRANSACTIONID = $charge->id; - $currency = $conf->currency; - $paymentmethod = 'stripe'; - $emetteur_name = $charge->customer; - - // Same code than into paymentok.php... - - $paymentTypeId = 0; - if ($paymentmethod == 'paybox') { - $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; - } - if ($paymentmethod == 'paypal') { - $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; - } - if ($paymentmethod == 'stripe') { - $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; - } - if (empty($paymentTypeId)) { - //erics - if ($sepaMode) { - $paymentType = 'PRE'; - } else { - $paymentType = $_SESSION["paymentType"]; - if (empty($paymentType)) { - $paymentType = 'CB'; - } - } - $paymentTypeId = dol_getIdFromCode($this->db, $paymentType, 'c_paiement', 'code', 'id', 1); - } - - $currencyCodeType = $currency; - - $ispostactionok = 1; - - // Creation of payment line - include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; - $paiement = new Paiement($this->db); - $paiement->datepaye = $now; - $paiement->date = $now; - if ($currencyCodeType == $conf->currency) { - $paiement->amounts = [$this->id => $amounttopay]; // Array with all payments dispatching with invoice id - } else { - $paiement->multicurrency_amounts = [$this->id => $amounttopay]; // Array with all payments dispatching - - $postactionmessages[] = 'Payment was done in a different currency than currency expected of company'; + // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document + $paiement_id = $paiement->create($user, 1); + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("
    \n", $paiement->errors); $ispostactionok = -1; - // Not yet supported, so error $error++; $errorforinvoice++; + } else { + $postactionmessages[] = 'Payment created'; } - $paiement->paiementid = $paymentTypeId; - $paiement->num_paiement = ''; - $paiement->num_payment = ''; - // Add a comment with keyword 'SellYourSaas' in text. Used by trigger. - $paiement->note_public = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; - $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $paymentmethod . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; - $paiement->ext_payment_id = $charge->id . ':' . $customer->id . '@' . $stripearrayofkeys['publishable_key']; - $paiement->ext_payment_site = 'stripe'; - if (!$errorforinvoice) { - dol_syslog('* Record payment for invoice id ' . $this->id . '. It includes closing of invoice and regenerating document'); + dol_syslog("The payment has been created for invoice id " . $this->id); + } - // This include closing invoices to 'paid' (and trigger including unsuspending) and regenerating document - $paiement_id = $paiement->create($user, 1); - if ($paiement_id < 0) { + if (!$errorforinvoice && isModEnabled('banque')) { + dol_syslog('* Add payment to bank'); + + $bankaccountid = 0; + if ($paymentmethod == 'paybox') { + $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + } + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($this->type == Facture::TYPE_CREDIT_NOTE) { + $label = '(CustomerInvoicePaymentBack)'; + } // Refund of a credit note + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $emetteur_name, ''); + if ($result < 0) { $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("
    \n", $paiement->errors); $ispostactionok = -1; $error++; $errorforinvoice++; } else { - $postactionmessages[] = 'Payment created'; + $postactionmessages[] = 'Bank transaction of payment created (by doTakePaymentStripeForThirdparty)'; } - - dol_syslog("The payment has been created for invoice id " . $this->id); - } - - if (!$errorforinvoice && isModEnabled('banque')) { - dol_syslog('* Add payment to bank'); - - $bankaccountid = 0; - if ($paymentmethod == 'paybox') { - $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; - } - if ($paymentmethod == 'paypal') { - $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; - } - if ($paymentmethod == 'stripe') { - $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; - } - - if ($bankaccountid > 0) { - $label = '(CustomerInvoicePayment)'; - if ($this->type == Facture::TYPE_CREDIT_NOTE) { - $label = '(CustomerInvoicePaymentBack)'; - } // Refund of a credit note - $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, $emetteur_name, ''); - if ($result < 0) { - $postactionmessages[] = $paiement->error . ($paiement->error ? ' ' : '') . join("
    \n", $paiement->errors); - $ispostactionok = -1; - $error++; - $errorforinvoice++; - } else { - $postactionmessages[] = 'Bank transaction of payment created (by doTakePaymentStripeForThirdparty)'; - } - } else { - $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; - $ispostactionok = -1; - $error++; - $errorforinvoice++; - } - } - - if ($ispostactionok < 1) { - $description = 'Stripe payment OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') but post action KO from doTakePaymentStripeForThirdparty: ' . $FULLTAG; } else { - $description = 'Stripe payment+post action OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; + $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + $errorforinvoice++; } } - $object = $invoice; - - // Send emails - $labeltouse = 'InvoicePaymentSuccess'; - $sendemailtocustomer = 1; - - if (empty($charge) || $charge->status == 'failed') { - $labeltouse = 'InvoicePaymentFailure'; - if ($noemailtocustomeriferror) { - $sendemailtocustomer = 0; - } // $noemailtocustomeriferror is set when error already reported on myaccount screen - } - - // Track an event - if (empty($charge) || $charge->status == 'failed') { - $actioncode = 'PAYMENT_STRIPE_KO'; - $extraparams = $stripefailurecode; - $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage; - $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode; + if ($ispostactionok < 1) { + $description = 'Stripe payment OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') but post action KO from doTakePaymentStripeForThirdparty: ' . $FULLTAG; } else { - $actioncode = 'PAYMENT_STRIPE_OK'; - $extraparams = ''; + $description = 'Stripe payment+post action OK (' . $charge->id . ' - ' . $amounttopay . ' ' . $conf->currency . ') from doTakePaymentStripeForThirdparty: ' . $FULLTAG; } - } else { - $error++; - $errorforinvoice++; - dol_syslog("No card or payment method found for this stripe customer " . $customer->id, LOG_WARNING); - $this->errors[] = 'Failed to get card | payment method for stripe customer = ' . $customer->id; - - $labeltouse = 'InvoicePaymentFailure'; - $sendemailtocustomer = 1; - if ($noemailtocustomeriferror) { - $sendemailtocustomer = 0; - } // $noemailtocustomeriferror is set when error already reported on myaccount screen - - $description = 'Failed to find or use the payment mode - no credit card defined for the customer account'; - $stripefailurecode = 'BADPAYMENTMODE'; - $stripefailuremessage = 'Failed to find or use the payment mode - no credit card defined for the customer account'; - $postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')'; - - $object = $invoice; - - $actioncode = 'PAYMENT_STRIPE_KO'; - $extraparams = ''; } - } else { - // If error because payment was canceled for a logical reason, we do nothing (no email and no event added) - $labeltouse = ''; - $sendemailtocustomer = 0; - - $description = ''; - $stripefailurecode = ''; - $stripefailuremessage = ''; $object = $invoice; - $actioncode = ''; + // Send emails + $labeltouse = 'InvoicePaymentSuccess'; + $sendemailtocustomer = 1; + + if (empty($charge) || $charge->status == 'failed') { + $labeltouse = 'InvoicePaymentFailure'; + if ($noemailtocustomeriferror) { + $sendemailtocustomer = 0; + } // $noemailtocustomeriferror is set when error already reported on myaccount screen + } + + // Track an event + if (empty($charge) || $charge->status == 'failed') { + $actioncode = 'PAYMENT_STRIPE_KO'; + $extraparams = $stripefailurecode; + $extraparams .= (($extraparams && $stripefailuremessage) ? ' - ' : '') . $stripefailuremessage; + $extraparams .= (($extraparams && $stripefailuredeclinecode) ? ' - ' : '') . $stripefailuredeclinecode; + } else { + $actioncode = 'PAYMENT_STRIPE_OK'; + $extraparams = ''; + } + } else { + $error++; + $errorforinvoice++; + dol_syslog("No card or payment method found for this stripe customer " . $customer->id, LOG_WARNING); + $this->errors[] = 'Failed to get card | payment method for stripe customer = ' . $customer->id; + + $labeltouse = 'InvoicePaymentFailure'; + $sendemailtocustomer = 1; + if ($noemailtocustomeriferror) { + $sendemailtocustomer = 0; + } // $noemailtocustomeriferror is set when error already reported on myaccount screen + + $description = 'Failed to find or use the payment mode - no credit card defined for the customer account'; + $stripefailurecode = 'BADPAYMENTMODE'; + $stripefailuremessage = 'Failed to find or use the payment mode - no credit card defined for the customer account'; + $postactionmessages[] = $description . ' (' . $stripearrayofkeys['publishable_key'] . ')'; + + $object = $invoice; + + $actioncode = 'PAYMENT_STRIPE_KO'; $extraparams = ''; } - } else { // Else of the if ($resultthirdparty > 0 && ! empty($customer)) { - if ($resultthirdparty <= 0) { - dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING); - $this->errors[] = 'Failed to load customer for thirdparty_id = ' . $thirdparty->id; - } else { // $customer stripe not found - dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); - $this->errors[] = 'Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; - } - $error++; - $errorforinvoice++; + } else { + // If error because payment was canceled for a logical reason, we do nothing (no email and no event added) + $labeltouse = ''; + $sendemailtocustomer = 0; - $labeltouse = 'InvoicePaymentFailure'; - $sendemailtocustomer = 1; - if ($noemailtocustomeriferror) { - $sendemailtocustomer = 0; - } // $noemailtocustomeriferror is set when error already reported on myaccount screen - - $description = 'Failed to find or use your payment mode (no payment mode for this customer id)'; - $stripefailurecode = 'BADPAYMENTMODE'; - $stripefailuremessage = 'Failed to find or use your payment mode (no payment mode for this customer id)'; - $postactionmessages = []; + $description = ''; + $stripefailurecode = ''; + $stripefailuremessage = ''; $object = $invoice; - $actioncode = 'PAYMENT_STRIPE_KO'; + $actioncode = ''; $extraparams = ''; } - - // Send email + create action after - if ($sendemailtocustomer && $labeltouse) { - dol_syslog("* Send email with result of payment - " . $labeltouse); - - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); - $outputlangs->loadLangs(["main", "members", "bills"]); - - // Get email content from templae - $arraydefaultmessage = null; - - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($this->db); - - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); - - //$substitutionarray['__SELLYOURSAAS_PAYMENT_ERROR_DESC__'] = $stripefailurecode . ' ' . $stripefailuremessage; - - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - // Set the property ->ref_customer with ref_customer of contract so __REF_CLIENT__ will be replaced in email content - // Search contract linked to invoice - $foundcontract = null; - $this->fetchObjectLinked(); - if (is_array($this->linkedObjects['contrat']) && count($this->linkedObjects['contrat']) > 0) { - //dol_sort_array($object->linkedObjects['facture'], 'date'); - foreach ($this->linkedObjects['contrat'] as $idcontract => $contract) { - $substitutionarray['__CONTRACT_REF__'] = $contract->ref_customer; - $substitutionarray['__REFCLIENT__'] = $contract->ref_customer; // For backward compatibility - $substitutionarray['__REF_CLIENT__'] = $contract->ref_customer; - $foundcontract = $contract; - break; - } - } - - dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__=' . $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); - - //erics - erreur de réécriture de l'url de téléchargement direct de la facture ... le lien de base est le bon - //on cherche donc d'ou vien le pb ... - //$urlforsellyoursaasaccount = getRootUrlForAccount($foundcontract); - // if ($urlforsellyoursaasaccount) { - // $tmpforurl = preg_replace('/.*document.php/', '', $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); - // if ($tmpforurl) { - // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 1, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); - // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount . '/source/document.php' . $tmpforurl; - // } else { - // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 2, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); - // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount; - // } - // } - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - // Attach a file ? - $file = ''; - $listofpaths = []; - $listofnames = []; - $listofmimes = []; - if (is_object($invoice)) { - $invoicediroutput = $conf->facture->dir_output; - //erics - choix du PDF a joindre aux mails - $fileparams = dol_most_recent_file($invoicediroutput . '/' . $this->ref, preg_quote($this->ref, '/') . '[^\-]+*.pdf'); - $file = $fileparams['fullname']; - //$file = $invoicediroutput . '/' . $this->ref . '/' . $this->ref . '.pdf'; - // $file = ''; // Disable attachment of invoice in emails - - if ($file) { - $listofpaths = [$file]; - $listofnames = [basename($file)]; - $listofmimes = [dol_mimetype($file)]; - } - } - $from = "";//$conf->global->SELLYOURSAAS_NOREPLY_EMAIL; - - $trackid = 'inv' . $this->id; - $moreinheader = 'X-Dolibarr-Info: doTakeStripePaymentForThirdParty' . "\r\n"; - - // Send email (substitutionarray must be done just before this) - include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subjecttosend, $this->thirdparty->email, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, -1, '', '', $trackid, $moreinheader); - if ($mailfile->sendfile()) { - $result = 1; - } else { - $this->error = $langs->trans("ErrorFailedToSendMail", $from, $this->thirdparty->email) . '. ' . $mailfile->error; - $result = -1; - } - - if ($result < 0) { - $errmsg = $this->error; - $postactionmessages[] = $errmsg; - $ispostactionok = -1; - } else { - if ($file) { - $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' with invoice document attached: ' . $file . ', language = ' . $outputlangs->defaultlang . ')'; - } else { - $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' without any attached document, language = ' . $outputlangs->defaultlang . ')'; - } - } + } else { // Else of the if ($resultthirdparty > 0 && ! empty($customer)) { + if ($resultthirdparty <= 0) { + dol_syslog('SellYourSaasUtils Failed to load customer for thirdparty_id = ' . $thirdparty->id, LOG_WARNING); + $this->errors[] = 'Failed to load customer for thirdparty_id = ' . $thirdparty->id; + } else { // $customer stripe not found + dol_syslog('SellYourSaasUtils Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'], LOG_WARNING); + $this->errors[] = 'Failed to get Stripe customer id for thirdparty_id = ' . $thirdparty->id . " in mode " . $servicestatus . " in Stripe env " . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; } - - if ($description) { - dol_syslog("* Record event for payment result - " . $description); - require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - - // Insert record of payment (success or error) - $actioncomm = new ActionComm($this->db); - - $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) - $actioncomm->code = 'AC_' . $actioncode; - $actioncomm->label = $description; - $actioncomm->note_private = join(",\n", $postactionmessages); - $actioncomm->fk_project = $this->fk_project; - $actioncomm->datep = $now; - $actioncomm->datef = $now; - $actioncomm->percentage = -1; // Not applicable - $actioncomm->socid = $thirdparty->id; - $actioncomm->contactid = 0; - $actioncomm->authorid = $user->id; // User saving action - $actioncomm->userownerid = $user->id; // Owner of action - // Fields when action is a real email (content is already into note) - /*$actioncomm->email_msgid = $object->email_msgid; - $actioncomm->email_from = $object->email_from; - $actioncomm->email_sender= $object->email_sender; - $actioncomm->email_to = $object->email_to; - $actioncomm->email_tocc = $object->email_tocc; - $actioncomm->email_tobcc = $object->email_tobcc; - $actioncomm->email_subject = $object->email_subject; - $actioncomm->errors_to = $object->errors_to;*/ - $actioncomm->fk_element = $this->id; - $actioncomm->elementtype = $this->element; - $actioncomm->extraparams = dol_trunc($extraparams, 250); - - $actioncomm->create($user); - } - - $this->description = $description; - $this->postactionmessages = $postactionmessages; - } catch (Exception $e) { $error++; $errorforinvoice++; - dol_syslog('Error ' . $e->getMessage(), LOG_ERR); - $this->errors[] = 'Error ' . $e->getMessage(); + + $labeltouse = 'InvoicePaymentFailure'; + $sendemailtocustomer = 1; + if ($noemailtocustomeriferror) { + $sendemailtocustomer = 0; + } // $noemailtocustomeriferror is set when error already reported on myaccount screen + + $description = 'Failed to find or use your payment mode (no payment mode for this customer id)'; + $stripefailurecode = 'BADPAYMENTMODE'; + $stripefailuremessage = 'Failed to find or use your payment mode (no payment mode for this customer id)'; + $postactionmessages = []; + + $object = $invoice; + + $actioncode = 'PAYMENT_STRIPE_KO'; + $extraparams = ''; } - } else { // If remain to pay is null + + // Send email + create action after + if ($sendemailtocustomer && $labeltouse) { + dol_syslog("* Send email with result of payment - " . $labeltouse); + + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(["main", "members", "bills"]); + + // Get email content from templae + $arraydefaultmessage = null; + + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; + $formmail = new FormMail($this->db); + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + + //$substitutionarray['__SELLYOURSAAS_PAYMENT_ERROR_DESC__'] = $stripefailurecode . ' ' . $stripefailuremessage; + + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + // Set the property ->ref_customer with ref_customer of contract so __REF_CLIENT__ will be replaced in email content + // Search contract linked to invoice + $foundcontract = null; + $this->fetchObjectLinked(); + if (is_array($this->linkedObjects['contrat']) && count($this->linkedObjects['contrat']) > 0) { + //dol_sort_array($object->linkedObjects['facture'], 'date'); + foreach ($this->linkedObjects['contrat'] as $idcontract => $contract) { + $substitutionarray['__CONTRACT_REF__'] = $contract->ref_customer; + $substitutionarray['__REFCLIENT__'] = $contract->ref_customer; // For backward compatibility + $substitutionarray['__REF_CLIENT__'] = $contract->ref_customer; + $foundcontract = $contract; + break; + } + } + + dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__=' . $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); + + //erics - erreur de réécriture de l'url de téléchargement direct de la facture ... le lien de base est le bon + //on cherche donc d'ou vien le pb ... + //$urlforsellyoursaasaccount = getRootUrlForAccount($foundcontract); + // if ($urlforsellyoursaasaccount) { + // $tmpforurl = preg_replace('/.*document.php/', '', $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__']); + // if ($tmpforurl) { + // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 1, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); + // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount . '/source/document.php' . $tmpforurl; + // } else { + // dol_syslog('__DIRECTDOWNLOAD_URL_INVOICE__ cas 2, urlforsellyoursaasaccount=' . $urlforsellyoursaasaccount); + // // $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = $urlforsellyoursaasaccount; + // } + // } + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + // Attach a file ? + $file = ''; + $listofpaths = []; + $listofnames = []; + $listofmimes = []; + if (is_object($invoice)) { + $invoicediroutput = $conf->facture->dir_output; + //erics - choix du PDF a joindre aux mails + $fileparams = dol_most_recent_file($invoicediroutput . '/' . $this->ref, preg_quote($this->ref, '/') . '[^\-]+*.pdf'); + $file = $fileparams['fullname']; + //$file = $invoicediroutput . '/' . $this->ref . '/' . $this->ref . '.pdf'; + // $file = ''; // Disable attachment of invoice in emails + + if ($file) { + $listofpaths = [$file]; + $listofnames = [basename($file)]; + $listofmimes = [dol_mimetype($file)]; + } + } + $from = "";//$conf->global->SELLYOURSAAS_NOREPLY_EMAIL; + + $trackid = 'inv' . $this->id; + $moreinheader = 'X-Dolibarr-Info: makeStripeSepaRequest' . "\r\n"; + + // Send email (substitutionarray must be done just before this) + include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subjecttosend, $this->thirdparty->email, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, -1, '', '', $trackid, $moreinheader); + if ($mailfile->sendfile()) { + $result = 1; + } else { + $this->error = $langs->trans("ErrorFailedToSendMail", $from, $this->thirdparty->email) . '. ' . $mailfile->error; + $result = -1; + } + + if ($result < 0) { + $errmsg = $this->error; + $postactionmessages[] = $errmsg; + $ispostactionok = -1; + } else { + if ($file) { + $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' with invoice document attached: ' . $file . ', language = ' . $outputlangs->defaultlang . ')'; + } else { + $postactionmessages[] = 'Email sent to thirdparty (to ' . $this->thirdparty->email . ' without any attached document, language = ' . $outputlangs->defaultlang . ')'; + } + } + } + + if ($description) { + dol_syslog("* Record event for payment result - " . $description); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + + // Insert record of payment (success or error) + $actioncomm = new ActionComm($this->db); + + $actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) + $actioncomm->code = 'AC_' . $actioncode; + $actioncomm->label = $description; + $actioncomm->note_private = join(",\n", $postactionmessages); + $actioncomm->fk_project = $this->fk_project; + $actioncomm->datep = $now; + $actioncomm->datef = $now; + $actioncomm->percentage = -1; // Not applicable + $actioncomm->socid = $thirdparty->id; + $actioncomm->contactid = 0; + $actioncomm->authorid = $user->id; // User saving action + $actioncomm->userownerid = $user->id; // Owner of action + // Fields when action is a real email (content is already into note) + /*$actioncomm->email_msgid = $object->email_msgid; + $actioncomm->email_from = $object->email_from; + $actioncomm->email_sender= $object->email_sender; + $actioncomm->email_to = $object->email_to; + $actioncomm->email_tocc = $object->email_tocc; + $actioncomm->email_tobcc = $object->email_tobcc; + $actioncomm->email_subject = $object->email_subject; + $actioncomm->errors_to = $object->errors_to;*/ + $actioncomm->fk_element = $this->id; + $actioncomm->elementtype = $this->element; + $actioncomm->extraparams = dol_trunc($extraparams, 250); + + $actioncomm->create($user); + } + + $this->description = $description; + $this->postactionmessages = $postactionmessages; + } catch (Exception $e) { $error++; $errorforinvoice++; - dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING); - $this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; + dol_syslog('Error ' . $e->getMessage(), LOG_ERR); + $this->errors[] = 'Error ' . $e->getMessage(); } + } else { // If remain to pay is null + $error++; + $errorforinvoice++; + dol_syslog("Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?", LOG_WARNING); + $this->errors[] = "Remain to pay is null for the invoice " . $this->id . " " . $this->ref . ". Why is the invoice not classified 'Paid' ?"; + } - $sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande("; - $sql .= "fk_facture, "; - $sql .= " amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)"; - $sql .= " VALUES (".$this->id; - $sql .= ",".((float) price2num($amount)); - $sql .= ",'".$this->db->idate($now)."'"; - $sql .= ",".((int) $fuser->id); - $sql .= ",'".$this->db->escape($stripe_id)."'"; - $sql .= ",'".$this->db->escape($stripe_uri)."'"; - $sql .= ",'".$this->db->escape($sourcetype)."'"; - $sql .= ",".$conf->entity; - $sql .= ")"; + $sql = "INSERT INTO '.MAIN_DB_PREFIX.'prelevement_facture_demande("; + $sql .= "fk_facture, "; + $sql .= " amount, date_demande, fk_user_demande, ext_payment_id, ext_payment_site, sourcetype, entity)"; + $sql .= " VALUES (".$this->id; + $sql .= ",".((float) price2num($amount)); + $sql .= ",'".$this->db->idate($now)."'"; + $sql .= ",".((int) $fuser->id); + $sql .= ",'".$this->db->escape($stripe_id)."'"; + $sql .= ",'".$this->db->escape($stripe_uri)."'"; + $sql .= ",'".$this->db->escape($sourcetype)."'"; + $sql .= ",".$conf->entity; + $sql .= ")"; - dol_syslog(get_class($this)."::demande_prelevement_stripe", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->error = $this->db->lasterror(); - dol_syslog(get_class($this).'::demande_prelevement_stripe Erreur'); - $error++; - } - } else { - $this->error = 'WithdrawRequestErrorNilAmount'; - dol_syslog(get_class($this).'::demande_prelevement_stripe WithdrawRequestErrorNilAmount'); + dol_syslog(get_class($this)."::makeStripeSepaRequest", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this).'::makeStripeSepaRequest Erreur'); $error++; } - - if (!$error) { - // Force payment mode of invoice to withdraw - $payment_mode_id = dol_getIdFromCode($this->db, ($type == 'bank-transfer' ? 'VIR' : 'PRE'), 'c_paiement', 'code', 'id', 1); - if ($payment_mode_id > 0) { - $result = $this->setPaymentMethods($payment_mode_id); - } - } - - if ($error) { - return -1; - } - return 1; } else { - $this->error = "A request already exists"; - dol_syslog(get_class($this).'::demande_prelevement_stripe Impossible de creer une demande, demande deja en cours'); - return 0; + $this->error = 'WithdrawRequestErrorNilAmount'; + dol_syslog(get_class($this).'::makeStripeSepaRequest WithdrawRequestErrorNilAmount'); + $error++; } + + if (!$error) { + // Force payment mode of invoice to withdraw + $payment_mode_id = dol_getIdFromCode($this->db, ($type == 'bank-transfer' ? 'VIR' : 'PRE'), 'c_paiement', 'code', 'id', 1); + if ($payment_mode_id > 0) { + $result = $this->setPaymentMethods($payment_mode_id); + } + } + + if ($error) { + return -1; + } + return 1; } else { $this->error = $this->db->error(); - dol_syslog(get_class($this).'::demande_prelevement_stripe Erreur -2'); + dol_syslog(get_class($this).'::makeStripeSepaRequest Erreur -2'); return -2; } } else { $this->error = "Status of invoice does not allow this"; - dol_syslog(get_class($this)."::demande_prelevement_stripe ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); + dol_syslog(get_class($this)."::makeStripeSepaRequest ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); return -3; } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7224949a70b..9bdd4a2b323 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -78,7 +78,7 @@ abstract class CommonObject /** * @var array To store error results of ->validateField() */ - public $validateFieldsErrors = array(); + private $validateFieldsErrors = array(); /** * @var string ID to identify managed object @@ -86,7 +86,8 @@ abstract class CommonObject public $element; /** - * @var string Name to use for 'features' parameter to check module permissions with restrictedArea(). Undefined means same value than $element. + * @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea(). + * Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element. */ public $element_for_permission; @@ -136,9 +137,9 @@ abstract class CommonObject public $linkedObjects; /** - * @var boolean Array of boolean with object id as key and value as true if linkedObjects full loaded. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction. + * @var boolean[] Array of boolean with object id as key and value as true if linkedObjects full loaded for object id. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction. */ - public $linkedObjectsFullLoaded = array(); + private $linkedObjectsFullLoaded = array(); /** * @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties @@ -3757,25 +3758,7 @@ abstract class CommonObject $fieldlocaltax2 = 'localtax2'; $fieldttc = 'total_ttc'; // Specific code for backward compatibility with old field names - if ($this->element == 'facture' || $this->element == 'facturerec') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'propal') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'expensereport') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'supplier_proposal') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'commande') { - $fieldtva = 'total_tva'; - } - if ($this->element == 'order_supplier') { + if (in_array($this->element, array('propal', 'commande', 'facture', 'facturerec', 'supplier_proposal', 'order_supplier', 'facture_fourn', 'invoice_supplier', 'invoice_supplier_rec', 'expensereport'))) { $fieldtva = 'total_tva'; } @@ -4410,7 +4393,7 @@ abstract class CommonObject $nb_rows_affected = $this->db->affected_rows($resql); // should be 1 or 0 if status was already correct - if ($nb_rows_affected >= 0) { + if ($nb_rows_affected > 0) { if (empty($trigkey)) { // Try to guess trigkey (for backward compatibility, now we should have trigkey defined into the call of setStatus) if ($this->element == 'supplier_proposal' && $status == 2) { @@ -4917,15 +4900,18 @@ abstract class CommonObject // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { + $res = 0; if (!empty($module)) { $tpl = dol_buildpath($reldir.'/objectline_title.tpl.php'); } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_title.tpl.php'; } - if (empty($conf->file->strict_mode)) { - $res = @include $tpl; - } else { - $res = include $tpl; // for debug + if (file_exists($tpl)) { + if (empty($conf->file->strict_mode)) { + $res = @include $tpl; + } else { + $res = include $tpl; // for debug + } } if ($res) { break; @@ -5030,7 +5016,7 @@ abstract class CommonObject } $text .= ' - '.(!empty($line->label) ? $line->label : $label); - $description .= (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc. + $description .= (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc. } $line->pu_ttc = price2num((!empty($line->subprice) ? $line->subprice : 0) * (1 + ((!empty($line->tva_tx) ? $line->tva_tx : 0) / 100)), 'MU'); @@ -5040,16 +5026,18 @@ abstract class CommonObject // Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook printObjectLine and printObjectSubLine. $dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir)); foreach ($dirtpls as $module => $reldir) { + $res = 0; if (!empty($module)) { $tpl = dol_buildpath($reldir.'/objectline_view.tpl.php'); } else { $tpl = DOL_DOCUMENT_ROOT.$reldir.'/objectline_view.tpl.php'; } - - if (empty($conf->file->strict_mode)) { - $res = @include $tpl; - } else { - $res = include $tpl; // for debug + if (file_exists($tpl)) { + if (empty($conf->file->strict_mode)) { + $res = @include $tpl; + } else { + $res = include $tpl; // for debug + } } if ($res) { break; @@ -5624,6 +5612,9 @@ abstract class CommonObject if ($this->element == 'contrat' && !empty($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD)) { $setsharekey = true; } + if ($this->element == 'fichinter' && !empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD)) { + $setsharekey = true; + } if ($this->element == 'supplier_proposal' && !empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) { $setsharekey = true; } @@ -6067,14 +6058,15 @@ abstract class CommonObject //var_dump('key '.$key.' '.$value.' type='.$extrafields->attributes[$this->table_element]['type'][$key].' '.$this->array_options["options_".$key]); } } + } - // If field is a computed field, value must become result of compute - foreach ($tab as $key => $value) { - if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { - //var_dump($conf->disable_compute); - if (empty($conf->disable_compute)) { - $this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); - } + // If field is a computed field, value must become result of compute (regardless of whether a row exists + // in the element's extrafields table) + foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { + //var_dump($conf->disable_compute); + if (empty($conf->disable_compute)) { + $this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); } } } @@ -7843,7 +7835,7 @@ abstract class CommonObject * get field error message * * @param string $fieldKey Key of attribute - * @return string + * @return string Error message of validation ('' if no error) */ public function getFieldError($fieldKey) { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 234f8d80e0c..42927d398aa 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -347,7 +347,7 @@ class Conf $db->free($resql); } - // Include other local consts.php files and fetch their values to the corresponding database constants. + // Include other local file xxx/zzz_consts.php to overwrite some variables if (!empty($this->global->LOCAL_CONSTS_FILES)) { $filesList = explode(":", $this->global->LOCAL_CONSTS_FILES); foreach ($filesList as $file) { @@ -675,6 +675,9 @@ class Conf } $this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE; + // Set PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE, may be modified later according to browser + $this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0); + // conf->theme et $this->css if (empty($this->global->MAIN_THEME)) { $this->global->MAIN_THEME = "eldy"; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index dff1383a629..052d5ae7e1c 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -559,7 +559,7 @@ class DiscountAbsolute /** * Return amount (with tax) of all deposits invoices used by invoice as a payment. - * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS or FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). * * @param CommonInvoice $invoice Object invoice (customer of supplier) * @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 007210c8888..53a20d6dadd 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -60,7 +60,7 @@ class DolEditor * 'In' = each window has its own toolbar * 'Out:name' = share toolbar into the div called 'name' * @param boolean $toolbarstartexpanded Bar is visible or not at start - * @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. + * @param boolean $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. * @param boolean|string $okforextendededitor True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". * @param int $rows Size of rows for textarea tool @@ -163,7 +163,7 @@ class DolEditor $skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa } - $pluginstodisable = 'elementspath,save,flash,div,specialchar'; + $pluginstodisable = 'elementspath,save,flash,div,specialchar,anchor'; if (!empty($conf->dol_optimize_smallscreen)) { $pluginstodisable .= ',scayt,wsc,find,undo'; } @@ -198,7 +198,7 @@ class DolEditor htmlEncodeOutput:'.$htmlencode_force.', allowedContent:'.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */ extraAllowedContent: \'a[target];div{float,display}\', /* Add the style float and display into div to default other allowed tags */ - disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */ + disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */ fullPage: '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */ toolbar: \''.$this->toolbarname.'\', toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').', diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e1859d61653..0a1f5f16d6d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -165,7 +165,7 @@ class Form $ret .= '
    '; } if ($htmlname && GETPOST('action', 'aZ09') != 'edit'.$htmlname && $perm) { - $ret .= 'id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; + $ret .= 'id.$moreparam.'">'.img_edit($langs->trans('Edit'), ($notabletag ? 0 : 1)).''; } if (!empty($notabletag) && $notabletag == 1) { $ret .= ' : '; @@ -626,11 +626,11 @@ class Form $extrastyle = ''; if ($direction < 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); - $extrastyle = 'padding: 0px; padding-left: 3px !important;'; + $extrastyle = 'padding: 0px; padding-left: 3px;'; } if ($direction > 0) { $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); - $extrastyle = 'padding: 0px; padding-right: 3px !important;'; + $extrastyle = 'padding: 0px; padding-right: 3px;'; } $classfortooltip = 'classfortooltip'; @@ -673,7 +673,7 @@ class Form if ($direction < 0) { $s .= '<'.$tag.$paramfortooltipimg; if ($tag == 'td') { - $s .= ' class=valigntop" width="14"'; + $s .= ' class="valigntop" width="14"'; } $s .= '>'.$textfordialog.$img.''; } @@ -3173,6 +3173,8 @@ class Form 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), + 'price_ht_locale'=>price(price2num($outprice_ht)), + 'price_ttc_locale'=>price(price2num($outprice_ttc)), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'default_vat_code'=>$outdefault_vat_code, @@ -3274,9 +3276,9 @@ class Form $sql .= " pfp.supplier_reputation"; // if we use supplier description of the products if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) { - $sql .= " ,pfp.desc_fourn as description"; + $sql .= ", pfp.desc_fourn as description"; } else { - $sql .= " ,p.description"; + $sql .= ", p.description"; } // Units if (!empty($conf->global->PRODUCT_USE_UNITS)) { @@ -3558,7 +3560,13 @@ class Form $optstart .= ' disabled'; } if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { - $optstart .= ' data-product-id="'.$objp->rowid.'" data-price-id="'.$objp->idprodfournprice.'" data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'" data-tvatx="'.$objp->tva_tx.'"'; + $opt .= ' data-product-id="'.dol_escape_htmltag($objp->rowid).'"'; + $opt .= ' data-price-id="'.dol_escape_htmltag($objp->idprodfournprice).'"'; + $opt .= ' data-qty="'.dol_escape_htmltag($objp->quantity).'"'; + $opt .= ' data-up="'.dol_escape_htmltag($objp->unitprice).'"'; + $opt .= ' data-up-locale="'.dol_escape_htmltag(price($objp->unitprice)).'"'; + $opt .= ' data-discount="'.dol_escape_htmltag($outdiscount).'"'; + $opt .= ' data-tvatx="'.dol_escape_htmltag($objp->tva_tx).'"'; } $optstart .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; @@ -3594,8 +3602,27 @@ class Form // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax // "label" value of json key array is used by jQuery automatically as text for combo box $out .= $optstart . ' data-html="'.dol_escape_htmltag($optlabel).'">' . $optlabel . "\n";; - array_push($outarray, $outarrayentry); - + array_push( + $outarray, + array('key'=>$outkey, + 'value'=>$outref, + 'label'=>$outval, + 'qty'=>$outqty, + 'price_qty_ht'=>price2num($objp->fprice, 'MU'), // Keep higher resolution for price for the min qty + 'price_unit_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price + 'price_ht'=>price2num($objp->unitprice, 'MU'), // This is used to fill the Unit Price (for compatibility) + 'price_qty_ht_locale'=>price($objp->fprice), + 'price_unit_ht_locale'=>price($objp->unitprice), + 'tva_tx'=>$objp->tva_tx, + 'default_vat_code'=>$objp->default_vat_code, + 'discount'=>$outdiscount, + 'type'=>$outtype, + 'duration_value'=>$outdurationvalue, + 'duration_unit'=>$outdurationunit, + 'disabled'=>(empty($objp->idprodfournprice) ? true : false), + 'description'=>$objp->description + ) + ); // Exemple of var_dump $outarray // array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp" // ["label"]=>string(76) "ppp (fff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)" @@ -5357,9 +5384,10 @@ class Form * @param int $maxlength Max length * @param int $forcefocus Force focus on field (works with javascript only) * @param int $nooutput No print is done. String is returned. + * @param string $textifnoproject Text to show if no project * @return string Return html content */ - public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0) + public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0, $textifnoproject = '') { // phpcs:enable global $langs; @@ -5373,7 +5401,6 @@ class Form $langs->load("project"); if ($htmlname != "none") { - $out .= "\n"; $out .= '
    '; $out .= ''; $out .= ''; @@ -5385,9 +5412,9 @@ class Form if ($selected) { $projet = new Project($this->db); $projet->fetch($selected); - $out .= $projet->getNomUrl(1, '', 1); + $out .= $projet->getNomUrl(0, '', 1); } else { - $out .= " "; + $out .= ''.$textifnoproject.''; } $out .= ''; } @@ -5412,22 +5439,26 @@ class Form * @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters) * 0 : use default deposit percentage from entry * > 0 : force deposit percentage (for example, from company object) + * @param int $nooutput No print is done. String is returned. * @return void */ - public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1) + public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0) { // phpcs:enable global $langs; + + $out = ''; + if ($htmlname != "none") { - print ''; - print ''; - print ''; + $out .= ''; + $out .= ''; + $out .= ''; if ($type) { - print ''; + $out .= ''; } - print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); - print ''; - print '
    '; + $out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent); + $out .= ''; + $out .= ''; } else { if ($selected) { $this->load_cache_conditions_paiements(); @@ -5438,15 +5469,21 @@ class Form $label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label); } - print $label; + $out .= $label; } else { $langs->load('errors'); - print $langs->trans('ErrorNotInDictionaryPaymentConditions'); + $out .= $langs->trans('ErrorNotInDictionaryPaymentConditions'); } } else { - print " "; + $out .= ' '; } } + + if (empty($nooutput)) { + print $out; + return ''; + } + return $out; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -5612,30 +5649,39 @@ class Form * @param int $active Active or not, -1 = all * @param int $addempty 1=Add empty entry * @param string $type Type ('direct-debit' or 'bank-transfer') + * @param int $nooutput 1=Return string, no output * @return void */ - public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '') + public function form_modes_reglement($page, $selected = '', $htmlname = 'mode_reglement_id', $filtertype = '', $active = 1, $addempty = 0, $type = '', $nooutput = 0) { // phpcs:enable global $langs; + + $out = ''; if ($htmlname != "none") { - print '
    '; - print ''; - print ''; + $out .= ''; + $out .= ''; + $out .= ''; if ($type) { - print ''; + $out .= ''; } - print $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); - print ''; - print '
    '; + $out .= $this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active, '', 1); + $out .= ''; + $out .= ''; } else { if ($selected) { $this->load_cache_types_paiements(); - print $this->cache_types_paiements[$selected]['label']; + $out .= $this->cache_types_paiements[$selected]['label']; } else { - print " "; + $out .= " "; } } + + if ($nooutput) { + return $out; + } else { + print $out; + } } /** @@ -5759,7 +5805,7 @@ class Form print ''; print '
    '; if (!empty($discount_type)) { - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { if (!$filter || $filter == "fk_invoice_supplier_source IS NULL") { $translationKey = 'HasAbsoluteDiscountFromSupplier'; // If we want deposit to be substracted to payments only and not to total of final invoice } else { @@ -5880,19 +5926,20 @@ class Form /** * Output html select to select thirdparty * - * @param string $page Page - * @param string $selected Id preselected - * @param string $htmlname Name of HTML select - * @param string $filter Optional filters criteras. Do not use a filter coming from input of users. - * @param int $showempty Add an empty field - * @param int $showtype Show third party type in combolist (customer, prospect or supplier) - * @param int $forcecombo Force to use combo box - * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) - * @param int $nooutput No print output. Return it only. - * @param array $excludeids Exclude IDs from the select combo + * @param string $page Page + * @param string $selected Id preselected + * @param string $htmlname Name of HTML select + * @param string $filter Optional filters criteras. Do not use a filter coming from input of users. + * @param int $showempty Add an empty field + * @param int $showtype Show third party type in combolist (customer, prospect or supplier) + * @param int $forcecombo Force to use combo box + * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param int $nooutput No print output. Return it only. + * @param array $excludeids Exclude IDs from the select combo + * @param string $textifnothirdparty Text to show if no thirdparty * @return void|string */ - public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array()) + public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array(), $textifnothirdparty = '') { // phpcs:enable global $langs; @@ -5910,9 +5957,9 @@ class Form require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $soc = new Societe($this->db); $soc->fetch($selected); - $out .= $soc->getNomUrl($langs); + $out .= $soc->getNomUrl(0, ''); } else { - $out .= " "; + $out .= ''.$textifnothirdparty.''; } } @@ -6252,7 +6299,7 @@ class Form } if (!$options_only) { - $return .= ''; } $selectedfound = false; @@ -6299,6 +6346,7 @@ class Form if (!$options_only) { $return .= ''; + //$return .= ajax_combobox($htmlname); // This break for the moment dynamic autoselection of a value when selecting a product in object lines } } else { $return .= $this->error; @@ -8215,6 +8263,7 @@ class Form if(! data.id) return null;'; if ($callurlonselect) { + // We forge the url with 'sall=' $outdelayed .= ' var urlBase = data.url; @@ -8878,7 +8927,7 @@ class Form $form = new Form($this->db); print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' '; } - print ''.price($objp->total_ht).''; + print ''.(isset($objp->total_ht) ? price($objp->total_ht) : '').''; print '
    '.$objp->name.'
    '; - $out .= 'trans("File").': '.$file["name"]); $out .= dol_trunc($file["name"], 150); - $out .= ''."\n"; - $out .= $this->showPreview($file, $modulepart, $relativepath, 0, $param); + $out .= ''; + $out .= ''."\n"; + $out .= $imgpreview; $out .= '
    '.$langs->trans("MailErrorsTo").''; - $out .= ''; + $out .= ''; $out .= "
    '; + $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); + print ' '; + print ''; + print '
    '; @@ -1416,12 +1424,6 @@ class FormTicket print '
    '; - $checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':'')); - print ' '; - print ''; - print '
    '; print '

    '; - print ''; + print ''; if ($this->withcancel) { print "     "; print ''; diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 4f77cfbaae5..426dec37962 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -193,12 +193,20 @@ class Ldap { // phpcs:enable global $conf; + global $dolibarr_main_auth_ldap_debug; $connected = 0; $this->bind = 0; $this->error = 0; $this->connectedServer = ''; + $ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true); + + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind"); + print "DEBUG: connect_bind
    \n"; + } + // Check parameters if (count($this->server) == 0 || empty($this->server[0])) { $this->error = 'LDAP setup (file conf.php) is not complete'; @@ -223,18 +231,28 @@ class Ldap } if ($this->serverPing($host, $this->serverPort) === true) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing true, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { if (preg_match('/^ldaps/i', $host)) { // With host = ldaps://server, the serverPing to ssl://server sometimes fails, even if the ldap_connect succeed, so - // we test this case and continue in suche a case even if serverPing fails. + // we test this case and continue in such a case even if serverPing fails. + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind serverPing false, we try ldap_connect to ".$host); + } $this->connection = ldap_connect($host, $this->serverPort); } else { continue; } } - if (is_resource($this->connection) || is_object($this->connection)) { + if (is_resource($this->connection) || is_object($this->connection)) { + if ($ldapdebug) { + dol_syslog(get_class($this)."::connect_bind this->connection is ok", LOG_DEBUG); + } + // Upgrade connexion to TLS, if requested by the configuration if (!empty($conf->global->LDAP_SERVER_USE_TLS)) { // For test/debug diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 06ada5c4911..92b835caf7f 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -1577,11 +1577,14 @@ class SMTPs // loop through all attachments foreach ($_content as $_file => $_data) { $content .= "--".$this->_getBoundary('mixed')."\r\n" - . 'Content-Disposition: attachment; filename="'.$_data['fileName'].'"'."\r\n" - . 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['fileName'].'"'."\r\n" - . 'Content-Transfer-Encoding: base64'."\r\n" - . 'Content-Description: '.$_data['fileName']."\r\n"; - + . 'Content-Disposition: attachment; filename="'.$_data['fileName'].'"'."\r\n" + . 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['fileName'].'"'."\r\n" + . 'Content-Transfer-Encoding: base64'."\r\n" + . 'Content-Description: '.$_data['fileName']."\r\n"; + if (!empty($_data['cid'])) { + $content .= "X-Attachment-Id: ".$_data['cid']."\r\n"; + $content .= "Content-ID: <".$_data['cid'].">\r\n"; + } if ($this->getMD5flag()) { $content .= 'Content-MD5: '.$_data['md5']."\r\n"; } @@ -1595,9 +1598,9 @@ class SMTPs $content .= "--".$this->_getBoundary('related')."\r\n"; // always related for an inline image $content .= 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['imageName'].'"'."\r\n" - . 'Content-Transfer-Encoding: base64'."\r\n" - . 'Content-Disposition: inline; filename="'.$_data['imageName'].'"'."\r\n" - . 'Content-ID: <'.$_data['cid'].'> '."\r\n"; + . 'Content-Transfer-Encoding: base64'."\r\n" + . 'Content-Disposition: inline; filename="'.$_data['imageName'].'"'."\r\n" + . 'Content-ID: <'.$_data['cid'].'> '."\r\n"; if ($this->getMD5flag()) { $content .= 'Content-MD5: '.$_data['md5']."\r\n"; @@ -1664,9 +1667,10 @@ class SMTPs * @param string $strContent File data to attach to message * @param string $strFileName File Name to give to attachment * @param string $strMimeType File Mime Type of attachment + * @param string $strCid File Cid of attachment (if defined, to be shown inline) * @return void */ - public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown') + public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown', $strCid = '') { if ($strContent) { $strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); // 76 max is defined into http://tools.ietf.org/html/rfc2047 @@ -1674,6 +1678,7 @@ class SMTPs $this->_msgContent['attachment'][$strFileName]['mimeType'] = $strMimeType; $this->_msgContent['attachment'][$strFileName]['fileName'] = $strFileName; $this->_msgContent['attachment'][$strFileName]['data'] = $strContent; + $this->_msgContent['attachment'][$strFileName]['cid'] = $strCid; // If defined, it means this attachment must be shown inline if ($this->getMD5flag()) { $this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, 3); diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 63125fffd9f..990bdaf107e 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -103,7 +103,8 @@ abstract class Stats $data[$i][] = $datay[$endyear][($i + $sm) % 12][0]; $year = $startyear; while ($year <= $endyear) { - $data[$i][] = $datay[$year - (1 - ((int) ($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; + // floor(($i + $sm) / 12)) is 0 if we are after the month start $sm and same year, become 1 when we reach january of next year + $data[$i][] = $datay[$year - (1 - floor(($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; $year++; } } @@ -204,7 +205,8 @@ abstract class Stats $data[$i][] = isset($datay[$endyear][($i + $sm) % 12]['label']) ? $datay[$endyear][($i + $sm) % 12]['label'] : $datay[$endyear][($i + $sm) % 12][0]; // set label $year = $startyear; while ($year <= $endyear) { - $data[$i][] = $datay[$year - (1 - ((int) ($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; // set yval for x=i + // floor(($i + $sm) / 12)) is 0 if we are after the month start $sm and same year, become 1 when we reach january of next year + $data[$i][] = $datay[$year - (1 - floor(($i + $sm) / 12)) + ($sm == 0 ? 1 : 0)][($i + $sm) % 12][1]; // set yval for x=i $year++; } } diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 29db15e0a0b..568ef7b4ace 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -725,9 +725,9 @@ class Translate return $str; } else { - if ($key[0] == '$') { + /*if ($key[0] == '$') { return dol_eval($key, 1, 1, '1'); - } + }*/ return $this->getTradFromKey($key); } } @@ -1096,7 +1096,7 @@ class Translate if ($obj) { // If a translation exists, we use it lese we use the default label $this->cache_currencies[$obj->code_iso]['label'] = ($obj->code_iso && $this->trans("Currency".$obj->code_iso) != "Currency".$obj->code_iso ? $this->trans("Currency".$obj->code_iso) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode($obj->unicode, true); + $this->cache_currencies[$obj->code_iso]['unicode'] = (array) json_decode((empty($obj->unicode) ? '' : $obj->unicode), true); $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso]['label']; } $i++; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index d67bee7abac..c0dcc67378d 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -215,6 +215,9 @@ class Utils dol_syslog("Utils::dumpDatabase type=".$type." compression=".$compression." file=".$file, LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + // Clean data + $file = dol_sanitizeFileName($file); + // Check compression parameter if (!in_array($compression, array('none', 'gz', 'bz', 'zip', 'zstd'))) { $langs->load("errors"); @@ -354,6 +357,8 @@ class Utils $handle = ''; + // If $lowmemorydump is set, it means we want to make the compression using an external pipe instead retreiving the + // content of the dump in PHP memory array $output_arr and then print it into the PHP pipe open with xopen(). $lowmemorydump = GETPOSTISSET("lowmemorydump") ? GETPOST("lowmemorydump") : getDolGlobalString('MAIN_LOW_MEMORY_DUMP'); // Start call method to execute dump @@ -371,23 +376,23 @@ class Utils } } else { if ($compression == 'none') { - $fullcommandclear .= " > ".$outputfile; - $fullcommandcrypted .= " > ".$outputfile; + $fullcommandclear .= ' > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' > "'.dol_sanitizePathName($outputfile).'"'; $handle = 1; } elseif ($compression == 'gz') { - $fullcommandclear .= " | gzip > ".$outputfile; - $fullcommandcrypted .= " | gzip > ".$outputfile; - $paramcrypted.=" | gzip"; + $fullcommandclear .= ' | gzip > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' | gzip > "'.dol_sanitizePathName($outputfile).'"'; + $paramcrypted .= ' | gzip'; $handle = 1; } elseif ($compression == 'bz') { - $fullcommandclear .= " | bzip2 > ".$outputfile; - $fullcommandcrypted .= " | bzip2 > ".$outputfile; - $paramcrypted.=" | bzip2"; + $fullcommandclear .= ' | bzip2 > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' | bzip2 > "'.dol_sanitizePathName($outputfile).'"'; + $paramcrypted .= ' | bzip2'; $handle = 1; } elseif ($compression == 'zstd') { - $fullcommandclear .= " | zstd > ".$outputfile; - $fullcommandcrypted .= " | zstd > ".$outputfile; - $paramcrypted.=" | zstd"; + $fullcommandclear .= ' | zstd > "'.dol_sanitizePathName($outputfile).'"'; + $fullcommandcrypted .= ' | zstd > "'.dol_sanitizePathName($outputfile).'"'; + $paramcrypted .= ' | zstd'; $handle = 1; } } @@ -411,8 +416,8 @@ class Utils } - // TODO Replace with executeCLI function but - // we must first introduce a low memory mode + // TODO Replace with Utils->executeCLI() function but + // we must first introduce the variant with $lowmemorydump into this method. if ($execmethod == 1) { $output_arr = array(); $retval = null; @@ -471,15 +476,16 @@ class Utils } } - - if ($compression == 'none') { - fclose($handle); - } elseif ($compression == 'gz') { - gzclose($handle); - } elseif ($compression == 'bz') { - bzclose($handle); - } elseif ($compression == 'zstd') { - fclose($handle); + if (!$lowmemorydump) { + if ($compression == 'none') { + fclose($handle); + } elseif ($compression == 'gz') { + gzclose($handle); + } elseif ($compression == 'bz') { + bzclose($handle); + } elseif ($compression == 'zstd') { + fclose($handle); + } } if (!empty($conf->global->MAIN_UMASK)) { @@ -1249,9 +1255,10 @@ class Utils * @param string $message Message * @param string $filename List of files to attach (full path of filename on file system) * @param string $filter Filter file send + * @param string $sizelimit Limit size to send file * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ - public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '') + public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '', $sizelimit = 100000000) { global $conf, $langs; @@ -1309,9 +1316,13 @@ class Utils } if ($filepath) { - if ($filesize > 100000000) { - $output = 'Sorry, last backup file is too large to be send by email'; - $error++; + if ($filesize > $sizelimit) { + $message .= '
    '.$langs->trans("BackupIsTooLargeSend"); + $documenturl = $dolibarr_main_url_root.'/document.php?modulepart=systemtools&atachement=1&file=backup/'.urlencode($filename[0]); + $message .= '
    Lien de téléchargement'; + $filepath = ''; + $mimetype = ''; + $filename = ''; } } else { $output = 'No backup file found'; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index b6ec08da434..35e67f19e80 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -143,8 +143,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen textarea[key] = item[value]; }); } + console.log("Return value from GET to the rest of code"); - return { label: label, value: item.value, id: item.key, disabled: item.disabled, + return { label: label, + value: item.value, + id: item.key, + disabled: item.disabled, update: update, textarea: textarea, pbq: item.pbq, @@ -154,6 +158,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen pricebasetype: item.pricebasetype, price_ht: item.price_ht, price_ttc: item.price_ttc, + price_unit_ht: item.price_unit_ht, + price_unit_ht_locale: item.price_unit_ht_locale, description : item.description, ref_customer: item.ref_customer, tva_tx: item.tva_tx } @@ -173,6 +179,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen // For supplier price and customer when price by quantity is off $("#'.$htmlnamejquery.'").attr("data-up", ui.item.price_ht); + $("#'.$htmlnamejquery.'").attr("data-up-locale", ui.item.price_unit_ht_locale); $("#'.$htmlnamejquery.'").attr("data-base", ui.item.pricebasetype); $("#'.$htmlnamejquery.'").attr("data-qty", ui.item.qty); $("#'.$htmlnamejquery.'").attr("data-discount", ui.item.discount); @@ -191,8 +198,12 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen '; } $script .= ' + // A new value has been selected, we trigger the handlers on #htmlnamejquery + console.log("Trigger changes on #'.$htmlnamejquery.'"); $("#'.$htmlnamejquery.'").val(ui.item.id).trigger("change"); // Select new value + // Complementary actions + // Disable an element if (options.option_disabled) { console.log("Make action option_disabled on #"+options.option_disabled+" with disabled="+ui.item.disabled) @@ -224,7 +235,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen // Update an input if (ui.item.update) { - console.log("Make action update on each ui.item.update") + console.log("Make action update on each ui.item.update (if there is)") // loop on each "update" fields $.each(ui.item.update, function(key, value) { console.log("Set value "+value+" into #"+key); @@ -232,7 +243,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen }); } if (ui.item.textarea) { - console.log("Make action textarea on each ui.item.textarea") + console.log("Make action textarea on each ui.item.textarea (if there is)") $.each(ui.item.textarea, function(key, value) { if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances[key] != "undefined") { CKEDITOR.instances[key].setData(value); diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 8920808766a..736b200bea3 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -131,7 +131,12 @@ function bank_prepare_head(Account $object) */ function bank_admin_prepare_head($object) { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('bank_account'); + $extrafields->fetch_name_optionals_label('bank'); + $h = 0; $head = array(); @@ -154,11 +159,19 @@ function bank_admin_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')'; + $nbExtrafields = $extrafields->attributes['bank_account']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')'; + $nbExtrafields = $extrafields->attributes['bank']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'bankline_extrafields'; $h++; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f1cf8e43269..70589dfb120 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -438,7 +438,11 @@ function societe_prepare_head2($object) */ function societe_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('societe'); + $extrafields->fetch_name_optionals_label('socpeople'); $h = 0; $head = array(); @@ -456,11 +460,19 @@ function societe_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsThirdParties"); + $nbExtrafields = $extrafields->attributes['societe']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/societe/admin/contact_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsContacts"); + $nbExtrafields = $extrafields->attributes['socpeople']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes_contacts'; $h++; @@ -927,6 +939,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $search_name = GETPOST("search_name", 'alpha'); $search_address = GETPOST("search_address", 'alpha'); $search_poste = GETPOST("search_poste", 'alpha'); + $search_note_private = GETPOST('search_note_private', 'alphanohtml'); $search_roles = GETPOST("search_roles", 'array'); $socialnetworks = getArrayOfSocialNetworks(); @@ -976,6 +989,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20), 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'visible'=>3, 'position'=>35), 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40), 'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))), ); @@ -986,6 +1000,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), + 't.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'position'=>35), 'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40), 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'), ); @@ -1020,6 +1035,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $search_roles = array(); $search_address = ''; $search_poste = ''; + $search_note_private = ''; $search = array(); $search_array_options = array(); @@ -1076,6 +1092,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if ($search_address != '') { $param .= '&search_address='.urlencode($search_address); } + if ($search_note_private != '') { + $param .= '&search_note_private='.urlencode($search_note_private); + } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } @@ -1086,6 +1105,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.socialnetworks, t.statut, t.photo,"; $sql .= " t.civility as civility_id, t.address, t.zip, t.town"; + $sql .= ", t.note_private"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)"; $sql .= " WHERE t.fk_soc = ".((int) $object->id); @@ -1104,6 +1124,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if ($search_address) { $sql .= natural_search($searchAddressPhoneDBFields, $search_address); } + if ($search_note_private) { + $sql .= natural_search('t.note_private', $search_note_private); + } if (count($search_roles) > 0) { $sql .= " AND t.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; } @@ -1285,6 +1308,15 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl print '
    '; + if ($obj->note_private) { + print dol_string_nohtmltag($obj->note_private); + } + print ''; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 9aaf0771d44..03223a7b65a 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -169,7 +169,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforend } else { $date->add($interval); } - //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (php returns March 1, 2 or 3 respectively) + //Change the behavior of PHP over data-interval when the result of this function is Feb 29 (non-leap years), 30 or Feb 31 (so php returns March 1, 2 or 3 respectively) if ($ruleforendofmonth == 1 && $duration_unit == 'm') { $timeyear = dol_print_date($time, '%Y'); $timemonth = dol_print_date($time, '%m'); diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index eaa1f85d142..87c9ce4a3fc 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -139,7 +139,11 @@ function fichinter_prepare_head($object) */ function fichinter_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('fichinter'); + $extrafields->fetch_name_optionals_label('fichinterdet'); $h = 0; $head = array(); @@ -159,19 +163,25 @@ function fichinter_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['fichinter']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['fichinterdet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributesdet'; $h++; - - complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove'); - return $head; + return $head; } /** diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 6838926a67b..c3eede90efd 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1372,7 +1372,7 @@ function dol_delete_dir($dir, $nophperrors = 0) // Security: // We refuse transversal using .. and pipes into filenames. if (preg_match('/\.\./', $dir) || preg_match('/[<>|]/', $dir)) { - dol_syslog("Refused to delete dir ".$dir, LOG_WARNING); + dol_syslog("Refused to delete dir ".$dir.' (contains invalid char sequence)', LOG_WARNING); return false; } @@ -2539,7 +2539,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->facture->multidir_output[$entity].'/'.$original_file; } elseif ($modulepart == 'apercupropal' && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les apercu propal - if ($fuser->rights->propale->{$lire}) { + if ($fuser->rights->propal->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; @@ -2611,7 +2611,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->expensereport->dir_output.'/'.$original_file; } elseif ($modulepart == 'propalstats' && !empty($conf->propal->multidir_temp[$entity])) { // Wrapping pour les images des stats propales - if ($fuser->rights->propale->{$lire}) { + if ($fuser->rights->propal->{$lire}) { $accessallowed = 1; } $original_file = $conf->propal->multidir_temp[$entity].'/'.$original_file; @@ -2832,7 +2832,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, //$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity])) { // Wrapping pour les propales - if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i', $original_file)) { + if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } $original_file = $conf->propal->multidir_output[$entity].'/'.$original_file; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index cbdd3bde6ea..14f43f24034 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -18,6 +18,7 @@ * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2022 Anthony Berton + * Copyright (C) 2022 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -966,10 +967,15 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options break; case 'custom': - if (empty($filter)) { - return 'BadFourthParameterForGETPOST'; + if (!empty($out)) { + if (empty($filter)) { + return 'BadParameterForGETPOST - Param 3 of sanitizeVal()'; + } + /*if (empty($options)) { + return 'BadParameterForGETPOST - Param 4 of sanitizeVal()'; + }*/ + $out = filter_var($out, $filter, $options); } - $out = filter_var($out, $filter, $options); break; } @@ -1154,26 +1160,26 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) /** * Create a clone of instance of object (new instance with same value for properties) - * With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object is not valid. + * With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object may not be valid. * With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object. * * @param object $object Object to clone - * @param int $native 0=Full isolation method, 1=Native PHP method + * @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method+destroy non scalar or array properties (recommended) * @return object Clone object * @see https://php.net/manual/language.oop5.cloning.php */ function dol_clone($object, $native = 0) { - if (empty($native)) { + if ($native == 0) { $tmpsavdb = null; if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') { $tmpsavdb = $object->db; - unset($object->db); // Such property can not be serialized when PgSql/Connection + unset($object->db); // Such property can not be serialized with pgsl (when object->db->db = 'PgSql\Connection') } $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields - if ($tmpsavdb) { + if (!empty($tmpsavdb)) { $object->db = $tmpsavdb; } } else { @@ -1227,6 +1233,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); $tmp = preg_replace('/\-\-+/', '_', $tmp); $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); + $tmp = preg_replace('/\s+\-$/', '', $tmp); $tmp = str_replace('..', '', $tmp); return $tmp; } @@ -1251,6 +1258,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); $tmp = preg_replace('/\-\-+/', '_', $tmp); $tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp); + $tmp = preg_replace('/\s+\-$/', '', $tmp); $tmp = str_replace('..', '', $tmp); return $tmp; } @@ -1812,7 +1820,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0 * @param array $links Array of tabs. Note that label into $links[$i][1] must be already HTML escaped. * @param string $active Active tab name * @param string $title Title - * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after) + * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after), -3=-2+'noborderbottom' * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param string $morehtmlright Add more html content on right of tabs title @@ -1986,8 +1994,8 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $out .= "\n"; } - if (!$notab || $notab == -1 || $notab == -2) { - $out .= "\n".'
    '."\n"; + if (!$notab || $notab == -1 || $notab == -2 || $notab == -3) { + $out .= "\n".'
    '."\n"; } $parameters = array('tabname' => $active, 'out' => $out); @@ -2294,13 +2302,13 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi // Add alias for thirdparty if (!empty($object->name_alias)) { - $morehtmlref .= '
    '.$object->name_alias.'
    '; + $morehtmlref .= '
    '.$object->name_alias.'
    '; } // Add label if (in_array($object->element, array('product', 'bank_account', 'project_task'))) { if (!empty($object->label)) { - $morehtmlref .= '
    '.$object->label.'
    '; + $morehtmlref .= '
    '.$object->label.'
    '; } } @@ -2315,7 +2323,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && ($conf->global->MAIN_SHOW_TECHNICAL_ID == '1' || preg_match('/'.preg_quote($object->element, '/').'/i', $conf->global->MAIN_SHOW_TECHNICAL_ID)) && !empty($object->id)) { $morehtmlref .= '
    '; - $morehtmlref .= '
    '; + $morehtmlref .= '
    '; $morehtmlref .= $langs->trans("TechnicalID").': '.$object->id; $morehtmlref .= '
    '; } @@ -2630,6 +2638,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $useadodb = getDolGlobalInt('MAIN_USE_LEGACY_ADODB_FOR_DATE', 0); //$useadodb = 1; // To switch to adodb + if (!empty($useadodb)) { + include_once DOL_DOCUMENT_ROOT.'/includes/adodbtime/adodb-time.inc.php'; + } // Analyze date $reg = array(); @@ -2659,8 +2670,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $dtts->setTimestamp($time); $dtts->setTimezone($tzo); $newformat = str_replace( - array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), - array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + array('%Y', '%y', '%m', '%d', '%H', '%I', '%M', '%S', '%p', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), + array('Y', 'y', 'm', 'd', 'H', 'h', 'i', 's', 'A', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), $format); $ret = $dtts->format($newformat); $ret = str_replace( @@ -2685,8 +2696,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = $dtts->setTimestamp($timetouse); $dtts->setTimezone($tzo); $newformat = str_replace( - array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), - array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), + array('%Y', '%y', '%m', '%d', '%H', '%I', '%M', '%S', '%p', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'), + array('Y', 'y', 'm', 'd', 'H', 'h', 'i', 's', 'A', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'), $format); $ret = $dtts->format($newformat); $ret = str_replace( @@ -3828,6 +3839,10 @@ function isValidPhone($phone) */ function dol_strlen($string, $stringencoding = 'UTF-8') { + if (is_null($string)) { + return 0; + } + if (function_exists('mb_strlen')) { return mb_strlen($string, $stringencoding); } else { @@ -5753,6 +5768,11 @@ function price2num($amount, $rounding = '', $option = 0) { global $langs, $conf; + // Clean parameters + if (is_null($amount)) { + $amount = ''; + } + // Round PHP function does not allow number like '1,234.56' nor '1.234,56' nor '1 234,56' // Numbers must be '1234.56' // Decimal delimiter for PHP and database SQL requests must be '.' @@ -6784,6 +6804,10 @@ function picto_required() */ function dol_string_nohtmltag($stringtoclean, $removelinefeed = 1, $pagecodeto = 'UTF-8', $strip_tags = 0, $removedoublespaces = 1) { + if (is_null($stringtoclean)) { + return ''; + } + if ($removelinefeed == 2) { $stringtoclean = preg_replace('/]*>(\n|\r)+/ims', '
    ', $stringtoclean); } @@ -7086,6 +7110,10 @@ function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false) */ function dol_htmlentitiesbr($stringtoencode, $nl2brmode = 0, $pagecodefrom = 'UTF-8', $removelasteolbr = 1) { + if (is_null($stringtoencode)) { + return ''; + } + $newstring = $stringtoencode; if (dol_textishtml($stringtoencode)) { // Check if text is already HTML or not $newstring = preg_replace('//i', '
    ', $newstring); // Replace "
    " by "
    ". It's same and avoid pb with FPDF. @@ -7280,6 +7308,10 @@ function dol_nboflines_bis($text, $maxlinesize = 0, $charset = 'UTF-8') */ function dol_textishtml($msg, $option = 0) { + if (is_null($msg)) { + return false; + } + if ($option == 1) { if (preg_match('/projet) ? $object->projet->ref : ''); $substitutionarray['__PROJECT_NAME__'] = (is_object($object->projet) ? $object->projet->title : ''); } + if (is_object($object) && $object->element == 'project') { + $substitutionarray['__PROJECT_NAME__'] = $object->title; + } if (is_object($object) && $object->element == 'shipping') { $substitutionarray['__SHIPPINGTRACKNUM__'] = $object->tracking_number; @@ -7752,6 +7787,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'contrat') { $typeforonlinepayment = 'contract'; } + if (is_object($object) && $object->element == 'fichinter') { + $typeforonlinepayment = 'ficheinter'; + } $url = getOnlinePaymentUrl(0, $typeforonlinepayment, $substitutionarray['__REF__']); $paymenturl = $url; } @@ -7784,6 +7822,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, } else { $substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = ''; } + if (!empty($conf->global->FICHINTER_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'fichinter') { + $substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = $object->getLastMainDocLink($object->element); + } else { + $substitutionarray['__DIRECTDOWNLOAD_URL_FICHINTER__'] = ''; + } if (!empty($conf->global->SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD) && is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = $object->getLastMainDocLink($object->element); } else { @@ -7802,6 +7845,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'contrat') { $substitutionarray['__URL_CONTRACT__'] = DOL_MAIN_URL_ROOT."/contrat/card.php?id=".$object->id; } + if (is_object($object) && $object->element == 'fichinter') { + $substitutionarray['__URL_FICHINTER__'] = DOL_MAIN_URL_ROOT."/fichinter/card.php?id=".$object->id; + } if (is_object($object) && $object->element == 'supplier_proposal') { $substitutionarray['__URL_SUPPLIER_PROPOSAL__'] = DOL_MAIN_URL_ROOT."/supplier_proposal/card.php?id=".$object->id; } @@ -8120,7 +8166,7 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = ' * * @param int $date_start Start date * @param int $date_end End date - * @param string $format Output format + * @param string $format Output date format ('day', 'dayhour', ...) * @param Translate $outputlangs Output language * @param integer $withparenthesis 1=Add parenthesis, 0=no parenthesis * @return string String @@ -9109,10 +9155,10 @@ function getLanguageCodeFromCountryCode($countrycode) * @param string $type Value for object where objectvalue can be * 'thirdparty' to add a tab in third party view * 'intervention' to add a tab in intervention view - * 'supplier_order' to add a tab in supplier order view - * 'supplier_invoice' to add a tab in supplier invoice view - * 'invoice' to add a tab in customer invoice view - * 'order' to add a tab in customer order view + * 'supplier_order' to add a tab in purchase order view + * 'supplier_invoice' to add a tab in purchase invoice view + * 'invoice' to add a tab in sales invoice view + * 'order' to add a tab in sales order view * 'contract' to add a tabl in contract view * 'product' to add a tab in product view * 'propal' to add a tab in propal view @@ -10537,7 +10583,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * @param array $params = [ // Various params for future : recommended rather than adding more function arguments * 'attr' => [ // to add or override button attributes * 'xxxxx' => '', // your xxxxx attribute you want - * 'class' => '', // to add more css class to the button class attribute + * 'class' => 'reposition', // to add more css class to the button class attribute * 'classOverride' => '' // to replace class attribute of the button * ], * 'confirm' => [ @@ -10584,7 +10630,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = if (empty($userRight)) { $attr['class'] = 'butActionRefused'; $attr['href'] = ''; - $attr['title'] = $langs->trans('NotEnoughPermissions'); + $attr['title'] = (($label && $text && $label != $text) ? $label : $langs->trans('NotEnoughPermissions')); } if (!empty($id)) { @@ -10640,7 +10686,7 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $TCompiledAttr = array(); foreach ($attr as $key => $value) { - $TCompiledAttr[] = $key.'="'.$value.'"'; + $TCompiledAttr[] = $key.'= "'.$value.'"'; } $compiledAttributes = empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr); diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index b98f17e46ee..bd02d7cca53 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2015 Juanjo Menent + * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Charlie Benke * Copyright (C) 2017 ATM-CONSULTING * @@ -137,7 +137,13 @@ function facture_prepare_head($object) */ function invoice_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('facture'); + $extrafields->fetch_name_optionals_label('facturedet'); + $extrafields->fetch_name_optionals_label('facture_rec'); + $extrafields->fetch_name_optionals_label('facturedet_rec'); $h = 0; $head = array(); @@ -160,25 +166,41 @@ function invoice_admin_prepare_head() $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices"); + $nbExtrafields = $extrafields->attributes['facture']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['facturedet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec"); + $nbExtrafields = $extrafields->attributes['facture_rec']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributesrec'; $h++; $head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLinesRec"); + $nbExtrafields = $extrafields->attributes['facturedet_rec']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslinesrec'; $h++; - if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable + if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 5c77f8ab821..a106bf62369 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -189,7 +189,7 @@ function order_admin_prepare_head() /** - * Return a HTML table that contains a pie chart of customer orders + * Return a HTML table that contains a pie chart of sales orders * * @param int $socid (Optional) Show only results from the customer with this id * @return string A HTML table that contains a pie chart of customer invoices diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a9f82e3776d..7795f927c19 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -411,7 +411,7 @@ function show_stats_for_company($product, $socid) print '
    '; + print '
    '; // Show filemanager tree (will be filled by a call of ajax /ecm/tpl/enablefiletreeajax.tpl.php, later, that executes ajaxdirtree.php) print '
    '; diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 656b5b263aa..f09d7defeb1 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -78,6 +78,24 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { } } +if ($massaction == 'presetsupervisor') { + $formquestion = array(); + + $valuefield = '
    '; + $valuefield .= img_picto('', 'user').' '; + $valuefield .= $form->select_dolusers('', 'supervisortoset', 1, $arrayofselected, 0, '', 0, $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); + $valuefield .= '
    '; + + $formquestion[] = array( + 'type' => 'other', + 'name' => 'supervisortoset', + 'label' => $langs->trans("Supervisor"), + 'value' => $valuefield + ); + + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmSetSupervisor"), $langs->trans("ConfirmSetSupervisorQuestion", count($toselect)), "setsupervisor", $formquestion, 1, 0, 200, 500, 1); +} + if ($massaction == 'presend') { $langs->load("mails"); @@ -285,7 +303,7 @@ if ($massaction == 'preapproveleave') { // Allow Pre-Mass-Action hook (eg for confirmation dialog) $parameters = array( - 'toselect' => $toselect, + 'toselect' => isset($toselect) ? $toselect : array(), 'uploaddir' => isset($uploaddir) ? $uploaddir : null ); diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index dfa9b0e4591..a81c95251f4 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -60,7 +60,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { - $permission = $user->rights->propale->creer; + $permission = $user->rights->propal->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { @@ -96,11 +96,6 @@ if ($module == 'propal') { } //else dol_print_error('','Bad value '.$module.' for param module'); -if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { - $typeofdata = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. -} else { - $typeofdata = 'textarea:12:95%'; -} if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC)) { $typeofdatapub = 'ckeditor:dolibarr_notes:100%:200::1:12:95%:0'; // Rem: This var is for all notes, not only thirdparties note. } else { diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 4373f09fdb7..0770233c782 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -54,7 +54,7 @@ if ($fixedDiscount > 0) { print $langs->trans($translationKey, $fixedDiscount).'.'; } else { $translationKey = (!empty($discount_type)) ? 'HasNoRelativeDiscountFromSupplier' : 'CompanyHasNoRelativeDiscount'; - print ''.$langs->trans($translationKey).'.'; + print ''.$langs->trans($translationKey).'.'; } if ($isNewObject) { print ' ('.$addrelativediscount.')'; @@ -115,7 +115,7 @@ if ($absolute_creditnote > 0) { if ($absolute_discount <= 0 && $absolute_creditnote <= 0) { $translationKey = !empty($discount_type) ? 'HasNoAbsoluteDiscountFromSupplier' : 'CompanyHasNoAbsoluteDiscount'; - print '
    '.$langs->trans($translationKey).'.'; + print '
    '.$langs->trans($translationKey).'.'; if ($isInvoice && $object->statut == $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { print ' ('.$addabsolutediscount.')'; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index bc48c28140e..381683cf62c 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -292,7 +292,9 @@ if ($nolinesbefore) { $alsoproductwithnosupplierprice = 0; } else { $ajaxoptions = array( - 'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key + // Disabled: This is useless because setting discount and price_ht after a selection is already managed + // by ths page itself with a .change on the combolist '#idprodfournprice' + //'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key ); $alsoproductwithnosupplierprice = 1; } @@ -411,13 +413,14 @@ if ($nolinesbefore) { $coldisplay++; ?>
    - "> + "> "> + + "> ">%">% %% %%%%'; + print $form->load_tva('tva_tx', GETPOSTISSET('tva_tx') ? GETPOST('tva_tx', 'alpha') : ($line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : '')), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1); + print '% - info_bits & 2) != 2) { - print '%'; + print '>%'; } else { ?>   %'.$margin_rate.'%'.$margin_rate.'%%%'.$mark_rate.'%'.$mark_rate.'%%%
      '.$langs->trans('Description').''.$langs->trans('Description').''.$langs->trans("SupplierRef").''.$langs->trans("SupplierRef").''; +print ''; if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) { print $langs->trans('Taxes'); } else { @@ -82,30 +82,30 @@ if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_ print ''; } } -print ''; +print ''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).''.$langs->trans('PriceUTTC').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''.$langs->trans('Qty').''.$langs->trans('Unit').''.$langs->trans('Unit').''; +print ''; print $langs->trans('ReductionShort'); if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) { @@ -122,59 +122,59 @@ if (in_array($object->element, array('propal', 'commande', 'facture')) && $objec print ''; } } -print ''; +print ''.$langs->trans('Progress').''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''.$langs->trans('Progress').''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''.$langs->trans('BuyingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('CostPrice').''.$langs->trans('CostPrice').''.$langs->trans('MarginRate').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').''.$langs->trans('MarkRate').''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShort').''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).''.$langs->trans('TotalTTCShort').''.$langs->trans('TotalTTCShort').''; + print ''; print ''; print ''; - print ''; + print '
    "; print "
    '; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index db48c0e7fce..8f4b32ae502 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2022 Laurent Destailleur * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -23,6 +23,7 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; /** @@ -1408,21 +1409,30 @@ class Cronjob extends CommonObject if (empty($this->datenextrun)) { if (empty($this->datestart)) { - $this->datenextrun = $now + ($this->frequency * $this->unitfrequency); + if ($this->unitfrequency == 2678400) { + $this->datenextrun = dol_time_plus_duree($now, $this->frequency, 'm'); + } else { + $this->datenextrun = $now + ($this->frequency * $this->unitfrequency); + } } else { - $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency); + if ($this->unitfrequency == 2678400) { + $this->datenextrun = dol_time_plus_duree($this->datestart, $this->frequency, 'm'); + } else { + $this->datenextrun = $this->datestart + ($this->frequency * $this->unitfrequency); + } } } if ($this->datenextrun < $now && $this->frequency > 0 && $this->unitfrequency > 0) { // Loop until date is after future while ($this->datenextrun < $now) { - $this->datenextrun += ($this->frequency * $this->unitfrequency); - - // TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit) + if ($this->unitfrequency == 2678400) { + $this->datenextrun = dol_time_plus_duree($this->datenextrun, $this->frequency, 'm'); + } else { + $this->datenextrun += ($this->frequency * $this->unitfrequency); + } } } else { - //$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency); dol_syslog(get_class($this)."::reprogram_jobs datenextrun is already in future, we do not change it"); } diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 44152f0c68b..fb76767bf1e 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -451,8 +451,8 @@ class DataPolicyCron $this->db->begin(); foreach ($arrayofparameters as $key => $params) { - if ($conf->global->$key != '' && is_numeric($conf->global->$key) && (int) $conf->global->$key > 0) { - $sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key); + if (getDolGlobalInt($key) > 0) { + $sql = sprintf($params['sql'], (int) $conf->entity, (int) getDolGlobalInt($key), (int) getDolGlobalInt($key)); $resql = $this->db->query($sql); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 8ab49d36990..b98b75015ab 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -328,37 +328,25 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1); $morehtmlref .= '
    '.$langs->trans("RefDeliveryReceipt").' : '.$object->ref; // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$expedition->thirdparty->getNomUrl(1); // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if (0) { // Do not change on shipment + $morehtmlref .= '
    '; + if (0) { // Do not change on shipment + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $expedition->id, $expedition->socid, $expedition->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($expedition->socid, $expedition->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
    '; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$expedition->id, $expedition->socid, $expedition->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - $morehtmlref .= ' : '; if (!empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } @@ -577,11 +565,11 @@ if ($action == 'create') { } $text .= ' '.$object->lines[$i]->product_ref.''; $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($object->lines[$i]->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($object->lines[$i]->description)); //print $description; print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range($object->lines[$i]->date_start, $object->lines[$i]->date_end); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '
    '.dol_htmlentitiesbr($object->lines[$i]->description) : ''; } } else { diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 42607aa0dab..adfd405790f 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -469,13 +469,14 @@ if ($action != 'edit' && $action != 'delete' && $action != 'deletefile') { print ''; } + // Confirm remove file if ($action == 'deletefile') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode(GETPOST("section", 'alpha')).'&urlfile='.urlencode(GETPOST("urlfile")).($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile'); } -// Confirm remove file -if ($action == 'delete_dir') { +// Confirm remove dir +if ($action == 'delete' || $action == 'delete_dir') { $relativepathwithoutslash = preg_replace('/[\/]$/', '', $relativepath); //Form to close proposal (signed or not) diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 9d9ff5a463f..625e69e626e 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -476,6 +476,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act $htmltooltip .= ''.$langs->trans("Description").': '.$val['desc']; print $form->textwithpicto('', $htmltooltip, 1, 'info'); print ''; + print ''; $nbofentries++; diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php index 1f5e52e4577..a7e601bf053 100644 --- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php +++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php @@ -24,6 +24,7 @@ if (empty($conf) || !is_object($conf)) { print "Error, template enablefiletreeajax.tpl.php can't be called as URL"; exit; } +// Must have set $module, $nameforformuserfile, $preopened ?> @@ -57,7 +58,7 @@ $(document).ready(function() { multiFolder: false }, // Called if we click on a file (not a dir) function(file) { - console.log("We click on a file"); + console.log("We click on a file "+file); $("#mesg").hide(); loadandshowpreview(file,0); }, @@ -65,7 +66,7 @@ $(document).ready(function() { function(elem) { id=elem.attr('id').substr(12); // We get id that is 'fmdirlia_id_xxx' (id we want is xxx) rel=elem.attr('rel') - console.log("We click on a dir, we call the ajaxdirtree.php with modulepart=, param="); + console.log("We click on a dir id="+id+", we call the ajaxdirtree.php with modulepart=, param="); console.log("We also save id and dir name into _section_id|dir (vars into form to attach new file in filemanager.tpl.php) with id="+id+" and rel="+rel); jQuery("#_section_dir").val(rel); jQuery("#_section_id").val(id); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index f5da262e0c1..8d72666ad53 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -28,12 +28,12 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal -require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order +require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Sale Order require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order -require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Purchase Order +require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Purchase Invoice require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting @@ -1766,7 +1766,7 @@ class EmailCollector extends CommonObject if ($reg[1] == 'pro') { // Customer Proposal $objectemail = new Propal($this->db); } - if ($reg[1] == 'ord') { // Customer Order + if ($reg[1] == 'ord') { // Sale Order $objectemail = new Commande($this->db); } if ($reg[1] == 'shi') { // Shipment diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 222a0c78946..909758ca3f2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -103,12 +103,13 @@ class ConferenceOrBoothAttendee extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), - 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), + 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1), 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), + 'email_company' => array('type'=>'mail', 'label'=>'EmailCompany', 'enabled'=>'1', 'position'=>41, 'notnull'=>0, 'visible'=>-2, 'searchall'=>1), 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',), 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'$conf->facture->enabled', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'), 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), @@ -125,11 +126,13 @@ class ConferenceOrBoothAttendee extends CommonObject ); public $rowid; public $ref; - public $fk_soc; public $fk_actioncomm; + public $fk_project; public $email; public $firstname; public $lastname; + public $fk_soc; + public $email_company; public $date_subscription; public $fk_invoice; public $amount; diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index 46e41dec78e..b6932c2cf09 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -203,7 +203,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 2c304bd8562..7810114aec1 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -187,7 +187,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 56b34f68b03..78f74ded42d 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -160,7 +160,7 @@ if (!empty($withproject)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 520435c9cdc..f69d86c62e7 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -287,7 +287,7 @@ if ($projectid > 0) { $morehtmlref .= $project->title; // Thirdparty if (isset($project->thirdparty->id) && $project->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$project->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$project->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -348,8 +348,15 @@ if ($projectid > 0) { } print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($project->budget_amount, '')) { + print ''.price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print '
    '.$langs->trans("Dates").' ('.$langs->trans("Project").')'; $start = dol_print_date($project->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($project->date_end, 'day'); @@ -360,13 +367,23 @@ if ($projectid > 0) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($project->budget_amount, '')) { - print price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + // Date start - end of event + print '
    '.$langs->trans("Dates").' ('.$langs->trans("Event").')'; + $start = dol_print_date($project->date_start_event, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($project->date_end_event, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($object->hasDelay()) { + print img_warning("Late"); } print '
    '.$langs->trans("Location").''; + print $project->location; + print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print '
    '.$langs->trans("Dates").' ('.$langs->trans("Project").')'; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -486,13 +493,23 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + // Date start - end of event + print '
    '.$langs->trans("Dates").' ('.$langs->trans("Event").')'; + $start = dol_print_date($projectstatic->date_start_event, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($projectstatic->date_end_event, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($projectstatic->hasDelay()) { + print img_warning("Late"); } print '
    '.$langs->trans("Location").''; + print $projectstatic->location; + print '
    '; + print '
    '; // Type print ''; print ''; - $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); - $form_permission2 = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate; + //$form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate && ($object->getSommePaiement() <= 0); + $form_permission = ($object->statut < FactureFournisseur::STATUS_CLOSED) && $usercancreate; // Date print '\n"; } } + +/** + * Migrate Rank into contract line + * + * @return void + */ +function migrate_contractdet_rank() +{ + + global $db, $langs; + + $error = 0; + $resultstring = ''; + + $db->begin(); + print ''; + + if (!$resultstring) { + print '\n"; + } +} diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index c20fa91c621..fee18df2478 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -105,7 +105,6 @@ class KnowledgeRecord extends CommonObject 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>20, 'index'=>1), 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1, 'tdcss'=>'titlefieldcreate nowraponall', "csslist"=>"tdoverflowmax100"), - 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>2,), 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), @@ -115,7 +114,8 @@ class KnowledgeRecord extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), - 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'$conf->ticket->enabled', 'position'=>512, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), + 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'isModEnabled("ticket")', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), + 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),), ); public $rowid; diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php index ba5a3c3b391..1e5f69aaa93 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php @@ -26,7 +26,7 @@ dol_include_once('/knowledgemanagement/core/modules/knowledgemanagement/modules_ /** - * Class to manage customer order numbering rules standard + * Class to manage the knowledgerecord numbering rules standard */ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord { diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 18f36c192c2..c28bc9e1c9c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -118,7 +118,7 @@ if (empty($reshook)) { $triggermodname = 'KNOWLEDGEMANAGEMENT_KNOWLEDGERECORD_MODIFY'; // Name of trigger action code to execute when we modify record - // Upadate / add for lang + // Update / add for lang if (($action == 'update' || $action == 'add') && !empty($permissiontoadd)) { $object->lang = (GETPOSTISSET('langkm') ? GETPOST('langkm', 'aZ09') : $object->lang); } @@ -182,12 +182,14 @@ if ($action == 'create') { print ''; } - print dol_get_fiche_head(array(), ''); + print dol_get_fiche_head(array(), '', '', -3); print '
    '.$langs->trans('Type').''; @@ -3002,8 +2991,8 @@ if ($action == 'create') { print ''.$form->editfieldval("Label", 'label', $object->label, $object, $usercancreate).'
    '; @@ -3015,11 +3004,11 @@ if ($action == 'create') { // Default terms of the settlement $langs->load('bills'); print '
    '; - print '
    '; + print ''; + print ''; } print '
    '; print $langs->trans('PaymentConditions'); print ''; if ($action != 'editconditions' && $form_permission) { - print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
    '; print '
    '; @@ -3033,9 +3022,9 @@ if ($action == 'create') { // Due date print '
    '; - print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker'); + print $form->editfieldkey("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); print ''; - print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission2, 'datepicker'); + print $form->editfieldval("DateMaxPayment", 'date_lim_reglement', $object->date_echeance, $object, $form_permission, 'datepicker'); if ($action != 'editdate_lim_reglement' && $object->hasDelay()) { print img_warning($langs->trans('Late')); } @@ -3044,10 +3033,10 @@ if ($action == 'create') { // Mode of payment $langs->load('bills'); print '
    '; - print ''; print ''; // Note -print ''; +print ''; //print ''; // No width to allow autodim diff --git a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php index 60bb56ff173..81e3f9f2155 100644 --- a/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php +++ b/htdocs/hrm/core/tpl/skilldet.fiche.tpl.php @@ -43,7 +43,7 @@ $value_private .= "\n"; /* // Special cases if ($module == 'propal') { -$permission = $user->rights->propale->creer; +$permission = $user->rights->propal->creer; } elseif ($module == 'supplier_proposal') { $permission = $user->rights->supplier_proposal->creer; } elseif ($module == 'fichinter') { diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index a6c6c2a9406..732b91d756f 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -158,7 +158,7 @@ if ($object->id > 0) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php index 9f9b937a467..08854e2d88e 100644 --- a/htdocs/hrm/evaluation_card.php +++ b/htdocs/hrm/evaluation_card.php @@ -94,7 +94,9 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled("hrm")) { + accessforbidden(); +} if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); @@ -283,11 +285,7 @@ if ($action == 'create') { print dol_get_fiche_end(); - print '
    '; - print ''; - print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage - print '
    '; + print $form->buttonsSaveCancel("Create", "Cancel"); print ''; } @@ -321,9 +319,7 @@ if (($id || $ref) && $action == 'edit') { print dol_get_fiche_end(); - print '
    '; - print '   '; - print '
    '; + print $form->buttonsSaveCancel(); print ''; } @@ -381,8 +377,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } - // Confirmation of action xxxx + // Confirmation of action xxxx (You can use it for xxx = 'close', xxx = 'reopen', ...) if ($action == 'xxx') { + $text = $langs->trans('ConfirmActionMyObject', $object->ref); + $formquestion = array(); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); @@ -412,7 +410,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= ''; @@ -446,11 +444,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea * Lines */ - if (!empty($object->table_element_line)) { - if ($object->status == Evaluation::STATUS_DRAFT) { - $result = $object->getLinesArray(); + if (!empty($object->table_element_line) && $object->status == Evaluation::STATUS_DRAFT) { + // Show object lines + $result = $object->getLinesArray(); + if ($result < 0) { + dol_print_error($db, $object->error, $object->errors); + } - print ' + print '
    '; + + print ' @@ -458,46 +461,44 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea '; - if (!empty($conf->use_javascript_ajax) && $object->status == 0) { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print '
    '; - /*if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
    '; + print ''; - if ($action != 'editmode' && $form_permission2) { + if ($action != 'editmode' && $form_permission) { print ''; } print '
    '; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
    '; @@ -3154,7 +3143,7 @@ if ($action == 'create') { if (isModEnabled('intracommreport')) { $langs->loadLangs(array("intracommreport")); print '
    '; - print ''; +} + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print "
    '; + print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { @@ -3300,7 +3289,7 @@ if ($action == 'create') { $i = 0; print '
    '; - print '
    '; print $langs->trans('IntracommReportTransportMode'); print '
    '; + print '
    '; print ''; print ''; print ''; @@ -3326,12 +3315,13 @@ if ($action == 'create') { $paymentstatic->type_label = $objp->payment_type; print ''; - print ''; print ''; - print ''; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; @@ -3783,21 +3773,26 @@ if ($action == 'create') { // Delete $isErasable = $object->is_erasable(); - if ($action != 'confirm_edit' && ($user->rights->fournisseur->facture->supprimer || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) - //var_dump($isErasable); + if ($action != 'confirm_edit' && ($usercandelete || ($usercancreate && $isErasable == 1))) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions) + $enableDelete = false; + $htmltooltip = ''; + $params = (empty($conf->use_javascript_ajax) ? array() : array('attr' => array('class' => 'reposition'))); + //var_dump($isErasable); var_dump($params); if ($isErasable == -4) { - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecausePayments"); } elseif ($isErasable == -3) { // Should never happen with supplier invoice - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseNotLastSituationInvoice"); } elseif ($isErasable == -2) { // Should never happen with supplier invoice - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseNotLastInvoice"); } elseif ($isErasable == -1) { - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseDispatchedInBookkeeping"); } elseif ($isErasable <= 0) { // Any other cases - print ''.$langs->trans('Delete').''; + $htmltooltip = $langs->trans("DisabledBecauseNotErasable"); } else { - print ''.$langs->trans('Delete').''; + $enableDelete = true; + $htmltooltip = ''; } + print dolGetButtonAction($htmltooltip, $langs->trans("Delete"), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), $object->id, $enableDelete, $params); } print ''; diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index f9f7a754b8f..542b37db092 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -51,6 +51,9 @@ $hookmanager->initHooks(array('invoicesuppliercardcontact')); $object = new FactureFournisseur($db); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$permissiontoadd = $usercancreate; + /* * Ajout d'un nouveau contact @@ -133,40 +136,28 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/facture/document.php b/htdocs/fourn/facture/document.php index fa08b721370..03012acbcaf 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -112,40 +112,28 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/facture/info.php b/htdocs/fourn/facture/info.php index a4322c2448e..9223d47b791 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -49,6 +49,9 @@ $hookmanager->initHooks(array('invoicesuppliercardinfo')); $object = new FactureFournisseur($db); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$permissiontoadd = $usercancreate; + /* * View @@ -75,40 +78,28 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty -$morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); +$morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->facture->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 .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 6e006704a83..1d7149cdb10 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -72,7 +72,6 @@ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search $search_label = GETPOST("search_label", "alpha"); $search_amount_no_tax = GETPOST("search_amount_no_tax", "alpha"); $search_amount_all_tax = GETPOST("search_amount_all_tax", "alpha"); -$search_product_category = GETPOST('search_product_category', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refsupplier = GETPOST('search_refsupplier', 'alpha'); $search_type = GETPOST('search_type', 'int'); @@ -116,10 +115,10 @@ $search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int'); $search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int'); $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); -$toselect = GETPOST('toselect', 'array'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); $search_categ_sup = trim(GETPOST("search_categ_sup", 'int')); +$search_product_category = GETPOST('search_product_category', 'int'); $option = GETPOST('search_option'); if ($option == 'late') { @@ -162,9 +161,9 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $fieldstosearchall = array( 'f.ref'=>'Ref', 'f.ref_supplier'=>'RefSupplier', - 'pd.description'=>'Description', - 's.nom'=>"ThirdParty", 'f.note_public'=>'NotePublic', + 's.nom'=>"ThirdParty", + 'pd.description'=>'Description', ); if (empty($user->socid)) { $fieldstosearchall["f.note_private"] = "NotePrivate"; @@ -296,10 +295,10 @@ if (empty($reshook)) { $search_datelimit_end = ''; $toselect = array(); $search_array_options = array(); + $search_categ_sup = 0; $filter = ''; $option = ''; $socid = ""; - $search_categ_sup = 0; } // Mass actions @@ -421,9 +420,6 @@ $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " country.code as country_code,"; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; $sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender'; -if ($search_categ_sup && $search_categ_sup != '-1') { - $sql .= ", cs.fk_categorie, cs.fk_soc"; -} // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. if (!$search_all) { @@ -437,16 +433,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.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_sup) && $search_categ_supplier != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; -} - $sql .= ', '.MAIN_DB_PREFIX.'facture_fourn as f'; if (isset($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 (f.rowid = ef.fk_object)"; @@ -457,9 +449,6 @@ if (!$search_all) { if ($search_all || $search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn'; } -if ($search_product_category > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; -} $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; // We'll need this table joined to the select in order to filter by sale @@ -479,9 +468,6 @@ $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; if (empty($user->rights->societe->client->voir) && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } -if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); -} if ($socid > 0) { $sql .= ' AND s.rowid = '.((int) $socid); } @@ -598,11 +584,57 @@ if ($option == 'late') { if ($search_label) { $sql .= natural_search('f.libelle', $search_label); } -if ($search_categ_sup > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ_sup); +$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array(); +$searchCategorySupplierOperator = 0; +// Search for tag/category ($searchCategorySupplierList is an array of ID) +if (!empty($searchCategorySupplierList)) { + $searchCategorySupplierSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategorySupplierList as $searchCategorySupplier) { + if (intval($searchCategorySupplier) == -2) { + $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategorySupplier) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } + } + if ($listofcategoryid) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategorySupplierOperator == 1) { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategorySupplierSqlList).")"; + } + } else { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategorySupplierSqlList).")"; + } + } } -if ($search_categ_sup == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductList = $search_product_category ? array($search_product_category) : array(); +$searchCategorySupplierOperator = 0; +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; + } elseif (intval($searchCategoryProduct) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } } if ($search_status != '' && $search_status >= 0) { $sql .= " AND f.fk_statut = ".((int) $search_status); @@ -624,7 +656,7 @@ if ($search_user > 0) { 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; if (!$search_all) { @@ -640,9 +672,6 @@ if (!$search_all) { $sql .= ' country.code,'; $sql .= " p.rowid, p.ref, p.title,"; $sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender"; - if ($search_categ_sup && $search_categ_sup != '-1') { - $sql .= ", cs.fk_categorie, cs.fk_soc"; - } if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { //prevent error with sql_mode=only_full_group_by @@ -651,7 +680,7 @@ if (!$search_all) { } // Add GroupBy from hooks $parameters = array('all' => $search_all, 'fieldstosearchall' => $fieldstosearchall); - $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } else { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); @@ -659,7 +688,7 @@ if (!$search_all) { // Add HAVING from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); @@ -678,1105 +707,1116 @@ $sql .= $db->plimit($limit + 1, $offset); //print $sql; $resql = $db->query($sql); -if ($resql) { - $num = $db->num_rows($resql); +if (!$resql) { + dol_print_error($db); +} - $arrayofselected = is_array($toselect) ? $toselect : array(); +$num = $db->num_rows($resql); - if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($resql); - $id = $obj->facid; +$arrayofselected = is_array($toselect) ? $toselect : array(); - header("Location: ".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$id); - exit; - } +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { + $obj = $db->fetch_object($resql); + $id = $obj->facid; - llxHeader('', $langs->trans("SuppliersInvoices"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); + header("Location: ".DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$id); + exit; +} - if ($socid) { - $soc = new Societe($db); - $soc->fetch($socid); - if (empty($search_company)) { - $search_company = $soc->name; - $search_company_alias = $soc->name_alias; - } - } +llxHeader('', $langs->trans("SuppliersInvoices"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores'); - $param = '&socid='.$socid; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); - } - if ($search_all) { - $param .= '&search_all='.urlencode($search_all); - } - if ($search_date_startday) { - $param .= '&search_date_startday='.urlencode($search_date_startday); - } - if ($search_date_startmonth) { - $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); - } - if ($search_date_startyear) { - $param .= '&search_date_startyear='.urlencode($search_date_startyear); - } - if ($search_date_endday) { - $param .= '&search_date_endday='.urlencode($search_date_endday); - } - if ($search_date_endmonth) { - $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); - } - if ($search_date_endyear) { - $param .= '&search_date_endyear='.urlencode($search_date_endyear); - } - if ($search_datelimit_startday) { - $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); - } - if ($search_datelimit_startmonth) { - $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); - } - if ($search_datelimit_startyear) { - $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); - } - if ($search_datelimit_endday) { - $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); - } - if ($search_datelimit_endmonth) { - $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); - } - if ($search_datelimit_endyear) { - $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); - } - if ($search_ref) { - $param .= '&search_ref='.urlencode($search_ref); - } - if ($search_refsupplier) { - $param .= '&search_refsupplier='.urlencode($search_refsupplier); - } - if ($search_type != '') { - $param .= '&search_type='.urlencode($search_type); - } - if ($search_label) { - $param .= '&search_label='.urlencode($search_label); - } - if ($search_company) { - $param .= '&search_company='.urlencode($search_company); - } - if ($search_company_alias) { - $param .= '&search_company_alias='.urlencode($search_company_alias); - } - if ($search_login) { - $param .= '&search_login='.urlencode($search_login); - } - if ($search_montant_ht != '') { - $param .= '&search_montant_ht='.urlencode($search_montant_ht); - } - if ($search_montant_vat != '') { - $param .= '&search_montant_vat='.urlencode($search_montant_vat); - } - if ($search_montant_localtax1 != '') { - $param .= '&search_montant_localtax1='.urlencode($search_montant_localtax1); - } - if ($search_montant_localtax2 != '') { - $param .= '&search_montant_localtax2='.urlencode($search_montant_localtax2); - } - if ($search_montant_ttc != '') { - $param .= '&search_montant_ttc='.urlencode($search_montant_ttc); - } - if ($search_multicurrency_code != '') { - $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code); - } - if ($search_multicurrency_tx != '') { - $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx); - } - if ($search_multicurrency_montant_ht != '') { - $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht); - } - if ($search_multicurrency_montant_vat != '') { - $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat); - } - if ($search_multicurrency_montant_ttc != '') { - $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc); - } - if ($search_amount_no_tax) { - $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax); - } - if ($search_amount_all_tax) { - $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax); - } - if ($search_status >= 0) { - $param .= "&search_status=".urlencode($search_status); - } - if ($show_files) { - $param .= '&show_files='.urlencode($show_files); - } - if ($option) { - $param .= "&search_option=".urlencode($option); - } - if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); - } - if ($search_categ_sup > 0) { - $param .= '&search_categ_sup='.urlencode($search_categ_sup); - } - if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { - $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); +if ($socid) { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) { + $search_company = $soc->name; + $search_company_alias = $soc->name_alias; } +} - // Add $param from extra fields - 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 - $param .= $hookmanager->resPrint; +$param = '&socid='.$socid; +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +if ($search_all) { + $param .= '&search_all='.urlencode($search_all); +} +if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); +} +if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); +} +if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); +} +if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); +} +if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); +} +if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); +} +if ($search_datelimit_startday) { + $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday); +} +if ($search_datelimit_startmonth) { + $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth); +} +if ($search_datelimit_startyear) { + $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear); +} +if ($search_datelimit_endday) { + $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday); +} +if ($search_datelimit_endmonth) { + $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth); +} +if ($search_datelimit_endyear) { + $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear); +} +if ($search_ref) { + $param .= '&search_ref='.urlencode($search_ref); +} +if ($search_refsupplier) { + $param .= '&search_refsupplier='.urlencode($search_refsupplier); +} +if ($search_type != '') { + $param .= '&search_type='.urlencode($search_type); +} +if ($search_label) { + $param .= '&search_label='.urlencode($search_label); +} +if ($search_company) { + $param .= '&search_company='.urlencode($search_company); +} +if ($search_company_alias) { + $param .= '&search_company_alias='.urlencode($search_company_alias); +} +if ($search_login) { + $param .= '&search_login='.urlencode($search_login); +} +if ($search_montant_ht != '') { + $param .= '&search_montant_ht='.urlencode($search_montant_ht); +} +if ($search_montant_vat != '') { + $param .= '&search_montant_vat='.urlencode($search_montant_vat); +} +if ($search_montant_localtax1 != '') { + $param .= '&search_montant_localtax1='.urlencode($search_montant_localtax1); +} +if ($search_montant_localtax2 != '') { + $param .= '&search_montant_localtax2='.urlencode($search_montant_localtax2); +} +if ($search_montant_ttc != '') { + $param .= '&search_montant_ttc='.urlencode($search_montant_ttc); +} +if ($search_multicurrency_code != '') { + $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code); +} +if ($search_multicurrency_tx != '') { + $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx); +} +if ($search_multicurrency_montant_ht != '') { + $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht); +} +if ($search_multicurrency_montant_vat != '') { + $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat); +} +if ($search_multicurrency_montant_ttc != '') { + $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc); +} +if ($search_amount_no_tax) { + $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax); +} +if ($search_amount_all_tax) { + $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax); +} +if ($search_status >= 0) { + $param .= "&search_status=".urlencode($search_status); +} +if ($show_files) { + $param .= '&show_files='.urlencode($show_files); +} +if ($option) { + $param .= "&search_option=".urlencode($option); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +if ($search_categ_sup > 0) { + $param .= '&search_categ_sup='.urlencode($search_categ_sup); +} +if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { + $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); +} - // List of mass actions available - $arrayofmassactions = array( - 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), - ); +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; - if (isModEnabled('paymentbybanktransfer') && !empty($user->rights->paymentbybanktransfer->create)) { - $langs->load('withdrawals'); - $arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); - } - if ($user->rights->fournisseur->facture->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); - } - if (in_array($massaction, array('presend', 'predelete'))) { - $arrayofmassactions = array(); - } - $massactionbutton = $form->selectMassAction('', $arrayofmassactions); +// List of mass actions available +$arrayofmassactions = array( + 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), + 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), + //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), + //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +); - $url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; - if (!empty($socid)) { - $url .= '&socid='.urlencode($socid); - } - $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); +if (isModEnabled('paymentbybanktransfer') && !empty($user->rights->paymentbybanktransfer->create)) { + $langs->load('withdrawals'); + $arrayofmassactions['banktransfertrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeBankTransferOrder"); +} +if ($user->rights->fournisseur->facture->supprimer) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} +if (in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); - $i = 0; - print '
    '."\n"; - if ($optioncss != '') { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; +$url = DOL_URL_ROOT.'/fourn/facture/card.php?action=create'; +if (!empty($socid)) { + $url .= '&socid='.urlencode($socid); +} +$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)); - print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_invoice', 0, $newcardbutton, '', $limit, 0, 0, 1); +$i = 0; +print ''."\n"; +if ($optioncss != '') { + print ''; +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; - $topicmail = "SendBillRef"; - $modelmail = "invoice_supplier_send"; - $objecttmp = new FactureFournisseur($db); - $trackid = 'sinv'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; +print_barre_liste($langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : ''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_invoice', 0, $newcardbutton, '', $limit, 0, 0, 1); - if ($search_all) { - foreach ($fieldstosearchall as $key => $val) { - $fieldstosearchall[$key] = $langs->trans($val); - } - print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; - } +$topicmail = "SendBillRef"; +$modelmail = "invoice_supplier_send"; +$objecttmp = new FactureFournisseur($db); +$trackid = 'sinv'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; - // If the user can view prospects other than his' - $moreforfilter = ''; - if ($user->rights->user->user->lire) { - $langs->load("commercial"); - $moreforfilter .= '
    '; - $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200'); - $moreforfilter .= '
    '; - } - // If the user can view prospects other than his' - if ($user->rights->user->user->lire) { - $moreforfilter .= '
    '; - $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); - $moreforfilter .= '
    '; - } - // If the user can view prospects other than his' - if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { - include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
    '; - $tmptitle = $langs->trans('IncludingProductWithTag'); - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); - $moreforfilter .= '
    '; +if ($search_all) { + foreach ($fieldstosearchall as $key => $val) { + $fieldstosearchall[$key] = $langs->trans($val); } + print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; +} - if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter .= '
    '; - $tmptitle = $langs->trans('SuppliersCategoriesShort'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $tmptitle); - $moreforfilter .= '
    '; - } - $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; - } +// If the user can view prospects other than his' +$moreforfilter = ''; +if ($user->rights->user->user->lire) { + $langs->load("commercial"); + $moreforfilter .= '
    '; + $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200'); + $moreforfilter .= '
    '; +} +// If the user can view prospects other than his' +if ($user->rights->user->user->lire) { + $moreforfilter .= '
    '; + $tmptitle = $langs->trans('LinkedToSpecificUsers'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); + $moreforfilter .= '
    '; +} +// If the user can view prospects other than his' +if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter .= '
    '; + $tmptitle = $langs->trans('IncludingProductWithTag'); + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); + $moreforfilter .= '
    '; +} - if ($moreforfilter) { - print '
    '; - print $moreforfilter; - print '
    '; - } +if (isModEnabled('categorie')) { + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter .= '
    '; + $tmptitle = $langs->trans('SuppliersCategoriesShort'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $tmptitle); + $moreforfilter .= '
    '; +} +$parameters = array(); +$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 { + $moreforfilter = $hookmanager->resPrint; +} - $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); - } +if ($moreforfilter) { + print '
    '; + print $moreforfilter; + print '
    '; +} - print '
    '; - print '
    '.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').'
    '; + print ''; print $paymentstatic->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dp), 'day').''; - print $form->form_modes_reglement(null, $objp->paiement_type, 'none').' '.$objp->num_payment; + $s = $form->form_modes_reglement(null, $objp->paiement_type, 'none', '', 1, 0, '', 1).' '.$objp->num_payment; + print ''; + print $s; print '
    '."\n"; +$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); +} - // Line for filters - print ''; - // Ref - if (!empty($arrayfields['f.ref']['checked'])) { - print ''; - } - // Ref supplier - if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; - } - // Type - if (!empty($arrayfields['f.type']['checked'])) { - print ''; - } - // Label - if (!empty($arrayfields['f.label']['checked'])) { - print ''; - } - // Date invoice - if (!empty($arrayfields['f.datef']['checked'])) { - print ''; - } - // Date due - if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; - } - // Project - if (!empty($arrayfields['p.ref']['checked'])) { - print ''; - } - // Thirpdarty - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - } - // Alias - if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - } - // Town - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - } - // Zip - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print ''; - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - } - // Company type - if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - } - // Condition of payment - if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; - } - // Payment mode - if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; - } - if (!empty($arrayfields['f.total_ht']['checked'])) { - // Amount without tax - print ''; - } - if (!empty($arrayfields['f.total_vat']['checked'])) { - // Amount vat - print ''; - } - if (!empty($arrayfields['f.total_localtax1']['checked'])) { - // Amount tax 1 - print ''; - } - if (!empty($arrayfields['f.total_localtax2']['checked'])) { - // Amount tax 2 - print ''; - } - if (!empty($arrayfields['f.total_ttc']['checked'])) { - // Amount inc tac - print ''; - } - if (!empty($arrayfields['u.login']['checked'])) { - // Author - print ''; - } - if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''; - } - if (!empty($arrayfields['rtp']['checked'])) { - print ''; - } - if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - // Currency - print ''; - } - if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - // Currency rate - print ''; - } - if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - // Amount - print ''; - } - if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''; - } - if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; +print '
    '; +print '
    '; - print ''; - print ''; - print ''; - print ''; - $listtype = array( - FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), - FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), - FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), - FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), - ); - /* - if (!empty($conf->global->INVOICE_USE_SITUATION)) - { - $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); - } - */ - //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. - print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); - print ''; - print ''; - print ''; - print '
    '; - print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); - print '
    '; - print '
    '; - print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); - print '
    '; - print '
    '; - print '
    '; - /* - print $langs->trans('From').' '; - print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); - print '
    '; - print '
    '; - print $langs->trans('to').' ';*/ - print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); - print '
    '.$langs->trans("Alert"); - print '
    '; - print '
    0 ? " disabled" : "").'>'; - print ''; - print ''; - print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); - print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); - print ''; - print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100'); - print ''; - print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 20, 1, 'maxwidth100', 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
    '."\n"; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields); - $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (!empty($arrayfields['f.datec']['checked'])) { - print ''; - } - // Date modification - if (!empty($arrayfields['f.tms']['checked'])) { - print ''; - } - // Status - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print ''; - } - // Action column - print ''; +// Ref +if (!empty($arrayfields['f.ref']['checked'])) { + print ''; +} +// Ref supplier +if (!empty($arrayfields['f.ref_supplier']['checked'])) { + print ''; +} +// Type +if (!empty($arrayfields['f.type']['checked'])) { + print ''; +} +// Label +if (!empty($arrayfields['f.label']['checked'])) { + print ''; +} +// Date invoice +if (!empty($arrayfields['f.datef']['checked'])) { + print ''; +} +// Date due +if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { + print ''; +} +// Project +if (!empty($arrayfields['p.ref']['checked'])) { + print ''; +} +// Thirpdarty +if (!empty($arrayfields['s.nom']['checked'])) { + print ''; +} +// Alias +if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; +} +// Town +if (!empty($arrayfields['s.town']['checked'])) { + print ''; +} +// Zip +if (!empty($arrayfields['s.zip']['checked'])) { + print ''; +} +// State +if (!empty($arrayfields['state.nom']['checked'])) { + print ''; +} +// Country +if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; +} +// Company type +if (!empty($arrayfields['typent.code']['checked'])) { + print ''; +} +// Condition of payment +if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { + print ''; +} +// Payment mode +if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { + print ''; +} +if (!empty($arrayfields['f.total_ht']['checked'])) { + // Amount without tax + print ''; +} +if (!empty($arrayfields['f.total_vat']['checked'])) { + // Amount vat + print ''; +} +if (!empty($arrayfields['f.total_localtax1']['checked'])) { + // Amount tax 1 + print ''; +} +if (!empty($arrayfields['f.total_localtax2']['checked'])) { + // Amount tax 2 + print ''; +} +if (!empty($arrayfields['f.total_ttc']['checked'])) { + // Amount inc tac + print ''; +} +if (!empty($arrayfields['u.login']['checked'])) { + // Author + print ''; +} +if (!empty($arrayfields['dynamount_payed']['checked'])) { + print ''; +} +if (!empty($arrayfields['rtp']['checked'])) { + print ''; +} +if (!empty($arrayfields['f.multicurrency_code']['checked'])) { + // Currency + print ''; +} +if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { + // Currency rate + print ''; +} +if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { + // Amount + print ''; +} +if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { + print ''; +} +if (!empty($arrayfields['multicurrency_rtp']['checked'])) { + print ''; +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - print "\n"; +// Fields from hook +$parameters = array('arrayfields'=>$arrayfields); +$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'])) { + print ''; +} +// Date modification +if (!empty($arrayfields['f.tms']['checked'])) { + print ''; +} +// Status +if (!empty($arrayfields['f.fk_statut']['checked'])) { + print ''; +} +// Action column +print ''; - print ''; - if (!empty($arrayfields['f.ref']['checked'])) { - print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER['PHP_SELF'], 'f.ref,f.rowid', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print_liste_field_titre($arrayfields['f.ref_supplier']['label'], $_SERVER["PHP_SELF"], 'f.ref_supplier', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.type']['checked'])) { - print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.label']['checked'])) { - print_liste_field_titre($arrayfields['f.label']['label'], $_SERVER['PHP_SELF'], "f.libelle,f.rowid", '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.datef']['checked'])) { - print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['p.ref']['checked'])) { - print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['s.nom']['checked'])) { - print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder); - } - 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['s.town']['checked'])) { - print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['s.zip']['checked'])) { - print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['state.nom']['checked'])) { - print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.name_alias", "", $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['state.name_alias']['checked'])) { - print_liste_field_titre($arrayfields['state.name_alias']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['country.code_iso']['checked'])) { - print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['typent.code']['checked'])) { - print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); - } - if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder); - } - if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder); - } - if (!empty($arrayfields['f.total_ht']['checked'])) { - print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_vat']['checked'])) { - print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.total_tva', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.total_ttc']['checked'])) { - print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['u.login']['checked'])) { - print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); - } - if (!empty($arrayfields['dynamount_payed']['checked'])) { - print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['rtp']['checked'])) { - print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); - } - if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_code', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_tx', '', $param, '', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print_liste_field_titre($arrayfields['f.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print_liste_field_titre($arrayfields['multicurrency_dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); - } - if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print_liste_field_titre($arrayfields['multicurrency_rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); - } - // Extra fields - 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 - print $hookmanager->resPrint; - if (!empty($arrayfields['f.datec']['checked'])) { - print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - } - if (!empty($arrayfields['f.tms']['checked'])) { - print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); - } - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, '', $sortfield, $sortorder, 'right '); - } - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); - print "\n"; +print "\n"; - $facturestatic = new FactureFournisseur($db); - $supplierstatic = new Fournisseur($db); - $projectstatic = new Project($db); - $userstatic = new User($db); +print ''; +if (!empty($arrayfields['f.ref']['checked'])) { + print_liste_field_titre($arrayfields['f.ref']['label'], $_SERVER['PHP_SELF'], 'f.ref,f.rowid', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.ref_supplier']['checked'])) { + print_liste_field_titre($arrayfields['f.ref_supplier']['label'], $_SERVER["PHP_SELF"], 'f.ref_supplier', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.type']['checked'])) { + print_liste_field_titre($arrayfields['f.type']['label'], $_SERVER["PHP_SELF"], 'f.type', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.label']['checked'])) { + print_liste_field_titre($arrayfields['f.label']['label'], $_SERVER['PHP_SELF'], "f.libelle,f.rowid", '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.datef']['checked'])) { + print_liste_field_titre($arrayfields['f.datef']['label'], $_SERVER['PHP_SELF'], 'f.datef,f.rowid', '', $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { + print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'], $_SERVER['PHP_SELF'], "f.date_lim_reglement", '', $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['p.ref']['checked'])) { + print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER['PHP_SELF'], "p.ref", '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.nom']['checked'])) { + print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], 's.nom', '', $param, '', $sortfield, $sortorder); +} +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['s.town']['checked'])) { + print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['s.zip']['checked'])) { + print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['state.nom']['checked'])) { + print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.name_alias", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['state.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['state.name_alias']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['country.code_iso']['checked'])) { + print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['typent.code']['checked'])) { + print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center '); +} +if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['f.total_ht']['checked'])) { + print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total_ht', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_vat']['checked'])) { + print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.total_tva', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_localtax1']['checked'])) { + print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_localtax2']['checked'])) { + print_liste_field_titre($arrayfields['f.total_localtax2']['label'], $_SERVER['PHP_SELF'], 'f.localtax2', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.total_ttc']['checked'])) { + print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.total_ttc', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['u.login']['checked'])) { + print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder); +} +if (!empty($arrayfields['dynamount_payed']['checked'])) { + print_liste_field_titre($arrayfields['dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['rtp']['checked'])) { + print_liste_field_titre($arrayfields['rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); +} +if (!empty($arrayfields['f.multicurrency_code']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_code', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_tx', '', $param, '', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { + print_liste_field_titre($arrayfields['f.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'f.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { + print_liste_field_titre($arrayfields['multicurrency_dynamount_payed']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); +} +if (!empty($arrayfields['multicurrency_rtp']['checked'])) { + print_liste_field_titre($arrayfields['multicurrency_rtp']['label'], $_SERVER['PHP_SELF'], '', '', $param, 'class="right"', $sortfield, $sortorder); +} +// Extra fields +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, $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, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.tms']['checked'])) { + print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); +} +if (!empty($arrayfields['f.fk_statut']['checked'])) { + print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "fk_statut,paye,type", "", $param, '', $sortfield, $sortorder, 'right '); +} +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +print "\n"; - if ($num > 0) { - $i = 0; - $totalarray = array(); - $totalarray['nbfield']=0; - $totalarray['val'] = array(); - $totalarray['val']['f.total_ht']=0; - $totalarray['val']['f.total_vat']=0; - $totalarray['val']['f.total_localtax1']=0; - $totalarray['val']['f.total_localtax1']=0; - $totalarray['val']['f.total_ttc']=0; +$facturestatic = new FactureFournisseur($db); +$supplierstatic = new Fournisseur($db); +$projectstatic = new Project($db); +$userstatic = new User($db); - while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); +if ($num > 0) { + $i = 0; + $totalarray = array(); + $totalarray['nbfield']=0; + $totalarray['val'] = array(); + $totalarray['val']['f.total_ht']=0; + $totalarray['val']['f.total_vat']=0; + $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_localtax1']=0; + $totalarray['val']['f.total_ttc']=0; - $datelimit = $db->jdate($obj->datelimite); - $facturestatic->id = $obj->facid; - $facturestatic->ref = $obj->ref; - $facturestatic->type = $obj->type; - $facturestatic->ref_supplier = $obj->ref_supplier; - $facturestatic->date_echeance = $db->jdate($obj->datelimite); - $facturestatic->statut = $obj->fk_statut; - $facturestatic->note_public = $obj->note_public; - $facturestatic->note_private = $obj->note_private; - $facturestatic->multicurrency_code = $obj->multicurrency_code; - $facturestatic->multicurrency_tx = $obj->multicurrency_tx; - $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht; - $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat; - $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + while ($i < min($num, $limit)) { + $obj = $db->fetch_object($resql); - $thirdparty->id = $obj->socid; - $thirdparty->name = $obj->name; - $thirdparty->name_alias = $obj->alias; - $thirdparty->client = $obj->client; - $thirdparty->fournisseur = $obj->fournisseur; - $thirdparty->code_client = $obj->code_client; - $thirdparty->code_compta_client = $obj->code_compta_client; - $thirdparty->code_fournisseur = $obj->code_fournisseur; - $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur; - $thirdparty->email = $obj->email; - $thirdparty->country_code = $obj->country_code; + $datelimit = $db->jdate($obj->datelimite); + $facturestatic->id = $obj->facid; + $facturestatic->ref = $obj->ref; + $facturestatic->type = $obj->type; + $facturestatic->ref_supplier = $obj->ref_supplier; + $facturestatic->date_echeance = $db->jdate($obj->datelimite); + $facturestatic->statut = $obj->fk_statut; + $facturestatic->note_public = $obj->note_public; + $facturestatic->note_private = $obj->note_private; + $facturestatic->multicurrency_code = $obj->multicurrency_code; + $facturestatic->multicurrency_tx = $obj->multicurrency_tx; + $facturestatic->multicurrency_total_ht = $obj->multicurrency_total_ht; + $facturestatic->multicurrency_total_tva = $obj->multicurrency_total_vat; + $facturestatic->multicurrency_total_ttc = $obj->multicurrency_total_ttc; - $paiement = $facturestatic->getSommePaiement(); - $totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); - $totaldeposits = $facturestatic->getSumDepositsUsed(); - $totalpay = $paiement + $totalcreditnotes + $totaldeposits; - $remaintopay = $obj->total_ttc - $totalpay; - $multicurrency_paiement = $facturestatic->getSommePaiement(1); - $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1); - $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1); - $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits; - $multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay); + $thirdparty->id = $obj->socid; + $thirdparty->name = $obj->name; + $thirdparty->name_alias = $obj->alias; + $thirdparty->client = $obj->client; + $thirdparty->fournisseur = $obj->fournisseur; + $thirdparty->code_client = $obj->code_client; + $thirdparty->code_compta_client = $obj->code_compta_client; + $thirdparty->code_fournisseur = $obj->code_fournisseur; + $thirdparty->code_compta_fournisseur = $obj->code_compta_fournisseur; + $thirdparty->email = $obj->email; + $thirdparty->country_code = $obj->country_code; - $facturestatic->alreadypaid = ($paiement ? $paiement : 0); - $facturestatic->paye = $obj->paye; - $facturestatic->statut = $obj->fk_statut; - $facturestatic->type = $obj->type; + $paiement = $facturestatic->getSommePaiement(); + $totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); + $totaldeposits = $facturestatic->getSumDepositsUsed(); + $totalpay = $paiement + $totalcreditnotes + $totaldeposits; + $remaintopay = $obj->total_ttc - $totalpay; + $multicurrency_paiement = $facturestatic->getSommePaiement(1); + $multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1); + $multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1); + $multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits; + $multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay); + + $facturestatic->alreadypaid = ($paiement ? $paiement : 0); + $facturestatic->paye = $obj->paye; + $facturestatic->statut = $obj->fk_statut; + $facturestatic->type = $obj->type; - //If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice - if ($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE) { - if ($facturestatic->isCreditNoteUsed()) { - $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed(); - } + //If invoice has been converted and the conversion has been used, we dont have remain to pay on invoice + if ($facturestatic->type == FactureFournisseur::TYPE_CREDIT_NOTE) { + if ($facturestatic->isCreditNoteUsed()) { + $remaintopay = -$facturestatic->getSumFromThisCreditNotesNotUsed(); } + } - print ''; - if (!empty($arrayfields['f.ref']['checked'])) { - print ''; + if (!empty($arrayfields['f.ref']['checked'])) { + print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } + print "\n"; + if (!$i) { + $totalarray['nbfield']++; } + } - // Supplier ref - if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Supplier ref + if (!empty($arrayfields['f.ref_supplier']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + } - // Type - if (!empty($arrayfields['f.type']['checked'])) { - print '"; - if (!$i) { - $totalarray['nbfield']++; - } + // Type + if (!empty($arrayfields['f.type']['checked'])) { + print '"; + if (!$i) { + $totalarray['nbfield']++; } + } - // Label - if (!empty($arrayfields['f.label']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Label + if (!empty($arrayfields['f.label']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + } - // Date - if (!empty($arrayfields['f.datef']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Date + if (!empty($arrayfields['f.datef']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + } - // Date limit - if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Project - if (!empty($arrayfields['p.ref']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Third party - if (!empty($arrayfields['s.nom']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Alias - if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Town - if (!empty($arrayfields['s.town']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Zip - if (!empty($arrayfields['s.zip']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // State - if (!empty($arrayfields['state.nom']['checked'])) { - print "\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Country - if (!empty($arrayfields['country.code_iso']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Type ent - if (!empty($arrayfields['typent.code']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Payment condition - if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Payment mode - if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Amount HT - if (!empty($arrayfields['f.total_ht']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; - } - $totalarray['val']['f.total_ht'] += $obj->total_ht; - } - // Amount VAT - if (!empty($arrayfields['f.total_vat']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_vat'; - } - $totalarray['val']['f.total_vat'] += $obj->total_vat; - } - // Amount LocalTax1 - if (!empty($arrayfields['f.total_localtax1']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax1'; - } - $totalarray['val']['f.total_localtax1'] += $obj->total_localtax1; - } - // Amount LocalTax2 - if (!empty($arrayfields['f.total_localtax2']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax2'; - } - $totalarray['val']['f.total_localtax2'] += $obj->total_localtax2; - } - // Amount TTC - if (!empty($arrayfields['f.total_ttc']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc'; - } - $totalarray['val']['f.total_ttc'] += $obj->total_ttc; - } - - $userstatic->id = $obj->fk_user_author; - $userstatic->login = $obj->login; - $userstatic->lastname = $obj->lastname; - $userstatic->firstname = $obj->firstname; - $userstatic->email = $obj->user_email; - $userstatic->statut = $obj->user_statut; - $userstatic->entity = $obj->entity; - $userstatic->photo = $obj->photo; - $userstatic->office_phone = $obj->office_phone; - $userstatic->office_fax = $obj->office_fax; - $userstatic->user_mobile = $obj->user_mobile; - $userstatic->job = $obj->job; - $userstatic->gender = $obj->gender; - - // Author - if (!empty($arrayfields['u.login']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - if (!empty($arrayfields['dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'totalam'; - } - $totalarray['val']['totalam'] += $totalpay; - } - - if (!empty($arrayfields['rtp']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'rtp'; - } - $totalarray['val']['rtp'] += $remaintopay; - } - - // Currency - if (!empty($arrayfields['f.multicurrency_code']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Currency rate - if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount HT - if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount VAT - if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Amount TTC - if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { - print '\n"; - if (!$i) { - $totalarray['nbfield']++; - } - } - if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Pending amount - if (!empty($arrayfields['multicurrency_rtp']['checked'])) { - print ''; // TODO Use a denormalized field - if (!$i) { - $totalarray['nbfield']++; - } - } - - - // Extra fields - 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 - print $hookmanager->resPrint; - - // Date creation - if (!empty($arrayfields['f.datec']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Date modification - if (!empty($arrayfields['f.tms']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - } - // Status - if (!empty($arrayfields['f.fk_statut']['checked'])) { - print '"; - if (!$i) { - $totalarray['nbfield']++; - } - } - - // Action column - print ''; if (!$i) { $totalarray['nbfield']++; } - - print "\n"; - - $i++; } - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // Project + if (!empty($arrayfields['p.ref']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Third party + if (!empty($arrayfields['s.nom']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Town + if (!empty($arrayfields['s.town']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Zip + if (!empty($arrayfields['s.zip']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // State + if (!empty($arrayfields['state.nom']['checked'])) { + print "\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Country + if (!empty($arrayfields['country.code_iso']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Type ent + if (!empty($arrayfields['typent.code']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Payment condition + if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Payment mode + if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Amount HT + if (!empty($arrayfields['f.total_ht']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht'; + } + $totalarray['val']['f.total_ht'] += $obj->total_ht; + } + // Amount VAT + if (!empty($arrayfields['f.total_vat']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_vat'; + } + $totalarray['val']['f.total_vat'] += $obj->total_vat; + } + // Amount LocalTax1 + if (!empty($arrayfields['f.total_localtax1']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax1'; + } + $totalarray['val']['f.total_localtax1'] += $obj->total_localtax1; + } + // Amount LocalTax2 + if (!empty($arrayfields['f.total_localtax2']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_localtax2'; + } + $totalarray['val']['f.total_localtax2'] += $obj->total_localtax2; + } + // Amount TTC + if (!empty($arrayfields['f.total_ttc']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc'; + } + $totalarray['val']['f.total_ttc'] += $obj->total_ttc; + } + + $userstatic->id = $obj->fk_user_author; + $userstatic->login = $obj->login; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->email = $obj->user_email; + $userstatic->statut = $obj->user_statut; + $userstatic->entity = $obj->entity; + $userstatic->photo = $obj->photo; + $userstatic->office_phone = $obj->office_phone; + $userstatic->office_fax = $obj->office_fax; + $userstatic->user_mobile = $obj->user_mobile; + $userstatic->job = $obj->job; + $userstatic->gender = $obj->gender; + + // Author + if (!empty($arrayfields['u.login']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + if (!empty($arrayfields['dynamount_payed']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totalam'; + } + $totalarray['val']['totalam'] += $totalpay; + } + + if (!empty($arrayfields['rtp']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'rtp'; + } + $totalarray['val']['rtp'] += $remaintopay; + } + + // Currency + if (!empty($arrayfields['f.multicurrency_code']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Currency rate + if (!empty($arrayfields['f.multicurrency_tx']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount HT + if (!empty($arrayfields['f.multicurrency_total_ht']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount VAT + if (!empty($arrayfields['f.multicurrency_total_vat']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Amount TTC + if (!empty($arrayfields['f.multicurrency_total_ttc']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + if (!empty($arrayfields['multicurrency_dynamount_payed']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Pending amount + if (!empty($arrayfields['multicurrency_rtp']['checked'])) { + print ''; // TODO Use a denormalized field + if (!$i) { + $totalarray['nbfield']++; + } + } + + + // Extra fields + 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, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Date creation + if (!empty($arrayfields['f.datec']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Date modification + if (!empty($arrayfields['f.tms']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Status + if (!empty($arrayfields['f.fk_statut']['checked'])) { + print '"; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print "\n"; + + $i++; } - $db->free($resql); - - $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - print "
    '; - print ''; - print ''; - $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); - print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1); - print ''; - $searchpicto = $form->showFilterButtons(); - print $searchpicto; +// Line for filters +print '
    '; + print ''; print ''; + print ''; + print ''; + $listtype = array( + FactureFournisseur::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), + FactureFournisseur::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), + FactureFournisseur::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), + FactureFournisseur::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), + ); + /* + if (!empty($conf->global->INVOICE_USE_SITUATION)) + { + $listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation"); + } + */ + //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. + print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); + print ''; + print ''; + print ''; + print '
    '; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; + print '
    '; + print '
    '; + /* + print $langs->trans('From').' '; + print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); + print '
    '; + print '
    '; + print $langs->trans('to').' ';*/ + print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); + print '
    '.$langs->trans("Alert"); + print '
    '; + print '
    0 ? " disabled" : "").'>'; + print ''; + print ''; + print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1); + print ''; + print $form->getSelectConditionsPaiements($search_paymentcond, 'search_paymentcond', -1, 1, 1, 'maxwidth100'); + print ''; + print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 20, 1, 'maxwidth100', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print ''; + print ''; + $liststatus = array('0'=>$langs->trans("Draft"), '1'=>$langs->trans("Unpaid"), '2'=>$langs->trans("Paid")); + print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 0, 0, 0, '', '', 1); + print ''; +$searchpicto = $form->showFilterButtons(); +print $searchpicto; +print '
    '; + print '
    '; - print ''; - // Picto + Ref - print '
    '; - print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); + print ''; + // Picto + Ref + print '
    '; + print $facturestatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1); - $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); - $subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); - print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir); - print '
    '; + $filename = dol_sanitizeFileName($obj->ref); + $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); + $subdir = get_exdir($obj->facid, 2, 0, 0, $facturestatic, 'invoice_supplier').dol_sanitizeFileName($obj->ref); + print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir); + print '
    '; - print "
    '; - print $obj->ref_supplier; - print ''; + print $obj->ref_supplier; + print ''; - print $facturestatic->getLibType(); - print "'; + print $facturestatic->getLibType(); + print "'; - print $obj->label; - print ''; + print $obj->label; + print ''; - print dol_print_date($db->jdate($obj->datef), 'day'); - print ''; + print dol_print_date($db->jdate($obj->datef), 'day'); + print ''.dol_print_date($datelimit, 'day'); - if ($facturestatic->hasDelay()) { - print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); - } - print ''; - if ($obj->project_id > 0) { - $projectstatic->id = $obj->project_id; - $projectstatic->ref = $obj->project_ref; - $projectstatic->title = $obj->project_label; - print $projectstatic->getNomUrl(1); - } - print ''; - print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); - print ''; - print $thirdparty->name_alias; - print ''; - print $obj->town; - print ''; - print dol_escape_htmltag($obj->zip); - print '".$obj->state_name."'; - $tmparray = getCountry($obj->fk_pays, 'all'); - print $tmparray['label']; - print ''; - if (empty($typenArray)) { - $typenArray = $formcompany->typent_array(1); - } - print $typenArray[$obj->typent_code]; - print ''; - $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1); - print ''; - $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); - print ''.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'; - if ($userstatic->id) { - print $userstatic->getLoginUrl(-1); - } else { - print ' '; - } - print "'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').''.(!empty($remaintopay) ?price($remaintopay, 0, $langs) : ' ').''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; - $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); - print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').''; - print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ''); - print ''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type); - print "'; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->facid, $arrayofselected)) { - $selected = 1; - } - print ''; + // Date limit + if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { + print ''.dol_print_date($datelimit, 'day'); + if ($facturestatic->hasDelay()) { + print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); } print '
    '; + if ($obj->project_id > 0) { + $projectstatic->id = $obj->project_id; + $projectstatic->ref = $obj->project_ref; + $projectstatic->title = $obj->project_label; + print $projectstatic->getNomUrl(1); + } + print ''; + print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''; + print $thirdparty->name_alias; + print ''; + print $obj->town; + print ''; + print dol_escape_htmltag($obj->zip); + print '".$obj->state_name."'; + $tmparray = getCountry($obj->fk_pays, 'all'); + print $tmparray['label']; + print ''; + if (empty($typenArray)) { + $typenArray = $formcompany->typent_array(1); + } + print $typenArray[$obj->typent_code]; + print ''; + $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1); + print ''; + $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1); + print ''.price($obj->total_ht)."'.price($obj->total_vat)."'.price($obj->total_localtax1)."'.price($obj->total_localtax2)."'.price($obj->total_ttc)."'; + if ($userstatic->id) { + print $userstatic->getLoginUrl(-1); + } else { + print ' '; + } + print "'.(!empty($totalpay) ?price($totalpay, 0, $langs) : '').''.(!empty($remaintopay) ?price($remaintopay, 0, $langs) : ' ').''.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."'; + $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code); + print "'.price($obj->multicurrency_total_ht)."'.price($obj->multicurrency_total_vat)."'.price($obj->multicurrency_total_ttc)."'.(!empty($multicurrency_totalpay) ?price($multicurrency_totalpay, 0, $langs) : '').''; + print (!empty($multicurrency_remaintopay) ? price($multicurrency_remaintopay, 0, $langs) : ''); + print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); + print ''; + print $facturestatic->LibStatut($obj->paye, $obj->fk_statut, 5, $paiement, $obj->type); + print "'; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->facid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    \n"; - print ''; - - print "\n"; - - $hidegeneratedfilelistifempty = 1; - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { - $hidegeneratedfilelistifempty = 0; - } - - // Show list of available documents - $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource .= str_replace('&', '&', $param); - - $filedir = $diroutputmassaction; - $genallowed = $user->rights->facture->lire; - $delallowed = $user->rights->facture->creer; - $title = ''; - - print $formfile->showdocuments('massfilesarea_supplier_invoice', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} else { - dol_print_error($db); + // Show total line + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; } +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print '
    '.$langs->trans("NoRecordFound").'
    \n"; +print ''; + +print "\n"; + +$hidegeneratedfilelistifempty = 1; +if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { + $hidegeneratedfilelistifempty = 0; +} + +// Show list of available documents +$urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; +$urlsource .= str_replace('&', '&', $param); + +$filedir = $diroutputmassaction; +$genallowed = $user->rights->facture->lire; +$delallowed = $user->rights->facture->creer; +$title = ''; + +print $formfile->showdocuments('massfilesarea_supplier_invoice', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); + // End of page llxFooter(); $db->close(); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index e1eb788723f..1c61fdc8e07 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -53,6 +53,8 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); $object = new FactureFournisseur($db); $object->fetch($id, $ref); +$usercancreate = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); +$permissiontoadd = $usercancreate; $permissionnote = ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer); // Used by the include of actions_setnotes.inc.php @@ -106,40 +108,28 @@ if ($object->id > 0) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->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 .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index e26734ed9c6..2e61322997a 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -123,7 +123,7 @@ if ($object->id > 0) { $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Amount $morehtmlref .= '
    '.$langs->trans('Amount').' : '. price($object->amount, '', $langs, 0, 0, -1, $conf->currency); diff --git a/htdocs/hrm/admin/job_extrafields.php b/htdocs/hrm/admin/job_extrafields.php index 8dff50f4b6f..6ac0773c00f 100644 --- a/htdocs/hrm/admin/job_extrafields.php +++ b/htdocs/hrm/admin/job_extrafields.php @@ -67,7 +67,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; * View */ -$textobject = $langs->transnoentitiesnoconv("Job"); +$textobject = $langs->transnoentitiesnoconv("JobPosition"); $help_url = ''; $page_name = "HrmSetup"; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 879acff61fa..b35a23a6389 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -119,7 +119,7 @@ class Evaluation extends CommonObject 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'default'=>0, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '6' => 'Closed'),), 'date_eval' => array('type'=>'date', 'label'=>'DateEval', 'enabled'=>'1', 'position'=>502, 'notnull'=>1, 'visible'=>1,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'enabled'=>'1', 'position'=>504, 'notnull'=>1, 'visible'=>1,), - 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), + 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,), ); public $rowid; public $ref; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 19246dc2313..5d0c04a4f47 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -110,10 +110,10 @@ class Position extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), 'fk_contrat' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'fk_contrat', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,), 'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0), - 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), + 'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,), 'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,), 'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,), - 'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'1', 'position'=>502, 'notnull'=>0, 'visible'=>1,), + 'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'getDolGlobalInt("HRM_JOB_POSITON_ENDING_COMMENT")', 'position'=>502, 'notnull'=>0, 'visible'=>1,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>71, 'notnull'=>0, 'visible'=>0,), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), diff --git a/htdocs/hrm/core/tpl/objectline_title.tpl.php b/htdocs/hrm/core/tpl/objectline_title.tpl.php index 3801288543a..ae835ea2bca 100644 --- a/htdocs/hrm/core/tpl/objectline_title.tpl.php +++ b/htdocs/hrm/core/tpl/objectline_title.tpl.php @@ -65,7 +65,7 @@ print '
    '.$langs->trans('Label').''.$langs->trans('Description').''.$langs->trans('EmployeeRank').''.$form->textwithpicto($langs->trans("Level"), $langs->trans('EmployeeRank')).'
    '; - print ''; - print ''; - print ''; - print ''; - print ''; - }*/ - - - if (!empty($object->lines)) { - $conf->modules_parts['tpl']['hrm']='/hrm/core/tpl/'; // Pour utilisation du tpl hrm sur cet écran - print '
    '.$langs->trans('Skill').''.$langs->trans('Description').''.$langs->trans('Rank').'
    '; - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, ''); - print '
    '; - } - - - - if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { - print '
    '; - - if ($object->status == $object::STATUS_DRAFT && $permissiontoadd) { - print '
    '; - print ''; - print '
    '; - } - } - - - print ''; - - print "\n"; - print "
    "; + if (!empty($conf->use_javascript_ajax) && $object->status == 0) { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; } + + $conf->modules_parts['tpl']['hrm']='/hrm/core/tpl/'; // Pour utilisation du tpl hrm sur cet écran + + print '
    '; + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print ''; + } + + //if (!empty($object->lines)) { + $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + //} + + // Form to add new line + /* + if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') { + if ($action != 'editline') { + // Add products/services form + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + if (empty($reshook)) + $object->formAddObjectLine(1, $mysoc, $soc); + } + } + */ + + if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) { + print '
    '; + } + print '
    '; + + print "\n"; + + print "
    "; } // list of comparison diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 1c1d9ed26fd..4ea2e8e81be 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -31,8 +31,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; // Load translation files required by the page $langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); @@ -138,43 +139,13 @@ if ($object->id) { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
    '; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - // Project - if (isModEnabled('project')) - { - $langs->load("projects"); - $morehtmlref.='
    '.$langs->trans('Project') . ' '; - if ($permissiontoadd) - { - 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.='
    '; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
    '; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (!empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; - } - } - }*/ + $morehtmlref .= $langs->trans('Label').' : '.$object->label; + $u_position = new User(($db)); + $u_position->fetch($object->fk_user); + $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); + $job = new Job($db); + $job->fetch($object->fk_job); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= '
    '; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php index 23f9d260f0f..84bc6023291 100644 --- a/htdocs/hrm/evaluation_document.php +++ b/htdocs/hrm/evaluation_document.php @@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php'; -require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/evaluation.class.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/lib/hrm_evaluation.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php'; // Load translation files required by the page $langs->loadLangs(array('hrm', 'companies', 'other', 'mails')); @@ -138,7 +138,7 @@ if ($object->id) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index f475cef7af7..cf3272b894e 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -54,6 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php index 5c02b533bb7..ff0921cc59e 100644 --- a/htdocs/hrm/evaluation_note.php +++ b/htdocs/hrm/evaluation_note.php @@ -113,7 +113,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$u_position->getNomUrl(1); $job = new Job($db); $job->fetch($object->fk_job); - $morehtmlref .= '
    '.$langs->trans('Job').' : '.$job->getNomUrl(1); + $morehtmlref .= '
    '.$langs->trans('JobPosition').' : '.$job->getNomUrl(1); $morehtmlref .= ''; diff --git a/htdocs/hrm/lib/hrm.lib.php b/htdocs/hrm/lib/hrm.lib.php index 2fef293784d..88a851f0137 100644 --- a/htdocs/hrm/lib/hrm.lib.php +++ b/htdocs/hrm/lib/hrm.lib.php @@ -54,13 +54,13 @@ function hrmAdminPrepareHead() $head[$h][2] = 'establishments'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; - $head[$h][1] = $langs->trans("EvaluationsExtraFields"); - $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count']; + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; + $head[$h][1] = $langs->trans("SkillsExtraFields"); + $nbExtrafields = $extrafields->attributes['hrm_skill']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ''.$nbExtrafields.''; } - $head[$h][2] = 'evaluationsAttributes'; + $head[$h][2] = 'skillsAttributes'; $h++; $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php'; @@ -72,13 +72,13 @@ function hrmAdminPrepareHead() $head[$h][2] = 'jobsAttributes'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; - $head[$h][1] = $langs->trans("SkillsExtraFields"); - $nbExtrafields = $extrafields->attributes['hrm_skill']['count']; + $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; + $head[$h][1] = $langs->trans("EvaluationsExtraFields"); + $nbExtrafields = $extrafields->attributes['hrm_evaluation']['count']; if ($nbExtrafields > 0) { $head[$h][1] .= ''.$nbExtrafields.''; } - $head[$h][2] = 'skillsAttributes'; + $head[$h][2] = 'evaluationsAttributes'; $h++; // Show more tabs from modules diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index e79af867a74..739dc8bee02 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -54,6 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -115,11 +116,11 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1, 1, '1'); + $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')), + 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); @@ -136,18 +137,15 @@ $permissiontoread = $user->rights->hrm->all->read; $permissiontoadd = $user->rights->hrm->all->write; $permissiontodelete = $user->rights->hrm->all->delete; -// Security check -if (empty($conf->hrm->enabled)) { - accessforbidden('Module not enabled'); -} - // Security check (enable the most restrictive one) if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) accessforbidden(); //$socid = 0; if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); +if (!isModEnabled('hrm')) { + accessforbidden('Module hrm not enabled'); +} if (!$permissiontoread) accessforbidden(); @@ -250,23 +248,23 @@ foreach ($search as $key => $val) { } $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { - if ($search[$key] == '-1' || $search[$key] === '0') { + if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) { $search[$key] = ''; } $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; } } } @@ -290,7 +288,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= "t.".$key.", "; + $sql .= "t.".$db->escape($key).", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -305,8 +303,6 @@ $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); */ -$sql .= $db->order($sortfield, $sortorder); - // Count total nb of records $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -316,24 +312,24 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $page = 0; $offset = 0; } + $db->free($resql); } -// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - $num = $nbtotalofrecords; -} else { - if ($limit) { - $sql .= $db->plimit($limit + 1, $offset); - } - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } - - $num = $db->num_rows($resql); +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); } +$resql = $db->query($sql); +if (!$resql) { + dol_print_error($db); + exit; +} + +$num = $db->num_rows($resql); + + // Direct jump if only one record found if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); @@ -366,6 +362,9 @@ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -374,11 +373,17 @@ if ($limit > 0 && $limit != $conf->liste_limit) { } foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { + if (is_array($search[$key])) { foreach ($search[$key] as $skey) { - $param .= '&search_'.$key.'[]='.urlencode($skey); + if ($skey != '') { + $param .= '&search_'.$key.'[]='.urlencode($skey); + } } - } else { + } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { + $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); + $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); + $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } } @@ -399,7 +404,7 @@ $arrayofmassactions = array( //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); -if ($permissiontodelete) { +if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { @@ -418,6 +423,7 @@ print ''; print ''; print ''; print ''; +print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/hrm/position.php', 1).'?action=create', '', $permissiontoadd); @@ -431,9 +437,12 @@ $trackid = 'xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { + $setupstring = ''; foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); + $setupstring .= $key."=".$val.";"; } + print ''."\n"; print '
    '.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
    '; } @@ -457,7 +466,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table @@ -467,7 +476,15 @@ print ''; +// Action column +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} foreach ($object->fields as $key => $val) { + $searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -475,7 +492,7 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -483,9 +500,7 @@ foreach ($object->fields as $key => $val) { if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { - print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); - } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - print ''; + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1); } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
    '; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -493,6 +508,12 @@ foreach ($object->fields as $key => $val) { print '
    '; print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
    '; + } elseif ($key == 'lang') { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; + $formadmin = new FormAdmin($db); + print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2); + } else { + print ''; } print ''; } @@ -505,16 +526,23 @@ $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print '
    '; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; +} print ''."\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; // Fields title label // -------------------------------------------------------------------- print ''; +if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -523,21 +551,26 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label if (!empty($arrayfields['t.'.$key]['checked'])) { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + $totalarray['nbfield']++; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); +$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +} +$totalarray['nbfield']++; print ''."\n"; @@ -555,9 +588,11 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar // Loop on record // -------------------------------------------------------------------- $i = 0; +$savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; -while ($i < ($limit ? min($num, $limit) : $num)) { +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { break; // Should not happen @@ -566,75 +601,107 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Store properties in $object $object->setVarsFromFetchObj($obj); - // Show here line of result - print ''; - foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } elseif ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; + if ($mode == 'kanban') { + if ($i == 0) { + print ''; } - - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; - - if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; - if ($key == 'status') { - print $object->getLibStatut(5); - } elseif ($key == 'rowid') { - print $object->getNomUrl(1); - } else { - print $object->showOutputField($val, $key, $object->$key, ''); + } else { + // Show here line of result + $j = 0; + print ''; + // Action column + if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!empty($val['isameasure']) && $val['isameasure'] == 1) { - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; - } - if (!isset($totalarray['val'])) { - $totalarray['val'] = array(); - } - if (!isset($totalarray['val']['t.'.$key])) { - $totalarray['val']['t.'.$key] = 0; - } - $totalarray['val']['t.'.$key] += $object->$key; - } } - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Action column - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } - print ''."\n"; + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } + + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; + + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; + if ($key == 'status') { + print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); + } else { + print $object->showOutputField($val, $key, $object->$key, ''); + } + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!empty($val['isameasure']) && $val['isameasure'] == 1) { + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; + } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } + $totalarray['val']['t.'.$key] += $object->$key; + } + } + } + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + print ''; + } + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + } $i++; } @@ -650,14 +717,14 @@ if ($num == 0) { $colspan++; } } - print ''; + print ''; } $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 '
    '; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
    '; + print '
    '; } - - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + // Output Kanban + print $object->getKanbanView(''); + if ($i == ($imaxinloop - 1)) { + print '
    '; + print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; } print ''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($object->id, $arrayofselected)) { - $selected = 1; - } - print ''; - } - print '
    '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '.$langs->trans("NoRecordFound").'
    '."\n"; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 664d54212a3..ddf385b170e 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -344,21 +344,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); -// Example : Adding jquery code -// print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; diff --git a/htdocs/index.php b/htdocs/index.php index f9ca18f530a..61a7d7f6d81 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -127,7 +127,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { } if ($message) { - print $message; + print $message.'
    '; //$message.='
    '; //print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); } @@ -194,7 +194,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed"); } - // Number of customer orders a deal + // Number of sales orders a deal if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board = new Commande($db); diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php index 37ea0bf165d..43664b7984b 100644 --- a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php @@ -39,7 +39,7 @@ ob_start(); @@ -101,7 +101,7 @@ ob_start();

    Ipsum consequat

    -

    Donec imperdiet consequat consequat. Suspendisse feugiat congue
    +

    Donec imperdiet consequat consequat. Suspendisse feugiat congue
    posuere. Nulla massa urna, fermentum eget quam aliquet.

      @@ -138,7 +138,7 @@ ob_start();

      Congue imperdiet

      -

      Donec imperdiet consequat consequat. Suspendisse feugiat congue
      +

      Donec imperdiet consequat consequat. Suspendisse feugiat congue
      posuere. Nulla massa urna, fermentum eget quam aliquet.

      diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index c717d55850e..e68f0d70a96 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -35,24 +35,16 @@ require_once '../filefunc.inc.php'; -// Define DOL_DOCUMENT_ROOT and ADODB_PATH used for install/upgrade process +// Define DOL_DOCUMENT_ROOT used for install/upgrade process if (!defined('DOL_DOCUMENT_ROOT')) { define('DOL_DOCUMENT_ROOT', '..'); } -if (!defined('ADODB_PATH')) { - $foundpath = DOL_DOCUMENT_ROOT.'/includes/adodbtime/'; - if (!is_dir($foundpath)) { - $foundpath = '/usr/share/php/adodb/'; - } - define('ADODB_PATH', $foundpath); -} require_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/conf.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once ADODB_PATH.'adodb-time.inc.php'; $conf = new Conf(); diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index ffd02aa9cf9..52a1a3bbbb6 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -4,12 +4,12 @@ -- Copyright (C) 2004 Benoit Mortier -- Copyright (C) 2004 Guillaume Delecourt -- Copyright (C) 2005-2009 Regis Houssin --- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2010-2016 Juanjo Menent -- Copyright (C) 2012 Sebastian Neuwert --- Copyright (C) 2012 Ricardo Schluter --- Copyright (C) 2015 Ferran Marcet --- Copyright (C) 2019~ Lao Tian <281388879@qq.com> +-- Copyright (C) 2012 Ricardo Schluter +-- Copyright (C) 2015 Ferran Marcet +-- Copyright (C) 2019~ Lao Tian <281388879@qq.com> -- Copyright (C) 2020-2021 Udo Tamm -- Copyright (C) 2022 Miro Sertić -- @@ -52,11 +52,12 @@ -- Belgium -- Bolivia -- Brazil -> for Departmements +-- Burundi -- Canada -> for Departmements -- Chile -- China -- Colombie -> for Departmements --- Croatia -> for Departmements +-- Croatia -- Denmark -- France -- Germany -> for Departmements @@ -66,6 +67,7 @@ -- India -> for Departmements -- Indonesia -> for Departmements -- Italy +-- Japan -> only for Departmements -- Luxembourg -- Mauritius -- Mexique -> for Departmements @@ -332,6 +334,10 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3 insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 3, 320, NULL, 1, 'Veneto'); +-- Japan Region (id country=123) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 123, 12301, '', 0,'日本'); + + -- Luxembourg Regions (districts) (id country=140) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 140, 14001, '', 0, 'Diekirch'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 140, 14002, '', 0, 'Grevenmacher'); @@ -533,5 +539,3 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana'); --- Japan Region (id country=123) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 123, 12301, '', 0,'日本'); diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 8874fad0784..661e786ca06 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -48,11 +48,11 @@ INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('VT', 'ACCOUNTING_SELL_JOURNAL', 2, 1, 1); INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AC', 'ACCOUNTING_PURCHASE_JOURNAL', 3, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'FinanceJournal', 4, 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('BQ', 'ACCOUNTING_BANK_JOURNAL', 4, 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('ER', 'ACCOUNTING_EXPENSEREPORT_JOURNAL', 5, 1, 1); INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('OD', 'ACCOUNTING_MISCELLANEOUS_JOURNAL', 1, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AN', 'ACCOUNTING_HAS_NEW_JOURNAL', 9, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('ER', 'ExpenseReportsJournal', 5, 1, 1); -INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'InventoryJournal', 8, 1, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('AN', 'ACCOUNTING_HAS_NEW_JOURNAL', 9, 0, 1); +INSERT INTO llx_accounting_journal (code, label, nature, active, entity) VALUES ('INV', 'ACCOUNTING_INVENTORY_JOURNAL', 8, 0, 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_fr.sql b/htdocs/install/mysql/data/llx_accounting_account_fr.sql index d49e509a5be..4520969f82b 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_fr.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_fr.sql @@ -136,7 +136,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 93,'PCG99-ABREGE','INCOME', '75', '1407', 'Autres produits de gestion courante', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 94,'PCG99-ABREGE','INCOME', '753', '93', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 95,'PCG99-ABREGE','INCOME', '754', '93', 'Ristournes perçues des coopératives', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96,'PCG99-ABREGE','INCOME', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 96,'PCG99-ABREGE','INCOME', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 97,'PCG99-ABREGE','INCOME', '76', '1407', 'Produits financiers', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 98,'PCG99-ABREGE','INCOME', '77', '1407', 'Produits exceptionnels', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 99,'PCG99-ABREGE','INCOME', '781', '1407', 'Reprises sur amortissements et provisions', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_gb.sql b/htdocs/install/mysql/data/llx_accounting_account_gb.sql index 35c245efa95..fc2acf12395 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_gb.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_gb.sql @@ -26,10 +26,10 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71501, 'ENG-BASE', 'CAPIT', '1', '0', 'Equity, provisions for liabilities and charges and liabilities at more than one year', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71502, 'ENG-BASE', 'IMMO', '2', '0', 'Administration fees.Fixed assets and receivables over one year', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71503, 'ENG-BASE', 'STOCK', '3', '0', 'Stock and orders running', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71504, 'ENG-BASE', 'TIERS', '4', '0', 'Amounts receivable and payable within one year', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71504, 'ENG-BASE', 'THIRDPARTY', '4', '0', 'Amounts receivable and payable within one year', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71505, 'ENG-BASE', 'FINAN', '5', '0', 'Placing of cash and cash equivalents', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71506, 'ENG-BASE', 'CHARGE','6', '0', 'Charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71507, 'ENG-BASE', 'PROD', '7', '0', 'Products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71506, 'ENG-BASE', 'EXPENSE','6', '0', 'Charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 71507, 'ENG-BASE', 'INCOME', '7', '0', 'Products', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70103, 'ENG-BASE', 'CAPIT', '10', '71501', 'Capital and reserves', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70104, 'ENG-BASE', 'CAPIT', '101', '70103', 'Capital', 1); @@ -158,70 +158,70 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70227, 'ENG-BASE', 'STOCK', '394', '70223', 'Provisions for depreciation of work in process', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70228, 'ENG-BASE', 'STOCK', '395', '70223', 'Provisions for depreciation of inventories of products', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70229, 'ENG-BASE', 'STOCK', '397', '70223', 'Provisions for depreciation of inventories of goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70230, 'ENG-BASE', 'TIERS', '40', '71504', 'Accounts payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70231, 'ENG-BASE', 'TIERS', '400', '70230', 'Accounts payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70232, 'ENG-BASE', 'TIERS', '401', '70230', 'Suppliers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70233, 'ENG-BASE', 'TIERS', '403', '70230', 'Suppliers - Payables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70234, 'ENG-BASE', 'TIERS', '404', '70230', 'Suppliers of fixed assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70235, 'ENG-BASE', 'TIERS', '405', '70230', 'Capital Suppliers - Payables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70236, 'ENG-BASE', 'TIERS', '408', '70230', 'Supplier invoices not yet received', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70237, 'ENG-BASE', 'TIERS', '409', '70230', 'Debtors suppliers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70238, 'ENG-BASE', 'TIERS', '41', '71504', 'Accounts receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70239, 'ENG-BASE', 'TIERS', '410', '70238', 'Customers and Related Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70240, 'ENG-BASE', 'TIERS', '411', '70238', 'Customers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70241, 'ENG-BASE', 'TIERS', '413', '70238', 'Accounts Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70242, 'ENG-BASE', 'TIERS', '416', '70238', 'Doubtful or contentious customers', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70243, 'ENG-BASE', 'TIERS', '418', '70238', 'Customers - Products not yet billed', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70244, 'ENG-BASE', 'TIERS', '419', '70238', 'Accounts payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70245, 'ENG-BASE', 'TIERS', '42', '71504', 'Personnel and related accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70246, 'ENG-BASE', 'TIERS', '421', '70245', 'Staff - Remuneration due', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70247, 'ENG-BASE', 'TIERS', '422', '70245', 'Works councils, establishment, ...', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70248, 'ENG-BASE', 'TIERS', '424', '70245', 'Employee participation in results', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70249, 'ENG-BASE', 'TIERS', '425', '70245', 'Staff - Advances and Advances', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70250, 'ENG-BASE', 'TIERS', '426', '70245', 'Staff - Deposits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70251, 'ENG-BASE', 'TIERS', '427', '70245', 'Staff - Oppositions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70252, 'ENG-BASE', 'TIERS', '428', '70245', 'Personnel - Accrued expenses and accrued income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70253, 'ENG-BASE', 'TIERS', '43', '71504', 'Social security and other social organizations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70254, 'ENG-BASE', 'TIERS', '431', '70253', 'Social Security', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70255, 'ENG-BASE', 'TIERS', '437', '70253', 'Other social organizations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70256, 'ENG-BASE', 'TIERS', '438', '70253', 'Social organizations - Accrued expenses and accrued income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70257, 'ENG-BASE', 'TIERS', '44', '71504', 'State and other public authorities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70258, 'ENG-BASE', 'TIERS', '441', '70257', 'Status - Grants Receivable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70259, 'ENG-BASE', 'TIERS', '442', '70257', 'Statement - Taxes and taxes recoverable on third parties', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70260, 'ENG-BASE', 'TIERS', '443', '70257', 'Special operations with the State, public authorities, international organizations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70261, 'ENG-BASE', 'TIERS', '444', '70257', 'State - Income taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70262, 'ENG-BASE', 'TIERS', '445', '70257', 'State - Taxes on turnover', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70263, 'ENG-BASE', 'TIERS', '446', '70257', 'Bonded Bonds', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70264, 'ENG-BASE', 'TIERS', '447', '70257', 'Other taxes, duties and similar payments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70265, 'ENG-BASE', 'TIERS', '448', '70257', 'Statement of Accounts Payable and Accrued Income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70266, 'ENG-BASE', 'TIERS', '449', '70257', 'Emission quotas to be returned to the State', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70267, 'ENG-BASE', 'TIERS', '45', '71504', 'Group and Associates', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70268, 'ENG-BASE', 'TIERS', '451', '70267', 'Group', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70269, 'ENG-BASE', 'TIERS', '455', '70267', 'Associates - Current Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70270, 'ENG-BASE', 'TIERS', '456', '70267', 'Associates - Capital transactions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70271, 'ENG-BASE', 'TIERS', '457', '70267', 'Associates - Dividends payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70272, 'ENG-BASE', 'TIERS', '458', '70267', 'Associates- Joint and EIG Operations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70273, 'ENG-BASE', 'TIERS', '46', '71504', 'Miscellaneous receivables and creditors', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70274, 'ENG-BASE', 'TIERS', '462', '70273', 'Receivables on disposals of fixed assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70275, 'ENG-BASE', 'TIERS', '464', '70273', 'Debts on acquisitions of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70276, 'ENG-BASE', 'TIERS', '465', '70273', 'Receivables on disposals of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70277, 'ENG-BASE', 'TIERS', '467', '70273', 'Other accounts receivable or payable', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70278, 'ENG-BASE', 'TIERS', '468', '70273', 'Miscellaneous - Accrued expenses and accrued income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70279, 'ENG-BASE', 'TIERS', '47', '71504', 'Transition or suspense accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70280, 'ENG-BASE', 'TIERS', '471', '70279', 'Waiting Accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70281, 'ENG-BASE', 'TIERS', '476', '70279', 'Conversion Difference - Assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70282, 'ENG-BASE', 'TIERS', '477', '70279', 'Translation differences - Liabilities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70283, 'ENG-BASE', 'TIERS', '478', '70279', 'Other transitional accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70284, 'ENG-BASE', 'TIERS', '48', '71504', 'regularisation account', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70285, 'ENG-BASE', 'TIERS', '481', '70284', 'Expenses to be spread over several financial years', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70286, 'ENG-BASE', 'TIERS', '486', '70284', 'Prepaid expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70287, 'ENG-BASE', 'TIERS', '487', '70284', 'Deferred income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70288, 'ENG-BASE', 'TIERS', '488', '70284', 'Accounts for the periodic distribution of expenses and revenues', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70289, 'ENG-BASE', 'TIERS', '489', '70284', 'Emission allowances allocated by the State', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70290, 'ENG-BASE', 'TIERS', '49', '71504', 'Provisions for depreciation of third party accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70291, 'ENG-BASE', 'TIERS', '491', '70290', 'Provisions for depreciation of customer accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70292, 'ENG-BASE', 'TIERS', '495', '70290', 'Provisions for impairment of group and associate accounts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70293, 'ENG-BASE', 'TIERS', '496', '70290', 'Provisions for depreciation of accounts receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70230, 'ENG-BASE', 'THIRDPARTY', '40', '71504', 'Accounts payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70231, 'ENG-BASE', 'THIRDPARTY', '400', '70230', 'Accounts payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70232, 'ENG-BASE', 'THIRDPARTY', '401', '70230', 'Suppliers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70233, 'ENG-BASE', 'THIRDPARTY', '403', '70230', 'Suppliers - Payables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70234, 'ENG-BASE', 'THIRDPARTY', '404', '70230', 'Suppliers of fixed assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70235, 'ENG-BASE', 'THIRDPARTY', '405', '70230', 'Capital Suppliers - Payables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70236, 'ENG-BASE', 'THIRDPARTY', '408', '70230', 'Supplier invoices not yet received', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70237, 'ENG-BASE', 'THIRDPARTY', '409', '70230', 'Debtors suppliers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70238, 'ENG-BASE', 'THIRDPARTY', '41', '71504', 'Accounts receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70239, 'ENG-BASE', 'THIRDPARTY', '410', '70238', 'Customers and Related Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70240, 'ENG-BASE', 'THIRDPARTY', '411', '70238', 'Customers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70241, 'ENG-BASE', 'THIRDPARTY', '413', '70238', 'Accounts Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70242, 'ENG-BASE', 'THIRDPARTY', '416', '70238', 'Doubtful or contentious customers', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70243, 'ENG-BASE', 'THIRDPARTY', '418', '70238', 'Customers - Products not yet billed', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70244, 'ENG-BASE', 'THIRDPARTY', '419', '70238', 'Accounts payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70245, 'ENG-BASE', 'THIRDPARTY', '42', '71504', 'Personnel and related accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70246, 'ENG-BASE', 'THIRDPARTY', '421', '70245', 'Staff - Remuneration due', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70247, 'ENG-BASE', 'THIRDPARTY', '422', '70245', 'Works councils, establishment, ...', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70248, 'ENG-BASE', 'THIRDPARTY', '424', '70245', 'Employee participation in results', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70249, 'ENG-BASE', 'THIRDPARTY', '425', '70245', 'Staff - Advances and Advances', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70250, 'ENG-BASE', 'THIRDPARTY', '426', '70245', 'Staff - Deposits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70251, 'ENG-BASE', 'THIRDPARTY', '427', '70245', 'Staff - Oppositions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70252, 'ENG-BASE', 'THIRDPARTY', '428', '70245', 'Personnel - Accrued expenses and accrued income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70253, 'ENG-BASE', 'THIRDPARTY', '43', '71504', 'Social security and other social organizations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70254, 'ENG-BASE', 'THIRDPARTY', '431', '70253', 'Social Security', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70255, 'ENG-BASE', 'THIRDPARTY', '437', '70253', 'Other social organizations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70256, 'ENG-BASE', 'THIRDPARTY', '438', '70253', 'Social organizations - Accrued expenses and accrued income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70257, 'ENG-BASE', 'THIRDPARTY', '44', '71504', 'State and other public authorities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70258, 'ENG-BASE', 'THIRDPARTY', '441', '70257', 'Status - Grants Receivable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70259, 'ENG-BASE', 'THIRDPARTY', '442', '70257', 'Statement - Taxes and taxes recoverable on third parties', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70260, 'ENG-BASE', 'THIRDPARTY', '443', '70257', 'Special operations with the State, public authorities, international organizations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70261, 'ENG-BASE', 'THIRDPARTY', '444', '70257', 'State - Income taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70262, 'ENG-BASE', 'THIRDPARTY', '445', '70257', 'State - Taxes on turnover', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70263, 'ENG-BASE', 'THIRDPARTY', '446', '70257', 'Bonded Bonds', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70264, 'ENG-BASE', 'THIRDPARTY', '447', '70257', 'Other taxes, duties and similar payments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70265, 'ENG-BASE', 'THIRDPARTY', '448', '70257', 'Statement of Accounts Payable and Accrued Income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70266, 'ENG-BASE', 'THIRDPARTY', '449', '70257', 'Emission quotas to be returned to the State', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70267, 'ENG-BASE', 'THIRDPARTY', '45', '71504', 'Group and Associates', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70268, 'ENG-BASE', 'THIRDPARTY', '451', '70267', 'Group', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70269, 'ENG-BASE', 'THIRDPARTY', '455', '70267', 'Associates - Current Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70270, 'ENG-BASE', 'THIRDPARTY', '456', '70267', 'Associates - Capital transactions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70271, 'ENG-BASE', 'THIRDPARTY', '457', '70267', 'Associates - Dividends payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70272, 'ENG-BASE', 'THIRDPARTY', '458', '70267', 'Associates- Joint and EIG Operations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70273, 'ENG-BASE', 'THIRDPARTY', '46', '71504', 'Miscellaneous receivables and creditors', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70274, 'ENG-BASE', 'THIRDPARTY', '462', '70273', 'Receivables on disposals of fixed assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70275, 'ENG-BASE', 'THIRDPARTY', '464', '70273', 'Debts on acquisitions of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70276, 'ENG-BASE', 'THIRDPARTY', '465', '70273', 'Receivables on disposals of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70277, 'ENG-BASE', 'THIRDPARTY', '467', '70273', 'Other accounts receivable or payable', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70278, 'ENG-BASE', 'THIRDPARTY', '468', '70273', 'Miscellaneous - Accrued expenses and accrued income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70279, 'ENG-BASE', 'THIRDPARTY', '47', '71504', 'Transition or suspense accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70280, 'ENG-BASE', 'THIRDPARTY', '471', '70279', 'Waiting Accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70281, 'ENG-BASE', 'THIRDPARTY', '476', '70279', 'Conversion Difference - Assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70282, 'ENG-BASE', 'THIRDPARTY', '477', '70279', 'Translation differences - Liabilities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70283, 'ENG-BASE', 'THIRDPARTY', '478', '70279', 'Other transitional accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70284, 'ENG-BASE', 'THIRDPARTY', '48', '71504', 'regularisation account', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70285, 'ENG-BASE', 'THIRDPARTY', '481', '70284', 'Expenses to be spread over several financial years', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70286, 'ENG-BASE', 'THIRDPARTY', '486', '70284', 'Prepaid expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70287, 'ENG-BASE', 'THIRDPARTY', '487', '70284', 'Deferred income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70288, 'ENG-BASE', 'THIRDPARTY', '488', '70284', 'Accounts for the periodic distribution of expenses and revenues', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70289, 'ENG-BASE', 'THIRDPARTY', '489', '70284', 'Emission allowances allocated by the State', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70290, 'ENG-BASE', 'THIRDPARTY', '49', '71504', 'Provisions for depreciation of third party accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70291, 'ENG-BASE', 'THIRDPARTY', '491', '70290', 'Provisions for depreciation of customer accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70292, 'ENG-BASE', 'THIRDPARTY', '495', '70290', 'Provisions for impairment of group and associate accounts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70293, 'ENG-BASE', 'THIRDPARTY', '496', '70290', 'Provisions for depreciation of accounts receivable', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70294, 'ENG-BASE', 'FINAN', '50', '71505', 'Marketable securities', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70295, 'ENG-BASE', 'FINAN', '501', '70294', 'Shares in related companies', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70296, 'ENG-BASE', 'FINAN', '502', '70294', 'Treasury shares', 1); @@ -250,120 +250,120 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70319, 'ENG-BASE', 'FINAN', '58', '71505', 'Internal transfers', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70320, 'ENG-BASE', 'FINAN', '59', '71505', 'Provisions for impairment of financial accounts', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70321, 'ENG-BASE', 'FINAN', '590', '70320', 'Provisions for depreciation of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70322, 'ENG-BASE', 'CHARGE', '60', '71506', 'Shopping', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70323, 'ENG-BASE', 'CHARGE', '601', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70324, 'ENG-BASE', 'CHARGE', '602', '70322', 'Stored Procurement - Other Supplies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70325, 'ENG-BASE', 'CHARGE', '603', '70322', 'Inventory Changes (Supplies and Commodities)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70326, 'ENG-BASE', 'CHARGE', '604', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70327, 'ENG-BASE', 'CHARGE', '605', '70322', 'Purchase of equipment, works and equipment', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70328, 'ENG-BASE', 'CHARGE', '606', '70322', 'Non-stock purchases of materials and supplies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70329, 'ENG-BASE', 'CHARGE', '607', '70322', 'Purchases of goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70330, 'ENG-BASE', 'CHARGE', '608', '70322', 'Reserved account, where applicable, to the recapitulation of incidental expenses included in purchases', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70331, 'ENG-BASE', 'CHARGE', '609', '70322', 'Discounts, rebates and rebates obtained on purchases', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70332, 'ENG-BASE', 'CHARGE', '61', '71506', 'Outside services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70333, 'ENG-BASE', 'CHARGE', '611', '70332', 'General subcontracting', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70334, 'ENG-BASE', 'CHARGE', '612', '70332', 'Lease payments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70335, 'ENG-BASE', 'CHARGE', '613', '70332', 'Rentals', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70336, 'ENG-BASE', 'CHARGE', '614', '70332', 'Rental and condominium expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70337, 'ENG-BASE', 'CHARGE', '615', '70332', 'Maintenance and repairs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70338, 'ENG-BASE', 'CHARGE', '616', '70332', 'Insurance premiums', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70339, 'ENG-BASE', 'CHARGE', '617', '70332', 'Studies and research', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70340, 'ENG-BASE', 'CHARGE', '618', '70332', 'Various', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70341, 'ENG-BASE', 'CHARGE', '619', '70332', 'Discounts, rebates and rebates obtained on external services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70342, 'ENG-BASE', 'CHARGE', '62', '71506', 'Other services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70343, 'ENG-BASE', 'CHARGE', '621', '70342', 'Staff outside the company', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70344, 'ENG-BASE', 'CHARGE', '622', '70342', 'Remuneration of intermediaries and fees', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70345, 'ENG-BASE', 'CHARGE', '623', '70342', 'Advertising, publications, public relations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70346, 'ENG-BASE', 'CHARGE', '624', '70342', 'Transport of goods and public transport of personnel', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70347, 'ENG-BASE', 'CHARGE', '625', '70342', 'Travel, missions and receptions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70348, 'ENG-BASE', 'CHARGE', '626', '70342', 'Postal and telecommunications costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70349, 'ENG-BASE', 'CHARGE', '627', '70342', 'Banking and related services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70350, 'ENG-BASE', 'CHARGE', '628', '70342', 'Various', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70351, 'ENG-BASE', 'CHARGE', '629', '70342', 'Discounts, rebates and rebates obtained on other external services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70352, 'ENG-BASE', 'CHARGE', '63', '71506', 'Taxes other and payments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70353, 'ENG-BASE', 'CHARGE', '631', '70352', 'Taxes and similar payments on remuneration (tax administrations)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70354, 'ENG-BASE', 'CHARGE', '633', '70352', 'Taxes and similar payments on remuneration (other bodies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70355, 'ENG-BASE', 'CHARGE', '635', '70352', 'Other taxes, duties and similar payments (tax administrations)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70356, 'ENG-BASE', 'CHARGE', '637', '70352', 'Other taxes, duties and similar payments (other bodies)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70357, 'ENG-BASE', 'CHARGE', '64', '71506', 'Staff costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70358, 'ENG-BASE', 'CHARGE', '641', '70357', 'Remuneration of staff', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70359, 'ENG-BASE', 'CHARGE', '644', '70357', 'Remuneration of the operator''s work', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70360, 'ENG-BASE', 'CHARGE', '645', '70357', 'Social Security and Welfare Expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70361, 'ENG-BASE', 'CHARGE', '646', '70357', 'Personal social contributions of the operator', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70362, 'ENG-BASE', 'CHARGE', '647', '70357', 'Other payroll taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70363, 'ENG-BASE', 'CHARGE', '648', '70357', 'Other staff costs', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70364, 'ENG-BASE', 'CHARGE', '65', '71506', 'Other current operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70365, 'ENG-BASE', 'CHARGE', '651', '70364', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70366, 'ENG-BASE', 'CHARGE', '653', '70364', 'Attendance fees', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70367, 'ENG-BASE', 'CHARGE', '654', '70364', 'Loss on bad debts', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70368, 'ENG-BASE', 'CHARGE', '655', '70364', 'Share of profit or loss on transactions made jointly', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70369, 'ENG-BASE', 'CHARGE', '658', '70364', 'Miscellaneous operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70370, 'ENG-BASE', 'CHARGE', '66', '71506', 'Financial expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70371, 'ENG-BASE', 'CHARGE', '661', '70370', 'Interest charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70372, 'ENG-BASE', 'CHARGE', '664', '70370', 'Loss on receivables related to investments', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70373, 'ENG-BASE', 'CHARGE', '665', '70370', 'Discounts granted', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70374, 'ENG-BASE', 'CHARGE', '666', '70370', 'Exchange losses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70375, 'ENG-BASE', 'CHARGE', '667', '70370', 'Net expense on disposals of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70376, 'ENG-BASE', 'CHARGE', '668', '70370', 'Other financial expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70377, 'ENG-BASE', 'CHARGE', '67', '71506', 'Extraordinary charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70378, 'ENG-BASE', 'CHARGE', '671', '70377', 'Exceptional charges on management operations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70379, 'ENG-BASE', 'CHARGE', '672', '70377', 'Account available to entities to record, in the course of the financial year, expenses over previous financial years', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70380, 'ENG-BASE', 'CHARGE', '675', '70377', 'Book value of assets sold', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70381, 'ENG-BASE', 'CHARGE', '678', '70377', 'Other extraordinary expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70382, 'ENG-BASE', 'CHARGE', '68', '71506', 'Depreciation, amortization and provisions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70383, 'ENG-BASE', 'CHARGE', '681', '70382', 'Depreciation, amortization and provisions - Operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70384, 'ENG-BASE', 'CHARGE', '686', '70382', 'Depreciation, amortization and provisions - Financial expense', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70385, 'ENG-BASE', 'CHARGE', '687', '70382', 'Depreciation, amortization and provisions - Extraordinary expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70386, 'ENG-BASE', 'CHARGE', '69', '71506', 'Employee participation - income tax and assimilated', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70387, 'ENG-BASE', 'CHARGE', '691', '70386', 'Employee participation in results', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70388, 'ENG-BASE', 'CHARGE', '695', '70386', 'Income taxes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70389, 'ENG-BASE', 'CHARGE', '696', '70386', 'Corporate income tax related to distributions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70390, 'ENG-BASE', 'CHARGE', '697', '70386', 'Annual corporation tax', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70391, 'ENG-BASE', 'CHARGE', '698', '70386', 'Tax integration', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70392, 'ENG-BASE', 'CHARGE', '699', '70386', 'Products - Reports back deficits', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70393, 'ENG-BASE', 'PROD', '70', '71507', 'Sales of manufactured goods, services, goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70394, 'ENG-BASE', 'PROD', '701', '70393', 'Sales of finished products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70395, 'ENG-BASE', 'PROD', '702', '70393', 'Sales of intermediate products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70396, 'ENG-BASE', 'PROD', '703', '70393', 'Sales of residual products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70397, 'ENG-BASE', 'PROD', '704', '70393', 'Works', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70398, 'ENG-BASE', 'PROD', '705', '70393', 'Studies', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70399, 'ENG-BASE', 'PROD', '706', '70393', 'Services', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70400, 'ENG-BASE', 'PROD', '707', '70393', 'Sale of goods', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70401, 'ENG-BASE', 'PROD', '708', '70393', 'Income from ancillary activities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70402, 'ENG-BASE', 'PROD', '709', '70393', 'Discounts, rebates and rebates granted by the company', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70403, 'ENG-BASE', 'PROD', '71', '71507', 'Stored production (or destocking)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70404, 'ENG-BASE', 'PROD', '713', '70403', 'Change in stocks (in-process production, products)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70405, 'ENG-BASE', 'PROD', '72', '71507', 'Immobilised production', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70406, 'ENG-BASE', 'PROD', '721', '70405', 'Intangible assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70407, 'ENG-BASE', 'PROD', '722', '70405', 'Property, plant and equipment', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70408, 'ENG-BASE', 'PROD', '74', '71507', 'Operating grants', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70409, 'ENG-BASE', 'PROD', '75', '71507', 'Other management products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70410, 'ENG-BASE', 'PROD', '751', '70409', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70411, 'ENG-BASE', 'PROD', '752', '70409', 'Income from buildings not used for professional purposes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70412, 'ENG-BASE', 'PROD', '753', '70409', 'Directors'' fees and remuneration of directors, managers, ...', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70413, 'ENG-BASE', 'PROD', '754', '70409', 'Perceived refunds of cooperatives (from surplus)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70414, 'ENG-BASE', 'PROD', '755', '70409', 'Share of profits on transactions made jointly', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70415, 'ENG-BASE', 'PROD', '758', '70409', 'Miscellaneous current management products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70416, 'ENG-BASE', 'PROD', '76', '71507', 'Financial products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70417, 'ENG-BASE', 'PROD', '761', '70416', 'Income from participations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70418, 'ENG-BASE', 'PROD', '762', '70416', 'Income from other financial assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70419, 'ENG-BASE', 'PROD', '763', '70416', 'Revenue from other receivables', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70420, 'ENG-BASE', 'PROD', '764', '70416', 'Income from marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70421, 'ENG-BASE', 'PROD', '765', '70416', 'Discounts obtained', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70422, 'ENG-BASE', 'PROD', '766', '70416', 'Exchange gains', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70423, 'ENG-BASE', 'PROD', '767', '70416', 'Net proceeds on disposals of marketable securities', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70424, 'ENG-BASE', 'PROD', '768', '70416', 'Other financial income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70425, 'ENG-BASE', 'PROD', '77', '71507', 'Exceptional products', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70426, 'ENG-BASE', 'PROD', '771', '70425', 'Extraordinary income from management operations', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70427, 'ENG-BASE', 'PROD', '772', '70425', 'Account available to entities to record, during the financial year, the revenues over previous financial years', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70428, 'ENG-BASE', 'PROD', '775', '70425', 'Proceeds from disposals of assets', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70429, 'ENG-BASE', 'PROD', '777', '70425', 'Share of investment grants transferred to profit or loss for the year', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70430, 'ENG-BASE', 'PROD', '778', '70425', 'Other extraordinary income', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70431, 'ENG-BASE', 'PROD', '78', '71507', 'Reversals of depreciation and provisions', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70432, 'ENG-BASE', 'PROD', '781', '70431', 'Reversals of depreciation and provisions (to be included in revenue)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70433, 'ENG-BASE', 'PROD', '786', '70431', 'Reversals of provisions for risks (to be recorded in financial income)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70434, 'ENG-BASE', 'PROD', '787', '70431', 'Reversals of provisions (to be recorded in exceptional income)', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70435, 'ENG-BASE', 'PROD', '79', '71507', 'Transfers of charges', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70436, 'ENG-BASE', 'PROD', '791', '70435', 'Transfers of operating expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70437, 'ENG-BASE', 'PROD', '796', '70435', 'Transfers of financial expenses', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70438, 'ENG-BASE', 'PROD', '797', '70435', 'Transfers of Exceptional Charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70322, 'ENG-BASE', 'EXPENSE', '60', '71506', 'Shopping', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70323, 'ENG-BASE', 'EXPENSE', '601', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70324, 'ENG-BASE', 'EXPENSE', '602', '70322', 'Stored Procurement - Other Supplies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70325, 'ENG-BASE', 'EXPENSE', '603', '70322', 'Inventory Changes (Supplies and Commodities)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70326, 'ENG-BASE', 'EXPENSE', '604', '70322', 'Stored Procurement - Raw Materials (and Supplies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70327, 'ENG-BASE', 'EXPENSE', '605', '70322', 'Purchase of equipment, works and equipment', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70328, 'ENG-BASE', 'EXPENSE', '606', '70322', 'Non-stock purchases of materials and supplies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70329, 'ENG-BASE', 'EXPENSE', '607', '70322', 'Purchases of goods', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70330, 'ENG-BASE', 'EXPENSE', '608', '70322', 'Reserved account, where applicable, to the recapitulation of incidental expenses included in purchases', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70331, 'ENG-BASE', 'EXPENSE', '609', '70322', 'Discounts, rebates and rebates obtained on purchases', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70332, 'ENG-BASE', 'EXPENSE', '61', '71506', 'Outside services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70333, 'ENG-BASE', 'EXPENSE', '611', '70332', 'General subcontracting', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70334, 'ENG-BASE', 'EXPENSE', '612', '70332', 'Lease payments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70335, 'ENG-BASE', 'EXPENSE', '613', '70332', 'Rentals', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70336, 'ENG-BASE', 'EXPENSE', '614', '70332', 'Rental and condominium expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70337, 'ENG-BASE', 'EXPENSE', '615', '70332', 'Maintenance and repairs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70338, 'ENG-BASE', 'EXPENSE', '616', '70332', 'Insurance premiums', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70339, 'ENG-BASE', 'EXPENSE', '617', '70332', 'Studies and research', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70340, 'ENG-BASE', 'EXPENSE', '618', '70332', 'Various', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70341, 'ENG-BASE', 'EXPENSE', '619', '70332', 'Discounts, rebates and rebates obtained on external services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70342, 'ENG-BASE', 'EXPENSE', '62', '71506', 'Other services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70343, 'ENG-BASE', 'EXPENSE', '621', '70342', 'Staff outside the company', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70344, 'ENG-BASE', 'EXPENSE', '622', '70342', 'Remuneration of intermediaries and fees', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70345, 'ENG-BASE', 'EXPENSE', '623', '70342', 'Advertising, publications, public relations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70346, 'ENG-BASE', 'EXPENSE', '624', '70342', 'Transport of goods and public transport of personnel', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70347, 'ENG-BASE', 'EXPENSE', '625', '70342', 'Travel, missions and receptions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70348, 'ENG-BASE', 'EXPENSE', '626', '70342', 'Postal and telecommunications costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70349, 'ENG-BASE', 'EXPENSE', '627', '70342', 'Banking and related services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70350, 'ENG-BASE', 'EXPENSE', '628', '70342', 'Various', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70351, 'ENG-BASE', 'EXPENSE', '629', '70342', 'Discounts, rebates and rebates obtained on other external services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70352, 'ENG-BASE', 'EXPENSE', '63', '71506', 'Taxes other and payments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70353, 'ENG-BASE', 'EXPENSE', '631', '70352', 'Taxes and similar payments on remuneration (tax administrations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70354, 'ENG-BASE', 'EXPENSE', '633', '70352', 'Taxes and similar payments on remuneration (other bodies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70355, 'ENG-BASE', 'EXPENSE', '635', '70352', 'Other taxes, duties and similar payments (tax administrations)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70356, 'ENG-BASE', 'EXPENSE', '637', '70352', 'Other taxes, duties and similar payments (other bodies)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70357, 'ENG-BASE', 'EXPENSE', '64', '71506', 'Staff costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70358, 'ENG-BASE', 'EXPENSE', '641', '70357', 'Remuneration of staff', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70359, 'ENG-BASE', 'EXPENSE', '644', '70357', 'Remuneration of the operator''s work', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70360, 'ENG-BASE', 'EXPENSE', '645', '70357', 'Social Security and Welfare Expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70361, 'ENG-BASE', 'EXPENSE', '646', '70357', 'Personal social contributions of the operator', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70362, 'ENG-BASE', 'EXPENSE', '647', '70357', 'Other payroll taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70363, 'ENG-BASE', 'EXPENSE', '648', '70357', 'Other staff costs', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70364, 'ENG-BASE', 'EXPENSE', '65', '71506', 'Other current operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70365, 'ENG-BASE', 'EXPENSE', '651', '70364', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70366, 'ENG-BASE', 'EXPENSE', '653', '70364', 'Attendance fees', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70367, 'ENG-BASE', 'EXPENSE', '654', '70364', 'Loss on bad debts', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70368, 'ENG-BASE', 'EXPENSE', '655', '70364', 'Share of profit or loss on transactions made jointly', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70369, 'ENG-BASE', 'EXPENSE', '658', '70364', 'Miscellaneous operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70370, 'ENG-BASE', 'EXPENSE', '66', '71506', 'Financial expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70371, 'ENG-BASE', 'EXPENSE', '661', '70370', 'Interest charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70372, 'ENG-BASE', 'EXPENSE', '664', '70370', 'Loss on receivables related to investments', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70373, 'ENG-BASE', 'EXPENSE', '665', '70370', 'Discounts granted', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70374, 'ENG-BASE', 'EXPENSE', '666', '70370', 'Exchange losses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70375, 'ENG-BASE', 'EXPENSE', '667', '70370', 'Net expense on disposals of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70376, 'ENG-BASE', 'EXPENSE', '668', '70370', 'Other financial expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70377, 'ENG-BASE', 'EXPENSE', '67', '71506', 'Extraordinary charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70378, 'ENG-BASE', 'EXPENSE', '671', '70377', 'Exceptional charges on management operations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70379, 'ENG-BASE', 'EXPENSE', '672', '70377', 'Account available to entities to record, in the course of the financial year, expenses over previous financial years', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70380, 'ENG-BASE', 'EXPENSE', '675', '70377', 'Book value of assets sold', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70381, 'ENG-BASE', 'EXPENSE', '678', '70377', 'Other extraordinary expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70382, 'ENG-BASE', 'EXPENSE', '68', '71506', 'Depreciation, amortization and provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70383, 'ENG-BASE', 'EXPENSE', '681', '70382', 'Depreciation, amortization and provisions - Operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70384, 'ENG-BASE', 'EXPENSE', '686', '70382', 'Depreciation, amortization and provisions - Financial expense', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70385, 'ENG-BASE', 'EXPENSE', '687', '70382', 'Depreciation, amortization and provisions - Extraordinary expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70386, 'ENG-BASE', 'EXPENSE', '69', '71506', 'Employee participation - income tax and assimilated', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70387, 'ENG-BASE', 'EXPENSE', '691', '70386', 'Employee participation in results', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70388, 'ENG-BASE', 'EXPENSE', '695', '70386', 'Income taxes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70389, 'ENG-BASE', 'EXPENSE', '696', '70386', 'Corporate income tax related to distributions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70390, 'ENG-BASE', 'EXPENSE', '697', '70386', 'Annual corporation tax', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70391, 'ENG-BASE', 'EXPENSE', '698', '70386', 'Tax integration', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70392, 'ENG-BASE', 'EXPENSE', '699', '70386', 'Products - Reports back deficits', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70393, 'ENG-BASE', 'INCOME', '70', '71507', 'Sales of manufactured goods, services, goods', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70394, 'ENG-BASE', 'INCOME', '701', '70393', 'Sales of finished products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70395, 'ENG-BASE', 'INCOME', '702', '70393', 'Sales of intermediate products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70396, 'ENG-BASE', 'INCOME', '703', '70393', 'Sales of residual products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70397, 'ENG-BASE', 'INCOME', '704', '70393', 'Works', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70398, 'ENG-BASE', 'INCOME', '705', '70393', 'Studies', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70399, 'ENG-BASE', 'INCOME', '706', '70393', 'Services', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70400, 'ENG-BASE', 'INCOME', '707', '70393', 'Sale of goods', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70401, 'ENG-BASE', 'INCOME', '708', '70393', 'Income from ancillary activities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70402, 'ENG-BASE', 'INCOME', '709', '70393', 'Discounts, rebates and rebates granted by the company', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70403, 'ENG-BASE', 'INCOME', '71', '71507', 'Stored production (or destocking)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70404, 'ENG-BASE', 'INCOME', '713', '70403', 'Change in stocks (in-process production, products)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70405, 'ENG-BASE', 'INCOME', '72', '71507', 'Immobilised production', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70406, 'ENG-BASE', 'INCOME', '721', '70405', 'Intangible assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70407, 'ENG-BASE', 'INCOME', '722', '70405', 'Property, plant and equipment', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70408, 'ENG-BASE', 'INCOME', '74', '71507', 'Operating grants', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70409, 'ENG-BASE', 'INCOME', '75', '71507', 'Other management products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70410, 'ENG-BASE', 'INCOME', '751', '70409', 'Royalties for concessions, patents, licenses, trademarks, processes, software, rights and similar values', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70411, 'ENG-BASE', 'INCOME', '752', '70409', 'Income from buildings not used for professional purposes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70412, 'ENG-BASE', 'INCOME', '753', '70409', 'Directors'' fees and remuneration of directors, managers, ...', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70413, 'ENG-BASE', 'INCOME', '754', '70409', 'Perceived refunds of cooperatives (from surplus)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70414, 'ENG-BASE', 'INCOME', '755', '70409', 'Share of profits on transactions made jointly', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70415, 'ENG-BASE', 'INCOME', '758', '70409', 'Miscellaneous current management products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70416, 'ENG-BASE', 'INCOME', '76', '71507', 'Financial products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70417, 'ENG-BASE', 'INCOME', '761', '70416', 'Income from participations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70418, 'ENG-BASE', 'INCOME', '762', '70416', 'Income from other financial assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70419, 'ENG-BASE', 'INCOME', '763', '70416', 'Revenue from other receivables', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70420, 'ENG-BASE', 'INCOME', '764', '70416', 'Income from marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70421, 'ENG-BASE', 'INCOME', '765', '70416', 'Discounts obtained', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70422, 'ENG-BASE', 'INCOME', '766', '70416', 'Exchange gains', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70423, 'ENG-BASE', 'INCOME', '767', '70416', 'Net proceeds on disposals of marketable securities', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70424, 'ENG-BASE', 'INCOME', '768', '70416', 'Other financial income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70425, 'ENG-BASE', 'INCOME', '77', '71507', 'Exceptional products', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70426, 'ENG-BASE', 'INCOME', '771', '70425', 'Extraordinary income from management operations', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70427, 'ENG-BASE', 'INCOME', '772', '70425', 'Account available to entities to record, during the financial year, the revenues over previous financial years', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70428, 'ENG-BASE', 'INCOME', '775', '70425', 'Proceeds from disposals of assets', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70429, 'ENG-BASE', 'INCOME', '777', '70425', 'Share of investment grants transferred to profit or loss for the year', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70430, 'ENG-BASE', 'INCOME', '778', '70425', 'Other extraordinary income', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70431, 'ENG-BASE', 'INCOME', '78', '71507', 'Reversals of depreciation and provisions', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70432, 'ENG-BASE', 'INCOME', '781', '70431', 'Reversals of depreciation and provisions (to be included in revenue)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70433, 'ENG-BASE', 'INCOME', '786', '70431', 'Reversals of provisions for risks (to be recorded in financial income)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70434, 'ENG-BASE', 'INCOME', '787', '70431', 'Reversals of provisions (to be recorded in exceptional income)', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70435, 'ENG-BASE', 'INCOME', '79', '71507', 'Transfers of charges', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70436, 'ENG-BASE', 'INCOME', '791', '70435', 'Transfers of operating expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70437, 'ENG-BASE', 'INCOME', '796', '70435', 'Transfers of financial expenses', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 70438, 'ENG-BASE', 'INCOME', '797', '70435', 'Transfers of Exceptional Charges', 1); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index bce46a70e49..d2886631942 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -21,25 +21,26 @@ -- -- Bank Thirdparty -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__,

      \n\n__(FindYourSEPAMandate)__ :
      \n__MYCOMPANY_NAME__
      \n__MYCOMPANY_FULLADDRESS__

      \n__(Sincerely)__
      \n__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'isModEnabled("societe") && isModEnabled("banque") && isModEnabled("prelevement")',0,'__(YourSEPAMandate)__','__(Hello)__,

      \n\n__(FindYourSEPAMandate)__ :
      \n__MYCOMPANY_NAME__
      \n__MYCOMPANY_FULLADDRESS__

      \n__(Sincerely)__
      \n__USER_SIGNATURE__',null, 0); -- Members -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourMembershipWasValidated)__
      __(FirstName)__ : __MEMBER_FIRSTNAME__
      __(LastName)__ : __MEMBER_LASTNAME__
      __(ID)__ : __MEMBER_ID__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
      \n\n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(YourMembershipWasCanceled)__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

      \n\n__(ThisIsContentOfYourCard)__
      \n__(ID)__ : __ID__
      \n__(Civility)__ : __MEMBER_CIVILITY__
      \n__(Firstname)__ : __MEMBER_FIRSTNAME__
      \n__(Lastname)__ : __MEMBER_LASTNAME__
      \n__(Fullname)__ : __MEMBER_FULLNAME__
      \n__(Company)__ : __MEMBER_COMPANY__
      \n__(Address)__ : __MEMBER_ADDRESS__
      \n__(Zip)__ : __MEMBER_ZIP__
      \n__(Town)__ : __MEMBER_TOWN__
      \n__(Country)__ : __MEMBER_COUNTRY__
      \n__(Email)__ : __MEMBER_EMAIL__
      \n__(Birthday)__ : __MEMBER_BIRTH__
      \n__(Photo)__ : __MEMBER_PHOTO__
      \n__(Login)__ : __MEMBER_LOGIN__
      \n__(Phone)__ : __MEMBER_PHONE__
      \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
      \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourMembershipWasValidated)__
      __(FirstName)__ : __MEMBER_FIRSTNAME__
      __(LastName)__ : __MEMBER_LASTNAME__
      __(ID)__ : __MEMBER_ID__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
      \n\n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(YourMembershipWasCanceled)__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

      \n\n__(ThisIsContentOfYourCard)__
      \n__(ID)__ : __ID__
      \n__(Civility)__ : __MEMBER_CIVILITY__
      \n__(Firstname)__ : __MEMBER_FIRSTNAME__
      \n__(Lastname)__ : __MEMBER_LASTNAME__
      \n__(Fullname)__ : __MEMBER_FULLNAME__
      \n__(Company)__ : __MEMBER_COMPANY__
      \n__(Address)__ : __MEMBER_ADDRESS__
      \n__(Zip)__ : __MEMBER_ZIP__
      \n__(Town)__ : __MEMBER_TOWN__
      \n__(Country)__ : __MEMBER_COUNTRY__
      \n__(Email)__ : __MEMBER_EMAIL__
      \n__(Birthday)__ : __MEMBER_BIRTH__
      \n__(Photo)__ : __MEMBER_PHOTO__
      \n__(Login)__ : __MEMBER_LOGIN__
      \n__(Phone)__ : __MEMBER_PHONE__
      \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
      \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); -- Recruiting -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

      \n\n__(YourCandidatureAnswerMessage)__
      __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'isModEnabled("recruitment")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

      \n\n__(YourCandidatureAnswerMessage)__
      __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); -- Event organization INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,

      __(OrganizationEventConfRequestWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,

      __(OrganizationEventBoothRequestWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); -- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__ -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

      __(OrganizationEventPaymentOfBoothWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); -INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

      __(OrganizationEventPaymentOfRegistrationWasReceived)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

      __(OrganizationEventPaymentOfBoothWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

      __(OrganizationEventPaymentOfRegistrationWasReceived)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +-- INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,

      __(OrganizationEventBulkMailToAttendees)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,

      __(OrganizationEventBulkMailToSpeakers)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index f7e7a7a1ba5..d5deec862d0 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -365,7 +365,52 @@ ALTER TABLE llx_bank_account ADD COLUMN pti_in_ctti smallint DEFAULT 0 AFTER dom -- Set default ticket type to OTHER if no default exists UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SELECT * FROM (SELECT * FROM llx_c_ticket_type) AS t WHERE use_default=1); + -- Assets - New module + +CREATE TABLE llx_asset( + rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref varchar(128) NOT NULL, + entity integer DEFAULT 1 NOT NULL, + label varchar(255), + + fk_asset_model integer, + + reversal_amount_ht double(24,8), + acquisition_value_ht double(24,8) DEFAULT NULL, + recovered_vat double(24,8), + + reversal_date date, + + date_acquisition date NOT NULL, + date_start date NOT NULL, + + qty real DEFAULT 1 NOT NULL, + + acquisition_type smallint DEFAULT 0 NOT NULL, + asset_type smallint DEFAULT 0 NOT NULL, + + not_depreciated integer DEFAULT 0, + + disposal_date date, + disposal_amount_ht double(24,8), + fk_disposal_type integer, + disposal_depreciated integer DEFAULT 0, + disposal_subject_to_vat integer DEFAULT 0, + + note_public text, + note_private text, + + date_creation datetime NOT NULL, + tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + last_main_doc varchar(255), + import_key varchar(14), + model_pdf varchar(255), + status integer NOT NULL +) ENGINE=innodb; + ALTER TABLE llx_asset DROP FOREIGN KEY fk_asset_asset_type; ALTER TABLE llx_asset DROP INDEX idx_asset_fk_asset_type; @@ -653,6 +698,9 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstnam ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email; +-- VMYSQL4.3 ALTER TABLE llx_eventorganization_conferenceorboothattendee MODIFY COLUMN fk_user_creat integer NULL; +-- VPGSQL8.2 ALTER TABLE llx_eventorganization_conferenceorboothattendee ALTER COLUMN fk_user_creat DROP NOT NULL; + ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles text; ALTER TABLE llx_c_email_templates ADD COLUMN email_from varchar(255); @@ -692,3 +740,34 @@ ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, da -- We need when upgrade 15 to 16 with Dolibarr v17+ for upgrade2 function migrate_user_photospath2() ALTER TABLE llx_user CHANGE COLUMN note note_private text; + + +-- Bank Thirdparty +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'isModEnabled("societe") && isModEnabled("banque") && isModEnabled("prelevement")',0,'__(YourSEPAMandate)__','__(Hello)__,

      \n\n__(FindYourSEPAMandate)__ :
      \n__MYCOMPANY_NAME__
      \n__MYCOMPANY_FULLADDRESS__

      \n__(Sincerely)__
      \n__USER_SIGNATURE__',null, 0); + +-- Members +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourMembershipWasValidated)__
      __(FirstName)__ : __MEMBER_FIRSTNAME__
      __(LastName)__ : __MEMBER_LASTNAME__
      __(ID)__ : __MEMBER_ID__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
      \n\n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(ThisIsContentOfSubscriptionReminderEmail)__
      \n
      __ONLINE_PAYMENT_TEXT_AND_URL__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

      \n\n__(YourMembershipWasCanceled)__
      \n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60, 'isModEnabled("adherent")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

      \n\n__(ThisIsContentOfYourCard)__
      \n__(ID)__ : __ID__
      \n__(Civility)__ : __MEMBER_CIVILITY__
      \n__(Firstname)__ : __MEMBER_FIRSTNAME__
      \n__(Lastname)__ : __MEMBER_LASTNAME__
      \n__(Fullname)__ : __MEMBER_FULLNAME__
      \n__(Company)__ : __MEMBER_COMPANY__
      \n__(Address)__ : __MEMBER_ADDRESS__
      \n__(Zip)__ : __MEMBER_ZIP__
      \n__(Town)__ : __MEMBER_TOWN__
      \n__(Country)__ : __MEMBER_COUNTRY__
      \n__(Email)__ : __MEMBER_EMAIL__
      \n__(Birthday)__ : __MEMBER_BIRTH__
      \n__(Photo)__ : __MEMBER_PHOTO__
      \n__(Login)__ : __MEMBER_LOGIN__
      \n__(Phone)__ : __MEMBER_PHONE__
      \n__(PhonePerso)__ : __MEMBER_PHONEPRO__
      \n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); + +-- Recruiting +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0, 'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'isModEnabled("recruitment")',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

      \n\n__(YourCandidatureAnswerMessage)__
      __ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

      \n__(Sincerely)__
      __USER_SIGNATURE__',null, 0); + +-- Event organization +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__,

      __(OrganizationEventConfRequestWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__,

      __(OrganizationEventBoothRequestWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +-- TODO Add message for registration only to event __ONLINE_PAYMENT_TEXT_AND_URL__ +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailBoothPayment)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailBoothPayment)__', '__(Hello)__,

      __(OrganizationEventPaymentOfBoothWasReceived)__


      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailRegistrationPayment)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailRegistrationPayment)__', '__(Hello)__,

      __(OrganizationEventPaymentOfRegistrationWasReceived)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +-- +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__,

      __(OrganizationEventBulkMailToAttendees)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__,

      __(OrganizationEventBulkMailToSpeakers)__

      __(Sincerely)__
      __USER_SIGNATURE__', null, '1', null); + +-- Partnership +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipWillSoonBeCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipWillSoonBeCanceledTopic)__', 0, '\n

      __(Hello)__,

      \n__(YourPartnershipWillSoonBeCanceledContent)__

      \n
      \n\n
      \n\n __(Sincerely)__
      \n __[MAIN_INFO_SOCIETE_NOM]__
      \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipCanceled)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipCanceledTopic)__', 0, '\n

      __(Hello)__,

      \n__(YourPartnershipCanceledContent)__

      \n
      \n\n
      \n\n __(Sincerely)__
      \n __[MAIN_INFO_SOCIETE_NOM]__
      \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipRefused)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipRefusedTopic)__', 0, '\n

      __(Hello)__,

      \n__(YourPartnershipRefusedContent)__

      \n
      \n\n
      \n\n __(Sincerely)__
      \n __[MAIN_INFO_SOCIETE_NOM]__
      \n \n'); +INSERT INTO llx_c_email_templates (entity, module, type_template, label, lang, position, topic, joinfiles, content) VALUES (0, 'partnership', 'partnership_send', '(SendingEmailOnPartnershipAccepted)', '', 100, '[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipAcceptedTopic)__', 0, '\n

      __(Hello)__,

      \n__(YourPartnershipAcceptedContent)__

      \n
      \n\n
      \n\n __(Sincerely)__
      \n __[MAIN_INFO_SOCIETE_NOM]__
      \n \n'); diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index 618e001b21c..24ac0e37ff5 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -195,3 +195,169 @@ ALTER TABLE llx_bank_url ADD INDEX idx_bank_url_url_id (url_id); ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_code varchar(3) NULL; ALTER TABLE llx_societe_remise_except ADD COLUMN multicurrency_tx double(24,8) NULL; +-- VMYSQL4.3 ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN `rank` rankorder integer; +-- VPGSQL8.2 ALTER TABLE llx_hrm_evaluationdet CHANGE COLUMN rank rankorder integer; + + +-- Rename const to hide public and private notes (fix allow notes const was used to hide) +UPDATE llx_const SET name = 'MAIN_LIST_HIDE_PUBLIC_NOTES' WHERE name = 'MAIN_LIST_ALLOW_PUBLIC_NOTES'; +UPDATE llx_const SET name = 'MAIN_LIST_HIDE_PRIVATE_NOTES' WHERE name = 'MAIN_LIST_ALLOW_PRIVATE_NOTES'; + + +ALTER TABLE llx_projet ADD COLUMN date_start_event datetime; +ALTER TABLE llx_projet ADD COLUMN date_end_event datetime; +ALTER TABLE llx_projet ADD COLUMN location varchar(255); + + +ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(128); + +-- +-- List of all managed triggered events (used for trigger agenda automatic events and for notification) +-- + +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_MODIFY','Customer proposal modified','Executed when a customer proposal is modified','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_DELETE','Customer proposal deleted','Executed when a customer proposal is deleted','propal',2); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_MODIFY','Customer order modified','Executed when a customer order is set modified','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_DELETE','Customer order deleted','Executed when a customer order is deleted','commande',5); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_MODIFY','Customer invoice modified','Executed when a customer invoice is modified','facture',7); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_VALIDATE','Price request validated','Executed when a commercial proposal is validated','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_MODIFY','Price request modified','Executed when a commercial proposal is modified','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_SENTBYMAIL','Price request sent by mail','Executed when a commercial proposal is sent by mail','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_CLOSE_SIGNED','Price request closed signed','Executed when a customer proposal is closed signed','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_CLOSE_REFUSED','Price request closed refused','Executed when a customer proposal is closed refused','proposal_supplier',10); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPOSAL_SUPPLIER_DELETE','Price request deleted','Executed when a customer proposal delete','proposal_supplier',10); +--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CREATE','Supplier order created','Executed when a supplier order is created','order_supplier',11); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',12); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_MODIFY','Supplier order request modified','Executed when a supplier order is modified','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_MODIFY','Supplier invoice modified','Executed when a supplier invoice is modified','invoice_supplier',15); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SUPPLIER_DELETE','Supplier invoice deleted','Executed when a supplier invoice is deleted','invoice_supplier',17); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_MODIFY','Contract modified','Executed when a contract is modified','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_SENTBYMAIL','Contract sent by mail','Executed when a contract is sent by mail','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTRACT_DELETE','Contract deleted','Executed when a contract is deleted','contrat',18); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_MODIFY','Shipping modified','Executed when a shipping is modified','shipping',20); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('SHIPPING_DELETE','Shipping sent is deleted','Executed when a shipping is deleted','shipping',21); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_VALIDATE','Reception validated','Executed when a reception is validated','reception',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECEPTION_SENTBYMAIL','Reception sent by mail','Executed when a reception is sent by mail','reception',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_MODIFY','Member modified','Executed when a member is modified','member',23); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',25); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',26); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MEMBER_EXCLUDE','Member excluded','Executed when a member is excluded','member',27); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',30); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modify','Executed when a intervention is modify','ficheinter',30); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',32); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',33); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',34); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',35); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',40); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',41); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',42); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_MODIFY','Expense report modified','Executed when an expense report is modified','expensereport',202); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Expense report modified','Executed when an expense report is modified','expensereport',212); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',140); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',143); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is modified','ticket',164); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_CREATE','User created','Executed when a user is created','user',301); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_MODIFY','User update','Executed when a user is updated','user',302); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_DELETE','User update','Executed when a user is deleted','user',303); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_NEW_PASSWORD','User update','Executed when a user is change password','user',304); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_ENABLEDISABLE','User update','Executed when a user is enable or disable','user',305); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',650); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_UNVALIDATE','BOM unvalidated','Executed when a BOM is unvalidated','bom',651); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','mrp',660); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','mrp',661); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','mrp',662); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','mrp',663); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact address record','contact',52); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',53); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516); + +-- actions not enabled by default : they are excluded when we enable the module Agenda (except TASK_...) +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ACTION_CREATE','Action added','Executed when an action is added to the agenda','agenda',700); + +-- holiday +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CREATE','Holiday created','Executed when a holiday is created','holiday',800); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Holiday validated','Executed when a holiday is validated','holiday',802); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Holiday aprouved','Executed when a holiday is aprouved','holiday',803); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804); + +-- facture rec +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_CREATE','Template invoices created','Executed when a Template invoices is created','facturerec',900); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_MODIFY','Template invoices update','Executed when a Template invoices is updated','facturerec',901); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_DELETE','Template invoices deleted','Executed when a Template invoices is deleted','facturerec',902); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILLREC_AUTOCREATEBILL','Template invoices use to create invoices with auto batch','Executed when a Template invoices is use to create invoice with auto batch','facturerec',903); diff --git a/htdocs/install/mysql/tables/llx_c_action_trigger.sql b/htdocs/install/mysql/tables/llx_c_action_trigger.sql index 8f7450d0fe9..be1c8580541 100644 --- a/htdocs/install/mysql/tables/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/tables/llx_c_action_trigger.sql @@ -23,7 +23,7 @@ create table llx_c_action_trigger ( rowid integer AUTO_INCREMENT PRIMARY KEY, elementtype varchar(64) NOT NULL, - code varchar(64) NOT NULL, + code varchar(128) NOT NULL, label varchar(128) NOT NULL, description varchar(255), rang integer DEFAULT 0 diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index f13fff71a6f..4119e7aac08 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -28,7 +28,7 @@ CREATE TABLE llx_emailcollector_emailcollector( acces_type integer DEFAULT 0, oauth_service varchar(128), password varchar(128), - source_directory varchar(255) NOT NULL, + source_directory varchar(255) DEFAULT 'Inbox' NOT NULL, target_directory varchar(255), maxemailpercollect integer DEFAULT 100, datelastresult datetime, diff --git a/htdocs/install/mysql/tables/llx_establishment.sql b/htdocs/install/mysql/tables/llx_establishment.sql index 1b0d2668cb0..a3542f6d9d6 100644 --- a/htdocs/install/mysql/tables/llx_establishment.sql +++ b/htdocs/install/mysql/tables/llx_establishment.sql @@ -22,8 +22,8 @@ CREATE TABLE llx_establishment ( rowid integer NOT NULL auto_increment PRIMARY KEY, entity integer NOT NULL DEFAULT 1, - label varchar(255) NOT NULL, ref varchar(30), + label varchar(255) NOT NULL, name varchar(128), address varchar(255), zip varchar(25), diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index 197a92ac2be..5b3df54ba14 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -47,7 +47,10 @@ create table llx_projet usage_opportunity integer DEFAULT 0, -- Set to 1 if project is used to follow an opportunity usage_task integer DEFAULT 1, -- Set to 1 if project is used to manage tasks and/or record timesheet usage_bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices - usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event or receive attendees registration + usage_organize_event integer DEFAULT 0, -- Set to 1 if you want to use project to organize an event or receive attendees registration + date_start_event datetime, -- date start event + date_end_event datetime, -- date end event + location varchar(255), -- location accept_conference_suggestions integer DEFAULT 0, -- Set to 1 if you want to allow unknown people to suggest conferences accept_booth_suggestions integer DEFAULT 0, -- Set to 1 if you want to Allow unknown people to suggest booth max_attendees integer DEFAULT 0, diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 24b5dba4d01..7958012b0a1 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -825,7 +825,7 @@ function write_conf_file($conffile) global $dolibarr_main_distrib; global $db_host, $db_port, $db_name, $db_user, $db_pass, $db_type, $db_character_set, $db_collation; global $conffile, $conffiletoshow, $conffiletoshowshort; - global $force_dolibarr_lib_ADODB_PATH, $force_dolibarr_lib_NUSOAP_PATH; + global $force_dolibarr_lib_NUSOAP_PATH; global $force_dolibarr_lib_TCPDF_PATH, $force_dolibarr_lib_FPDI_PATH; global $force_dolibarr_lib_GEOIP_PATH; global $force_dolibarr_lib_ODTPHP_PATH, $force_dolibarr_lib_ODTPHP_PATHTOPCLZIP; @@ -944,11 +944,6 @@ function write_conf_file($conffile) } fputs($fp, '$dolibarr_lib_TCPDI_PATH=\''.$force_dolibarr_lib_TCPDI_PATH.'\';'); fputs($fp, "\n"); - if (empty($force_dolibarr_lib_ADODB_PATH)) { - fputs($fp, '//'); $force_dolibarr_lib_ADODB_PATH = ''; - } - fputs($fp, '$dolibarr_lib_ADODB_PATH=\''.$force_dolibarr_lib_ADODB_PATH.'\';'); - fputs($fp, "\n"); if (empty($force_dolibarr_lib_GEOIP_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_GEOIP_PATH = ''; } diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index c6cbab64965..bbb12e8693e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -483,6 +483,13 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ migrate_user_photospath(); migrate_user_photospath2(); } + + // Scripts for 17.0 + $afterversionarray = explode('.', '16.0.9'); + $beforeversionarray = explode('.', '17.0.9'); + if (versioncompare($versiontoarray, $afterversionarray) >= 0 && versioncompare($versiontoarray, $beforeversionarray) <= 0) { + migrate_contractdet_rank(); + } } @@ -5137,3 +5144,61 @@ function migrate_export_import_profiles($mode = 'export') print '
    '.$langs->trans("NothingToDo")."
    '; + print ''.$langs->trans('MigrationContractLineRank')."
    \n"; + + $sql = "SELECT c.rowid as cid ,cd.rowid as cdid,cd.rang FROM ".$db->prefix()."contratdet as cd INNER JOIN ".$db->prefix()."contrat as c ON c.rowid=cd.fk_contrat AND cd.rang=0"; + $sql .=" ORDER BY c.rowid,cd.rowid"; + + $resql = $db->query($sql); + if ($resql) { + $currentRank=0; + $current_contract=0; + while ($obj = $db->fetch_object($resql)) { + if (empty($current_contract) || $current_contract==$obj->cid) { + $currentRank++; + } else { + $currentRank=1; + } + + $sqlUpd = "UPDATE ".$db->prefix()."contratdet SET rang=".(int) $currentRank." WHERE rowid=".(int) $obj->cdid; + $resultstring = '.'; + print $resultstring; + $resqlUpd = $db->query($sqlUpd); + if (!$resqlUpd) { + dol_print_error($db); + $error++; + } + + $current_contract = $obj->cid; + } + } else { + $error++; + } + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + + print '
    '.$langs->trans("NothingToDo")."
    '."\n"; // Common attributes + $object->fields['answer']['enabled'] = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; + $object->fields['answer']['enabled'] = 1; if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); @@ -205,6 +207,14 @@ if ($action == 'create') { print '
    '."\n"; + // Add field answer + print '
    '; + print $langs->trans($object->fields['answer']['label']).'
    '; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%'); + $out = $doleditor->Create(1); + print $out; + print dol_get_fiche_end(); print $form->buttonsSaveCancel('Create'); @@ -229,12 +239,14 @@ if (($id || $ref) && $action == 'edit') { print ''; } - print dol_get_fiche_head(); + print dol_get_fiche_head(array(), '', '', -3); print ''."\n"; // Common attributes + $object->fields['answer']['enabled'] = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; + $object->fields['answer']['enabled'] = 1; if (isModEnabled('categorie')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); @@ -260,6 +272,14 @@ if (($id || $ref) && $action == 'edit') { print '
    '; + // Add field answer + print '
    '; + print $langs->trans($object->fields['answer']['label']).'
    '; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%'); + $out = $doleditor->Create(1); + print $out; + print dol_get_fiche_end(); print $form->buttonsSaveCancel(); @@ -408,11 +428,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $keyforbreak='fk_c_ticket_category'; // We change column just before this field //unset($object->fields['fk_project']); // Hide field already shown in banner //unset($object->fields['fk_soc']); // Hide field already shown in banner + $object->fields['answer']['enabled'] = 0; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + $object->fields['answer']['enabled'] = 1; // Categories if (isModEnabled('categorie')) { - print ''.$langs->trans("Categories").''; + print ''.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); print ""; } @@ -421,11 +443,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; + print '
    '; print '
    '; print '
    '; + // Add field answer + print '
    '; + print $langs->trans($object->fields['answer']['label']).'
    '; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('answer', $object->answer, '', 200, 'dolibarr_notes', 'In', true, 0, true, ROWS_9, '100%', 1); + $out = $doleditor->Create(1); + print $out; + print dol_get_fiche_end(); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index d9fc25fa1fe..217c7c71468 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -472,7 +472,7 @@ $moreforfilter.= '
    ';*/ // Filter on categories $moreforfilter = ''; -if (isModEnabled('categorie') && $user->rights->categorie->lire) { +if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { $moreforfilter .= '
    '; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $categoriesKnowledgeArr = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', '', 64, 0, 1); diff --git a/htdocs/langs/ar_IQ/projects.lang b/htdocs/langs/ar_IQ/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/ar_IQ/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index 54771c2245a..eb37ef1ee98 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -21,8 +21,6 @@ SessionSaveHandler=Sessionmanager YourSession=Ihre Anmeldung Sessions=Benutzeranmeldungen DolibarrSetup=Dolibarr installieren oder aktualisieren -InternalUser=interner Nutzer -ExternalUser=externer Nutzer InternalUsers=interne Nutzer ExternalUsers=externe Nutzer UploadNewTemplate=Neue Vorlage(n) hochladen diff --git a/htdocs/langs/de_CH/accountancy.lang b/htdocs/langs/de_CH/accountancy.lang index 6a826327010..a65ad255398 100644 --- a/htdocs/langs/de_CH/accountancy.lang +++ b/htdocs/langs/de_CH/accountancy.lang @@ -39,7 +39,6 @@ CountriesNotInEEC=Nicht EWR - Staaten CountriesInEECExceptMe=Länder im EWR ausser %s CountriesExceptMe=Alle Staaten, ausser %s AccountantFiles=Geschäftsvorgänge exportieren -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
    The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). ExportAccountingSourceDocHelp2=Die Journale exportierst du im Menu %s - %s. VueByAccountAccounting=Anzeigen nach Buchhaltungskonto VueBySubAccountAccounting=Anzeigen nach Nebenbuchkonto @@ -232,7 +231,6 @@ AccountingAccountForSalesTaxAreDefinedInto=Obacht: Das Buchhaltungskonto für d NumberOfAccountancyEntries=Anzahl Einträge NumberOfAccountancyMovements=Anzahl Bewegungen ACCOUNTING_DISABLE_BINDING_ON_SALES=Bindung & Übertragung in der Verkaufsbuchhaltung deaktivieren (Kundenrechnungen werden in der Buchhaltung nicht berücksichtigt) -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) ConfirmExportFile=Bestätigen der Generierung der Buchhaltungsexportdatei ? ExportDraftJournal=Exportiere Entwurfsjournal Modelcsv=Exportformat diff --git a/htdocs/langs/de_CH/admin.lang b/htdocs/langs/de_CH/admin.lang index 3529a5b6b40..b8e31734903 100644 --- a/htdocs/langs/de_CH/admin.lang +++ b/htdocs/langs/de_CH/admin.lang @@ -256,7 +256,6 @@ SetAsDefault=Als Standard definieren InstalledInto=Installiert im Verzeichnis %s BarcodeInitForThirdparties=Barcode Init. für alle Partner BarcodeInitForProductsOrServices=Alle Strichcodes für Produkte oder Services initialisieren oder zurücksetzen -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Alle aktuellen Barcode-Werte löschen ConfirmEraseAllCurrentBarCode=Wirklich alle aktuellen Barcode-Werte löschen? AllBarcodeReset=Alle Barcode-Werte wurden entfernt @@ -396,7 +395,6 @@ Permission215=Lieferanten einrichten Permission255=Andere Passwörter ändern Permission272=Rechnungen anzeigen Permission273=Ausgabe Rechnungen -Permission300=Barcodes auslesen Permission301=Barcodes erzeugen und ändern. Permission331=Lesezeichen einsehen Permission430=PHP Debug Bar verwenden diff --git a/htdocs/langs/de_CH/commercial.lang b/htdocs/langs/de_CH/commercial.lang index edf30db19b1..a3ab0012f82 100644 --- a/htdocs/langs/de_CH/commercial.lang +++ b/htdocs/langs/de_CH/commercial.lang @@ -35,8 +35,5 @@ Stats=Verkaufsstatistik StatusProsp=Interessenten Status NoLimit=Kein Limit ToOfferALinkForOnlineSignature=Link zur Digitalen Unterschrift -WelcomeOnOnlineSignaturePage=Willkommen auf der Seite zum Offerten von %s zu aktzeptieren. -ThisScreenAllowsYouToSignDocFrom=Hier kannst du die Offerte akzeptieren, unterzeichen oder zurückweisen. -ThisIsInformationOnDocumentToSign=Hier die Informationen zum Dokument, das zu akzeptieren oder zurückzuweisen ist. SignatureProposalRef=Unterschrift zur Offerte %s FeatureOnlineSignDisabled=Hoppla, online unterschreiben ist entweder deaktiviert - oder die Offerte wurde erstellt, bevor online unterschreiben aktiviert worden war. diff --git a/htdocs/langs/el_CY/members.lang b/htdocs/langs/el_CY/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/el_CY/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/el_CY/projects.lang b/htdocs/langs/el_CY/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/el_CY/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_AE/members.lang b/htdocs/langs/en_AE/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_AE/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_AE/projects.lang b/htdocs/langs/en_AE/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_AE/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_AU/members.lang b/htdocs/langs/en_AU/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_AU/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_AU/projects.lang b/htdocs/langs/en_AU/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_AU/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_CA/members.lang b/htdocs/langs/en_CA/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_CA/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_CA/projects.lang b/htdocs/langs/en_CA/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_CA/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_GB/accountancy.lang b/htdocs/langs/en_GB/accountancy.lang index 0afbc72c036..8ed034a497b 100644 --- a/htdocs/langs/en_GB/accountancy.lang +++ b/htdocs/langs/en_GB/accountancy.lang @@ -50,7 +50,6 @@ ACCOUNTING_LIST_SORT_VENTILATION_TODO=Begin sorting the page "Links to do" by th ACCOUNTING_LIST_SORT_VENTILATION_DONE=Begin sorting the page "Links done" by the most recent elements ACCOUNTING_LENGTH_GACCOUNT=Length of the General Ledger accounts (If you set value to 6 here, the account '706' will appear as '706000' on screen) ACCOUNTING_SELL_JOURNAL=Sales journal -ACCOUNTING_MISCELLANEOUS_JOURNAL=General journal ACCOUNTING_ACCOUNT_SUSPENSE=Suspense account DONATION_ACCOUNTINGACCOUNT=Finance account to register donations ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Default sales account (used if not defined in the product sheet) diff --git a/htdocs/langs/en_GB/admin.lang b/htdocs/langs/en_GB/admin.lang index 40504938dbe..f61f52381f7 100644 --- a/htdocs/langs/en_GB/admin.lang +++ b/htdocs/langs/en_GB/admin.lang @@ -39,7 +39,6 @@ UMaskExplanation=This parameter allows you to define permissions set by default ListOfDirectories=List of OpenDocument template directories ListOfDirectoriesForModelGenODT=List of directories containing template files in OpenDocument format.

    Put here full path of directories.
    Add a carriage return between each directory.
    To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

    Files in those directories must end with .odt or .ods. FollowingSubstitutionKeysCanBeUsed=
    To learn how to create your .odt document templates, before storing them in those directories, read wiki documentation: -InitEmptyBarCode=Init value for the %s empty barcodes Module50200Name=PayPal DictionaryAccountancyJournal=Finance journals CompanyZip=Postcode diff --git a/htdocs/langs/en_GB/members.lang b/htdocs/langs/en_GB/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_GB/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_GB/projects.lang b/htdocs/langs/en_GB/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_GB/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_GB/trips.lang b/htdocs/langs/en_GB/trips.lang index 31e58b7f935..b9af13b26fa 100644 --- a/htdocs/langs/en_GB/trips.lang +++ b/htdocs/langs/en_GB/trips.lang @@ -1,8 +1,8 @@ # Dolibarr language file - Source file is en_US - trips -TripsAndExpensesStatistics=Expense report statistics -FeesKilometersOrAmout=Amount or Miles -TripNDF=Information expense report -TF_METRO=Tube -ErrorDoubleDeclaration=You have submitted another expense report in a similar date range. BrouillonnerTrip=Move expense report status back to "Draft" ConfirmBrouillonnerTrip=Are you sure you want to move this expense report status back to "Draft"? +ErrorDoubleDeclaration=You have submitted another expense report in a similar date range. +FeesKilometersOrAmout=Amount or Miles +TripNDF=Information expense report +TripsAndExpensesStatistics=Expense report statistics +TF_METRO=Tube diff --git a/htdocs/langs/en_IN/members.lang b/htdocs/langs/en_IN/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_IN/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_SG/members.lang b/htdocs/langs/en_SG/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_SG/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_SG/projects.lang b/htdocs/langs/en_SG/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_SG/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index bb4451de682..40482298e63 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -165,12 +165,14 @@ ACCOUNTANCY_COMBO_FOR_AUX=Enable combo list for subsidiary account (may be slow ACCOUNTING_DATE_START_BINDING=Define a date to start binding & transfer in accountancy. Below this date, the transactions will not be transferred to accounting. ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER=On accountancy transfer, what is the period selected by default -ACCOUNTING_SELL_JOURNAL=Sell journal -ACCOUNTING_PURCHASE_JOURNAL=Purchase journal -ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal +ACCOUNTING_SELL_JOURNAL=Sales journal (sales and returns) +ACCOUNTING_PURCHASE_JOURNAL=Purchase journal (purchase and returns) +ACCOUNTING_BANK_JOURNAL=Cash journal (receipts and disbursements) ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal -ACCOUNTING_SOCIAL_JOURNAL=Social journal +ACCOUNTING_MISCELLANEOUS_JOURNAL=General journal ACCOUNTING_HAS_NEW_JOURNAL=Has new Journal +ACCOUNTING_INVENTORY_JOURNAL=Inventory journal +ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_RESULT_PROFIT=Result accounting account (Profit) ACCOUNTING_RESULT_LOSS=Result accounting account (Loss) @@ -463,6 +465,5 @@ FECFormatMulticurrencyCode=Multicurrency code (Idevise) DateExport=Date export WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manually in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate. ExpenseReportJournal=Expense Report Journal -InventoryJournal=Inventory Journal NAccounts=%s accounts diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 502953f0140..90ca6c15362 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -501,7 +501,8 @@ WarningPHPMail=WARNING: The setup to send emails from the application is using t WarningPHPMailA=- Using the server of the Email Service Provider increases the trustability of your email, so it increases the deliverablity without being flagged as SPAM WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota). WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox. -WarningPHPMailD=Also, it is therefore recommended to change the sending method of e-mails to the value "SMTP". If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by setting the MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP constant to 1 in Home - Setup - Other. +WarningPHPMailD=It is therefore recommended to change the sending method of e-mails to the value "SMTP". +WarningPHPMailDbis=If you really want to keep the default "PHP" method to send emails, just ignore this warning, or remove it by %sclicking here%s. WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s. WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask your domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s. ActualMailSPFRecordFound=Actual SPF record found (for email %s) : %s @@ -645,9 +646,9 @@ Module2400Name=Events/Agenda Module2400Desc=Track events. Log automatic events for tracking purposes or record manual events or meetings. This is the principal module for good Customer or Vendor Relationship Management. Module2500Name=DMS / ECM Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. -Module2600Name=API/Web services (SOAP server) +Module2600Name=API / Web services (SOAP server) Module2600Desc=Enable the Dolibarr SOAP server providing API services -Module2610Name=API/Web services (REST server) +Module2610Name=API / Web services (REST server) Module2610Desc=Enable the Dolibarr REST server providing API services Module2660Name=Call WebServices (SOAP client) Module2660Desc=Enable the Dolibarr web services client (Can be used to push data/requests to external servers. Only Purchase orders are currently supported.) @@ -1746,8 +1747,8 @@ ActivateFCKeditor=Activate advanced editor for: FCKeditorForNotePublic=WYSIWIG creation/edition of the field "public notes" of elements FCKeditorForNotePrivate=WYSIWIG creation/edition of the field "private notes" of elements FCKeditorForCompany=WYSIWIG creation/edition of the field description of elements (except products/services) -FCKeditorForProduct=WYSIWIG creation/edition of the field description of products/services -FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. +FCKeditorForProductDetails=WYSIWIG creation/edition of products description or lines for objects (lines of proposals, orders, invoices, etc...). +FCKeditorForProductDetails2=Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formatting when building PDF files. FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) FCKeditorForUserSignature=WYSIWIG creation/edition of user signature FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) @@ -2269,7 +2270,7 @@ LateWarningAfter="Late" warning after TemplateforBusinessCards=Template for a business card in different size InventorySetup= Inventory Setup ExportUseLowMemoryMode=Use a low memory mode -ExportUseLowMemoryModeHelp=Use the low memory mode to execute the exec of the dump (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that file is completed and error message can't be reported if it fails. +ExportUseLowMemoryModeHelp=Use the low memory mode to generate the dump file (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that the file is complete and error message can't be reported if it fails. Use it if you experience not enough memory errors. ModuleWebhookName = Webhook ModuleWebhookDesc = Interface to catch dolibarr triggers and send it to an URL @@ -2311,7 +2312,6 @@ MAIN_MAIL_SMTPS_AUTH_TYPE=Authentification method UsePassword=Use a password UseOauth=Use a OAUTH token Images=Images -Posts=Posts MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form MaxNumberOfPostOnPublicPagesByIP=Max number of posts on public pages with an IP Address CIDLookupURL=The module brings an URL that can be used by an external tool to get the name of a thirdparty or contact from its phone number. URL to use is: @@ -2329,3 +2329,7 @@ HelpCssOnViewDesc=The Css used when viewing the field. HelpCssOnListDesc=The Css used when field is inside a list table.
    Example: "tdoverflowmax200" RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents for receptions MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions +WarningDisabled=Warning disabled +LimitsAndMitigation=Access limits and mitigation +DesktopsOnly=Desktops only +DesktopsAndSmartphones=Desktops et smartphones \ No newline at end of file diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 7ea8295a346..f13baf06446 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -13,6 +13,7 @@ BillsStatistics=Customers invoices statistics BillsStatisticsSuppliers=Vendors invoices statistics DisabledBecauseDispatchedInBookkeeping=Disabled because invoice was dispatched into bookkeeping DisabledBecauseNotLastInvoice=Disabled because invoice is not erasable. Some invoices were recorded after this one and it will create holes in the counter. +DisabledBecauseNotLastSituationInvoice=Disabled because invoice is not erasable. This invoice is not the last one in situation invoice cycle. DisabledBecauseNotErasable=Disabled because cannot be erased InvoiceStandard=Standard invoice InvoiceStandardAsk=Standard invoice diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 9978118f763..eba95a8aabb 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -76,10 +76,14 @@ NoLimit=No limit ToOfferALinkForOnlineSignature=Link for online signature WelcomeOnOnlineSignaturePageProposal=Welcome to the page to accept commercial proposals from %s WelcomeOnOnlineSignaturePageContract=Welcome to %s Contract PDF Signing Page +WelcomeOnOnlineSignaturePageFichinter=Welcome to %s Intervention PDF Signing Page ThisScreenAllowsYouToSignDocFromProposal=This screen allow you to accept and sign, or refuse, a quote/commercial proposal ThisScreenAllowsYouToSignDocFromContract=This screen allow you to sign contract on PDF format online. +ThisScreenAllowsYouToSignDocFromFichinter=This screen allow you to sign intervention on PDF format online. ThisIsInformationOnDocumentToSignProposal=This is information on document to accept or refuse ThisIsInformationOnDocumentToSignContract=This is information on contract to sign +ThisIsInformationOnDocumentToSignFichinter=This is information on intervention to sign SignatureProposalRef=Signature of quote/commercial proposal %s SignatureContractRef=Signature of contract %s +SignatureFichinterRef=Signature of intervention %s FeatureOnlineSignDisabled=Feature for online signing disabled or document generated before the feature was enabled diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 70fb9e387b9..5e4da60f0f2 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -84,6 +84,7 @@ MakeLocalDatabaseDumpShort=Local database backup MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep MakeSendLocalDatabaseDumpShort=Send local database backup MakeSendLocalDatabaseDump=Send local database backup by email. Parameters are: to, from, subject, message, filename (Name of file sent), filter ('sql' for backup of database only) +BackupIsTooLargeSend=Sorry, last backup file is too large to be send by email CleanUnfinishedCronjobShort=Clean unfinished cronjob CleanUnfinishedCronjob=Clean cronjob stuck in processing when the process is no longer running WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index f732641fc79..860ae75e604 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -14,6 +14,7 @@ ErrorLoginAlreadyExists=Login %s already exists. ErrorGroupAlreadyExists=Group %s already exists. ErrorEmailAlreadyExists=Email %s already exists. ErrorRecordNotFound=Record not found. +ErrorRecordNotFoundShort=Not found ErrorFailToCopyFile=Failed to copy file '%s' into '%s'. ErrorFailToCopyDir=Failed to copy directory '%s' into '%s'. ErrorFailToRenameFile=Failed to rename file '%s' into '%s'. @@ -96,6 +97,7 @@ ErrorWrongValueForField=Field %s: '%s' does not match regex rule < ErrorHtmlInjectionForField=Field %s: The value '%s' contains a malicious data not allowed ErrorFieldValueNotIn=Field %s: '%s' is not a value found in field %s of %s ErrorFieldRefNotIn=Field %s: '%s' is not a %s existing ref +ErrorMultipleRecordFoundFromRef=Several record found when searching from ref %s. No way to know which ID to use. ErrorsOnXLines=%s errors found ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus) ErrorNumRefModel=A reference exists into database (%s) and is not compatible with this numbering rule. Remove record or renamed reference to activate this module. @@ -298,6 +300,7 @@ ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into ErrorTableNotFound=Table %s not found ErrorValueForTooLow=Value for %s is too low ErrorValueCantBeNull=Value for %s can't be null +ErrorDateOfMovementLowerThanDateOfFileTransmission=The date of the bank transaction can't be lower than the date of the file transmission # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup. diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index b4179b04be6..f9531260c97 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -122,7 +122,7 @@ ViewAndVote = View and vote for suggested events PublicAttendeeSubscriptionGlobalPage = Public link for registration to the event PublicAttendeeSubscriptionPage = Public link for registration to this event only MissingOrBadSecureKey = The security key is invalid or missing -EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event : %s +EvntOrgWelcomeMessage = This form allows you to register as a new participant to the event EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s @@ -132,7 +132,7 @@ LabelOfconference=Conference label ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s - +MaxNbOfAttendeesReached=The maximum number of participants has been reached NewSubscription=Registration OrganizationEventConfRequestWasReceived=Your suggestion for a conference has been received OrganizationEventBoothRequestWasReceived=Your request for a booth has been received @@ -157,7 +157,7 @@ VoteOk = Your vote has been accepted. AlreadyVoted = You have already voted for this event. VoteError = An error has occurred during the vote, please try again. -SubscriptionOk = Your registration has been validated +SubscriptionOk=Your registration has been recorded ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event Attendee = Attendee PaymentConferenceAttendee = Conference attendee payment @@ -165,6 +165,7 @@ PaymentBoothLocation = Booth location payment DeleteConferenceOrBoothAttendee=Remove attendee RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s EmailAttendee=Attendee email +EmailCompany=Company email EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) ErrorSeveralCompaniesWithEmailContactUs=Several companies with this email has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation ErrorSeveralCompaniesWithNameContactUs=Several companies with this name has been found so we can't validate automaticaly your registration. Please contact us at %s for a manual validation diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index cbd3dc91663..966f2399a13 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -26,8 +26,8 @@ HRM_DEFAULT_SKILL_DESCRIPTION=Default description of ranks when skill is created deplacement=Shift DateEval=Evaluation date JobCard=Job card -JobPosition=Job -JobsPosition=Jobs +JobPosition=Job profile +JobsPosition=Job profiles NewSkill=New Skill SkillType=Skill type Skilldets=List of ranks for this skill diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index ad8217153be..d0c841fe802 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -214,3 +214,4 @@ Loaded=Loaded FunctionTest=Function test NodoUpgradeAfterDB=No action requested by external modules after upgrade of database NodoUpgradeAfterFiles=No action requested by external modules after upgrade of files or directories +MigrationContractLineRank=Migrate Contract Line to use Rank (and enable Reorder) diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 767688a4ce8..7524439f3ec 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -69,3 +69,5 @@ GenerateInter=Generate intervention FichinterNoContractLinked=Intervention %s has been created without a linked contract. ErrorFicheinterCompanyDoesNotExist=Company does not exist. Intervention has not been created. NextDateToIntervention=Date for next intervention generation +AllowOnlineSign=Allow online signing +AllowExternalDownload=Allow external download \ No newline at end of file diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index 1746b0671ce..38c1624afad 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -47,7 +47,7 @@ KnowledgeRecord = Article KnowledgeRecordExtraFields = Extrafields for Article GroupOfTicket=Group of tickets YouCanLinkArticleToATicketCategory=You can link the article to a ticket group (so the article will be highlighted on any tickets in this group) -SuggestedForTicketsInGroup=Suggested for tickets when group is +SuggestedForTicketsInGroup=Suggested on ticket creation SetObsolete=Set as obsolete ConfirmCloseKM=Do you confirm the closing of this article as obsolete ? diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index 78378c6c5d3..b6368a7d374 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -36,6 +36,7 @@ Language_en_SA=English (Saudi Arabia) Language_en_SG=English (Singapore) Language_en_US=English (United States) Language_en_ZA=English (South Africa) +Language_en_ZW=English (Zimbabwe) Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) Language_es_BO=Spanish (Bolivia) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 2b021f406f3..325e27b6606 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1146,10 +1146,14 @@ UpdateForAllLines=Update for all lines OnHold=On hold Civility=Civility AffectTag=Affect Tag +SetSupervisor=Set Supervisor CreateExternalUser=Create external user ConfirmAffectTag=Bulk Tag Affect +ConfirmSetSupervisor=Bulk Supervisor Set ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)? +ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)? CategTypeNotFound=No tag type found for type of records +SupervisorNotFound=Supervisor not found CopiedToClipboard=Copied to clipboard InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration. ConfirmCancel=Are you sure you want to cancel diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index aebe3affdae..d774a8e7434 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -36,6 +36,7 @@ DateEndSubscription=End date of membership EndSubscription=End of membership SubscriptionId=Contribution ID WithoutSubscription=Without contribution +WaitingSubscription=Waiting contribution MemberId=Member Id MemberRef=Member Ref NewMember=New member diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 0e11bef2bf1..6de9ada7e4d 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -56,6 +56,8 @@ RegenerateMissingFiles=Generate missing files SpecificationFile=File of documentation LanguageFile=File for language ObjectProperties=Object Properties +Property=Propery +PropertyDesc=A property is an attribute that characterizes an object. This attribute has a code, a label and a type with several options. ConfirmDeleteProperty=Are you sure you want to delete the property %s? This will change code in PHP class but also remove column from table definition of object. NotNull=Not NULL NotNullDesc=1=Set database to NOT NULL, 0=Allow null values, -1=Allow null values by forcing value to NULL if empty ('' or 0) @@ -90,7 +92,8 @@ ListOfDictionariesEntries=List of dictionaries entries ListOfPermissionsDefined=List of defined permissions SeeExamples=See examples here EnabledDesc=Condition to have this field active.

    Examples:
    1
    isModEnabled('MAIN_MODULE_MYMODULE')
    getDolGlobalString('MYMODULE_OPTION')==2 -VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).

    Using a negative value means field is not shown by default on list but can be selected for viewing).

    It can be an expression, for example:
    preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
    $user->hasRight('holiday', 'define_holiday')?1:5 +VisibleDesc=Is the field visible ? (Examples: 0=Never visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create), 5=Visible on list end view form only (not create, not update).

    Using a negative value means field is not shown by default on list but can be selected for viewing). +ItCanBeAnExpression=It can be an expression. Example:
    preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
    $user->hasRight('holiday', 'define_holiday')?1:5 DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.
    For document :
    0 = not displayed
    1 = display
    2 = display only if not empty

    For document lines :
    0 = not displayed
    1 = displayed in a column
    3 = display in line description column after the description
    4 = display in description column after the description only if not empty DisplayOnPdf=On PDF IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0) @@ -144,13 +147,15 @@ CSSViewClass=CSS for read form CSSListClass=CSS for list NotEditable=Not editable ForeignKey=Foreign key -TypeOfFieldsHelp=Type of fields:
    varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]
    '1' means we add a + button after the combo to create the record
    'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)' +ForeignKeyDesc=If the value of this field must be guaranted to exists into another table. Enter here a value matching syntax: tablename.parentfieldtocheck +TypeOfFieldsHelp=Example:
    varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]
    '1' means we add a + button after the combo to create the record
    'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)' +TypeOfFieldsHelpIntro=This is the type of the field/attribute. AsciiToHtmlConverter=Ascii to HTML converter AsciiToPdfConverter=Ascii to PDF converter TableNotEmptyDropCanceled=Table not empty. Drop has been canceled. ModuleBuilderNotAllowed=The module builder is available but not allowed to your user. ImportExportProfiles=Import and export profiles -ValidateModBuilderDesc=Set this to 1 if you want to have the method $this->validateField() of object being called to validate the content of the field during insert or upadate. Set 0 if there is no validation required. +ValidateModBuilderDesc=Set this to 1 if you want to have the method $this->validateField() of object being called to validate the content of the field during insert or update. Set 0 if there is no validation required. WarningDatabaseIsNotUpdated=Warning: The database is not updated automatically, you must destroy tables and disable-enable the module to have tables recreated LinkToParentMenu=Parent menu (fk_xxxxmenu) ListOfTabsEntries=List of tab entries diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 44fb4457999..82196b584bd 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -114,3 +114,4 @@ MoChildGenerate=Generate Child Mo ParentMo=MO Parent MOChild=MO Child BomCantAddChildBom=The nomenclature %s is already present in the tree leading to the nomenclature %s +BOMNetNeeds = BOM Net Needs diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index bf2dabf5a0a..fa2ed9669d9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -399,7 +399,7 @@ ActionAvailableOnVariantProductOnly=Action only available on the variant of prod ProductsPricePerCustomer=Product prices per customers ProductSupplierExtraFields=Additional Attributes (Supplier Prices) DeleteLinkedProduct=Delete the child product linked to the combination -AmountUsedToUpdateWAP=Amount to use to update the Weighted Average Price +AmountUsedToUpdateWAP=Unit amount to use to update the Weighted Average Price PMPValue=Weighted average price PMPValueShort=WAP mandatoryperiod=Mandatory periods diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 037ddd1c4e1..b6001b2b27b 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -37,7 +37,9 @@ OpportunitiesStatusForOpenedProjects=Leads amount of open projects by status OpportunitiesStatusForProjects=Leads amount of projects by status ShowProject=Show project ShowTask=Show task +SetThirdParty=Set third party SetProject=Set project +OutOfProject=Out of project NoProject=No project defined or owned NbOfProjects=Number of projects NbOfTasks=Number of tasks diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index d07d6d2efba..7e9afd4e27c 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -104,6 +104,7 @@ IdProduct=Product ID LineBuyPriceHT=Buy Price Amount net of tax for line SignPropal=Accept proposal SignContract=Sign contract +SignFichinter=Sign intervention RefusePropal=Refuse proposal Sign=Sign NoSign=Refuse @@ -111,5 +112,6 @@ PropalAlreadySigned=Proposal already accepted PropalAlreadyRefused=Proposal already refused PropalSigned=Proposal accepted ContractSigned=Contract signed +FichinterSigned=Intervention signed PropalRefused=Proposal refused ConfirmRefusePropal=Are you sure you want to refuse this commercial proposal? diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index 3ea0cf2354b..2a3f988cebf 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -61,6 +61,7 @@ DeleteACard=Delete Card ConfirmDeleteCard=Are you sure you want to delete this Credit or Debit card? CreateCustomerOnStripe=Create customer on Stripe CreateCardOnStripe=Create card on Stripe +CreateBANOnStripe=Create bank on Stripe ShowInStripe=Show in Stripe StripeUserAccountForActions=User account to use for email notification of some Stripe events (Stripe payouts) StripePayoutList=List of Stripe payouts @@ -69,4 +70,5 @@ ToOfferALinkForLiveWebhook=Link to setup Stripe WebHook to call the IPN (live mo PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period. ClickHereToTryAgain=Click here to try again... CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s -TERMINAL_LOCATION=Location (address) for terminals \ No newline at end of file +TERMINAL_LOCATION=Location (address) for terminals +RequestDirectDebitWithStripe=Request Direct Debit with Stripe \ No newline at end of file diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 3e1415c3625..1696018db89 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -194,8 +194,7 @@ TicketAssigned=Ticket is now assigned TicketChangeType=Change type TicketChangeCategory=Change analytic code TicketChangeSeverity=Change severity -TicketAddMessage=Add a message -AddMessage=Add a message +TicketAddMessage=Add private message MessageSuccessfullyAdded=Ticket added TicketMessageSuccessfullyAdded=Message successfully added TicketMessagesList=Message list diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index c6b5c2fe106..3f2c7f5f53a 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -47,7 +47,7 @@ RemoveFromGroup=Remove from group PasswordChangedAndSentTo=Password changed and sent to %s. PasswordChangeRequest=Request to change password for %s PasswordChangeRequestSent=Request to change password for %s sent to %s. -IfLoginExistPasswordRequestSent=If this login is a valid account, an email to reset password has been sent. +IfLoginExistPasswordRequestSent=If this login is a valid account (with a valid email), an email to reset password has been sent. IfEmailExistPasswordRequestSent=If this email is a valid account, an email to reset password has been sent. ConfirmPasswordReset=Confirm password reset MenuUsersAndGroups=Users & Groups diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 8644becdd8c..874cdc76f28 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -140,7 +140,7 @@ PagesRegenerated=%s page(s)/container(s) regenerated RegenerateWebsiteContent=Regenerate web site cache files AllowedInFrames=Allowed in Frames DefineListOfAltLanguagesInWebsiteProperties=Define list of all available languages into web site properties. -GenerateSitemaps=Generate website sitemap file +GenerateSitemaps=Generate website sitemap.xml file ConfirmGenerateSitemaps=If you confirm, you will erase the existing sitemap file... ConfirmSitemapsCreation=Confirm sitemap generation SitemapGenerated=Sitemap file %s generated diff --git a/htdocs/langs/en_ZA/members.lang b/htdocs/langs/en_ZA/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/en_ZA/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/en_ZA/projects.lang b/htdocs/langs/en_ZA/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/en_ZA/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_AR/admin.lang b/htdocs/langs/es_AR/admin.lang index 76c93629d16..beedcee5010 100644 --- a/htdocs/langs/es_AR/admin.lang +++ b/htdocs/langs/es_AR/admin.lang @@ -252,7 +252,6 @@ UpdateServerOffline=Actualizar servidor fuera de línea WithCounter=Administrar un contador AddCRIfTooLong=No hay ajuste de texto automático. El texto que es demasiado largo no será mostrado en el documento. Por favor agregar saltos de línea en el área de texto si es necesario. String=Cuerda -InitEmptyBarCode=Init value for the %s empty barcodes Module30Name=Facturas Module40Desc=Gestión de proveedores y compras (órdenes de compra y facturas de proveedores) Module52Name=Inventarios(Stocks) diff --git a/htdocs/langs/es_AR/commercial.lang b/htdocs/langs/es_AR/commercial.lang index d85913580a1..b8b70ff7a01 100644 --- a/htdocs/langs/es_AR/commercial.lang +++ b/htdocs/langs/es_AR/commercial.lang @@ -60,6 +60,5 @@ Stats=Estadísticas de ventas StatusProsp=Estado del cliente potencial DraftPropals=Presupuestos en borrador ToOfferALinkForOnlineSignature=Vínculo para firma digital -ThisScreenAllowsYouToSignDocFrom=Esta pantalla te permitirá aceptar, firmar o rechazar un presupuesto SignatureProposalRef=Firma del presupuesto %s FeatureOnlineSignDisabled=La funcionalidad para la firma digital está deshabilitada o el documento fue generado antes de habilitar la función diff --git a/htdocs/langs/es_AR/mailmanspip.lang b/htdocs/langs/es_AR/mailmanspip.lang index 700cfd3bb70..840c7e7dd58 100644 --- a/htdocs/langs/es_AR/mailmanspip.lang +++ b/htdocs/langs/es_AR/mailmanspip.lang @@ -7,7 +7,6 @@ MailmanCreationSuccess=La prueba de suscripción se ha ejecutado correctamente MailmanDeletionSuccess=La prueba de desuscripción se ha ejecutado correctamente SynchroMailManEnabled=Será realizada una actualización en la lista de envío de correos SynchroSpipEnabled=Será realizada una actualización en el módulo SPIP -DescADHERENT_MAILMAN_ADMINPW=Contraseña de administrador de Envío de Correos DescADHERENT_MAILMAN_URL=URL para suscripciones a la lista de envío de correos DescADHERENT_MAILMAN_UNSUB_URL=URL para desuscripciones a la lista de envío de correos DescADHERENT_MAILMAN_LISTS=Lista(s) para inscripción automática de nuevos miembros (separados por una coma) diff --git a/htdocs/langs/es_BO/members.lang b/htdocs/langs/es_BO/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_BO/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_BO/projects.lang b/htdocs/langs/es_BO/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_BO/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_CL/accountancy.lang b/htdocs/langs/es_CL/accountancy.lang index 2bff8d60933..9a12ca9824b 100644 --- a/htdocs/langs/es_CL/accountancy.lang +++ b/htdocs/langs/es_CL/accountancy.lang @@ -217,4 +217,3 @@ ToBind=Líneas para enlazar UseMenuToSetBindindManualy=Líneas aún no enlazadas, use el menú %s para hacer el enlace manualmente WarningReportNotReliable=Advertencia, este informe no se basa en el Libro mayor, por lo que no contiene la transacción modificada manualmente en el Libro mayor. Si su publicación está actualizada, la vista de contabilidad es más precisa. ExpenseReportJournal=Diario del informe de gastos -InventoryJournal=Revista de inventario diff --git a/htdocs/langs/es_CL/admin.lang b/htdocs/langs/es_CL/admin.lang index aa792dc23db..7e7c5a27736 100644 --- a/htdocs/langs/es_CL/admin.lang +++ b/htdocs/langs/es_CL/admin.lang @@ -340,7 +340,6 @@ DefaultLink=Enlace predeterminado ValueOverwrittenByUserSetup=Advertencia, este valor puede ser sobrescrito por la configuración específica del usuario (cada usuario puede establecer su propia URL de clicktodial) BarcodeInitForProductsOrServices=Inicialización o reinicio masivo del código de barras para productos o servicios CurrentlyNWithoutBarCode=Actualmente, tiene %s registros en %s %s sin código de barras definido. -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Borrar todos los valores actuales del código de barras ConfirmEraseAllCurrentBarCode=¿Seguro que quieres borrar todos los valores actuales del código de barras? AllBarcodeReset=Todos los valores del código de barras han sido eliminados @@ -574,7 +573,6 @@ Permission281=Leer contactos Permission291=Tarifas de lectura Permission292=Establecer permisos sobre las tarifas Permission293=Modificar las tarifas del cliente. -Permission300=Leer codigos de barras Permission301=Crear / modificar códigos de barras Permission311=Leer Servicios Permission312=Asignar servicio / suscripción al contrato diff --git a/htdocs/langs/es_CL/commercial.lang b/htdocs/langs/es_CL/commercial.lang index 33c14696715..2308c317fae 100644 --- a/htdocs/langs/es_CL/commercial.lang +++ b/htdocs/langs/es_CL/commercial.lang @@ -57,6 +57,4 @@ ActionAC_AUTO=Eventos insertados automáticamente Stats=Estadísticas de ventas StatusProsp=Estado de la perspectiva DraftPropals=Cotizaciones borrador -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar propuestas comerciales de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, un presupuesto/propuesta comercial SignatureProposalRef=Firma de cotización / propuesta comercial %s diff --git a/htdocs/langs/es_CL/errors.lang b/htdocs/langs/es_CL/errors.lang index 8c45fd1469b..93bfc615ce6 100644 --- a/htdocs/langs/es_CL/errors.lang +++ b/htdocs/langs/es_CL/errors.lang @@ -69,7 +69,6 @@ ErrorFieldValueNotIn=El campo %s : ' %s ' no es un valor e ErrorFieldRefNotIn=Campo %s : ' %s ' no es una referencia %s existente ErrorsOnXLines=Se encontraron errores %s ErrorFileIsInfectedWithAVirus=El programa antivirus no pudo validar el archivo (el archivo podría estar infectado por un virus) -ErrorSpecialCharNotAllowedForField=Los caracteres especiales no están permitidos para el campo "%s" ErrorNumRefModel=Existe una referencia en la base de datos (%s) y no es compatible con esta regla de numeración. Elimine la referencia de registro o renombrada para activar este módulo. ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorOrdersNotCreatedQtyTooLow=Algunos pedidos no se han creado debido a cantidades demasiado bajas diff --git a/htdocs/langs/es_CL/mailmanspip.lang b/htdocs/langs/es_CL/mailmanspip.lang index 34a39aa742a..fdbf3c00d12 100644 --- a/htdocs/langs/es_CL/mailmanspip.lang +++ b/htdocs/langs/es_CL/mailmanspip.lang @@ -6,7 +6,6 @@ MailmanCreationSuccess=La prueba de suscripción se ejecutó con éxito MailmanDeletionSuccess=La prueba de cancelación se ejecutó con éxito SynchroMailManEnabled=Se realizará una actualización de Mailman SynchroSpipEnabled=Se realizará una actualización de Spip -DescADHERENT_MAILMAN_ADMINPW=Contraseña de administrador de Mailman DescADHERENT_MAILMAN_URL=URL para las suscripciones de Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para la cancelación de suscripciones de Mailman DescADHERENT_MAILMAN_LISTS=Lista (s) para la inscripción automática de nuevos miembros (separados por una coma) diff --git a/htdocs/langs/es_CL/members.lang b/htdocs/langs/es_CL/members.lang index a226d236563..d8ea715ef45 100644 --- a/htdocs/langs/es_CL/members.lang +++ b/htdocs/langs/es_CL/members.lang @@ -53,7 +53,6 @@ YourMembershipWasValidated=Su membresía fue validada YourMembershipWasCanceled=Su membresía fue cancelada CardContent=Contenido de su tarjeta de miembro ThisIsContentOfYourMembershipRequestWasReceived=Queremos informarle que se recibió su solicitud de membresía.

    -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    ThisIsContentOfSubscriptionReminderEmail=Queremos informarle que su suscripción está a punto de caducar o ya ha caducado (__MEMBER_LAST_SUBSCRIPTION_DATE_END__). Esperamos que lo renueven.

    ThisIsContentOfYourCard=Este es un resumen de la información que tenemos sobre usted. Por favor, póngase en contacto con nosotros si algo es incorrecto.

    DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Asunto de la notificación por correo electrónico recibida en caso de autoinscripción de un invitado @@ -85,7 +84,6 @@ MenuMembersStats=Estadística NewMemberbyWeb=Nuevo miembro agregado. Esperando aprobacion NewMemberForm=Nueva forma de miembro TurnoverOrBudget=Volumen de ventas (empresa) o Cotización (asociación o colectivo) -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type MEMBER_NEWFORM_PAYONLINE=Salte en la página integrada de pago en línea MembersStatisticsByProperties=Estadísticas de miembros por naturaleza NoEmailSentToMember=No se envió ningún correo electrónico al miembro diff --git a/htdocs/langs/es_CL/projects.lang b/htdocs/langs/es_CL/projects.lang index aaae5a794c4..7afb36f5a70 100644 --- a/htdocs/langs/es_CL/projects.lang +++ b/htdocs/langs/es_CL/projects.lang @@ -156,6 +156,5 @@ ModuleSalaryToDefineHourlyRateMustBeEnabled=El módulo 'Salarios' debe e NewTaskRefSuggested=Referencia de tarea ya utilizada, se requiere una nueva referencia de tarea TimeSpentForIntervention=Tiempo dedicado TimeSpentForInvoice=Tiempo dedicado -ServiceToUseOnLines=Service to use on lines by default InvoiceGeneratedFromTimeSpent=La factura %s se ha generado desde el tiempo invertido en el proyecto UsageBillTimeShort=Uso: Bill time diff --git a/htdocs/langs/es_CL/ticket.lang b/htdocs/langs/es_CL/ticket.lang index c1f9984feda..5a4f2f39b72 100644 --- a/htdocs/langs/es_CL/ticket.lang +++ b/htdocs/langs/es_CL/ticket.lang @@ -73,8 +73,6 @@ TicketDurationAutoInfos=Duración calculada automáticamente a partir de interve SendMessageByEmail=Enviar mensaje por correo electrónico ErrorMailRecipientIsEmptyForSendTicketMessage=El destinatario está vacío. Sin enviar correo electrónico TicketMessageMailIntroHelp=Este texto se agrega solo al comienzo del correo electrónico y no se guardará. -TicketMessageMailSignatureHelp=Este texto se agrega solo al final del correo electrónico y no se guardará. -TicketMessageMailSignatureLabelAdmin=Firma del correo electrónico de respuesta TicketMessageHelp=Solo este texto se guardará en la lista de mensajes en la tarjeta de Tickets. TicketTimeToRead=Tiempo transcurrido antes de leer TicketContacts=Ticket de contactos diff --git a/htdocs/langs/es_CO/accountancy.lang b/htdocs/langs/es_CO/accountancy.lang index 8e9afa1c3f8..43dd8df9360 100644 --- a/htdocs/langs/es_CO/accountancy.lang +++ b/htdocs/langs/es_CO/accountancy.lang @@ -33,7 +33,6 @@ GroupIsEmptyCheckSetup=El grupo está vacío, verifique la configuración del gr DetailByAccount=Mostrar detalle por cuenta AccountWithNonZeroValues=Cuentas con valores distintos de cero. CountriesInEECExceptMe=Países en EEC excepto %s -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
    The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). MainAccountForCustomersNotDefined=Cuenta contable principal para clientes no definidos en la configuración. MainAccountForSuppliersNotDefined=Cuenta de contabilidad principal para proveedores no definidos en la configuración. MainAccountForUsersNotDefined=Cuenta de contabilidad principal para usuarios no definidos en la configuración. @@ -215,7 +214,6 @@ AccountingAccountForSalesTaxAreDefinedInto=Nota: la cuenta contable del impuesto NumberOfAccountancyMovements=Numero de movimientos ACCOUNTING_DISABLE_BINDING_ON_SALES=Deshabilitar la vinculación y la transferencia en la contabilidad de las ventas (las facturas de los clientes no se tendrán en cuenta en la contabilidad) ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Deshabilite la vinculación y transferencia en contabilidad en compras (las facturas de proveedores no se tendrán en cuenta en la contabilidad) -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) ExportDraftJournal=Exportar borrador de revista Selectmodelcsv=Selecciona un modelo de exportación. Modelcsv_CEGID=Exportación para CEGID Expert Comptabilité @@ -277,4 +275,3 @@ FECFormatCredit=Crédito (crédito) DateExport=Exportación de fecha WarningReportNotReliable=Advertencia, este informe no se basa en el Libro mayor, por lo que no contiene la transacción modificada manualmente en el Libro mayor. Si su publicación está actualizada, la vista de contabilidad es más precisa. ExpenseReportJournal=Diario de informe de gastos -InventoryJournal=Diario de inventario diff --git a/htdocs/langs/es_CO/admin.lang b/htdocs/langs/es_CO/admin.lang index d6fec62304b..af4d57d1984 100644 --- a/htdocs/langs/es_CO/admin.lang +++ b/htdocs/langs/es_CO/admin.lang @@ -362,7 +362,6 @@ ValueOverwrittenByUserSetup=Advertencia, este valor puede ser sobrescrito por la BarcodeInitForThirdparties=init para código de barras masivo para terceros BarcodeInitForProductsOrServices=Código de barras masivo de inicio o reinicio para productos o servicios. CurrentlyNWithoutBarCode=Actualmente, tienes el registro %s en %s %s sin un código de barras definido. -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Borrar todos los valores de código de barras actuales ConfirmEraseAllCurrentBarCode=¿Está seguro de que desea borrar todos los valores de código de barras actuales? AllBarcodeReset=Todos los valores de código de barras han sido eliminados diff --git a/htdocs/langs/es_CO/commercial.lang b/htdocs/langs/es_CO/commercial.lang index 4ecf1bf3338..a682aab5fd4 100644 --- a/htdocs/langs/es_CO/commercial.lang +++ b/htdocs/langs/es_CO/commercial.lang @@ -53,8 +53,5 @@ Stats=Estadísticas de ventas StatusProsp=Estado cliente potencial DraftPropals=Borrador de propuestas comerciales ToOfferALinkForOnlineSignature=Enlace para firma en línea -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar propuestas comerciales de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, una cotización / propuesta comercial -ThisIsInformationOnDocumentToSign=Esta es información en el documento para aceptar o rechazar SignatureProposalRef=Firma de cotización / propuesta comercial %s FeatureOnlineSignDisabled=Característica para la firma en línea deshabilitada o documento generado antes de que se habilitara la característica diff --git a/htdocs/langs/es_CO/errors.lang b/htdocs/langs/es_CO/errors.lang index 2e958b678d9..23b931b6d88 100644 --- a/htdocs/langs/es_CO/errors.lang +++ b/htdocs/langs/es_CO/errors.lang @@ -73,7 +73,6 @@ ErrorWrongValueForField=El campo %s: '%s' no coincide con la regla ErrorFieldValueNotIn=El campo %s : ' %s ' no es un valor que se encuentra en el campo %s de %s ErrorFieldRefNotIn=El campo%s: '%s' no es una referia existente %s ErrorFileIsInfectedWithAVirus=El programa antivirus no pudo validar el archivo (el archivo podría estar infectado por un virus) -ErrorSpecialCharNotAllowedForField=No se permiten caracteres especiales para el campo "%s" ErrorNumRefModel=Existe una referencia en la base de datos (%s) y no es compatible con esta regla de numeración. Elimine el registro o la referencia renombrada para activar este módulo. ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorOrdersNotCreatedQtyTooLow=Algunos pedidos no se han creado debido a cantidades demasiado bajas. diff --git a/htdocs/langs/es_CO/mailmanspip.lang b/htdocs/langs/es_CO/mailmanspip.lang index 98090117641..eaf04c1a531 100644 --- a/htdocs/langs/es_CO/mailmanspip.lang +++ b/htdocs/langs/es_CO/mailmanspip.lang @@ -6,7 +6,6 @@ MailmanCreationSuccess=La prueba de suscripción se ejecutó con éxito MailmanDeletionSuccess=La prueba de cancelación de suscripción se ejecutó con éxito SynchroMailManEnabled=Se realizará una actualización de Mailman SynchroSpipEnabled=Se realizará una actualización de Spip -DescADHERENT_MAILMAN_ADMINPW=Contraseña de administrador de Mailman DescADHERENT_MAILMAN_URL=URL de las suscripciones de Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para darse de baja de Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para la inscripción automática de nuevos miembros (separados por coma) diff --git a/htdocs/langs/es_CO/projects.lang b/htdocs/langs/es_CO/projects.lang index d7d0f29d616..2535094af83 100644 --- a/htdocs/langs/es_CO/projects.lang +++ b/htdocs/langs/es_CO/projects.lang @@ -186,7 +186,6 @@ NewTaskRefSuggested=La referencia de tarea ya se usó, se requiere una nueva ref TimeSpentInvoiced=Tiempo invertido facturado TimeSpentForIntervention=Tiempo usado TimeSpentForInvoice=Tiempo usado -ServiceToUseOnLines=Service to use on lines by default InvoiceGeneratedFromTimeSpent=La factura %s se ha generado a partir del tiempo dedicado al proyecto InterventionGeneratedFromTimeSpent=La intervención %s se ha generado a partir del tiempo dedicado al proyecto ProjectBillTimeDescription=Verifique si ingresa la hoja de tiempo en las tareas del proyecto Y planea generar factura(s) a partir de la hoja de tiempo para facturar al cliente del proyecto (no verifique si planea crear una factura que no se base en las hojas de tiempo ingresadas). Nota: Para generar factura, vaya a la pestaña 'Tiempo invertido' del proyecto y seleccione las líneas para incluir. diff --git a/htdocs/langs/es_CO/ticket.lang b/htdocs/langs/es_CO/ticket.lang index 02301c15de2..3f6313f135e 100644 --- a/htdocs/langs/es_CO/ticket.lang +++ b/htdocs/langs/es_CO/ticket.lang @@ -93,8 +93,6 @@ SendMessageByEmail=Enviar mensaje por correo electrónico ErrorMailRecipientIsEmptyForSendTicketMessage=El destinatario está vacío. No enviar correo electrónico TicketGoIntoContactTab=Vaya a la pestaña "Contactos" para seleccionarlos. TicketMessageMailIntroHelp=Este texto se agrega solo al comienzo del correo electrónico y no se guardará. -TicketMessageMailSignatureHelp=Este texto se agrega solo al final del correo electrónico y no se guardará. -TicketMessageMailSignatureLabelAdmin=Firma del correo electrónico de respuesta TicketMessageHelp=Solo este texto se guardará en la lista de mensajes de la tarjeta del ticket. TicketTimeToRead=Tiempo transcurrido antes de leer TicketContacts=Ticket de contactos diff --git a/htdocs/langs/es_DO/members.lang b/htdocs/langs/es_DO/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_DO/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_DO/projects.lang b/htdocs/langs/es_DO/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_DO/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_EC/accountancy.lang b/htdocs/langs/es_EC/accountancy.lang index 56a5c3e928d..b24e09e5bb2 100644 --- a/htdocs/langs/es_EC/accountancy.lang +++ b/htdocs/langs/es_EC/accountancy.lang @@ -229,4 +229,3 @@ ToBind=Líneas para atar UseMenuToSetBindindManualy=Líneas aún no enlazadas, use el menú %s para hacer el enlace manualmente. WarningReportNotReliable=Advertencia, este informe no se basa en el Libro mayor, por lo que no contiene la transacción modificada manualmente en el Libro mayor. Si su publicación está actualizada, la vista de contabilidad es más precisa. ExpenseReportJournal=Diario del informe de gastos -InventoryJournal=Diario de inventario diff --git a/htdocs/langs/es_EC/admin.lang b/htdocs/langs/es_EC/admin.lang index 96820c4587e..6286debaffd 100644 --- a/htdocs/langs/es_EC/admin.lang +++ b/htdocs/langs/es_EC/admin.lang @@ -335,7 +335,6 @@ ValueOverwrittenByUserSetup=Advertencia: este valor puede ser sobrescrito por la BarcodeInitForThirdparties=Inicio masivo de código de barras para terceros. BarcodeInitForProductsOrServices=Inicio de código de barras masivo o restablecimiento de productos o servicios CurrentlyNWithoutBarCode=Actualmente, tiene %s registrado en %s %s sin código de barras definido. -InitEmptyBarCode=Init value for the %s empty barcodes EraseAllCurrentBarCode=Borrar todos los valores de códigos de barras actuales ConfirmEraseAllCurrentBarCode=¿Está seguro de que desea borrar todos los valores de códigos de barras actuales? AllBarcodeReset=Todos los valores de código de barras se han eliminado @@ -586,7 +585,6 @@ Permission282=Crear / modificar contactos Permission291=Leer tarifas Permission292=Establecer permisos en las tarifas Permission293=Modificar las tarifas del cliente. -Permission300=Leer codigos de barras Permission301=Crear / modificar códigos de barras Permission311=Leer servicios Permission312=Asignar servicio / suscripción al contrato. diff --git a/htdocs/langs/es_EC/commercial.lang b/htdocs/langs/es_EC/commercial.lang index 85789b47b39..ee890081cfd 100644 --- a/htdocs/langs/es_EC/commercial.lang +++ b/htdocs/langs/es_EC/commercial.lang @@ -60,6 +60,4 @@ ActionAC_OTH_AUTOShort=Automático Stats=Estadísticas de ventas StatusProsp=Estado del prospecto DraftPropals=Proyecto de propuestas comerciales -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar propuestas comerciales de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, una propuesta de cotización/comercial SignatureProposalRef=Firma de cotización/propuesta comercial %s. diff --git a/htdocs/langs/es_EC/errors.lang b/htdocs/langs/es_EC/errors.lang index 87dd8507320..ae701afac8d 100644 --- a/htdocs/langs/es_EC/errors.lang +++ b/htdocs/langs/es_EC/errors.lang @@ -64,7 +64,6 @@ ErrorWrongValueForField=El campo %s: '%s' no coincide con la expre ErrorFieldValueNotIn=El campo %s: '%s' no es un valor que se encuentra en el campo %s de %s ErrorFieldRefNotIn=Campo %s: '%s' no es una %s referencia existente ErrorFileIsInfectedWithAVirus=El programa antivirus no pudo validar el archivo (el archivo podría estar infectado por un virus) -ErrorSpecialCharNotAllowedForField=No se permiten caracteres especiales para el campo "%s" ErrorNumRefModel=Existe una referencia en la base de datos (%s) y no es compatible con esta regla de numeración. Elimine la referencia de registro o renombrado para activar este módulo. ErrorQtyTooLowForThisSupplier=Cantidad demasiado baja para este proveedor o ningún precio definido en este producto para este proveedor ErrorOrdersNotCreatedQtyTooLow=Algunos pedidos no se han creado debido a cantidades demasiado bajas diff --git a/htdocs/langs/es_EC/mailmanspip.lang b/htdocs/langs/es_EC/mailmanspip.lang index 6b8fb02ecff..dc6431a176e 100644 --- a/htdocs/langs/es_EC/mailmanspip.lang +++ b/htdocs/langs/es_EC/mailmanspip.lang @@ -6,7 +6,6 @@ MailmanCreationSuccess=La prueba de suscripción se ejecutó correctamente MailmanDeletionSuccess=La prueba de cancelación de la suscripción se ejecutó correctamente SynchroMailManEnabled=Se realizará una actualización Mailman SynchroSpipEnabled=Se realizará una actualización de Spip -DescADHERENT_MAILMAN_ADMINPW=Contraseña del administrador de Mailman DescADHERENT_MAILMAN_URL=URL para las suscripciones de Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para cancelación de suscripciones de Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para la inscripción automática de nuevos miembros (separados por una coma) diff --git a/htdocs/langs/es_EC/projects.lang b/htdocs/langs/es_EC/projects.lang index 7ac28478c77..c87a5444272 100644 --- a/htdocs/langs/es_EC/projects.lang +++ b/htdocs/langs/es_EC/projects.lang @@ -165,7 +165,6 @@ NewTaskRefSuggested=Referencia de tarea ya utilizada, se requiere una nueva refe TimeSpentInvoiced=Tiempo gastado facturado TimeSpentForIntervention=Tiempo usado TimeSpentForInvoice=Tiempo usado -ServiceToUseOnLines=Service to use on lines by default InvoiceGeneratedFromTimeSpent=La factura %s se ha generado a partir del tiempo dedicado al proyecto ProjectBillTimeDescription=Verifique si ingresa la hoja de tiempo en las tareas del proyecto Y planea generar factura(s) de la hoja de tiempo para facturar al cliente del proyecto (no verifique si planea crear una factura que no se base en las hojas de tiempo ingresadas). Nota: Para generar la factura, vaya a la pestaña 'Tiempo empleado' del proyecto y seleccione las líneas para incluir. UsageBillTimeShort=Uso: Tiempo a facturar diff --git a/htdocs/langs/es_EC/ticket.lang b/htdocs/langs/es_EC/ticket.lang index 657aba67728..29b388752e1 100644 --- a/htdocs/langs/es_EC/ticket.lang +++ b/htdocs/langs/es_EC/ticket.lang @@ -65,9 +65,6 @@ TicketDurationAutoInfos=Duración calculada automáticamente a partir de interve SendMessageByEmail=Enviar mensaje por correo electrónico ErrorMailRecipientIsEmptyForSendTicketMessage=El destinatario está vacío. No se envio el correo electrónico TicketMessageMailIntroHelp=Este texto se agrega solo al comienzo del correo electrónico y no se guardará. -TicketMessageMailSignatureHelp=Este texto se agrega solo al final del correo electrónico y no se guardará. -TicketMessageMailSignatureLabelAdmin=Firma del correo electrónico de respuesta -TicketMessageMailSignatureHelpAdmin=Este texto se inserta después del mensaje de respuesta. TicketMessageHelp=Solo este texto se guardará en la lista de mensajes en la tarjeta de tickets. TicketTimeToRead=Tiempo transcurrido antes de leer TicketContacts=Boleto de contactos diff --git a/htdocs/langs/es_ES/commercial.lang b/htdocs/langs/es_ES/commercial.lang index 5fe49a5b4f4..8292b6391d6 100644 --- a/htdocs/langs/es_ES/commercial.lang +++ b/htdocs/langs/es_ES/commercial.lang @@ -68,13 +68,22 @@ ActionAC_OTH_AUTO=Eventos creados automáticamente ActionAC_MANUAL=Eventos creados manualmente ActionAC_AUTO=Eventos creados automáticamente ActionAC_OTH_AUTOShort=Auto +ActionAC_EVENTORGANIZATION=Eventos de organización Stats=Estadísticas de venta StatusProsp=Estado prospección DraftPropals=Presupuestos borrador NoLimit=Sin límite ToOfferALinkForOnlineSignature=Enlace para la firma en línea -WelcomeOnOnlineSignaturePage=Bienvenido a la página para aceptar presupuestos de %s -ThisScreenAllowsYouToSignDocFrom=Esta pantalla le permite aceptar y firmar, o rechazar, una presupuesto/propuesta comercial -ThisIsInformationOnDocumentToSign=Esta es la información del documento para aceptar o rechazar +WelcomeOnOnlineSignaturePageProposal=Bienvenido a la página para firmar presupuestos de %s +WelcomeOnOnlineSignaturePageContract=Bienvenido a la página para firmar contratos de %s +WelcomeOnOnlineSignaturePageFichinter=Bienvenido a la página para firmar intervenciones de %s +ThisScreenAllowsYouToSignDocFromProposal=Esta página permite aceptar y firmar o rechazar un presupuesto o propuesta comercial. +ThisScreenAllowsYouToSignDocFromContract=Esta página permite aceptar y firmar el contrato PDF online. +ThisScreenAllowsYouToSignDocFromFichinter=Esta página permite aceptar y firmar una intervención en formato PDF online. +ThisIsInformationOnDocumentToSignProposal=Esta es la información del presupuesto para aceptar o rechazar +ThisIsInformationOnDocumentToSignContract=Esta es la información del contrato a firmar +ThisIsInformationOnDocumentToSignFichinter=Esta es la información de la intervención a firmar SignatureProposalRef=Firma del presupuesto/propuesta comercial %s +SignatureContractRef=Firma del contrato %s +SignatureFichinterRef=Firma de la intervención %s FeatureOnlineSignDisabled=Característica para la firma en línea inhabilitada o documento generado antes de que se habilitara la característica diff --git a/htdocs/langs/es_ES/interventions.lang b/htdocs/langs/es_ES/interventions.lang index 83471928031..b335c533713 100644 --- a/htdocs/langs/es_ES/interventions.lang +++ b/htdocs/langs/es_ES/interventions.lang @@ -66,3 +66,8 @@ RepeatableIntervention=Plantilla de intervención ToCreateAPredefinedIntervention=Para crear una intervención predefinida o recurrente, cree una intervención común y conviértala en plantilla de intervención ConfirmReopenIntervention=¿Está seguro de querer volver a abrir la intervención %s ? GenerateInter=Generar intervención +FichinterNoContractLinked=La intervención %s se ha creado sin un contacto vinculado. +ErrorFicheinterCompanyDoesNotExist=La compañía no existe, la intervención no se ha creado. +NextDateToIntervention=Fecha para la próxima generación de intervención +AllowOnlineSign=Permitir firma online +AllowExternalDownload=Permitir descarga externa \ No newline at end of file diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 2af1c00c5cf..00488783f8a 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -926,6 +926,7 @@ DirectDownloadInternalLink=Enlace de descarga privado PrivateDownloadLinkDesc=Debe iniciar sesión y necesita permisos para ver o descargar el archivo Download=Descargar DownloadDocument=Descargar el documento +DownloadSignedDocument=Descargar el documento firmado ActualizeCurrency=Actualizar el tipo de cambio Fiscalyear=Año fiscal ModuleBuilder=Módulo Builder diff --git a/htdocs/langs/es_ES/propal.lang b/htdocs/langs/es_ES/propal.lang index 2f31aab4e89..159daf31178 100644 --- a/htdocs/langs/es_ES/propal.lang +++ b/htdocs/langs/es_ES/propal.lang @@ -103,11 +103,15 @@ IdProposal=ID de Presupuesto IdProduct=ID del Producto LineBuyPriceHT=Precio de compra Importe neto de impuestos por línea SignPropal=Aceptar presupuesto +SignContract=Firmar contrato +SignFichinter=Firmar intervención RefusePropal=Rechazar presupuesto Sign=Firma NoSign=Establecer no firmado PropalAlreadySigned=Presupuesto ya aceptado PropalAlreadyRefused=Presupuesto ya rechazado PropalSigned=Presupuesto aceptado +ContractSigned=Contrato firmado +FichinterSigned=Intervención firmada PropalRefused=Presupuesto rechazado ConfirmRefusePropal=¿Está seguro de querer rechazar este presupuesto? diff --git a/htdocs/langs/es_GT/members.lang b/htdocs/langs/es_GT/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_GT/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_GT/projects.lang b/htdocs/langs/es_GT/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_GT/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_HN/members.lang b/htdocs/langs/es_HN/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_HN/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_HN/projects.lang b/htdocs/langs/es_HN/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_HN/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_MX/accountancy.lang b/htdocs/langs/es_MX/accountancy.lang index 1ae2423f16f..ef79a5fabff 100644 --- a/htdocs/langs/es_MX/accountancy.lang +++ b/htdocs/langs/es_MX/accountancy.lang @@ -125,4 +125,3 @@ ExportDraftJournal=Exportar borrador de diario SomeMandatoryStepsOfSetupWereNotDone=Algunos pasos obligatorios de la instalación no se realizaron, favor de completar ExportNotSupported=El formato de exportación configurado no se admite en esta página NoJournalDefined=Ningún diario definido -InventoryJournal=Diario de inventario diff --git a/htdocs/langs/es_MX/admin.lang b/htdocs/langs/es_MX/admin.lang index 8c57272b7ea..4097de49b9f 100644 --- a/htdocs/langs/es_MX/admin.lang +++ b/htdocs/langs/es_MX/admin.lang @@ -238,7 +238,6 @@ ExtrafieldSelectList =Seleccionar de la tabla ComputedFormula=Campo calculado Computedpersistent=Almacenar campo calculado SetAsDefault=Establecer como predeterminado -InitEmptyBarCode=Init value for the %s empty barcodes ClickToShowDescription=Haga clic para mostrar la descripción DependsOn=Este módulo necesita los módulo(s) WarningSettingSortOrder=Advertencia, establecer un orden predeterminado puede resultar en un error técnico al pasar a la página de lista si "campo" es un campo desconocido. Si experimenta un error de este tipo, vuelva a esta página para eliminar el orden predeterminado y restaurar el comportamiento predeterminado. diff --git a/htdocs/langs/es_PA/members.lang b/htdocs/langs/es_PA/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_PA/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_PA/projects.lang b/htdocs/langs/es_PA/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_PA/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_PE/members.lang b/htdocs/langs/es_PE/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_PE/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_PY/members.lang b/htdocs/langs/es_PY/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_PY/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_PY/projects.lang b/htdocs/langs/es_PY/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_PY/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_US/members.lang b/htdocs/langs/es_US/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_US/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_US/projects.lang b/htdocs/langs/es_US/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_US/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_UY/members.lang b/htdocs/langs/es_UY/members.lang deleted file mode 100644 index 5f7a2ff4020..00000000000 --- a/htdocs/langs/es_UY/members.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - members -ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded. Please find your invoice here enclosed.

    -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type diff --git a/htdocs/langs/es_UY/projects.lang b/htdocs/langs/es_UY/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_UY/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/es_VE/admin.lang b/htdocs/langs/es_VE/admin.lang index 33ac1c8513d..5ac3d8e921b 100644 --- a/htdocs/langs/es_VE/admin.lang +++ b/htdocs/langs/es_VE/admin.lang @@ -5,7 +5,6 @@ ConfirmPurgeSessions=¿De verdad quieres purgar todas las sesiones? Esto descone SetupArea=Parametrizaje NotConfigured=Módulo / Aplicación no configurada GenericMaskCodes3=Cualquier otro carácter en la máscara se quedará sin cambios.
    No se permiten espacios
    -InitEmptyBarCode=Init value for the %s empty barcodes Module1780Desc=Crear etiquetas/Categoría (Productos, clientes, proveedores, contactos y miembros) Permission254=Modificar la contraseña de otros usuarios Permission255=Eliminar o desactivar otros usuarios diff --git a/htdocs/langs/es_VE/projects.lang b/htdocs/langs/es_VE/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/es_VE/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang index a04f84af674..d9c277fcdf6 100644 --- a/htdocs/langs/fr_CA/admin.lang +++ b/htdocs/langs/fr_CA/admin.lang @@ -72,7 +72,6 @@ ExtrafieldCheckBoxFromList=Les cases à cocher du tableau ExtrafieldLink=Lier à un objet LibraryToBuildPDF=Bibliothèque utilisée pour la génération de PDF CurrentlyNWithoutBarCode=Actuellement, vous avez %s enregistrements sur %s %s sans code à barres défini. -InitEmptyBarCode=Init value for the %s empty barcodes ConfirmEraseAllCurrentBarCode=Êtes-vous sûr de vouloir effacer toutes les valeurs actuelles du code-barres? EnableFileCache=Activer le cache de fichiers DisplayCompanyManagers=Afficher les noms des gestionnaires diff --git a/htdocs/langs/fr_CA/commercial.lang b/htdocs/langs/fr_CA/commercial.lang index fe52f49e25d..0f68fbd09db 100644 --- a/htdocs/langs/fr_CA/commercial.lang +++ b/htdocs/langs/fr_CA/commercial.lang @@ -9,5 +9,3 @@ SaleRepresentativesOfThirdParty=Représentants commerciaux de tiers LastDoneTasks=Dernières %s actions complétées LastActionsToDo=Le plus ancien %s actions non complétées ActionAC_OTH_AUTO=Événements insérés automatiquement -ThisScreenAllowsYouToSignDocFrom=Cet écran vous permet d'accepter et signer ou de refuser le devis ou la proposition commerciale -ThisIsInformationOnDocumentToSign=Ceci est une information sur le document à accepter ou à refuser diff --git a/htdocs/langs/fr_CA/errors.lang b/htdocs/langs/fr_CA/errors.lang index 86d639a66e5..2560a86fb1b 100644 --- a/htdocs/langs/fr_CA/errors.lang +++ b/htdocs/langs/fr_CA/errors.lang @@ -51,7 +51,6 @@ ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire % ErrorModuleRequireJavascript=Javascript ne doit pas être désactivé pour que cette fonction fonctionne. Pour activer / désactiver Javascript, accédez au menu Accueil-> Configuration-> Affichage. ErrorPasswordsMustMatch=Les deux mots de passe dactylographiés doivent correspondre les uns aux autres ErrorFileIsInfectedWithAVirus=Le programme antivirus n'a pas pu valider le fichier (le fichier peut être infecté par un virus) -ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas autorisés pour le champ "%s" ErrorNumRefModel=Une référence existe dans la base de données (%s) et n'est pas compatible avec cette règle de numérotation. Supprimez l'enregistrement ou la renommée référence pour activer ce module. ErrorBadMaskBadRazMonth=Erreur, mauvaise valeur de réinitialisation ErrorCounterMustHaveMoreThan3Digits=Le compteur doit avoir plus de 3 chiffres diff --git a/htdocs/langs/fr_FR/accountancy.lang b/htdocs/langs/fr_FR/accountancy.lang index 83d10982ca2..53edef4c0a1 100644 --- a/htdocs/langs/fr_FR/accountancy.lang +++ b/htdocs/langs/fr_FR/accountancy.lang @@ -59,6 +59,7 @@ MainAccountForSuppliersNotDefined=Compte comptable général pour les fournisseu MainAccountForUsersNotDefined=Compte comptable général pour les utilisateurs non défini dans la configuration MainAccountForVatPaymentNotDefined=Compte comptable général pour les paiements de TVA non défini dans la configuration MainAccountForSubscriptionPaymentNotDefined=Le compte comptable général des paiements de cotisations n'est pas défini dans la configuration +UserAccountNotDefined=Compte comptable pour l'utilisateur non défini dans la configuration AccountancyArea=Espace comptabilité AccountancyAreaDescIntro=L'utilisation du module de comptabilité se fait en plusieurs étapes: @@ -185,7 +186,7 @@ ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT=Compte comptable pour enregistrer les ad ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT=Compte comptable par défaut pour les acomptes clients UseAuxiliaryAccountOnCustomerDeposit=Enregistrer le compte client comme compte individuel dans le grand livre auxiliaire pour les lignes d'acompte (si désactivé, le compte individuel pour les lignes d'acompte restera vide) ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT=Compte comptable par défaut pour enregistrer l'acompte fournisseur -UseAuxiliaryAccountOnSupplierDeposit=Store supplier account as individual account in subsidiary ledger for lines of down payments (if disabled, individual account for down payment lines will remain empty) +UseAuxiliaryAccountOnSupplierDeposit=Stocker le compte fournisseur comme compte individuel dans le grand livre auxiliaire pour les lignes d'acomptes (si désactivé, le compte individuel pour les lignes d'acompte restera vide) ACCOUNTING_PRODUCT_BUY_ACCOUNT=Compte comptable par défaut pour les produits achetés (utilisé si non défini dans la fiche produit) ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT=Compte comptable par défaut pour les produits achetés dans la CEE (utilisé si non défini dans la fiche produit) @@ -286,7 +287,7 @@ DescClosure=Consultez ici le nombre de mouvements par mois non encore validés & OverviewOfMovementsNotValidated=Aperçu des mouvements non validés et verrouillés AllMovementsWereRecordedAsValidated=Tous les mouvements ont été enregistrés comme validés et ont été verrouillés NotAllMovementsCouldBeRecordedAsValidated=Certains mouvements n'ont pas pu être enregistrés comme validés et n'ont pas été verrouillés -ValidateMovements=Valider et verrouiller l'enregistrement... +ValidateMovements=Valider et verrouiller les mouvements... DescValidateMovements=Toute modification ou suppression d'écriture, de lettrage et de suppression sera interdite. Toutes les entrées pour un exercice doivent être validées, sinon la fermeture ne sera pas possible ValidateHistory=Lier automatiquement @@ -401,7 +402,11 @@ Calculated=Calculé Formula=Formule ## Reconcile +LetteringAuto=Rapprocher automatiquement +LetteringManual=Rapprocher manuel Unlettering=Annuler le rapprochement +UnletteringAuto=Annuler le rapprochement automatique +UnletteringManual=Annuler rapprochement manuel AccountancyNoLetteringModified=Pas de rapprochement modifié AccountancyOneLetteringModifiedSuccessfully=Un rapprochement modifié avec succès AccountancyLetteringModifiedSuccessfully=%s rapprochements modifiés avec succès @@ -410,8 +415,9 @@ AccountancyOneUnletteringModifiedSuccessfully=Une annulation de rapprochement mo AccountancyUnletteringModifiedSuccessfully=%s annulations de rapprochement modifiées avec succès ## Confirm box -ConfirmMassUnlettering=Confirmation d'annulation de rapprochement en masse -ConfirmMassUnletteringQuestion=Êtes-vous sûr de vouloir annuler le rapprochement de(s) %s enregistrement(s) sélectionné(s) ? +ConfirmMassUnletteringAuto=Confirmation d'annulation de rapprochement automatique +ConfirmMassUnletteringManual=Confirmation de dé-rapprochement manuel +ConfirmMassUnletteringQuestion=Voulez-vous vraiment annuler le rapprochement des %s enregistrements sélectionnés ? ConfirmMassDeleteBookkeepingWriting=Confirmation de suppression en masse ConfirmMassDeleteBookkeepingWritingQuestion=Cela supprimera la transaction de la comptabilité (toutes les lignes liées à la même transaction seront supprimées). Êtes-vous sûr de vouloir supprimer le(s) %s enregistrement(s) sélectionné(s) ? diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 313e151a044..8edc331780b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -51,8 +51,6 @@ ClientSortingCharset=Jeu de caractère de tri du client WarningModuleNotActive=Le module %s doit être activé pour utiliser cette fonction. WarningOnlyPermissionOfActivatedModules=Attention, seules les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer d'autres modules sur la page Accueil->Configuration->Modules. DolibarrSetup=Installation ou mise à jour de Dolibarr -InternalUser=Utilisateur interne -ExternalUser=Utilisateur externe InternalUsers=Utilisateurs internes ExternalUsers=Utilisateurs externes UserInterface=Interface utilisateur @@ -190,7 +188,7 @@ Compression=Compression CommandsToDisableForeignKeysForImport=Commande pour désactiver les clés étrangères à l'importation CommandsToDisableForeignKeysForImportWarning=Requis si vous voulez être en mesure de restaurer votre « dump » SQL plus tard ExportCompatibility=Compatibilité du fichier d'exportation généré -ExportUseMySQLQuickParameter=Utiliser le paramètre --quick +ExportUseMySQLQuickParameter=Utiliser le paramètre --quick ExportUseMySQLQuickParameterHelp=Le paramètre '--quick' aide à réduire la consommation de RAM pour les longues listes MySqlExportParameters=Paramètres de l'exportation MySQL PostgreSqlExportParameters= Paramètres de l'exportation PostgreSQL @@ -285,7 +283,7 @@ ContentForLines=Contenu à afficher pour chaque produit ou service (à partir de NoticePeriod=Délai de prévenance NewByMonth=Mois suivant Emails=Emails -EMailsSetup=Configuration Emails +EMailsSetup=Configuration des mails EMailsDesc=Cette page permet de définir les paramètres et options d'envoi des e-mails. EmailSenderProfiles=Expéditeur des e-mails EMailsSenderProfileDesc=Vous pouvez garder cette section vide. Si vous entrez des emails ici, ils seront ajoutés à la liste des expéditeurs possibles dans la liste déroulante lorsque vous écrivez un nouvel email. @@ -338,7 +336,7 @@ MenuHandlers=Gestionnaires de menu MenuAdmin=Édition menu DoNotUseInProduction=Ne pas utiliser en production ThisIsProcessToFollow=Procédure de mise à jour: -ThisIsAlternativeProcessToFollow=Voici une procédure de configuration alternative +ThisIsAlternativeProcessToFollow=Voici une procédure de configuration alternative StepNb=Étape %s FindPackageFromWebSite=Rechercher le paquet qui répond à votre besoin (par exemple sur le site web %s). DownloadPackageFromWebSite=Télécharger le package (par exemple depuis le site web officiel %s) @@ -439,8 +437,10 @@ Unique=Unique Boolean=Boolean (case à cocher unique) ExtrafieldPhone = Téléphone ExtrafieldPrice = Prix +ExtrafieldPriceWithCurrency=Prix avec devise ExtrafieldMail = Email ExtrafieldUrl = Url +ExtrafieldIP = IP ExtrafieldSelect = Liste de sélection ExtrafieldSelectList = Liste issue d'une table ExtrafieldSeparator=Séparateur (il ne s'agit pas d'un champ de saisie) @@ -501,7 +501,7 @@ WarningPHPMail=AVERTISSEMENT: la configuration pour envoyer des e-mails à parti WarningPHPMailA= - L'utilisation des serveurs de prestataires de messagerie augmente le niveau confiance des e-mails, cela augmente donc les chances de délivrabilité en n'étant pas considéré comme spam. WarningPHPMailB=- Certains fournisseurs de services de messagerie (comme Yahoo) ne vous permettent pas d'envoyer un e-mail à partir d'un autre serveur que leur propre serveur. Votre configuration actuelle utilise le serveur de l'application pour envoyer des e-mails et non le serveur de votre fournisseur de messagerie, donc certains destinataires (ceux compatibles avec le protocole DMARC restrictif), demanderont à votre fournisseur de messagerie si ils peuvent accepter votre message et ce fournisseur de messagerie (comme Yahoo) peut répondre «non» parce que le serveur d'envoi n'est pas le leur, aussi une partie de vos e-mails envoyés peuvent ne pas être acceptés pour la livraison (faites également attention au quota d'envoi de votre fournisseur de messagerie). WarningPHPMailC=- Utiliser le serveur SMTP de votre propre fournisseur de services de messagerie pour envoyer des e-mails est également intéressant afin que tous les e-mails envoyés depuis l'application soient également enregistrés dans votre répertoire "Envoyés" de votre boîte aux lettres. -WarningPHPMailD=Aussi, il est recommandé de changer le mode d'envoi des e-mails à la valeur "SMTP". Si vous souhaitez vraiment conserver la méthode "PHP" par défaut pour envoyer des e-mails, ignorez simplement cet avertissement ou supprimez-le en définissant la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP sur 1 dans Accueil - Configuration - Autre. +WarningPHPMailD=Aussi, il est recommandé de changer le mode d'envoi des e-mails à la valeur "SMTP". Si vous souhaitez vraiment conserver la méthode "PHP" par défaut pour envoyer des e-mails, ignorez simplement cet avertissement ou supprimez-le en définissant la constante MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP sur 1 dans Accueil - Configuration - Divers. WarningPHPMail2=Si votre fournisseur de messagerie SMTP a besoin de restreindre le client de messagerie à certaines adresses IP (très rare), voici l'adresse IP du mail user agent (MUA) de votre application CRM ERP : %s . WarningPHPMailSPF=Si le nom de domaine de votre adresse e-mail d'expéditeur est protégé par un enregistrement SPF (demandez à votre fournisseur de nom de domaine), vous devez inclure les adresses IP suivantes dans l'enregistrement SPF du DNS de votre domaine: %s. ActualMailSPFRecordFound=Enregistrement SPF réel trouvé (pour l'e-mail %s) : %s @@ -842,9 +842,9 @@ Permission286=Exporter les contacts Permission291=Consulter les tarifs Permission292=Définir les permissions sur les tarifs Permission293=Modifier les tarifs clients -Permission300=Consulter les codes-barres -Permission301=Créer/modifier les codes-barres -Permission302=Supprimer les codes-barres +Permission301=Générer le PDF du code barre +Permission304=Créer/modifier les codes-barres +Permission305=Supprimer les codes-barres Permission311=Consulter les services Permission312=Affecter le service/abonnement au contrat Permission331=Lire les marque-pages @@ -1081,9 +1081,9 @@ DictionaryAssetDisposalType=Type de cession d'actifs TypeOfUnit=Type d'unité SetupSaved=Configuration sauvegardée SetupNotSaved=Configuration non enregistrée -OAuthServiceConfirmDeleteTitle=Suprresion d'entrée OAuth -OAuthServiceConfirmDeleteMessage=Êtes vous sur de vouloir supprimer cette entrée OAuth? Tous les jetons existants associés seront supprimés. -ErrorInEntryDeletion=Erreur dans la suppression +OAuthServiceConfirmDeleteTitle=Supprimer l'entrée OAuth +OAuthServiceConfirmDeleteMessage=Voulez-vous vraiment supprimer cette entrée OAuth ? Tous les jetons existants pour celui-ci seront également supprimés. +ErrorInEntryDeletion=Erreur lors de la suppression de l'entrée EntryDeleted=Entrée supprimée BackToModuleList=Retour liste des modules BackToDictionaryList=Retour liste des dictionnaires @@ -1242,7 +1242,7 @@ BrowserName=Nom du navigateur BrowserOS=OS du navigateur ListOfSecurityEvents=Liste des événements de sécurité Dolibarr SecurityEventsPurged=Evenement de sécurité purgés -TrackableSecurityEvents=Trackable security events +TrackableSecurityEvents=événement de sécurité traçable LogEventDesc=Vous pouvez activer ici l'historique des événements d'audit de sécurité. Cet historique est consultable par les administrateurs dans le menu %s - %s. Attention, cette fonctionnalité peut générer un gros volume de données. AreaForAdminOnly=Les paramètres d'installation ne peuvent être remplis que par les utilisateurs administrateurs uniquement. SystemInfoDesc=Les informations systèmes sont des informations techniques diverses accessibles en lecture seule aux administrateurs uniquement. @@ -1385,7 +1385,7 @@ NumberingModules=Modèles de numérotation DocumentModules=Modèles de documents ##### Module password generation PasswordGenerationStandard=Renvoie un mot de passe généré selon l'algorythme interne de Dolibarr :%s caractères contenant chiffres et minuscules -PasswordGenerationNone=Ne pas suggérer un mot de passe généré. Le mot de passe doit être entré manuellement. +PasswordGenerationNone=Ne pas suggérer un mot de passe généré. Le mot de passe doit être entré manuellement. PasswordGenerationPerso=Renvoie un mot de passe en fonction d'une configuration personnalisée. SetupPerso=Selon votre configuration PasswordPatternDesc=Description du masque du mot de passe @@ -1463,7 +1463,7 @@ OrdersNumberingModules=Modèles de numérotation des commandes OrdersModelModule=Modèles de document des commandes FreeLegalTextOnOrders=Mention complémentaire sur les commandes WatermarkOnDraftOrders=Filigrane sur les brouillons de commandes (aucun si vide) -ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. +ShippableOrderIconInList=Ajouter une icône dans la liste des commandes qui indique si la commande est expédiable. BANK_ASK_PAYMENT_BANK_DURING_ORDER=Demander le compte bancaire cible durant la commande ##### Interventions ##### InterventionsSetup=Configuration du module Interventions @@ -1618,7 +1618,7 @@ LDAPFieldUserid=Id utilisateur LDAPFieldUseridExample=Exemple: uidnumber LDAPFieldHomedirectory=Répertoire racine LDAPFieldHomedirectoryExample=Exemple: homedirectory -LDAPFieldHomedirectoryprefix=Répertoire racine +LDAPFieldHomedirectoryprefix=Préfixe du répertoire racine LDAPSetupNotComplete=Configuration LDAP incomplète (à compléter sur les autres onglets) LDAPNoUserOrPasswordProvidedAccessIsReadOnly=Administrateur ou mot de passe non renseigné. Les accès LDAP seront donc anonymes et en lecture seule. LDAPDescContact=Cette page permet de définir le nom des attributs de l'arbre LDAP pour chaque information des contacts Dolibarr. @@ -1653,7 +1653,7 @@ TestNotPossibleWithCurrentBrowsers=Une détection automatique n'est pas possible DefaultValuesDesc=Vous pouvez définir/forcer ici la valeur par défaut que vous voulez obtenir lorsque vous créez un nouvel enregistrement, et/ou les filtres par défaut ou ordre de tri des listes. DefaultCreateForm=Valeurs par défaut (sur les formulaires de création) DefaultSearchFilters=Filtres de recherche par défaut -DefaultSortOrder=Ordre de tri par défaut +DefaultSortOrder=Ordre de tri par défaut DefaultFocus=Champs par défaut ayant le focus DefaultMandatory=Champs de formulaire obligatoires ##### Products ##### @@ -1747,7 +1747,8 @@ FCKeditorForNotePublic=Création/édition WYSIWIG du champ notes publiques des FCKeditorForNotePrivate=Création/édition WYSIWIG du champ notes privées des éléments FCKeditorForCompany=Création/édition WYSIWIG de la description des éléments (autre que produits/services) FCKeditorForProduct=Création/édition WYSIWIG du champ description des produits/services -FCKeditorForProductDetails=Création/édition WYSIWYG des lignes de détails produits sur tous les éléments (commandes, propales, factures, etc...). Attention: L'utilisation pour ce cas est fortement déconseillée car peut créer des problèmes dans la gestion de caractères et mise en page des fichiers PDF générés. +FCKeditorForProductDetails=Création/édition WYSIWYG des lignes de détails produits sur tous les éléments (commandes, propales, factures, etc...). +FCKeditorForProductDetails2=Attention: L'utilisation pour ce cas est fortement déconseillée car peut créer des problèmes dans la gestion de caractères et mise en page des fichiers PDF générés. FCKeditorForMailing= Création/édition WYSIWIG des emailings (Outils->Emailings) FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs FCKeditorForMail=Création/édition WYSIWIG tous les emails (sauf Outils->Emailings) @@ -1770,7 +1771,7 @@ DetailMenuHandler=Nom du gestionnaire menu dans lequel faire apparaitre le nouve DetailMenuModule=Nom du module si l'entrée menu est issue d'un module DetailType=Type de menu (top ou left) DetailTitre=Libellé du menu ou code libellé à traduire -DetailUrl=URL vers laquelle le menu pointe (Lien URL absolu ou lien externe avec http://) +DetailUrl=URL où le menu vous envoie (lien URL relatif ou lien externe avec https://) DetailEnabled=Condition d'affichage ou non DetailRight=Condition d'affichage plein ou grisé DetailLangs=Fichier .lang pour la traduction du code libellé @@ -1872,7 +1873,7 @@ ChequeReceiptsNumberingModule=Module de numérotation des bordereaux de remises MultiCompanySetup=Configuration du module Multi-société ##### Suppliers ##### SuppliersSetup=Configuration du module Fournisseurs -SuppliersCommandModel=Modèle de commande fournisseur complet +SuppliersCommandModel=Modèle de commande fournisseur complet SuppliersCommandModelMuscadet=Modèle de commande fournisseur complet (ancienne implémentation du modèle Cornas) SuppliersInvoiceModel=Modèle de facture fournisseur complet SuppliersInvoiceNumberingModel=Modèles de numérotation des factures fournisseur @@ -1907,7 +1908,7 @@ NbMajMin=Nombre minimal de caractères majuscules NbNumMin=Nombre minimal de caractères numériques NbSpeMin=Nombre minimal de caractères spéciaux NbIteConsecutive=Nombre maximal de répétition des mêmes caractères -NoAmbiCaracAutoGeneration=Ne pas utiliser des caractères ambigus ("1","l","i","|","0","O") pour la génération automatique +NoAmbiCaracAutoGeneration=Ne pas utiliser des caractères ambigus ("1","l","i","|","0","O") pour la génération automatique SalariesSetup=Configuration du module salaires SortOrder=Ordre de tri Format=Format @@ -1928,7 +1929,7 @@ GoOntoContactCardToAddMore=Rendez-vous sur l'onglet "Notifications" d'un tiers p Threshold=Seuil BackupDumpWizard=Assistant pour créer le fichier dump de la base de données BackupZipWizard=Assistant pour générer l'archive du répertoire documents -SomethingMakeInstallFromWebNotPossible=L'installation de module externe est impossible depuis l'interface web pour la raison suivante : +SomethingMakeInstallFromWebNotPossible=L'installation de module externe est impossible depuis l'interface web pour la raison suivante : SomethingMakeInstallFromWebNotPossible2=Pour cette raison, le processus de mise à jour décrit ici est une processus manuel que seul un utilisateur ayant des droits privilégiés peut réaliser. InstallModuleFromWebHasBeenDisabledByFile=L'installation de module externe depuis l'application a été désactivé par l'administrator. Vous devez lui demander de supprimer le fichier %s pour permettre cette fonctionnalité. ConfFileMustContainCustom=Installer ou créer un module externe à partir de l'application nécessite de sauvegarder les fichiers du module dans le répertoire %s. Pour que ce répertoire soit reconnu par Dolibarr, vous devez paramétrer le fichier de configuration conf/conf.php en ajoutant les 2 lignes suivantes :
    $dolibarr_main_url_root_alt='/custom'
    $dolibarr_main_document_root_alt='%s/custom'; @@ -2078,12 +2079,13 @@ loginPassword=Mot de passe oauthToken=Jeton Oauth2 accessType=Type d'accès oauthService=Service Oauth -TokenMustHaveBeenCreated=Module OAuth2 must be enabled and an oauth2 token must have been created with the correct permissions (for example scope "gmail_full" with OAuth for Gmail). +TokenMustHaveBeenCreated=Le module OAuth2 doit être activé et un token oauth2 doit avoir été créé avec les bonnes permissions (par exemple scope "gmail_full" avec OAuth pour Gmail). MailboxSourceDirectory=Répertoire source de la boîte aux lettres MailboxTargetDirectory=Répertoire cible de la boîte aux lettres EmailcollectorOperations=Opérations à effectuer par le collecteur EmailcollectorOperationsDesc=Les opérations sont exécutées de haut en bas MaxEmailCollectPerCollect=Nombre maximum d'emails collectés par collecte +TestCollectNow=Tester la collecte CollectNow=Collecter maintenant ConfirmCloneEmailCollector=Voulez-vous vraiment cloner le collecteur d'e-mails %s ? DateLastCollectResult=Date de la dernière tentative de collecte @@ -2107,7 +2109,7 @@ NoNewEmailToProcess=Aucun nouvel email (correspondants aux filtres) à traiter NothingProcessed=Aucune action faite XEmailsDoneYActionsDone=%s e-mails pré-qualifiés, %s e-mails traités avec succès (pour %s enregistrement/actions effectuées) RecordEvent=Enregistrer un événement dans l'agenda (avec le type Email envoyé ou reçu) -CreateLeadAndThirdParty=Créer un prospect (et un tiers si nécessaire) +CreateLeadAndThirdParty=Créer une opportunité (et un tiers si nécessaire) CreateTicketAndThirdParty=Créer un ticket (lié à un tiers si le tiers a été chargé par une opération précédente ou a été deviné à partir d'un tracker en en-tête d'email, sans tiers sinon) CodeLastResult=Dernier code de retour NbOfEmailsInInbox=Nombre de courriels dans le répertoire source @@ -2228,7 +2230,7 @@ NoExternalModuleWithUpdate=Aucune mise à jour trouvée pour les modules externe SwaggerDescriptionFile=Fichier de description de l’API Swagger (à utiliser avec redoc par exemple) YouEnableDeprecatedWSAPIsUseRESTAPIsInstead=Vous avez activé l'API WS qui est dépréciée. Vous devriez utiliser l'API REST à la place. RandomlySelectedIfSeveral=Sélectionnée au hasard si plusieurs images sont disponibles -SalesRepresentativeInfo=For Proposals, Orders, Invoices. +SalesRepresentativeInfo=Pour Propositions, Commandes, Factures DatabasePasswordObfuscated=Le mot de passe de la base de données est masqué dans le fichier de configuration DatabasePasswordNotObfuscated=Le mot de passe de la base de données n'est PAS masqué dans le fichier de configuration APIsAreNotEnabled=Les modules API ne sont pas activés @@ -2310,4 +2312,21 @@ MAIN_MAIL_SMTPS_AUTH_TYPE=Méthode d'authentification UsePassword=Utiliser mot de passe UseOauth=Utiliser un token OAUTH Images=Images +Posts=publications MaxNumberOfImagesInGetPost=Nombre maximum d'images autorisées dans un champ HTML soumis dans un formulaire +MaxNumberOfPostOnPublicPagesByIP=Nombre maximum de publications sur des pages publiques avec une adresse IP +CIDLookupURL=Le module apporte une URL qui peut être utilisée par un outil externe pour obtenir le nom d'un tiers ou d'un contact à partir de son numéro de téléphone. L'URL à utiliser est : +ScriptIsEmpty=Le script est manquant +ShowHideTheNRequests=Afficher/Cacher les %s requête(s) SQL. +DefinedAPathForAntivirusCommandIntoSetup=Définir un chemin pour un programme antivirus dans %s +TriggerCodes=Événements déclenchables +TriggerCodeInfo=Saisissez ici le(s) code(s) déclencheur(s) qui doivent générer la publication d'une requête web (seules les URL externes sont autorisées). Vous pouvez entrer plusieurs codes déclencheurs séparés par une virgule. +EditableWhenDraftOnly=Si décochée, la valeur ne peut être modifiée que lorsque l'objet a un état de brouillon +CssOnEdit=CSS sur les pages d'édition +CssOnView=CSS sur les pages de visualisation +CssOnList=CSS sur les pages de liste +HelpCssOnEditDesc=Le CSS utilisé lors de la modification du champ.
    Exemple : "minwidth100 maxwidth500 widthcentpercentminusx" +HelpCssOnViewDesc=Le CSS utilisé lors de l'affichage du champ. +HelpCssOnListDesc=Le CSS utilisé lorsque le champ est à l'intérieur du tableau d'une liste.
    Exemple : "tdoverflowmax200" +RECEPTION_PDF_HIDE_ORDERED=Masquer la quantité commandée sur les documents générés pour les réceptions +MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Afficher le prix sur les documents générés pour les réceptions diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 1ac6cb60597..62dbae7233e 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -87,6 +87,7 @@ SupplierInvoiceSentByEMail=Facture fournisseur %s envoyée par email ShippingSentByEMail=Bon d'expédition %s envoyé par email ShippingValidated= Expédition %s validée InterventionSentByEMail=Intervention %s envoyé par email +ProjectSentByEMail=Projet %s envoyé par email ProposalDeleted=Proposition commerciale supprimée OrderDeleted=Commande supprimée InvoiceDeleted=Facture supprimée @@ -99,7 +100,7 @@ PRODUCT_MODIFYInDolibarr=Produit %s modifié PRODUCT_DELETEInDolibarr=Produit%ssupprimé HOLIDAY_CREATEInDolibarr=Demande de congé %s créée HOLIDAY_MODIFYInDolibarr=Demande de congé %s modifiée -HOLIDAY_APPROVEInDolibarr=Demande de congé %s approuvée +HOLIDAY_APPROVEInDolibarr=Demande de congé %s approuvée HOLIDAY_VALIDATEInDolibarr=Demande de congé %s validée HOLIDAY_DELETEInDolibarr=Demande de congé %s supprimée EXPENSE_REPORT_CREATEInDolibarr=Note de frais %s créée diff --git a/htdocs/langs/fr_FR/banks.lang b/htdocs/langs/fr_FR/banks.lang index af88349f585..35de9806932 100644 --- a/htdocs/langs/fr_FR/banks.lang +++ b/htdocs/langs/fr_FR/banks.lang @@ -185,4 +185,4 @@ AlreadyOneBankAccount=un compte bancaire est déjà défini SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation=Virement SEPA : 'Type de paiement' au niveau 'Virement' SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformationHelp=A la génération d'un fichier SEPA XML pour les virements, la section "PaymentTypeInformation" peut maintenant être placée dans la section "CreditTransferTransactionInformation" (à la place de la section "Payment").\nNous recommandons fortement de ne pas cocher cette case pour conserver "PaymentTypeInformation" dans "Payment level" car toutes les banques ne l'accepterons pas obligatoirement au niveau de "CreditTransferTransactionInformation". Contactez votre banque avant de modifier ce paramètre. ToCreateRelatedRecordIntoBank=Pour créer un enregistrement bancaire associé manquant -BanklineExtraFields=Bank Line Extrafields +BanklineExtraFields=Extrait de la ligne bancaire diff --git a/htdocs/langs/fr_FR/bookmarks.lang b/htdocs/langs/fr_FR/bookmarks.lang index b449ca7110a..355b1b351e4 100644 --- a/htdocs/langs/fr_FR/bookmarks.lang +++ b/htdocs/langs/fr_FR/bookmarks.lang @@ -20,3 +20,4 @@ ChooseIfANewWindowMustBeOpenedOnClickOnBookmark=Choisir si le raccourci doit ouv BookmarksManagement=Gestion des marque-pages BookmarksMenuShortCut=Ctrl + Maj + m NoBookmarks=Aucun marque page enregistré +NoBookmarkFound=Pas de marque-page trouvé. diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang index 75c6ccb9ed9..4cb9011885d 100644 --- a/htdocs/langs/fr_FR/boxes.lang +++ b/htdocs/langs/fr_FR/boxes.lang @@ -46,6 +46,7 @@ BoxMyLastBookmarks=Mes %s derniers marque-pages BoxOldestExpiredServices=Plus anciens services expirés BoxLastExpiredServices=Les %s plus anciens contrats avec services actifs expirés BoxTitleLastActionsToDo=Les %s derniers événements à réaliser +BoxTitleOldestActionsToDo=Les %s plus anciens événement non terminés BoxTitleLastContracts=Les %s derniers contrats modifiés BoxTitleLastModifiedDonations=Les %s derniers dons modifiés BoxTitleLastModifiedExpenses=Les %s dernières notes de frais modifiées diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 244718df17d..049ee169cef 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -136,10 +136,12 @@ PrintWithoutDetails=Générer sans les détails YearNotDefined=L'année n'est pas définie TakeposBarcodeRuleToInsertProduct=Règle de lecture du code barre des produits TakeposBarcodeRuleToInsertProductDesc=Règle pour extraire la référence produit + une quantité d'un code barre scanné.
    Si vide (valeur par défaut), l'application utilisera le code-barres complet scanné pour trouver le produit.

    Si elle est définie, la syntaxe doit être:
    ref: NB + Qu: NB + QD: NB + autres: NB
    où NB est le nombre de caractères à utiliser pour extraire les données du code à barres scannés avec:
    • ref : référence produit
    • qu : quantité de jeu lors de l'insertion article (unités)
    • qd: quantité de jeu lors de l'insertion article (décimaux)
    • autre : autres caractères
    -HideCategories=Masquer les catégories -HideStockOnLine=Masquer le stock en ligne -ShowOnlyProductInStock=Affficher les produits en stock -ShowCategoryDescription=Afficher la description des catégories -ShowProductReference=Afficher la référence des produits -UsePriceHT= Utiliser le prix HT et non en TTC AlreadyPrinted=Déjà imprimé +HideCategories=Cacher catégories +HideStockOnLine=Cacher les stocks sur les lignes +ShowOnlyProductInStock=Afficher les produits en stock +ShowCategoryDescription=Afficher la description de la catégorie +ShowProductReference=Afficher la référence des produits +UsePriceHT=Utiliser le prix HT et non le prix TTC +TerminalName=Terminal %s +TerminalNameDesc=Nom du terminal diff --git a/htdocs/langs/fr_FR/categories.lang b/htdocs/langs/fr_FR/categories.lang index 5f478aabc7f..641cf97bacf 100644 --- a/htdocs/langs/fr_FR/categories.lang +++ b/htdocs/langs/fr_FR/categories.lang @@ -42,6 +42,7 @@ MemberHasNoCategory=Ce membre n'appartient à aucun(e) tag/catégorie ContactHasNoCategory=Ce contact n'appartient à aucun(e) tag/catégorie ProjectHasNoCategory=Ce projet n'est classé dans aucune catégorie ClassifyInCategory=Ajouter tag/catégorie +RemoveCategory=Supprimer la catégorie NotCategorized=Sans tag/catégorie CategoryExistsAtSameLevel=Ce tag existe déjà avec cette référence ContentsVisibleByAllShort=Contenu visible par tous @@ -67,6 +68,7 @@ StockCategoriesShort=Tags/catégories d’entrepôt ThisCategoryHasNoItems=Cette catégorie ne contient aucun élément. CategId=ID du(de la) tag/catégorie ParentCategory=Catégorie parente +ParentCategoryID=ID de la balise/catégorie parent ParentCategoryLabel=Libellé du tag/catégorie parent CatSupList=Liste des tags/catégories des fournisseurs CatCusList=Liste des tags/catégories des clients/prospects diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 84bb1364386..924059a1262 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -75,11 +75,11 @@ DraftPropals=Propositions brouillons NoLimit=Pas de limite ToOfferALinkForOnlineSignature=Lien pour signature en ligne WelcomeOnOnlineSignaturePageProposal=Bienvenue sur la page pour accepter les propositions commerciales de %s -WelcomeOnOnlineSignaturePageContract=Bienvenue sur la page de signature en ligne de contrats au format PDF de %s +WelcomeOnOnlineSignaturePageContract=Bienvenue sur la page de signature du contrat PDF %s ThisScreenAllowsYouToSignDocFromProposal=Cet écran vous permet d'accepter et signer en ligne, ou de refuser, le devis ou la proposition commerciale -ThisScreenAllowsYouToSignDocFromContract=Cet écran vous permet de signer en ligne des contrats au format PDF. +ThisScreenAllowsYouToSignDocFromContract=Cet écran vous permet de signer en ligne un contrat au format PDF. ThisIsInformationOnDocumentToSignProposal=Voici les informations sur le document à accepter ou refuser -ThisIsInformationOnDocumentToSignContract=Voici les informations sur le contrat a signer +ThisIsInformationOnDocumentToSignContract=Voici les informations sur le contrat à signer SignatureProposalRef=Signature du devis ou proposition commerciale %s SignatureContractRef=Signature du contrat %s FeatureOnlineSignDisabled=Fonctionnalité pour la signature en ligne désactivée ou document généré avant l'activation de la fonctionnalité diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index e875ef168fd..f66d2005c73 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -313,11 +313,11 @@ CustomerAbsoluteDiscountShort=Remise fixe CompanyHasRelativeDiscount=Ce client a une remise par défaut de %s%% CompanyHasNoRelativeDiscount=Ce client n'a pas de remise relative par défaut HasRelativeDiscountFromSupplier=Vous avez une réduction par défaut de %s%% chez ce fournisseur -HasNoRelativeDiscountFromSupplier=Vous n'avez pas de remise relative par défaut chez ce fournisseur +HasNoRelativeDiscountFromSupplier=Aucune remise relative par défaut de ce fournisseur CompanyHasAbsoluteDiscount=Ce client dispose de crédits disponibles (avoirs ou acomptes) pour un montant de %s %s CompanyHasDownPaymentOrCommercialDiscount=Ce client a une réduction disponible (commercial, acompte) pour %s%s CompanyHasCreditNote=Ce client a %s %s d'avoirs disponibles -HasNoAbsoluteDiscountFromSupplier=Vous n'avez aucun crédit de réduction disponible auprès de ce fournisseur +HasNoAbsoluteDiscountFromSupplier=Aucun rabais/crédit disponible auprès de ce fournisseur HasAbsoluteDiscountFromSupplier=Vous avez des crédits disponibles (avoirs ou acomptes) pour %s %s chez ce fournisseur HasDownPaymentOrCommercialDiscountFromSupplier=Vous avez des crédits disponibles (bon de réductions, acomptes) pour %s %s chez ce fournisseur HasCreditNoteFromSupplier=Vous avez des avoirs pour %s %s chez ce fournisseur @@ -444,7 +444,7 @@ AddAddress=Créer adresse SupplierCategory=Catégorie du fournisseur JuridicalStatus200=Indépendant DeleteFile=Suppression d'un fichier -ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier %s? +ConfirmDeleteFile=Êtes-vous sûr de vouloir supprimer ce fichier %s ? AllocateCommercial=Affecter un commercial Organization=Organisme FiscalYearInformation=Exercice fiscal @@ -467,7 +467,7 @@ UniqueThirdParties=Nombre total des tiers InActivity=Ouvert ActivityCeased=Clos ThirdPartyIsClosed=Le tiers est clôturé -ProductsIntoElements=Liste des produits/services jusqu'à %s +ProductsIntoElements=Liste des produits/services présents dans %s CurrentOutstandingBill=Montant encours OutstandingBill=Montant encours autorisé OutstandingBillReached=Montant encours autorisé dépassé @@ -498,3 +498,5 @@ RestOfEurope=Reste de l'Union Européenne (UE) OutOfEurope=Hors Union Européenne (UE) CurrentOutstandingBillLate=Montant impayé arrivé à échéance BecarefullChangeThirdpartyBeforeAddProductToInvoice=Attention : selon votre configuration des prix des produits/services, vous devriez changer le tiers avant d'ajouter le produit +EmailAlreadyExistsPleaseRewriteYourCompanyName=l'e-mail existe déjà, veuillez réécrire le nom de votre entreprise +TwoRecordsOfCompanyName=plusieurs fiches existent pour cette entreprise merci de nous contacter pour compléter votre demande de partenariat" diff --git a/htdocs/langs/fr_FR/contracts.lang b/htdocs/langs/fr_FR/contracts.lang index bb7bf18da67..3c3d5620d1a 100644 --- a/htdocs/langs/fr_FR/contracts.lang +++ b/htdocs/langs/fr_FR/contracts.lang @@ -20,6 +20,7 @@ ContractsSubscriptions=Contrats/Abonnements ContractsAndLine=Contrats et lignes de contrats Contract=Contrat ContractLine=Ligne de contrat +ContractLines=Lignes du contrat Closing=Fermé NoContracts=Pas de contrats MenuServices=Services @@ -79,7 +80,7 @@ ConfirmDeleteContractLine=Êtes-vous sûr de vouloir supprimer cette ligne de co MoveToAnotherContract=Déplacer le service vers un autre contrat de ce tiers. ConfirmMoveToAnotherContract=J'ai choisi le contrat cible et confirme le déplacement du service dans ce contrat. ConfirmMoveToAnotherContractQuestion=Choisissez vers quel autre contrat (du même tiers), vous voulez déplacer ce service ? -PaymentRenewContractId=Renouvellement service (numéro %s) +PaymentRenewContractId=Renouveler le contrat %s (service %s) ExpiredSince=Expiré le NoExpiredServices=Pas de services actifs expirés ListOfServicesToExpireWithDuration=Liste des services actifs expirant dans %s jours @@ -104,3 +105,5 @@ AllowOnlineSign=Autoriser la signature en ligne AllowExternalDownload=Autoriser le téléchargement externe ShowClosedServices=Afficher les services fermés HideClosedServices=Masquer les services fermés +UserStartingService=Utilisateur démarrant le service +UserClosingService=Utilisateur stoppant le service diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 64bf5493285..e851fd5a13a 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -82,10 +82,18 @@ UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nombre de fichiers de sauvegarde à garder +MakeSendLocalDatabaseDumpShort=Envoyer la sauvegarde de la base de données locale +MakeSendLocalDatabaseDump=Envoyez la sauvegarde de la base de données locale par e-mail. Les paramètres sont : to, from, subject, message, filename (nom du fichier envoyé), filter ('sql' pour la sauvegarde de la base de données uniquement) +CleanUnfinishedCronjobShort=Nettoyer la tâche planifiée inachevée +CleanUnfinishedCronjob=Nettoyer la tâche planifiée bloquée dans le traitement lorsque le processus n'est plus en cours d'exécution WarningCronDelayed=Attention, à des fins de performance, quelle que soit la prochaine date d'exécution des travaux activés, vos travaux peuvent être retardés jusqu'à %s heures avant d'être exécutés. DATAPOLICYJob=Nettoyeur de données et anonymiseur JobXMustBeEnabled=La tâche planifiée %s doit être activée +EmailIfError=E-mail d'avertissement en cas d'erreur +ErrorInBatch=Erreur lors de l'exécution du travail %s + # Cron Boxes LastExecutedScheduledJob=Dernier travail planifié exécuté NextScheduledJobExecute=Prochaine travail planifié à exécuter NumberScheduledJobError=Nombre de travaux planifiées en erreur +NumberScheduledJobNeverFinished=Nombre de tâches planifiées jamais terminées diff --git a/htdocs/langs/fr_FR/datapolicy.lang b/htdocs/langs/fr_FR/datapolicy.lang new file mode 100644 index 00000000000..16ed7ca5933 --- /dev/null +++ b/htdocs/langs/fr_FR/datapolicy.lang @@ -0,0 +1,92 @@ +# Copyright (C) 2018 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Module label 'ModuledatapolicyName' +Module4100Name = Politique de confidentialité des données +# Module description 'ModuledatapolicyDesc' +Module4100Desc = Module de gestion de la confidentialité des données (conformité avec le RGPD) + +# +# Administration page +# +datapolicySetup = Configuration de la politique de confidentialité des données du module +Deletion = Suppression de données +datapolicySetupPage = En fonction des législations de vos pays (Exemple Article 5 du RGPD), les données personnelles doivent être conservées pendant une durée n'excédant pas celle nécessaire aux finalités pour lesquelles elles ont été collectées, sauf à des fins d'archivage.
    La suppression se fera automatiquement après une certaine durée sans événement (la durée que vous aurez indiquée ci-dessous). +NB_MONTHS = %s mois +ONE_YEAR = 1 an +NB_YEARS = %s ans +DATAPOLICY_TIERS_CLIENT = Client +DATAPOLICY_TIERS_PROSPECT = Prospect +DATAPOLICY_TIERS_PROSPECT_CLIENT = Prospect/Client +DATAPOLICY_TIERS_NIPROSPECT_NICLIENT = Ni prospect/Ni client +DATAPOLICY_TIERS_FOURNISSEUR = Fournisseur +DATAPOLICY_CONTACT_CLIENT = Client +DATAPOLICY_CONTACT_PROSPECT = Prospect +DATAPOLICY_CONTACT_PROSPECT_CLIENT = Prospect/Client +DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT = Ni prospect/Ni client +DATAPOLICY_CONTACT_FOURNISSEUR = Fournisseur +DATAPOLICY_ADHERENT = Adhérent +DATAPOLICY_Tooltip_SETUP = Type de contact - Indiquez vos choix pour chaque type. +DATAPOLICYMail = Configuration des e-mails +DATAPOLICYSUBJECTMAIL = Objet du courriel +DATAPOLICYCONTENTMAIL = Contenu de l'e-mail +DATAPOLICYSUBSITUTION = Vous pouvez utiliser les variables suivantes dans votre email (LINKACCEPT permet de créer un lien enregistrant l'accord de la personne, LINKREFUSED permet d'enregistrer le refus de la personne) : +DATAPOLICYACCEPT = Message après accord +DATAPOLICYREFUSE = Message après désaccord +SendAgreementText = Vous pouvez envoyer un e-mail RGPD à tous vos contacts concernés (qui n'ont pas encore reçu d'e-mail et pour lesquels vous n'avez rien enregistré concernant leur accord RGPD). Pour ce faire, utilisez le bouton suivant. +SendAgreement = Envoyer des emails +AllAgreementSend = Tous les e-mails ont été envoyés +TXTLINKDATAPOLICYACCEPT = Texte pour le lien "accord" +TXTLINKDATAPOLICYREFUSE = Texte pour le lien "désaccord" + + +# +# Extrafields +# +DATAPOLICY_BLOCKCHECKBOX = RGPD : Traitement des données personnelles +DATAPOLICY_consentement = Consentement obtenu pour le traitement des données personnelles +DATAPOLICY_opposition_traitement = S'oppose au traitement de ses données personnelles +DATAPOLICY_opposition_prospection = S'oppose au traitement de ses données personnelles à des fins de prospection + +# +# Popup +# +DATAPOLICY_POPUP_ANONYME_TITLE = Anonymiser un tiers +DATAPOLICY_POPUP_ANONYME_TEXTE = Vous ne pouvez pas supprimer ce contact de Dolibarr car il y a des éléments liés. Conformément au RGPD, vous rendrez toutes ces données anonymes pour respecter vos obligations. Voulez-vous continuer ? + +# +# Button for portability +# +DATAPOLICY_PORTABILITE = Portabilité RGPD +DATAPOLICY_PORTABILITE_TITLE = Exportation de données personnelles +DATAPOLICY_PORTABILITE_CONFIRMATION = Vous souhaitez exporter les données personnelles de ce contact. Êtes-vous sûr ? + +# +# Notes added during an anonymization +# +ANONYMISER_AT = Anonymisé le %s + +# V2 +DATAPOLICYReturn = Validation RGPD +DATAPOLICY_date = Date d'accord/désaccord RGPD +DATAPOLICY_send = Date d'envoi de l'e-mail d'accord +DATAPOLICYReturn = Validation RGPD +DATAPOLICY_SEND = Envoyer un e-mail RGPD +MailSent = L'email a été envoyé + +# ERROR +ErrorSubjectIsRequired = Erreur : L'objet de l'email est obligatoire. Indiquez-le dans la configuration du module +=Suite à un problème technique, nous n'avons pas pu enregistrer votre choix. Nous nous en excusons. Contactez-nous pour nous faire part de votre choix. +NUMBER_MONTH_BEFORE_DELETION = Nombre de mois avant la suppression diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index f043c5b5afc..d407d7c91b8 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -48,6 +48,7 @@ ErrorBadImageFormat=Cet image est dans un format non pris en charge (Votre PHP n ErrorBadDateFormat=La valeur '%s' a un format de date non reconnu ErrorWrongDate=La date est incorrecte ErrorFailedToWriteInDir=Impossible d'écrire dans le répertoire %s +ErrorFailedToBuildArchive=Échec de la création du fichier d'archive %s ErrorFoundBadEmailInFile=Syntaxe d'email incorrecte trouvée pour %s lignes dans le fichier (exemple ligne %s avec email=%s) ErrorUserCannotBeDelete=L'utilisateur ne peut pas être supprimé. Peut-être est-il associé à des éléments de Dolibarr. ErrorFieldsRequired=Des champs obligatoire n'ont pas été remplis. @@ -76,7 +77,7 @@ ErrorNoValueForCheckBoxType=Les valeurs de la liste de case à cochées doivent ErrorNoValueForRadioType=Les valeurs de la liste d'options doivent être renseignées ErrorBadFormatValueList=Les valeurs de la liste ne peuvent pas avoir plus d'une virgule: %s mais il en faut au moins une: clé, valeur ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux. -ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ %s ne doit contenir ni caractères spéciaux ni majuscules et ne peut contenir que des chiffres. +ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ %s ne doit pas contenir de caractères spéciaux, ni de majuscules, et doit commencer par un caractère alphabétique (a-z) ErrorFieldMustHaveXChar=Le champ %s doit comporter au moins %s caractères. ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export. @@ -97,7 +98,6 @@ ErrorFieldValueNotIn=Champ %s: '%s' n'est pas une valeur disponibl ErrorFieldRefNotIn=Champ %s: '%s' n'est pas une référence existante comme %s ErrorsOnXLines=Erreurs sur %s enregistrement(s) source ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) ! -ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admis pour le champ "%s" ErrorNumRefModel=Une référence existe en base (%s) et est incompatible avec cette numérotation. Supprimez la ligne ou renommez la référence pour activer ce module. ErrorQtyTooLowForThisSupplier=Quantité insuffisante pour ce fournisseur ou aucun tarif défini sur ce produit pour ce fournisseur ErrorOrdersNotCreatedQtyTooLow=Certaines commandes n'ont pas été créées en raison de quantités trop faibles @@ -291,6 +291,13 @@ ErrorAjaxRequestFailed=Demande échouée ErrorThirpdartyOrMemberidIsMandatory=Définir un tiers ou un adhérent dans le partenariat est obligatoire ErrorFailedToWriteInTempDirectory=Impossible d'écrire dans le répertoire temporaire ErrorQuantityIsLimitedTo=La quantité est limitée à %s +ErrorFailedToLoadThirdParty=Impossible de trouver/charger un tiers à partir de id=%s, email=%s, name=%s +ErrorThisPaymentModeIsNotSepa=Ce mode de paiement n'est pas un compte bancaire +ErrorStripeCustomerNotFoundCreateFirst=Le client Stripe n'est pas défini pour ce tiers (ou défini sur une valeur supprimée du côté Stripe). Créez (ou rattachez) d'abord. +ErrorCharPlusNotSupportedByImapForSearch=La recherche IMAP n'est pas en mesure de rechercher dans l'expéditeur ou le destinataire une chaîne contenant le caractère + +ErrorTableNotFound=Table %s introuvable +ErrorValueForTooLow=La valeur pour %s est trop faible +ErrorValueCantBeNull=La valeur pour %s ne peut pas être nulle # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. @@ -326,6 +333,8 @@ WarningAvailableOnlyForHTTPSServers=Disponible uniquement si une connexion sécu WarningModuleXDisabledSoYouMayMissEventHere=Le module %s n’a pas été activé. Par conséquent, il se peut que vous manquiez beaucoup d’événements ici. WarningPaypalPaymentNotCompatibleWithStrict=La valeur 'Strict' fait que les fonctionnalités de paiement en ligne ne fonctionnent pas correctement. Utilisez plutôt 'Lax'. WarningThemeForcedTo=Attention, le choix du thème a été forcé à %s par la constante cachée MAIN_FORCETHEME +WarningPagesWillBeDeleted=Attention, cela supprimera également toutes les pages/conteneurs existants du site. Vous devriez exporter votre site Web avant, afin d'avoir une sauvegarde pour le réimporter plus tard. +WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal=La validation automatique est désactivée lorsque l'option de diminution du stock est définie sur "Validation de la facture". # Validate RequireValidValue = Valeur non valide diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index 665173fd58e..260bcebda1d 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -95,8 +95,8 @@ NbOfLinesOK=Nombre de lignes sans erreur ni avertissement : %s. NbOfLinesImported=Nombre de lignes importées avec succès : %s. DataComeFromNoWhere=La valeur à insérer n'est issue d'aucun champ du fichier source. DataComeFromFileFieldNb=La valeur à insérer provient de la colonne %s dans le fichier source. -DataComeFromIdFoundFromRef=La valeur provenant du fichier source sera utilisée pour trouver l'identifiant de l'objet parent à utiliser (donc l'objet %s qui a la référence du fichier source doit exister dans la base de données). -DataComeFromIdFoundFromCodeId=Le valeur du code provenant du fichier source sera utilisé pour trouver l'id de l'objet parent à utiliser (donc le code du fichier source doit exister dans le dictionnaire %s ). Notez que si vous connaissez l'identifiant, vous pouvez également l'utiliser dans le fichier source à la place du code. L'importation devrait fonctionner dans les deux cas. +DataComeFromIdFoundFromRef=La valeur qui vient du fichier source sera utilisée pour trouver l'id de l'objet parent à utiliser (donc l'objet %s qui a la réf. du fichier source doit exister dans la base de données). +DataComeFromIdFoundFromCodeId=La valeur du code provenant du fichier source sera utilisée pour trouver l'identifiant de l'objet parent à utiliser (donc le code du fichier source doit exister dans le dictionnaire %s). Notez que si vous connaissez l'identifiant, vous pouvez également l'utiliser dans le fichier source à la place du code. L'importation devrait fonctionner dans les deux cas. DataIsInsertedInto=La donnée issue du fichier source sera insérée dans le champ suivant: DataIDSourceIsInsertedInto=L'identifiant de l'objet père, retrouvé à partir de la donnée dans le fichier source, sera inséré dans le champ suivant : DataCodeIDSourceIsInsertedInto=L'identifiant de la ligne père, retrouvé à partir du code, sera inséré dans le champ suivant : @@ -134,7 +134,9 @@ FormatControlRule=Règle de contrôle de format ## imports updates KeysToUseForUpdates=Clé à utiliser pour mettre à jour les données NbInsert=Nombre de lignes insérées: %s +NbInsertSim=Nombre de lignes qui seront insérées : %s NbUpdate=Nombre de lignes mises à jour: %s +NbUpdateSim=Nombre de lignes qui seront mises à jour : %s MultipleRecordFoundWithTheseFilters=Plusieurs enregistrements ont été trouvés avec ces filtres: %s StocksWithBatch=Stocks et entrepôts des produits avec numéro de lot/série WarningFirstImportedLine=La ou les premières lignes ne seront pas importées avec la sélection actuelle diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 22720779eaf..27439f66c27 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -1,10 +1,11 @@ # Dolibarr language file - Source file is en_US - holiday HRM=GRH -Holidays=Congés -Holiday=Congé +Holidays=Feuilles +Holiday=Demande de congés CPTitreMenu=Demande de congés MenuReportMonth=État mensuel MenuAddCP=Créer demande de congés +MenuCollectiveAddCP=Nouvelle demande de congé collectif NotActiveModCP=Vous devez activer le module Congés pour afficher cette page. AddCP=Créer une demande de congés DateDebCP=Date Début @@ -57,6 +58,7 @@ ConfirmDeleteCP=Confirmer la suppression de cette demande de congés ? ErrorCantDeleteCP=Erreur, vous n'avez pas le droit de supprimer cette demande de congés. CantCreateCP=Erreur, vous n'avez pas le droit de créer une demande de congés. InvalidValidatorCP=Vous devez choisir un approbateur pour votre demande de congés. +InvalidValidator=L'utilisateur choisi n'est pas un approbateur. NoDateDebut=Vous devez choisir une date de début. NoDateFin=Vous devez choisir une date de fin. ErrorDureeCP=Votre demande de congés payés ne contient aucun jour ouvré. @@ -80,6 +82,8 @@ MotifCP=Motif UserCP=Utilisateur ErrorAddEventToUserCP=Une erreur est survenue durant l'ajout du congé exceptionnel. AddEventToUserOkCP=L'ajout du congé exceptionnel à bien été effectué. +ErrorFieldRequiredUserOrGroup=Le champ "groupe" ou le champ "utilisateur" doivent être remplis +fusionGroupsUsers=Le champ "groupes" et le champ "utilisateur" seront fusionnés MenuLogCP=Voir historique modif. LogCP=Historique des mises à jour de jours de congés disponibles ActionByCP=Réalisée par @@ -87,6 +91,13 @@ UserUpdateCP=Mis à jour pour PrevSoldeCP=Précédent Solde NewSoldeCP=Nouveau Solde alreadyCPexist=Une demande de congés a déjà été faite sur cette période. +UseralreadyCPexist=Une demande de congé a déjà été faite pour cette période pour %s. +groups=Groupes +users=Utilisateurs +AutoSendMail=Envoi automatique d'email +NewHolidayForGroup=Nouvelle demande de congé collectif +SendRequestCollectiveCP=Envoyer la demande de congé collectif +AutoValidationOnCreate=Validation automatique FirstDayOfHoliday=Premier jour de congés LastDayOfHoliday=Dernier jour de congés BoxTitleLastLeaveRequests=Les %s dernières demandes de congés modifiées @@ -138,3 +149,10 @@ XIsAUsualNonWorkingDay=%s est généralement un jour NON ouvrable BlockHolidayIfNegative=Bloqué lorsque le solde est négatif LeaveRequestCreationBlockedBecauseBalanceIsNegative=La création de cette demande de congé est bloquée car votre solde est négatif ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted=La demande de congé %s doit être brouillon, annulée ou refusée pour être supprimée +IncreaseHolidays=Augmenter le nombre de jours de vacances +HolidayRecordsIncreased= %s registres de vacances augmentés +HolidayRecordIncreased=Registre de vacances augmenté +ConfirmMassIncreaseHoliday=Augmentation en masse des vacances +NumberDayAddMass=Nombre de jours à ajouter à la sélection +ConfirmMassIncreaseHolidayQuestion=Êtes-vous sûr de vouloir augmenter les vacances du ou des enregistrement(s) sélectionnés %s ? +HolidayQtyNotModified=Le solde des jours restants pour %s n'a pas été modifié diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index 5e520547352..0888db3aca6 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -28,6 +28,7 @@ ErrorPHPVersionTooLow=Version PHP trop ancienne. La version %s ou supérieure es ErrorPHPVersionTooHigh=Version PHP trop élevée. La version %s ou inférieure est requise. ErrorConnectedButDatabaseNotFound=Connexion au serveur réussie mais base '%s' introuvable. ErrorDatabaseAlreadyExists=La base de données '%s' existe déjà. +ErrorNoMigrationFilesFoundForParameters=Aucun fichier de migration trouvé pour les versions sélectionnées IfDatabaseNotExistsGoBackAndUncheckCreate=Si la base n'existe pas, revenez en arrière et cochez l'option "Créer la base de données". IfDatabaseExistsGoBackAndCheckCreate=Si la base existe déjà, revenez en arrière et désactiver l'option "Créer la base de données". WarningBrowserTooOld=Version du navigateur trop ancienne. Nous vous recommandons de mettre à jour vers une version récente de Firefox, Chrome ou Opera. @@ -50,7 +51,6 @@ DatabaseName=Nom de la base de données DatabasePrefix=Préfixe des tables DatabasePrefixDescription=Préfixe de table de base de données. Si vide, la valeur par défaut est llx_. AdminLogin=Identifiant du propriétaire de la base de données Dolibarr. -PasswordAgain=Vérification du mot de passe AdminPassword=Mot de passe du propriétaire de la base de données Dolibarr. CreateDatabase=Créer la base de données CreateUser=Créer le propriétaire ou lui affecter les droits à la base @@ -212,3 +212,5 @@ ClickHereToGoToApp=Cliquez ici pour aller sur votre application ClickOnLinkOrRemoveManualy=Si une mise à niveau est en cours, veuillez patienter. Si non, cliquez sur le lien suivant. Si vous atteignez toujours cette page, vous devez supprimer manuellement le fichier install.lock dans le répertoire documents Loaded=Chargé FunctionTest=Fonction test +NodoUpgradeAfterDB=Aucune action demandée par les modules externes après la mise à jour de la base de données +NodoUpgradeAfterFiles=Aucune action demandée par les modules externes après la mise à jour des fichiers ou des répertoires diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang index 50e6ff1d9d1..c09f8431498 100644 --- a/htdocs/langs/fr_FR/interventions.lang +++ b/htdocs/langs/fr_FR/interventions.lang @@ -68,3 +68,4 @@ ConfirmReopenIntervention=Êtes-vous sur de vouloir ré-ouvrir l'intervention %s, i ErrorUserPermissionAllowsToLinksToItselfOnly=Pour des raisons de sécurité, il faut posséder les droits de modification de tous les utilisateurs pour pouvoir lier un adhérent à un utilisateur autre que vous même. SetLinkToUser=Lier à un utilisateur Dolibarr SetLinkToThirdParty=Lier à un tiers Dolibarr +MemberCountersArePublic=Les compteurs de membres valides sont publics MembersCards=Génération de cartes pour les membres MembersList=Liste des adhérents MembersListToValid=Liste des adhérents brouillons (à valider) @@ -72,6 +73,12 @@ MemberTypeCanNotBeDeleted=Ce type d'adhérent ne peut pas être supprimé NewSubscription=Nouvelle cotisation NewSubscriptionDesc=Ce formulaire permet de vous inscrire comme nouvel adhérent de l'association. Pour un renouvellement (si vous êtes déjà adhérent), contactez plutôt l'association par email %s. Subscription=Adhésion / cotisation +AnyAmountWithAdvisedAmount=Tout montant avec une quantité recommandée de %s%s +AnyAmountWithoutAdvisedAmount=Tout montant +CanEditAmountShort=Tout montant +CanEditAmountShortForValues=recommandé, tout montant +MembershipDuration=Durée +GetMembershipButtonLabel=Obtenir l'adhésion Subscriptions=Adhésions / cotisations SubscriptionLate=En retard SubscriptionNotReceived=Cotisation non reçue @@ -136,7 +143,7 @@ CardContent=Contenu de votre fiche adhérent # Text of email templates ThisIsContentOfYourMembershipRequestWasReceived=Nous vous informons que votre demande d'adhésion a bien été reçue.

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

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

    +ThisIsContentOfYourSubscriptionWasRecorded=Nous voulons vous informer que votre nouvelle cotisation a été enregistrée. Veuillez trouver votre facture ci-jointe.

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

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

    DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Sujet de l'email reçu en cas d'auto-inscription d'un invité @@ -199,14 +206,8 @@ NbOfSubscriptions=Nombre de cotisations AmountOfSubscriptions=Montant des cotisations TurnoverOrBudget=Chiffre affaire (pour société) ou Budget (asso ou collectivité) DefaultAmount=Montant par défaut de la cotisation -CanEditAmount=Le visiteur peut modifier / choisir le montant de sa cotisation quel que soit le type d'adhésion -AmountIsLowerToMinimumNotice=sur un dû total de %s -AnyAmountWithAdvisedAmount=Montant libre avec un montant recommandé de %s %s -AnyAmountWithoutAdvisedAmount=Montant libre -CanEditAmountShortForValues=conseillé, montant libre -MembershipDuration=Durée -GetMembershipButtonLabel=Adhérer -CanEditAmountShort=Montant libre +CanEditAmount=Le visiteur peut choisir/modifier le montant de sa contribution quel que soit le type d'adhérent +AmountIsLowerToMinimumNotice=Le montant est inférieur au montant minimum de %s MEMBER_NEWFORM_PAYONLINE=Rediriger sur la page intégrée de paiement en ligne ByProperties=Par nature MembersStatisticsByProperties=Statistiques des adhérents par nature diff --git a/htdocs/langs/fr_FR/modulebuilder.lang b/htdocs/langs/fr_FR/modulebuilder.lang index d29c9f2164b..2bd50f4225b 100644 --- a/htdocs/langs/fr_FR/modulebuilder.lang +++ b/htdocs/langs/fr_FR/modulebuilder.lang @@ -1,7 +1,8 @@ # Dolibarr language file - Source file is en_US - loan +IdModule= ID module ModuleBuilderDesc=Cet outil ne doit être utilisé que par des utilisateurs ou des développeurs expérimentés. Il fournit des utilitaires pour construire ou éditer votre propre module. La documentation pour le développement manuel alternatif est ici . EnterNameOfModuleDesc=Entrez le nom du module/application à créer sans espaces. Utilisez des majuscules pour séparer les mots (Par exemple: MyModule, EcommerceForShop, SyncWithMySystem...) -EnterNameOfObjectDesc=Entrez le nom de l'objet à créer sans espaces. Utilisez des majuscules pour séparer les mots (par exemple: MyObject, Student, Teacher...). Le fichier de classe CRUD, mais aussi le fichier d'API, les pages pour lister/ajouter/modifier/supprimer l'objet et les fichiers SQL seront générés. +EnterNameOfObjectDesc=Renseignez le nom de l'objet à créer, sans utiliser d'espace. Utilisez des majuscules pour séparer les termes (par exemple : MyObject, Student, Teacher...). Le fichier de classe CRUD, les pages pour lister/ajouter/modifier/supprimer l'objet et les fichiers SQL seront générés. EnterNameOfDictionaryDesc=Entrez le nom du dictionnaire à créer sans espaces. Utilisez des majuscules pour séparer les mots (Par exemple : MyDico...). Le fichier de classe, mais aussi le fichier SQL seront générés. ModuleBuilderDesc2=Chemin ou les modules sont générés/modifiés (premier répertoire pour les modules externes défini dans %s):%s ModuleBuilderDesc3=Modules générés/éditables trouvés : %s @@ -9,6 +10,7 @@ ModuleBuilderDesc4=Un module est détecté comme 'modifiable' quand le fichier < NewModule=Nouveau module NewObjectInModulebuilder=Nouvel objet NewDictionary=Nouveau dictionnaire +ModuleName=Nom du module ModuleKey=Clé du module ObjectKey=Clé de l'objet DicKey=Clé du dictionnaire @@ -48,6 +50,7 @@ PathToModulePackage=Chemin du zip du package du module/application PathToModuleDocumentation=Chemin d'accès au fichier de documentation du module (%s) SpaceOrSpecialCharAreNotAllowed=Les espaces et les caractères spéciaux ne sont pas autorisés. FileNotYetGenerated=Fichier non encore généré +GenerateCode=Générer le code RegenerateClassAndSql=Forcer la mise à jour des fichiers .class et .sql RegenerateMissingFiles=Générer les fichiers manquant SpecificationFile=Fichier de documentation @@ -86,10 +89,10 @@ ListOfMenusEntries=Liste des entrées du menu ListOfDictionariesEntries=Liste des entrées de dictionnaires ListOfPermissionsDefined=Liste des permissions SeeExamples=Voir des exemples ici -EnabledDesc=Condition pour que ce champ soit actif (Exemples: 1 ou $conf->global->MYMODULE_MYOPTION) -VisibleDesc=Le champ est-il visible ? (Exemples: 0 = Jamais visible, 1 = Visible sur les listes et formulaires de création/mise à jour/visualisation, 2 = Visible uniquement sur la liste, 3 = Visible uniquement sur le formulaire de création/mise à jour/affichage (pas les listes), 4=Visible sur les listes et formulaire de mise à jour et affichage uniquement (pas en création), 5=Visible sur les listes et formulaire en lecture (pas en création ni modification).

    Utiliser une valeur négative signifie que le champ n'est pas affiché par défaut sur la liste mais peut être sélectionné pour l'affichage).

    Il peut s'agir d'une expression, par exemple :
    preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
    ($user->rights->holiday->define_holiday ? 1 : 0) -DisplayOnPdfDesc=Afficher ce champ sur les documents PDF compatibles, vous pouvez gérer la position avec le champ "Position.
    Actuellement, les modèles compatibles PDF connus sont : eratostene (commande), espadon (expédition), sponge (factures), cyan (devis/propositions commerciales), cornas (commande fournisseur)

    Pour le document :
    0 = non affiché
    1 = affiché
    2 = affiché uniquement si non vide

    Pour les lignes de document :
    0 = non affiché
    1 = affiché dans une colonne
    3 = affiché dans la colonne description après la description
    4 = affiché dans la colonne description après la description uniquement si non vide -DisplayOnPdf=Afficher sur PDF +EnabledDesc=Condition pour que ce champs soit actif.

    Exemples:
    1
    isModEnabled('MAIN_MODULE_MYMODULE')
    getDolGlobalString('MYMODULE_OPTION')==2 +VisibleDesc=Le champ est-il visible ? (Exemples: 0=Jamais visible, 1=Visible sur les listes et formulaires de création/mise à jour/visualisation, 2=Visible uniquement sur les listes, 3=Visible uniquement sur le formulaire de création/mise à jour/affichage (pas les listes), 4=Visible sur les listes et formulaire de mise à jour et affichage uniquement (pas en création), 5=Visible sur les listes et formulaire en lecture (pas en création ni modification).

    Utiliser une valeur négative signifie que le champ n'est pas affiché par défaut sur la liste mais peut être sélectionné pour l'affichage).

    Il peut s'agir d'une expression, par exemple :
    preg_match('/public/', $_SERVER['PHP_SELF'])?0:1
    $user->hasRight('holiday', 'define_holiday')?1:5 +DisplayOnPdfDesc=Affichez ce champ sur les documents PDF compatibles, vous pouvez gérer la position avec le champ "Position".
    Pour le document :
    0 = non affiché
    1 = affiché
    2 = affiché uniquement si non vide

    Pour les lignes de document :
    0 = non affiché
    1 = affiché dans une colonne
    3 = affiché dans la colonne description après la description
    4 = affiché dans la colonne description après la description uniquement si non vide +DisplayOnPdf=Sur les PDF IsAMeasureDesc=Peut-on cumuler la valeur du champ pour obtenir un total dans les listes ? (Exemples: 1 ou 0) SearchAllDesc=Le champ doit-il être utilisé pour effectuer une recherche à partir de l'outil de recherche rapide ? (Exemples: 1 ou 0) SpecDefDesc=Entrez ici toute la documentation que vous souhaitez joindre au module et qui n'a pas encore été définis dans d'autres onglets. Vous pouvez utiliser .md ou, mieux, la syntaxe enrichie .asciidoc. @@ -105,7 +108,7 @@ TriggerDefDesc=Définissez dans le fichier trigger le code que vous souhaitez ex SeeIDsInUse=Voir les IDs utilisés dans votre installation SeeReservedIDsRangeHere=Voir la plage des ID réservés ToolkitForDevelopers=Boîte à outils pour développeurs Dolibarr -TryToUseTheModuleBuilder=Si vous connaissez SQL et PHP, vous pouvez utiliser l'assistant de création de module natif.
    Activez le module %s et utilisez l'assistant en cliquant sur la . dans le menu en haut à droite.
    Avertissement: Il s'agit d'une fonctionnalité avancée pour les développeurs. Ne pas expérimenter sur votre site de production! +TryToUseTheModuleBuilder=Si vous connaissez SQL et PHP, vous pouvez utiliser l'assistant de création de module natif.
    Activez le module %s et utilisez l'assistant en cliquant sur la dans le menu en haut à droite.
    Avertissement: Il s'agit d'une fonctionnalité avancée pour les développeurs. Ne pas expérimenter sur votre site de production! SeeTopRightMenu=Voir à droite de votre barre de menu principal AddLanguageFile=Ajouter le fichier de langue YouCanUseTranslationKey=Vous pouvez utiliser ici une clé qui est la clé de traduction trouvée dans le fichier de langue (voir l'onglet "Langues") @@ -132,9 +135,9 @@ UseSpecificAuthor = Utiliser un auteur spécifique UseSpecificVersion = Utiliser une version initiale spécifique IncludeRefGeneration=La référence de l'objet doit être générée automatiquement par des règles de numérotation personnalisées IncludeRefGenerationHelp=Cochez cette case si vous souhaitez inclure du code pour gérer automatiquement la génération de la référence à l'aide de règles de numérotation personnalisées -IncludeDocGeneration=Je souhaite générer des documents à partir de modèles pour l'objet +IncludeDocGeneration=Je souhaite la fonctionnalité pour générer des documents (PDF, ODT) à partir de modèles pour cet objet IncludeDocGenerationHelp=Si vous cochez cette case, du code sera généré pour ajouter une section "Générer un document" sur la fiche de l'objet. -ShowOnCombobox=Afficher la valeur dans la liste déroulante +ShowOnCombobox=Afficher la valeur dans les listes déroulantes KeyForTooltip=Clé pour l'info-bulle CSSClass=CSS pour le formulaire d'édition / création CSSViewClass=CSS pour le formulaire de lecture @@ -154,3 +157,6 @@ ListOfTabsEntries=Liste des entrées d'onglet TabsDefDesc=Définissez ici les onglets proposés par votre module TabsDefDescTooltip=Les onglets fournis par votre module/application sont définis dans le tableau $this->tabs dans le fichier descripteur de module. Vous pouvez modifier manuellement ce fichier ou utiliser l'éditeur intégré. BadValueForType=Mauvaise valeur pour le type %s +DefinePropertiesFromExistingTable=Définir des propriétés à partir d'une table existante +DefinePropertiesFromExistingTableDesc=Si une table dans la base de données (pour l'objet à créer) existe déjà, vous pouvez l'utiliser pour définir les propriétés de l'objet. +DefinePropertiesFromExistingTableDesc2=Laisser vide si la table n'existe pas encore. Le générateur de code utilisera différents types de champs pour créer un exemple de table que vous pourrez modifier ultérieurement. diff --git a/htdocs/langs/fr_FR/mrp.lang b/htdocs/langs/fr_FR/mrp.lang index b9730cdb7f8..3cab2476a09 100644 --- a/htdocs/langs/fr_FR/mrp.lang +++ b/htdocs/langs/fr_FR/mrp.lang @@ -82,9 +82,7 @@ ProductsToProduce=Produits à produire UnitCost=Coût unitaire TotalCost=Coût total BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) -BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travail est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" -BOMProductsList=Liste des composants -BOMServicesList=Liste des services +BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travail est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x poste de travail ahr", sinon "quantité (convertie en heures) x prix de revient de la prestation" GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. ErrorAVirtualProductCantBeUsedIntoABomOrMo=Un kit ne peut pas être utilisé dans une Nomenclature ou un Ordre de fabrication. Workstation=Poste de travail @@ -94,7 +92,6 @@ WorkstationSetup = Configuration du module Poste de travail WorkstationSetupPage = Configuration du module Poste de travail WorkstationList=Liste des postes de travail WorkstationCreate=Ajouter un nouveau poste de travail -DefaultWorkstation=Poste de travail par défaut ConfirmEnableWorkstation=Voulez-vous vraiment activer le poste de travail %s? EnableAWorkstation=Activer le module Poste de travail ConfirmDisableWorkstation=Voulez-vous vraiment désactiver la station de travail %s? @@ -113,7 +110,7 @@ THMEstimatedHelp=Ce taux permet de définir un coût prévisionnel de l'article BOM=Nomenclature CollapseBOMHelp=Vous pouvez définir l'affichage par défaut des détails de la nomenclature dans la configuration du module BOM MOAndLines=Ordres de fabrication et lignes -MoChildGenerate=Generate Child Mo -ParentMo=MO Parent -MOChild=MO Child -BomCantAddChildBom=La nomenclature %s est déjà présente dans l'arborescence qui mène à la nomenclature %s +MoChildGenerate=Générer OF enfant +ParentMo=OF parent +MOChild=OF Enfant +BomCantAddChildBom=La nomenclature %s est déjà présente dans l'arbre menant à la nomenclature %s diff --git a/htdocs/langs/fr_FR/oauth.lang b/htdocs/langs/fr_FR/oauth.lang index 95cb2958bcb..e884f616f39 100644 --- a/htdocs/langs/fr_FR/oauth.lang +++ b/htdocs/langs/fr_FR/oauth.lang @@ -9,8 +9,9 @@ HasAccessToken=Un jeton a été généré et sauvegardé dans la base de donnée NewTokenStored=Jeton reçu et sauvegardé ToCheckDeleteTokenOnProvider=Cliquer ici pour vérifier/effacer les autorisations sauvées par le fournisseur OAuth %s TokenDeleted=Jeton effacé +GetAccess=Cliquez ici pour obtenir un token RequestAccess=Cliquez ici pour demander/renouveler l'accès et recevoir un nouveau jeton -DeleteAccess=Cliquez ici pour effacer le jeton +DeleteAccess=Cliquez ici pour supprimer le jeton UseTheFollowingUrlAsRedirectURI=Utilisez l'URL suivante comme URI de redirection quand vous créez des identifiants d'accès chez votre fournisseur OAuth : ListOfSupportedOauthProviders=Ajoutez vos fournisseurs de jetons OAuth2. Ensuite, rendez-vous sur la page d'administration de votre fournisseur OAuth pour créer/obtenir un identifiant et un secret OAuth et enregistrez-les ici. Une fois cela fait, basculez sur l'autre onglet pour générer votre jeton. OAuthSetupForLogin=Page pour gérer (générer/supprimer) les jetons OAuth @@ -34,5 +35,6 @@ OAUTH_ID=ID OAuth OAUTH_SECRET=Code secret OAuth OAuthProviderAdded=Fournisseur OAuth ajouté AOAuthEntryForThisProviderAndLabelAlreadyHasAKey=Une entrée OAuth pour ce fournisseur et ce libellé existe déjà -ScopeUndefined=Permissions (Scopes) non définies (voir onglet précédent) -Scopes=Portées \ No newline at end of file +URLOfServiceForAuthorization=URL fournie par le service OAuth pour l'authentification +Scopes=Permissions ("Scopes" OAuth) +ScopeUndefined=Permissions (Cibles) non définies (voir onglet précédent) diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 7617085348e..6c714be2c4d 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -311,10 +311,10 @@ ExternalSiteURL=URL du site externe du contenu iFrame HTML ExternalSiteModuleNotComplete=La configuration du module "Site externe" est incomplète. ExampleMyMenuEntry=Mon entrée de menu -# FTP +# ftp FTPClientSetup=Connexion client FTP/FTPS NewFTPClient=Nouvelle connexion FTP/FTPS -FTPArea=Zone des connexions FTP/FTPS +FTPArea=Zone FTP/SFTP FTPAreaDesc=Vue d'un serveur FTP/FTPS SetupOfFTPClientModuleNotComplete=La configuration du client FTP/FTPS semble incomplète FTPFeatureNotSupportedByYourPHP=Votre version de PHP ne supporte pas les fonctions FTP/FTPS @@ -325,3 +325,9 @@ FTPFailedToRemoveDir=Échec suppression répertoire %s (Vérifiez les per FTPPassiveMode=Mode passif ChooseAFTPEntryIntoMenu=Sélection d'un site FTP/FTPS depuis le menu FailedToGetFile=Echec à la récupération du fichier %s +ErrorFTPNodisconnect=Erreur de déconnexion du serveur FTP/SFTP +FileWasUpload=Le fichier %s a été téléchargé +FTPFailedToUploadFile=Impossible de télécharger le fichier %s. +AddFolder=Créer un dossier +FileWasCreateFolder=Le dossier %s a été créé +FTPFailedToCreateFolder=Échec de la création du dossier %s. diff --git a/htdocs/langs/fr_FR/partnership.lang b/htdocs/langs/fr_FR/partnership.lang index 845bf4ff36c..41849e2812e 100644 --- a/htdocs/langs/fr_FR/partnership.lang +++ b/htdocs/langs/fr_FR/partnership.lang @@ -28,6 +28,7 @@ PartnershipCheckBacklink=Partenariat : Vérifiez le backlink référent # Menu # NewPartnership=Nouveau partenariat +NewPartnershipbyWeb= Votre partenariat a été ajouté avec succès. ListOfPartnerships=Listes des partenariats # @@ -42,6 +43,7 @@ PARTNERSHIP_BACKLINKS_TO_CHECK=Liens de retour à vérifier PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL=Nb de jours avant l'annulation de l'état d'un partenariat lorsque la cotisation a expiré ReferingWebsiteCheck=Vérification du site référent ReferingWebsiteCheckDesc=Vous pouvez activer une fonctionnalité pour vérifier que vos partenaires ont ajouté un rétrolien vers les domaines de votre site Web sur leur propre site Web. +PublicFormRegistrationPartnerDesc=Dolibarr peut vous fournir une URL/un site Web public pour permettre aux visiteurs externes de demander à faire partie du programme de partenariat. # # Object @@ -59,6 +61,12 @@ BacklinkNotFoundOnPartnerWebsite=Lien de retour non trouvé sur le site web part ConfirmClosePartnershipAsk=Êtes-vous sûr de vouloir annuler ce partenariat ? PartnershipType=Type de partenariat PartnershipRefApproved=Partenariat %s approuvé +KeywordToCheckInWebsite=Si vous souhaitez vérifier qu'un mot-clé donné est présent dans le site de chaque partenaire, définissez ce mot-clé ici +PartnershipDraft=Brouillon +PartnershipAccepted=Accepté +PartnershipRefused=Refusé +PartnershipCanceled=Annulé +PartnershipManagedFor=Les partenaires sont # # Template Mail @@ -82,11 +90,6 @@ CountLastUrlCheckError=Nombre d'erreurs lors de la dernière vérification d'URL LastCheckBacklink=Date de la dernière vérification d'URL ReasonDeclineOrCancel=Raison du refus -# -# Status -# -PartnershipDraft=Brouillon -PartnershipAccepted=Accepté -PartnershipRefused=Refusé -PartnershipCanceled=Annulé -PartnershipManagedFor=Les partenaires sont +NewPartnershipRequest=Nouvelle demande de partenariat +NewPartnershipRequestDesc=Ce formulaire vous permet de demander à faire partie de l'un de nos programmes de partenariat. Si vous avez besoin d'aide pour remplir ce formulaire, veuillez contacter par email %s . + diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang index 0fdb3e38d20..be600a2671b 100644 --- a/htdocs/langs/fr_FR/paypal.lang +++ b/htdocs/langs/fr_FR/paypal.lang @@ -34,3 +34,4 @@ ARollbackWasPerformedOnPostActions=Une annulation a été effectuée sur toutes ValidationOfPaymentFailed=La validation du paiement a échoué CardOwner=Titulaire de la carte PayPalBalance=Crédit Paypal +OnlineSubscriptionPaymentLine=Cotisation en ligne enregistrée sur %s
    Payé via %s
    Adresse IP d'origine : %s
    ID de transaction : %s diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang index 68b5e928084..8493e419384 100644 --- a/htdocs/langs/fr_FR/productbatch.lang +++ b/htdocs/langs/fr_FR/productbatch.lang @@ -1,8 +1,8 @@ # ProductBATCH language file - Source file is en_US - ProductBATCH ManageLotSerial=Utiliser les numéros de lots/série -ProductStatusOnBatch=Oui (Lot/Série requis) +ProductStatusOnBatch=Oui (lot/série requis) ProductStatusOnSerial=Oui (numéro de série unique requis) -ProductStatusNotOnBatch=Non (Lot/Série non utilisé) +ProductStatusNotOnBatch=Non (lot/série non utilisé) ProductStatusOnBatchShort=Lot ProductStatusOnSerialShort=Numéro Série ProductStatusNotOnBatchShort=Non @@ -17,6 +17,7 @@ printBatch=Lot/Série: %s printEatby=DMD/DLUO: %s printSellby=DLC: %s printQty=Qté: %d +printPlannedWarehouse=Entrepôt : %s AddDispatchBatchLine=Ajouter une ligne pour la répartition par durée de conservation WhenProductBatchModuleOnOptionAreForced=Quand le module Lot/Série est activé, le mode de décrémentation automatique des stocks est forcé sur 'Décrémenter les stocks réel sur validation d'expédition' et le mode d'incrémentation automatique de stocks est forcé sur 'Incrémenter les stocks réels sur ventilation manuels dans les entrepôts' et ne peut pas être édité. Les autres options peuvent être définies comme vous le voulez. ProductDoesNotUseBatchSerial=Ce produit n'utilise pas les numéros de lot/série @@ -43,4 +44,4 @@ HideLots=Masquer les lots OutOfOrder=Hors d'usage InWorkingOrder=En état de marche ToReplace=Remplacer -CantMoveNonExistantSerial=Erreur : Vous avez demandé un mouvement sur un numéro de série qui n’existe plus. Peut-être avez-vous requis le même numéro de série plusieurs fois dans une même expédition, ou il a déjà servi dans une autre expédition. Supprimez cette expédition et préparez-en une autre. +CantMoveNonExistantSerial=Erreur : un numéro de série sur lequel vous avez demandé un mouvement n'existe plus. Peut-être avez-vous utilisé plusieurs fois le même numéro de série depuis le même entrepôt sur la même expédition, ou peut-être était-il utilisé sur une autre expédition. Supprimez cette expédition et préparez-en une autre. diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 3e7eece5d0e..9061f0498fc 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -140,7 +140,7 @@ PriceQtyMin=Prix quantité min. PriceQtyMinCurrency=Prix (devise) pour cette quantité. WithoutDiscount=Sans remise VATRateForSupplierProduct=Taux TVA (pour ce produit/fournisseur) -DiscountQtyMin=Remise par défaut quantité min. +DiscountQtyMin=Remise pour cette qté. NoPriceDefinedForThisSupplier=Aucun prix/qté défini pour ce fournisseur/produit NoSupplierPriceDefinedForThisProduct=Aucun prix/qté fournisseur défini pour ce produit PredefinedItem=Article prédéfini @@ -345,7 +345,7 @@ PossibleValues=Valeurs possibles GoOnMenuToCreateVairants=Allez sur le menu %s - %s pour ajouter les attributs de variantes (comme les couleurs, tailles, ...) UseProductFournDesc=Ajouter une fonctionnalité pour définir la description produit définie par les vendeurs (pour chaque référence vendeur) en plus de la description pour les clients ProductSupplierDescription=Description du fournisseur du produit -UseProductSupplierPackaging=Utiliser le conditionnement/emballage sur les prix fournisseur (recalculer les quantités en fonction de l'emballage défini sur le prix fournisseur lors de l'ajout / mise à jour de la ligne dans les documents fournisseurs) +UseProductSupplierPackaging=Utiliser l'emballage pour les prix arrondis aux multiples pour les prix d'achat (recalculer les quantités en fonction des multiples définis sur les prix d'achat lors de l'ajout/de la mise à jour d'une ligne dans les documents d'un fournisseur) PackagingForThisProduct=Conditionnement PackagingForThisProductDesc=Vous achèterez automatiquement un multiple de cette quantité. QtyRecalculatedWithPackaging=La quantité de la ligne a été recalculée en fonction de l'emballage du fournisseur @@ -417,7 +417,6 @@ ErrorsProductsMerge=Erreur lors de la fusion des produits SwitchOnSaleStatus=Basculer le statut En vente SwitchOnPurchaseStatus=Basculer le statut En achat StockMouvementExtraFields= Champs supplémentaires (mouvement de stock) -OrProductsWithCategories=Ou produits avec tags/categories InventoryExtraFields= Attributs supplémentaires (inventaire) ScanOrTypeOrCopyPasteYourBarCodes=Scannez ou tapez ou copiez/collez vos codes-barres PuttingPricesUpToDate=Mise à jour des prix avec les prix connus actuels @@ -428,3 +427,4 @@ RealValuation=Valorisation réelle ConfirmEditExtrafield = Sélectionnez l'extrafield que vous souhaitez modifier ConfirmEditExtrafieldQuestion = Voulez-vous vraiment modifier cet extrafield ? ModifyValueExtrafields = Modifier la valeur d'un extrafield +OrProductsWithCategories=Ou des produits avec des tags/catégories diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index af97ce451bb..90fe82c2ffb 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -167,7 +167,7 @@ OpportunityAmount=Montant opportunité OpportunityAmountShort=Montant opportunité OpportunityWeightedAmount=Montant pondéré des opportunités OpportunityWeightedAmountShort=Montant pondéré opp. -OpportunityAmountAverageShort=montant moyen des opportunités +OpportunityAmountAverageShort=Montant moyen des opportunités OpportunityAmountWeigthedShort=Montant pondéré des opportunités WonLostExcluded=hors opportunités remportées/perdues ##### Types de contacts ##### @@ -259,7 +259,7 @@ TimeSpentInvoiced=Temps passé facturé TimeSpentForIntervention=Temps consommé TimeSpentForInvoice=Temps consommés OneLinePerUser=Une ligne par utilisateur -ServiceToUseOnLines=Service à utiliser sur les lignes +ServiceToUseOnLines=Service à utiliser sur les lignes par défaut InvoiceGeneratedFromTimeSpent=La facture %s a été générée à partir du temps passé sur le projet InterventionGeneratedFromTimeSpent=L'intervention %s a été générée à partir du temps consacré au projet ProjectBillTimeDescription=Cochez si vous saisissez du temps sur les tâches du projet ET prévoyez de générer des factures à partir des temps pour facturer le client du projet (ne cochez pas si vous comptez créer une facture qui n'est pas basée sur la saisie des temps). Note: Pour générer une facture, aller sur l'onglet 'Temps consommé' du project et sélectionnez les lignes à inclure. @@ -294,3 +294,4 @@ EnablePublicLeadForm=Activer le formulaire public de contact NewLeadbyWeb=Votre message ou votre demande a été enregistré. Nous vous répondrons ou vous contacterons bientôt. NewLeadForm=Nouveau formulaire de contact LeadFromPublicForm=Lead en ligne à partir d'un formulaire public +ExportAccountingReportButtonLabel=Obtenir un rapport diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index 4c44d0691c3..93bfd82a24e 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -47,7 +47,7 @@ SendPropalByMail=Envoyer proposition commerciale par email DatePropal=Date de proposition DateEndPropal=Date de fin de validité ValidityDuration=Durée de validité -SetAcceptedRefused=Accepter/Refuser +SetAcceptedRefused=Accepter/Refuser ErrorPropalNotFound=Propale %s inexistante AddToDraftProposals=Ajouter à proposition brouillon NoDraftProposals=Pas de propositions brouillons diff --git a/htdocs/langs/fr_FR/receiptprinter.lang b/htdocs/langs/fr_FR/receiptprinter.lang index 6c313e08dd8..6964eb61308 100644 --- a/htdocs/langs/fr_FR/receiptprinter.lang +++ b/htdocs/langs/fr_FR/receiptprinter.lang @@ -7,7 +7,7 @@ TestSentToPrinter=Test envoyé à l'imprimante %s ReceiptPrinter=Imprimantes Tickets ReceiptPrinterDesc=Réglage des imprimantes de tickets ReceiptPrinterTemplateDesc=Réglage des modèles -ReceiptPrinterTypeDesc=Description des types d'imprimantes de tickets +ReceiptPrinterTypeDesc=Exemple de valeurs possibles pour le champ "Paramètres" selon le type de driver ReceiptPrinterProfileDesc=Description des imprimantes de tickets ListPrinters=Liste des imprimantes SetupReceiptTemplate=Réglage des modèles @@ -54,7 +54,9 @@ DOL_DOUBLE_WIDTH=Double la taille en largeur DOL_DEFAULT_HEIGHT_WIDTH=Hauteur et largeur par défaut  DOL_UNDERLINE=Activer le souligné DOL_UNDERLINE_DISABLED=Désactiver le souligné -DOL_BEEP=Bruit de fond +DOL_BEEP=Notification sonore +DOL_BEEP_ALTERNATIVE=Bip sonore (mode alternatif) +DOL_PRINT_CURR_DATE=Imprimer la date/l'heure actuelle DOL_PRINT_TEXT=Imprimer le texte DateInvoiceWithTime=Date et heure de facturation YearInvoice=Année de facturation diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index 30ac8e985bc..5411fc7142f 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -48,7 +48,6 @@ ReceptionsNumberingModules=Module de numérotation pour les réceptions ReceptionsReceiptModel=Modèles de document pour les réceptions NoMorePredefinedProductToDispatch=Plus de produits prédéfinis à expédier ReceptionExist=Une réception existe -ByingPrice=Prix d'achat ReceptionBackToDraftInDolibarr=Réception %s retourné en brouillon ReceptionClassifyClosedInDolibarr=Reception %s classée Fermée ReceptionUnClassifyCloseddInDolibarr=Réception %s ré-ouverte diff --git a/htdocs/langs/fr_FR/recruitment.lang b/htdocs/langs/fr_FR/recruitment.lang index f2d8df78aa3..1525b06d5b3 100644 --- a/htdocs/langs/fr_FR/recruitment.lang +++ b/htdocs/langs/fr_FR/recruitment.lang @@ -57,8 +57,9 @@ EmailRecruiter=Email recruteur ToUseAGenericEmail=Pour utiliser un e-mail générique. S'il n'est pas défini, l'email du responsable du recrutement sera utilisé NewCandidature=Nouvelle candidature ListOfCandidatures=Liste des candidatures -RequestedRemuneration=Rémunération demandée -ProposedRemuneration=Rémunération proposée +Remuneration=Salaire +RequestedRemuneration=Salaire demandé +ProposedRemuneration=Salaire proposé ContractProposed=Contrat proposé ContractSigned=Contrat signé ContractRefused=Contrat refusé @@ -74,3 +75,5 @@ JobClosedTextCanceled=Le poste n'est plus ouvert. ExtrafieldsJobPosition=Attributs complémentaires (postes) ExtrafieldsApplication=Attributs complémentaires (candidature) MakeOffer=Faire un offre +WeAreRecruiting=Nous recrutons. Voici une liste de postes à pourvoir... +NoPositionOpen=Aucun poste ouvert pour le moment diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 2b3559787d3..a0d91884279 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -24,6 +24,7 @@ StockAtDateInFuture=Date dans le futur StocksByLotSerial=Stocks par lot/série LotSerial=Lots/séries LotSerialList=Liste des numéros de lots/séries +SubjectToLotSerialOnly=Produits soumis au lot/série uniquement Movements=Mouvements ErrorWarehouseRefRequired=Le nom de référence de l'entrepôt est obligatoire ListOfWarehouses=Liste des entrepôts @@ -234,7 +235,7 @@ StockIncrease=Augmentation du stock StockDecrease=Diminution du stock InventoryForASpecificWarehouse=Inventaire pour un entrepôt spécifique InventoryForASpecificProduct=Inventaire pour un produit spécifique -StockIsRequiredToChooseWhichLotToUse=Un stock existant est requis pour pouvoir choisir un lot +StockIsRequiredToChooseWhichLotToUse=Un stock existant est nécessaire pour pouvoir choisir le lot à utiliser ForceTo=Forcer à AlwaysShowFullArbo=Afficher l'arborescence complète de l'entrepôt sur la popup du lien entrepôt (Avertissement: cela peut réduire considérablement les performances) StockAtDatePastDesc=Vous pouvez voir ici le stock (stock réel) à une date donnée dans le passé diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index 0998191b0a2..f73df3434c9 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -4,6 +4,7 @@ SuppliersInvoice=Facture fournisseur SupplierInvoices=Factures fournisseur ShowSupplierInvoice=Montrer la facture fournisseur NewSupplier=Nouveau fournisseur +NewSupplierInvoice = Nouvelle facture du vendeur History=Historique ListOfSuppliers=Liste des fournisseurs ShowSupplier=Afficher fournisseur diff --git a/htdocs/langs/fr_FR/ticket.lang b/htdocs/langs/fr_FR/ticket.lang index 3f5be72e1d9..be78d74f2a8 100644 --- a/htdocs/langs/fr_FR/ticket.lang +++ b/htdocs/langs/fr_FR/ticket.lang @@ -149,6 +149,8 @@ TicketsAutoNotifyCloseHelp=Lors de la clôture d'un ticket, il vous sera propos TicketWrongContact=Le contact fourni ne fait pas partie des contacts actuels du ticket. E-mail non envoyé. TicketChooseProductCategory=Catégorie de produit pour les tickets TicketChooseProductCategoryHelp=Sélectionnez la catégorie de produit du support de ticket. Celui-ci sera utilisé pour lier automatiquement un contrat à un ticket. +TicketUseCaptchaCode=Utiliser le code graphique (CAPTCHA) lors de la création d'un ticket +TicketUseCaptchaCodeHelp=Ajoute la vérification CAPTCHA lors de la création d'un nouveau ticket. # # Index & list page @@ -204,8 +206,8 @@ TicketSeverity=Sévérité ShowTicket=Voir le ticket RelatedTickets=Tickets liés TicketAddIntervention=Créer intervention -CloseTicket=Fermer|Résoudre ticket -AbandonTicket=Abandonner le ticket +CloseTicket=Fermer|Résoudre +AbandonTicket=Abandonner CloseATicket=Fermer|Résoudre un ticket ConfirmCloseAticket=Confirmer la fermeture du ticket ConfirmAbandonTicket=Confirmez-vous la fermeture du ticket au statut 'Abandonné' @@ -219,18 +221,17 @@ SendMessageByEmail=Envoyer ce message par email TicketNewMessage=Nouveau message ErrorMailRecipientIsEmptyForSendTicketMessage=Le destinataire est vide. Aucun e-mail envoyé TicketGoIntoContactTab=Rendez-vous dans le tableau "Contacts" pour les sélectionner -TicketMessageMailIntro=Introduction +TicketMessageMailIntro=Entête de message TicketMessageMailIntroHelp=Ce texte est ajouté seulement au début de l'email et ne sera pas sauvegardé. -TicketMessageMailIntroLabelAdmin=Texte d'introduction à toutes les réponses aux tickets TicketMessageMailIntroText=Bonjour,
    Une nouvelle réponse a été ajoutée à un ticket que vous suivez. Voici le message :
    TicketMessageMailIntroHelpAdmin=Ce texte sera inséré avant la réponse lors d'une réponse à un ticket depuis Dolibarr -TicketMessageMailSignature=Signature -TicketMessageMailSignatureHelp=Ce texte est ajouté seulement à la fin de l'email et ne sera pas sauvegardé. -TicketMessageMailSignatureText=Message envoyé par %s via Dolibarr -TicketMessageMailSignatureLabelAdmin=Signature de l'email de réponse -TicketMessageMailSignatureHelpAdmin=Ce texte sera inséré après le message de réponse. +TicketMessageMailFooter=Pied de page des messages +TicketMessageMailFooterHelp=Ce texte est ajouté uniquement à la fin du message envoyé par e-mail et ne sera pas enregistré. +TicketMessageMailFooterText=Message envoyé par %s via Dolibarr +TicketMessageMailFooterHelpAdmin=Ce texte sera inséré après le message de réponse. TicketMessageHelp=Seul ce texte sera sauvegardé dans la liste des messages sur la fiche ticket. TicketMessageSubstitutionReplacedByGenericValues=Les variables de substitution sont remplacées par des valeurs génériques. +ForEmailMessageWillBeCompletedWith=Pour les e-mails envoyés à des utilisateurs externes, le message sera complété par TimeElapsedSince=Temps écoulé depuis TicketTimeToRead=Temps écoulé avant la lecture TicketTimeElapsedBeforeSince=Temps écoulé avant / depuis @@ -296,7 +297,7 @@ TicketNewEmailBodyInfosTrackUrlCustomer=Vous pouvez voir la progression du ticke TicketCloseEmailBodyInfosTrackUrlCustomer=Vous pouvez consulter l'historique de ce ticket en cliquant sur le lien suivant TicketEmailPleaseDoNotReplyToThisEmail=Merci de ne pas répondre directement à ce courriel ! Utilisez le lien pour répondre via l'interface. TicketPublicInfoCreateTicket=Ce formulaire vous permet d'enregistrer un ticket dans notre système de gestion. -TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire avec précision le problème. Fournissez le plus d'informations possibles pour nous permettre d'identifier correctement votre demande. +TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire précisément votre question. Fournissez le plus d'informations possible pour nous permettre d'identifier correctement votre demande. TicketPublicMsgViewLogIn=Merci d'entrer le code de suivi du ticket TicketTrackId=ID de suivi publique OneOfTicketTrackId=Un de vos ID de suivi diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang index 5888332a820..4840c05740a 100644 --- a/htdocs/langs/fr_FR/users.lang +++ b/htdocs/langs/fr_FR/users.lang @@ -68,7 +68,6 @@ CreateDolibarrLogin=Créer un compte utilisateur CreateDolibarrThirdParty=Créer un tiers LoginAccountDisableInDolibarr=Le compte est désactivé sur Dolibarr. UsePersonalValue=Utiliser valeur personnalisée -InternalUser=Utilisateur interne ExportDataset_user_1=Utilisateurs et attributs DomainUser=Utilisateur du domaine %s Reactivate=Réactiver diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 53e07d0dd2e..c46c3b33e37 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -1,5 +1,6 @@ # Dolibarr language file - Source file is en_US - website Shortname=Code +WebsiteName=Nom du site web WebsiteSetupDesc=Créez ici les sites Web que vous souhaitez utiliser. Ensuite, allez dans le menu Sites Web pour les éditer. DeleteWebsite=Effacer site web ConfirmDeleteWebsite=Êtes-vous sûr de vouloir supprimer ce site web. Toutes les pages et le contenu seront également supprimés. Les fichiers téléversés (comme ceux dans le répertoire medias, dans le module GED, ...) seront conservés. @@ -15,9 +16,9 @@ WEBSITE_HTML_HEADER=Ajout en bas de l'en-tête HTML (commun à toutes les pages) WEBSITE_ROBOT=Fichier robot (robots.txt) WEBSITE_HTACCESS=Fichier .htaccess du site web WEBSITE_MANIFEST_JSON=Fichier manifest.json de site Web -WEBSITE_README=Fichier README.md WEBSITE_KEYWORDSDesc=Utiliser une virgule pour séparer les valeurs -EnterHereLicenseInformation=Entrez ici les métadonnées ou les informations de licence pour créer un fichier README.md. Si vous distribuez votre site Web en tant que modèle, le fichier sera inclus dans le package. +EnterHereReadmeInformation=Entrez ici une description du site Web. Si vous distribuez votre site Web en tant que modèle, le fichier sera inclus dans le package de modèles. +EnterHereLicenseInformation=Entrez ici la LICENCE du code du site Web. Si vous distribuez votre site Web en tant que modèle, le fichier sera inclus dans le package de modèles. HtmlHeaderPage=En-tête HTML (spécifique pour la page uniquement) PageNameAliasHelp=Nom ou alias de la page.
    Cet alias est également utilisé pour forger une URL SEO lorsque le site Web est exécuté à partir d'un hôte virtuel d'un serveur Web (comme Apache, Nginx, ...). Utilisez le bouton "%s" pour modifier cet alias. EditTheWebSiteForACommonHeader=Remarque: Si vous souhaitez définir un en-tête personnalisé pour toutes les pages, modifiez l'en-tête au niveau du site plutôt qu'au niveau page/container. @@ -42,6 +43,8 @@ ViewPageInNewTab=Pré-visualiser la page dans un nouvel onglet SetAsHomePage=Définir comme page d'accueil RealURL=URL réelle ViewWebsiteInProduction=Pré-visualiser le site web en utilisant l'URL de la page d'accueil +Virtualhost=Hôte virtuel ou nom de domaine +VirtualhostDesc=Le nom de l'hôte virtuel ou du domaine (par exemple : www.mywebsite.com, mybigcompany.net, ...) SetHereVirtualHost= Utilisation avec Apache/NGinx/...
    Créez sur votre serveur Web (Apache, Nginx, ...) un hôte virtuel dédié avec PHP activé et un répertoire racine sur
    %s ExampleToUseInApacheVirtualHostConfig=Exemple à utiliser dans la configuration de l'hôte virtuel Apache: YouCanAlsoTestWithPHPS= Utilisation avec un serveur PHP incorporé
    Sous environnement de développement, vous pouvez préférer tester le site avec le serveur Web PHP intégré (PHP 5.5 requis) en exécutant
    php -S 0.0.0.0:8080 -t %s @@ -145,3 +148,6 @@ ImportFavicon=Favicon ErrorFaviconType=Le Favicon doit être en png ErrorFaviconSize=Le Favicon doit être de taille 16x16, 32x32 ou 64x64 FaviconTooltip=Téléverser une image qui doit être au format png (16x16, 32x32 ou 64x64) +NextContainer=Page/conteneur suivant(e) +PreviousContainer=Page/conteneur précédent(e) +WebsiteMustBeDisabled=Le site Web doit avoir le statut "désactivé" diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index f91ffbd55f3..8b6e6aa317e 100644 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -42,6 +42,7 @@ CreditTransferStatistics=Statistiques sur les virements Rejects=Rejets LastWithdrawalReceipt=Les %s derniers bons de prélèvements MakeWithdrawRequest=Faire une demande de prélèvement +MakeWithdrawRequestStripe=Faire une demande de paiement par prélèvement automatique via Stripe MakeBankTransferOrder=Faire une demande de virement WithdrawRequestsDone=%s demandes de prélèvements enregistrées BankTransferRequestsDone=%s demandes de prélèvements enregistrées @@ -100,8 +101,11 @@ CreditDate=Crédité le WithdrawalFileNotCapable=Impossible de générer le fichier de reçu des prélèvement pour votre pays %s (Votre pays n'est pas supporté) ShowWithdraw=Afficher ordre de prélèvement IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Toutefois, si la facture a au moins une demande de prélèvement non traité, elle ne sera pas classée payée afin de permettre le prélèvement d'abord. -DoStandingOrdersBeforePayments=Cet onglet vous permet de demander un prélèvement. Une fois la demande faite, allez dans le menu Banque->Paiement par prélèvement pour générer l'ordre de prélèvement. Lorsque l'ordre de paiement est clos, le paiement sur les factures seront automatiquement enregistrés, et les factures fermées si le reste à payer est nul. -DoCreditTransferBeforePayments=Cet onglet vous permet de demander un ordre de virement. Une fois fait, allez dans le menu Banque ->Paiements par virement pour gérer l'ordre de virement. Lorsque le virement est clôturé, le paiement des factures fournisseurs sera automatiquement enregistré et les factures clôturées si le solde à payer est nul. +DoStandingOrdersBeforePayments=Cet onglet vous permet de demander un ordre de prélèvement automatique. Une fois cela fait, vous pouvez vous rendre dans le menu "Banque->Paiement par prélèvement" pour générer et gérer un fichier d'ordre de prélèvement. +DoStandingOrdersBeforePayments2=Vous pouvez également envoyer une demande directement à un processeur de paiement SEPA comme Stripe, ... +DoStandingOrdersBeforePayments3=Lors de la clôture d'un ordre de prélèvement, le règlement des factures sera automatiquement enregistré, et les factures clôturées si le reste à payer est nul. +DoCreditTransferBeforePayments=Cet onglet vous permet de demander un ordre de virement. Une fois cela fait, allez dans le menu "Banque->Paiement par virement" pour générer et gérer un fichier d'ordre de virement. +DoCreditTransferBeforePayments3=A la clôture de l'ordre de virement, le règlement des factures sera automatiquement enregistré, et les factures clôturées si le reste à payer est nul. WithdrawalFile=Fichier de prélèvement CreditTransferFile=Fichier de virement SetToStatusSent=Mettre au statut "Fichier envoyé" @@ -118,7 +122,7 @@ WithdrawRequestErrorNilAmount=Impossible de créer une demande de prélèvement SepaMandate=Mandat prélèvement SEPA SepaMandateShort=Mandat SEPA PleaseReturnMandate=Merci de retourner ce formulaire mandat par email à %s ou par courrier à -SEPALegalText=En signant ce formulaire de mandat, vous autorisez (A) %s à envoyer des instructions à votre banque pour débiter votre compte et (B) votre banque à débiter votre compte conformément aux instructions de %s. Dans le cadre de vos droits, vous avez droit à un remboursement de votre banque selon les termes et conditions de votre accord avec votre banque. Vos droits concernant le mandat ci-dessus sont expliqués dans une déclaration que vous pouvez obtenir auprès de votre banque. +SEPALegalText=En signant ce formulaire de mandat, vous autorisez (A) %s et son prestataire de services de paiement à envoyer des instructions à votre banque pour débiter votre compte et (B) votre banque à débiter votre compte conformément aux instructions de %s. Dans le cadre de vos droits, vous avez droit à un remboursement de votre banque selon les termes et conditions de votre accord avec votre banque. Vos droits concernant le mandat ci-dessus sont expliqués dans une déclaration que vous pouvez obtenir auprès de votre banque. CreditorIdentifier=Identifiant créditeur CreditorName=Nom du créditeur SEPAFillForm=(B) Remplir tous les champs marqués * @@ -137,7 +141,7 @@ SEPAFRST=SEPA FRST ExecutionDate=Date d'éxecution CreateForSepa=Créer fichier de prélèvement automatique ICS=Identifiant du créancier - ICS -IDS=Debitor Identifier +IDS=Identifiant débiteur END_TO_END=Balise XML SEPA "EndToEndId" - Identifiant unique attribué par transaction USTRD=Balise XML SEPA "Non structurée" ADDDAYS=Ajouter des jours à la date d'exécution @@ -156,4 +160,4 @@ ErrorICSmissing=ICS manquant pour le compte bancaire %s TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Le montant total de l'ordre de prélèvement diffère de la somme des lignes WarningSomeDirectDebitOrdersAlreadyExists=Attention : Il y a déjà des ordres de prélèvement automatique en attente (%s) demandés pour un montant de %s WarningSomeCreditTransferAlreadyExists=Attention : Il y a déjà des virements en attente (%s) demandés pour un montant de %s -UsedFor=Used for %s +UsedFor=Utilisé pour %s diff --git a/htdocs/langs/it_CH/accountancy.lang b/htdocs/langs/it_CH/accountancy.lang deleted file mode 100644 index 44c4229cd8b..00000000000 --- a/htdocs/langs/it_CH/accountancy.lang +++ /dev/null @@ -1,3 +0,0 @@ -# Dolibarr language file - Source file is en_US - accountancy -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
    The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index 29adcec7d4d..96a2c46c4ed 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -192,7 +192,6 @@ LibraryToBuildPDF=Bibliotheek om PDF bestanden te genereren. RefreshPhoneLink=Herladen link SetAsDefault=Instellen als standaard BarcodeInitForProductsOrServices=Mass barcode init of reset voor producten of diensten -InitEmptyBarCode=Init value for the %s empty barcodes NoDetails=Geen aanvullende details in voettekst DisplayCompanyInfo=Bedrijfsadres weergeven DisplayCompanyManagers=Namen van beheerders weergeven diff --git a/htdocs/langs/nl_BE/commercial.lang b/htdocs/langs/nl_BE/commercial.lang index d949aad6bac..fae3f5e6ae7 100644 --- a/htdocs/langs/nl_BE/commercial.lang +++ b/htdocs/langs/nl_BE/commercial.lang @@ -11,8 +11,5 @@ ActionAC_COM=Verzend verkooporder per mail ActionAC_SUP_ORD=Verzend bestelling per mail ActionAC_SUP_INV=Stuur leveranciersfactuur per mail ToOfferALinkForOnlineSignature=Link voor online handtekening -WelcomeOnOnlineSignaturePage=Welkom op deze pagina om commerciële voorstellen van %s te accepteren -ThisScreenAllowsYouToSignDocFrom=Met dit scherm kunt u een offerte / commercieel voorstel accepteren en ondertekenen of weigeren -ThisIsInformationOnDocumentToSign=In dit document is informatie om te accepteren of te weigeren SignatureProposalRef=Handtekening van offerte / commercieel voorstel %s FeatureOnlineSignDisabled=Functie voor online ondertekenen uitgeschakeld of het document is gegenereerd voordat de functie was ingeschakeld diff --git a/htdocs/langs/nl_BE/ticket.lang b/htdocs/langs/nl_BE/ticket.lang index 37e0550685c..30a0241a7d4 100644 --- a/htdocs/langs/nl_BE/ticket.lang +++ b/htdocs/langs/nl_BE/ticket.lang @@ -67,7 +67,6 @@ SendMessageByEmail=Stuur bericht per e-mail ErrorMailRecipientIsEmptyForSendTicketMessage=Ontvanger is leeg. Geen e-mail verzonden TicketMessageMailIntro=Inleiding TicketMessageMailIntroHelp=Deze tekst wordt alleen aan het begin van de e-mail toegevoegd en wordt niet opgeslagen. -TicketMessageMailSignatureLabelAdmin=Handtekening van reactie-e-mail TicketMessageHelp=Alleen deze tekst wordt opgeslagen in de berichtenlijst van het ticket. TicketMessageSubstitutionReplacedByGenericValues=Vervangingenvariabelen worden vervangen door generieke waarden. TimeElapsedSince=tijd verstreken sinds diff --git a/htdocs/langs/pt_AO/projects.lang b/htdocs/langs/pt_AO/projects.lang deleted file mode 100644 index f5f817beac1..00000000000 --- a/htdocs/langs/pt_AO/projects.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - projects -ServiceToUseOnLines=Service to use on lines by default diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index d2ab3e033a9..80684c463d4 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -47,8 +47,6 @@ ClientSortingCharset=Conferência de Clientes WarningModuleNotActive=Módulo %s deve ser Ativado! WarningOnlyPermissionOfActivatedModules=Somente as permissões relacionadas com os módulos ativados que aparecem aqui. DolibarrSetup=Instalação/Atualização do Dolibarr -InternalUser=Usuário Interno -ExternalUser=Usuário Externo InternalUsers=Usuários Internos ExternalUsers=Usuários Externos UploadNewTemplate=Carregar novo(s) tema(s) @@ -652,7 +650,6 @@ Permission283=Deletar Contatos Permission286=Exportar Contatos Permission291=Ler Tarifas Permission292=Definir Permissões das Tarifas -Permission300=Ler códigos de barras Permission301=Criar/modificar códigos de barras Permission311=Ler Serviços Permission312=Atribuir Serviço no Contrato diff --git a/htdocs/langs/pt_BR/commercial.lang b/htdocs/langs/pt_BR/commercial.lang index a70dde7954c..d7296bed8f8 100644 --- a/htdocs/langs/pt_BR/commercial.lang +++ b/htdocs/langs/pt_BR/commercial.lang @@ -54,7 +54,5 @@ Stats=Estatísticas de vendas StatusProsp=Status de prospecto de cliente DraftPropals=Minutas de orçamentos ToOfferALinkForOnlineSignature=Link para assinatura on-line -WelcomeOnOnlineSignaturePage=Bem-vindo à página para aceitar propostas comerciais de %s -ThisScreenAllowsYouToSignDocFrom=Esta tela permite que você aceite e assine ou recuse um orçamento / proposta comercial SignatureProposalRef=Assinatura da cotação / proposta comercial %s FeatureOnlineSignDisabled=Recurso para assinatura online desabilitado ou documento gerado antes que o recurso fosse ativado diff --git a/htdocs/langs/pt_BR/errors.lang b/htdocs/langs/pt_BR/errors.lang index 03f3d75a362..517027dde8c 100644 --- a/htdocs/langs/pt_BR/errors.lang +++ b/htdocs/langs/pt_BR/errors.lang @@ -64,7 +64,6 @@ ErrorFieldValueNotIn=Campo %s : '%s' não é um valor encontrado n ErrorFieldRefNotIn=Campo %s : '%s' não é uma referência existente %s ErrorsOnXLines=%s erros encontrados ErrorFileIsInfectedWithAVirus=O antivírus não foi capaz de atestar o arquivo (o arquivo pode estar infectado por um vírus) -ErrorSpecialCharNotAllowedForField=O campo "%s" não aceita caracteres especiais ErrorNumRefModel=Uma referência existe no banco de dados (% s) e não é compatível com esta regra de numeração. Remover registro ou referência renomeado para ativar este módulo. ErrorQtyTooLowForThisSupplier=Quantidade muito baixa para este fornecedor ou nenhum preço definido neste produto para este fornecedor ErrorOrdersNotCreatedQtyTooLow=Algumas encomendas não foram criadas por causa de quantidades muito baixas diff --git a/htdocs/langs/pt_BR/mailmanspip.lang b/htdocs/langs/pt_BR/mailmanspip.lang index bbea232c4ef..9e0a707c3eb 100644 --- a/htdocs/langs/pt_BR/mailmanspip.lang +++ b/htdocs/langs/pt_BR/mailmanspip.lang @@ -7,7 +7,6 @@ MailmanCreationSuccess=O teste da assinatura foi realizado com sucesso MailmanDeletionSuccess=O teste de cancelamento da assinatura foi realizado com sucesso SynchroMailManEnabled=O Mailman sera atualizado SynchroSpipEnabled=O SPIP sera atualizado -DescADHERENT_MAILMAN_ADMINPW=Senha do administrador Mailman DescADHERENT_MAILMAN_URL=URL para inscriçoes Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para desenscriçoes Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para inscriçao automatica de novos membros (separado por virgula) diff --git a/htdocs/langs/pt_BR/ticket.lang b/htdocs/langs/pt_BR/ticket.lang index 2a751f5516a..df070b1eced 100644 --- a/htdocs/langs/pt_BR/ticket.lang +++ b/htdocs/langs/pt_BR/ticket.lang @@ -97,8 +97,6 @@ TicketUpdated=Bilhete atualizado SendMessageByEmail=Enviar mensagem por e-mail ErrorMailRecipientIsEmptyForSendTicketMessage=O destinatário está vazio. Nenhum e-mail enviado TicketMessageMailIntroHelp=Este texto é adicionado apenas no início do e-mail e não será salvo. -TicketMessageMailSignatureHelp=Este texto é adicionado somente no final do e-mail e não será salvo. -TicketMessageMailSignatureLabelAdmin=Assinatura do e-mail de resposta TicketTimeElapsedBeforeSince=Tempo decorrido antes / desde TicketContacts=Bilhete de contatos TicketDocumentsLinked=Documentos vinculados ao ticket diff --git a/htdocs/langs/pt_BR/website.lang b/htdocs/langs/pt_BR/website.lang index a5781ea5a75..e2afc369eb2 100644 --- a/htdocs/langs/pt_BR/website.lang +++ b/htdocs/langs/pt_BR/website.lang @@ -9,7 +9,6 @@ WEBSITE_CSS_URL=URL do arquivo CSS externo. WEBSITE_HTML_HEADER=Adição na parte inferior do cabeçalho HTML (comum a todas as páginas) WEBSITE_ROBOT=Arquivo robô (robots.txt) WEBSITE_MANIFEST_JSON=Arquivo manifest.json do site -WEBSITE_README=Arquivo README.md EnterHereLicenseInformation=Digite aqui metadados ou informações de licença para arquivar num arquivo README.md. Se você distribuir seu site como modelo, o arquivo será incluído no pacote tentado. HtmlHeaderPage=Cabeçalho HTML (específico apenas para esta página) PageNameAliasHelp=Nome ou alias da página.
    Esse alias também é usado para forjar uma URL de SEO quando o site é executado a partir de um host virtual de um servidor da Web (como Apacke, Nginx, ...). Use o botão %s para editar este alias. diff --git a/htdocs/langs/pt_MZ/accountancy.lang b/htdocs/langs/pt_MZ/accountancy.lang index 90584e4bd28..b99e895d7c0 100644 --- a/htdocs/langs/pt_MZ/accountancy.lang +++ b/htdocs/langs/pt_MZ/accountancy.lang @@ -27,7 +27,6 @@ ConfirmDeleteCptCategory=Tem certeza de que deseja remover essa conta contábil JournalizationInLedgerStatus=Situação do registro do diário GroupIsEmptyCheckSetup=O grupo está vazio, verifique a configuração do grupo de contabilidade personalizado AccountantFiles=Exportar documentos de origem -ExportAccountingSourceDocHelp=With this tool, you can search and export the source events that are used to generate your accountancy.
    The exported ZIP file will contain the lists of requested items in CSV, as well as their attached files in their original format (PDF, ODT, DOCX...). VueByAccountAccounting=Ver por conta contábil MainAccountForCustomersNotDefined=Conta contábil principal para clientes não definidos na configuração MainAccountForUsersNotDefined=Conta contábil principal para usuários não definidos na configuração @@ -185,7 +184,6 @@ AccountingJournalType9=Novo ErrorAccountingJournalIsAlreadyUse=Esta Livro de Registro já está sendo usado NumberOfAccountancyEntries=Número de entradas NumberOfAccountancyMovements=Número de movimentos -NotifiedValidationDate=Validate and Lock the exported entries (same effect than the "%s" feature, modification and deletion of the lines will DEFINITELY not be possible) ExportDraftJournal=Livro de Registro de rascunho de exportação Selectmodelcsv=Escolha um modelo de exportação Modelcsv_CEGID=Exportar para CEGID Expert Comptable diff --git a/htdocs/langs/pt_MZ/admin.lang b/htdocs/langs/pt_MZ/admin.lang index e805a0c6120..f499ad97ebf 100644 --- a/htdocs/langs/pt_MZ/admin.lang +++ b/htdocs/langs/pt_MZ/admin.lang @@ -47,8 +47,6 @@ ClientSortingCharset=Conferência de Clientes WarningModuleNotActive=Módulo %s deve ser Ativado! WarningOnlyPermissionOfActivatedModules=Somente as permissões relacionadas com os módulos ativados que aparecem aqui. DolibarrSetup=Instalação/Atualização do Dolibarr -InternalUser=Usuário Interno -ExternalUser=Usuário Externo InternalUsers=Usuários Internos ExternalUsers=Usuários Externos SetupArea=Conf. @@ -647,7 +645,6 @@ Permission283=Deletar Contatos Permission286=Exportar Contatos Permission291=Ler Tarifas Permission292=Definir Permissões das Tarifas -Permission300=Ler códigos de barras Permission301=Criar/modificar códigos de barras Permission311=Ler Serviços Permission312=Atribuir Serviço no Contrato diff --git a/htdocs/langs/pt_MZ/commercial.lang b/htdocs/langs/pt_MZ/commercial.lang index 493791da89d..4e15f6d6895 100644 --- a/htdocs/langs/pt_MZ/commercial.lang +++ b/htdocs/langs/pt_MZ/commercial.lang @@ -56,7 +56,5 @@ Stats=Estatísticas de vendas StatusProsp=Status de prospecto de cliente DraftPropals=Minutas de orçamentos ToOfferALinkForOnlineSignature=Link para assinatura on-line -WelcomeOnOnlineSignaturePage=Bem-vindo à página para aceitar propostas comerciais de %s -ThisScreenAllowsYouToSignDocFrom=Esta tela permite que você aceite e assine ou recuse um orçamento / proposta comercial SignatureProposalRef=Assinatura da cotação / proposta comercial %s FeatureOnlineSignDisabled=Recurso para assinatura online desabilitado ou documento gerado antes que o recurso fosse ativado diff --git a/htdocs/langs/pt_MZ/errors.lang b/htdocs/langs/pt_MZ/errors.lang index 03f3d75a362..517027dde8c 100644 --- a/htdocs/langs/pt_MZ/errors.lang +++ b/htdocs/langs/pt_MZ/errors.lang @@ -64,7 +64,6 @@ ErrorFieldValueNotIn=Campo %s : '%s' não é um valor encontrado n ErrorFieldRefNotIn=Campo %s : '%s' não é uma referência existente %s ErrorsOnXLines=%s erros encontrados ErrorFileIsInfectedWithAVirus=O antivírus não foi capaz de atestar o arquivo (o arquivo pode estar infectado por um vírus) -ErrorSpecialCharNotAllowedForField=O campo "%s" não aceita caracteres especiais ErrorNumRefModel=Uma referência existe no banco de dados (% s) e não é compatível com esta regra de numeração. Remover registro ou referência renomeado para ativar este módulo. ErrorQtyTooLowForThisSupplier=Quantidade muito baixa para este fornecedor ou nenhum preço definido neste produto para este fornecedor ErrorOrdersNotCreatedQtyTooLow=Algumas encomendas não foram criadas por causa de quantidades muito baixas diff --git a/htdocs/langs/pt_MZ/mailmanspip.lang b/htdocs/langs/pt_MZ/mailmanspip.lang index bbea232c4ef..9e0a707c3eb 100644 --- a/htdocs/langs/pt_MZ/mailmanspip.lang +++ b/htdocs/langs/pt_MZ/mailmanspip.lang @@ -7,7 +7,6 @@ MailmanCreationSuccess=O teste da assinatura foi realizado com sucesso MailmanDeletionSuccess=O teste de cancelamento da assinatura foi realizado com sucesso SynchroMailManEnabled=O Mailman sera atualizado SynchroSpipEnabled=O SPIP sera atualizado -DescADHERENT_MAILMAN_ADMINPW=Senha do administrador Mailman DescADHERENT_MAILMAN_URL=URL para inscriçoes Mailman DescADHERENT_MAILMAN_UNSUB_URL=URL para desenscriçoes Mailman DescADHERENT_MAILMAN_LISTS=Lista(s) para inscriçao automatica de novos membros (separado por virgula) diff --git a/htdocs/langs/pt_MZ/projects.lang b/htdocs/langs/pt_MZ/projects.lang index 8d0c1cedae8..065ddf804d6 100644 --- a/htdocs/langs/pt_MZ/projects.lang +++ b/htdocs/langs/pt_MZ/projects.lang @@ -6,6 +6,5 @@ LinkToElementShort=Link para ProjectReferers=Itens correlatos OppStatusPROPO=Proposta OppStatusPENDING=Pedente -ServiceToUseOnLines=Service to use on lines by default NewInter=Nova Intervenção StartDateCannotBeAfterEndDate=A data final não pode ser anterior a data de início diff --git a/htdocs/langs/pt_MZ/website.lang b/htdocs/langs/pt_MZ/website.lang index a5781ea5a75..e2afc369eb2 100644 --- a/htdocs/langs/pt_MZ/website.lang +++ b/htdocs/langs/pt_MZ/website.lang @@ -9,7 +9,6 @@ WEBSITE_CSS_URL=URL do arquivo CSS externo. WEBSITE_HTML_HEADER=Adição na parte inferior do cabeçalho HTML (comum a todas as páginas) WEBSITE_ROBOT=Arquivo robô (robots.txt) WEBSITE_MANIFEST_JSON=Arquivo manifest.json do site -WEBSITE_README=Arquivo README.md EnterHereLicenseInformation=Digite aqui metadados ou informações de licença para arquivar num arquivo README.md. Se você distribuir seu site como modelo, o arquivo será incluído no pacote tentado. HtmlHeaderPage=Cabeçalho HTML (específico apenas para esta página) PageNameAliasHelp=Nome ou alias da página.
    Esse alias também é usado para forjar uma URL de SEO quando o site é executado a partir de um host virtual de um servidor da Web (como Apacke, Nginx, ...). Use o botão %s para editar este alias. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index eebf96a6040..32d442008eb 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -518,7 +518,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt( $sensitiveget = false; if ((GETPOSTISSET('massaction') || GETPOST('action', 'aZ09')) && getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 3) { // All GET actions and mass actions are processed as sensitive. - if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude the case action='create' and action='file_manager' that are legitimate + if (GETPOSTISSET('massaction') || !in_array(GETPOST('action', 'aZ09'), array('create', 'createsite', 'createcard', 'edit', 'editvalidator', 'file_manager', 'presend', 'presend_addmessage', 'preview', 'specimen'))) { // We exclude the case action='create' and action='file_manager' that are legitimate $sensitiveget = true; } } elseif (getDolGlobalInt('MAIN_SECURITY_CSRF_WITH_TOKEN') >= 2) { @@ -1207,14 +1207,22 @@ if (GETPOST('dol_no_mouse_hover', 'int') || !empty($_SESSION['dol_no_mouse_hover if (GETPOST('dol_use_jmobile', 'int') || !empty($_SESSION['dol_use_jmobile'])) { $conf->dol_use_jmobile = 1; } +// If not on Desktop if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') { $conf->dol_no_mouse_hover = 1; } + +// If on smartphone or optmized for small screen if ((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') || (!empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) - || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400) + || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400 + || !empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) ) { $conf->dol_optimize_smallscreen = 1; + + if (isset($conf->global->PRODUIT_DESC_IN_FORM) && $conf->global->PRODUIT_DESC_IN_FORM == 1) { + $conf->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = 0; + } } // Replace themes bugged with jmobile with eldy if (!empty($conf->dol_use_jmobile) && in_array($conf->theme, array('bureau2crea', 'cameleo', 'amarok'))) { @@ -2469,7 +2477,7 @@ function printDropdownQuickadd() "title" => "NewPropal@propal", "name" => "Proposal@propal", "picto" => "object_propal", - "activation" => isModEnabled("propal") && $user->hasRight("propale", "write"), // vs hooking + "activation" => isModEnabled("propal") && $user->hasRight("propal", "write"), // vs hooking "position" => 30, ), diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 50c86e38cc0..4c7e597e889 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -132,21 +132,23 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { } } print ''; +} - print ''; - print ''.$langs->trans("UseSpecificEditorName").''; - print ''; - print ''; - print ''; - print ''; +print ''; +print ''.$langs->trans("UseSpecificEditorName").''; +print ''; +print ''; +print ''; +print ''; - print ''; - print ''.$langs->trans("UseSpecificEditorURL").''; - print ''; - print ''; - print ''; - print ''; +print ''; +print ''.$langs->trans("UseSpecificEditorURL").''; +print ''; +print ''; +print ''; +print ''; +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print ''; print ''.$langs->trans("UseSpecificFamily").''; print ''; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 1c30d709576..705dc202932 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1771,7 +1771,7 @@ if ($dirins && $action == 'generatepackage') { $arrayversion = explode('.', $moduleobj->version, 3); if (count($arrayversion)) { - $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip'; + $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).(empty($arrayversion[2]) ? '' : '.'.$arrayversion[2]).'.zip'; $dirofmodule = dol_buildpath($modulelowercase, 0).'/bin'; $outputfilezip = $dirofmodule.'/'.$FILENAMEZIP; @@ -1780,7 +1780,7 @@ if ($dirins && $action == 'generatepackage') { dol_mkdir($dirofmodule); } // Note: We exclude /bin/ to not include the already generated zip - $result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\//', $modulelowercase); + $result = dol_compress_dir($dir, $outputfilezip, 'zip', '/\/bin\/|\.git/', $modulelowercase); } else { $result = -1; } @@ -2161,25 +2161,30 @@ if ($module == 'initmodule') { print '
    '; print ''.$langs->trans("Version").''; print '
    '; - print ''; + print ''; print '
    '; print '
    '; print ''.$langs->trans("Family").''; print '
    '; print ''; print ajax_combobox("family"); print '
    '; @@ -2187,20 +2192,20 @@ if ($module == 'initmodule') { print '
    '; print ''.$langs->trans("Picto").''; print '
    '; - print ''; + print ''; print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.
    Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]'); print '
    '; print '
    '; print ''.$langs->trans("EditorName").''; print '
    '; - print '
    '; + print '
    '; print '
    '; print '
    '; print ''.$langs->trans("EditorUrl").''; print '
    '; - print '
    '; + print '
    '; print '
    '; print '
    '; @@ -2337,15 +2342,15 @@ if ($module == 'initmodule') { print ''; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ' '.$langs->trans("ReadmeFile").' : '.$pathtofilereadme.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ' '.$langs->trans("ChangeLog").' : '.$pathtochangelog.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print ''; print ''; @@ -2416,7 +2421,7 @@ if ($module == 'initmodule') { print $langs->trans("EditorUrl"); print ''; if (!empty($moduleobj->editor_url)) { - print ''.$moduleobj->editor_url.' '.img_picto('', 'globe').''; + print ''.$moduleobj->editor_url.' '.img_picto('', 'globe').''; } print ''; @@ -2527,8 +2532,8 @@ if ($module == 'initmodule') { $pathtofile = 'langs/'.$langfile['relativename']; } print ' '.$langs->trans("LanguageFile").' '.basename(dirname($pathtofile)).' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } print ''; @@ -2810,12 +2815,12 @@ if ($module == 'initmodule') { print '
    '; // Main DAO class file print ' '.$langs->trans("ClassFile").' : '.(dol_is_file($realpathtoclass) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).(dol_is_file($realpathtoclass) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; // Image if (dol_is_file($realpathtopicto)) { print ' '.$langs->trans("Image").' : '.(dol_is_file($realpathtopicto) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '').''; - //print ' '.img_picto($langs->trans("Edit"), 'edit').''; + //print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; } elseif (!empty($tmpobject)) { print ' '.$langs->trans("Image").' : '.img_picto('', $tmpobject->picto, 'class="pictofixedwidth"'); @@ -2826,9 +2831,9 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("ApiClassFile").' : '.(dol_is_file($realpathtoapi) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'').''; if (dol_is_file($realpathtoapi)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; if (empty($conf->global->$const_name)) { // If module is not activated print ''.$langs->trans("GoToApiExplorer").''; @@ -2836,107 +2841,107 @@ if ($module == 'initmodule') { print ''.$langs->trans("GoToApiExplorer").''; } } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } // PHPUnit print '
    '; print ' '.$langs->trans("TestClassFile").' : '.(dol_is_file($realpathtophpunit) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit)?'':'').''; if (dol_is_file($realpathtophpunit)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; print '
    '; print ' '.$langs->trans("PageForLib").' : '.(dol_is_file($realpathtolib) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolib).(dol_is_file($realpathtolib) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("PageForObjLib").' : '.(dol_is_file($realpathtoobjlib) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoobjlib).(dol_is_file($realpathtoobjlib) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; print ' '.$langs->trans("SqlFile").' : '.(dol_is_file($realpathtosql) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosql).(dol_is_file($realpathtosql) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '   '.$langs->trans("DropTableIfEmpty").''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '   '.$langs->trans("DropTableIfEmpty").''; //print '   '.$langs->trans("RunSql").''; print '
    '; print ' '.$langs->trans("SqlFileKey").' : '.(dol_is_file($realpathtosqlkey) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlkey).(dol_is_file($realpathtosqlkey) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; //print '   '.$langs->trans("RunSql").''; print '
    '; print ' '.$langs->trans("SqlFileExtraFields").' : '.(dol_is_file($realpathtosqlextra) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlextra).(dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey) ? '' : '').''; if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print '   '; - print ''.$langs->trans("DropTableIfEmpty").''; + print ''.$langs->trans("DropTableIfEmpty").''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } //print '   '.$langs->trans("RunSql").''; print '
    '; print ' '.$langs->trans("SqlFileKeyExtraFields").' : '.(dol_is_file($realpathtosqlextrakey) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosqlextrakey).(dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey) ? '' : '').''; if (dol_is_file($realpathtosqlextra) && dol_is_file($realpathtosqlextrakey)) { - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; print '
    '; print '
    '; print ' '.$langs->trans("PageForList").' : '.(dol_is_file($realpathtolist) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolist).(dol_is_file($realpathtolist) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("PageForCreateEditView").' : '.(dol_is_file($realpathtocard) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocard).(dol_is_file($realpathtocard) ? '' : '').'?action=create'; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; // Page contact print ' '.$langs->trans("PageForContactTab").' : '.(dol_is_file($realpathtocontact) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocontact).(dol_is_file($realpathtocontact) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtocontact)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; // Page document print ' '.$langs->trans("PageForDocumentTab").' : '.(dol_is_file($realpathtodocument) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtodocument).(dol_is_file($realpathtodocument) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtodocument)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; // Page notes print ' '.$langs->trans("PageForNoteTab").' : '.(dol_is_file($realpathtonote) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtonote).(dol_is_file($realpathtonote) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtonote)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; // Page agenda print ' '.$langs->trans("PageForAgendaTab").' : '.(dol_is_file($realpathtoagenda) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoagenda).(dol_is_file($realpathtoagenda) ? '' : '').''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; if (dol_is_file($realpathtoagenda)) { print ' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; } else { - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; } print '
    '; print '
    '; @@ -2969,21 +2974,24 @@ if ($module == 'initmodule') { print '
    '; print ''; print ''; - print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -3091,7 +3099,9 @@ if ($module == 'initmodule') { print ''; print ''; print ''; - print ''; - print ''; - print ''; print ''; - print ''; - print ''; - print ''; - print ''; print ''; print ''; - print ''; + print ''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -3867,7 +3882,7 @@ if ($module == 'initmodule') { print ''; if (!empty($triggers)) { @@ -3876,15 +3891,15 @@ if ($module == 'initmodule') { print ''; - print ''; + print ''; + print ''; print ''; } } else { print ''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; print ''; } @@ -3929,11 +3944,11 @@ if ($module == 'initmodule') { print ' '.$langs->trans("CSSFile").' : '; if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''; - print ''; + print ''; + print ''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''; + print ''; } print ''; } else { @@ -3975,11 +3990,11 @@ if ($module == 'initmodule') { print ' '.$langs->trans("JSFile").' : '; if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; - print ''; - print ''; + print ''; + print ''; } else { print ''.$langs->trans("FileNotYetGenerated").''; - print ''; + print ''; } print ''; } else { @@ -4024,13 +4039,13 @@ if ($module == 'initmodule') { $pathtofile = $widget['relpath']; print ''; + print ''; print ''; } } else { print ''; } print '
    '.$langs->trans("Property"); - print ' ('.$langs->trans("SeeExamples").')'; + print ''; + + $htmltext = $langs->trans("PropertyDesc").'

    '.$langs->trans("SeeExamples").''; + print $form->textwithpicto($langs->trans("Code"), $htmltext, 1, 'help', 'extracss', 0, 3, 'propertyhelp'); + print '
    '; print $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")); print ''.$form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelp")).''.$form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'

    '.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp').'
    '.$form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")).''.$form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")).''.$langs->trans("DefaultValue").''.$langs->trans("DatabaseIndex").''.$langs->trans("ForeignKey").''.$form->textwithpicto($langs->trans("ForeignKey"), $langs->trans("ForeignKeyDesc"), 1, 'help', 'extracss', 0, 3, 'foreignkeyhelp').''.$langs->trans("Position").''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp').''.$form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'

    '.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp').'
    '.$langs->trans("NotEditable").''.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).''; print ''; print ''; @@ -3106,7 +3116,7 @@ if ($module == 'initmodule') { print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -3180,13 +3190,15 @@ if ($module == 'initmodule') { print ''; print dol_escape_htmltag($propposition); print ''; + print ''; print $propenabled ? dol_escape_htmltag($propenabled) : ''; print ''; + // Visibility + print ''; print $propvisible ? dol_escape_htmltag($propvisible) : '0'; print ''; + // Readonly + print ''; print $propnoteditable ? dol_escape_htmltag($propnoteditable) : ''; print ''; @@ -3198,16 +3210,17 @@ if ($module == 'initmodule') { print ''; print $propisameasure ? dol_escape_htmltag($propisameasure) : ''; print ''; + print ''; print $propcss ? dol_escape_htmltag($propcss) : ''; print ''; + print ''; print $propcssview ? dol_escape_htmltag($propcssview) : ''; print ''; + print ''; print $propcsslist ? dol_escape_htmltag($propcsslist) : ''; print ''; + // Key for tooltop + print ''; print $prophelp ? dol_escape_htmltag($prophelp) : ''; print ''; @@ -3248,7 +3261,7 @@ if ($module == 'initmodule') { $format = 'markdown'; } print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; } } else { @@ -3341,7 +3354,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; if (is_array($dicts) && !empty($dicts)) { print ' '.$langs->trans("LanguageFile").' : '; @@ -3365,18 +3378,20 @@ if ($module == 'initmodule') { //$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$'); $firstdicname = ''; - foreach ($dicts['tabname'] as $key => $dic) { - $dicname = $dic; - $diclabel = $dicts['tablib'][$key]; + if (!empty($dicts['tabname'])) { + foreach ($dicts['tabname'] as $key => $dic) { + $dicname = $dic; + $diclabel = $dicts['tablib'][$key]; - if (empty($firstdicname)) { - $firstdicname = $dicname; + if (empty($firstdicname)) { + $firstdicname = $dicname; + } + + $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname; + $head3[$h][1] = $diclabel; + $head3[$h][2] = $dicname; + $h++; } - - $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname; - $head3[$h][1] = $diclabel; - $head3[$h][2] = $dicname; - $h++; } if ($h > 1) { @@ -3566,7 +3581,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; @@ -3716,7 +3731,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; @@ -3807,7 +3822,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; @@ -3816,11 +3831,11 @@ if ($module == 'initmodule') { if (dol_is_file($dirins.'/'.$pathtohook)) { print ''.$pathtohook.''; print ''.img_picto($langs->trans("Edit"), 'edit').' '; - print ''.img_picto($langs->trans("Delete"), 'delete').''.img_picto($langs->trans("Edit"), 'edit').' '; + print ''.img_picto($langs->trans("Delete"), 'delete').'
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; print ''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').''.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').'
    '; print ' '.$langs->trans("TriggersFile"); print ' : '.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').'
    '.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').''.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').''.img_picto('Generate', 'generate', 'class="paddingleft"').''.img_picto('Generate', 'generate', 'class="paddingleft"').'
    '.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').''.img_picto($langs->trans("Edit"), 'edit').''.img_picto($langs->trans("Delete"), 'delete').''.img_picto('Generate', 'generate', 'class="paddingleft"').''.img_picto('Generate', 'generate', 'class="paddingleft"').'
    '.$langs->trans("WidgetFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').'
    '.$langs->trans("WidgetFile").' : '.$langs->trans("NoWidget").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print '
    '; @@ -4072,7 +4087,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; } else { $fullpathoffile = dol_buildpath($file, 0); @@ -4143,13 +4158,13 @@ if ($module == 'initmodule') { $pathtofile = $clifile['relpath']; print ' '.$langs->trans("CLIFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ' '.$langs->trans("CLIFile").' : '.$langs->trans("FileNotYetGenerated"); ''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -4190,7 +4205,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; @@ -4319,14 +4334,14 @@ if ($module == 'initmodule') { } print ''; print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.''; - print ''.img_picto($langs->trans("Edit"), 'edit').''; - print ''.img_picto($langs->trans("Delete"), 'delete').''; + print ''.img_picto($langs->trans("Edit"), 'edit').''; + print ''.img_picto($langs->trans("Delete"), 'delete').''; print ''; } } else { print ''; print ' '.$langs->trans("SpecificationFile").' : '.$langs->trans("FileNotYetGenerated").''; - print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; + print ''.img_picto('Generate', 'generate', 'class="paddingleft"').''; print ''; } print ''; @@ -4381,7 +4396,7 @@ if ($module == 'initmodule') { print ''; print ''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')'; - print ' '.img_picto($langs->trans("Delete"), 'delete').''; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print '
    '; @@ -4396,7 +4411,7 @@ if ($module == 'initmodule') { print ''; print ''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')'; - print ' '.img_picto($langs->trans("Delete"), 'delete').''; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print '
    '; @@ -4451,7 +4466,7 @@ if ($module == 'initmodule') { $arrayversion = explode('.', $moduleobj->version, 3); if (count($arrayversion)) { - $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? ".".$arrayversion[2] : '').".zip"; + $FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).(empty($arrayversion[2]) ? '' : ".".$arrayversion[2]).".zip"; $outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP; } @@ -4464,7 +4479,7 @@ if ($module == 'initmodule') { $relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP; print ''.$outputfilezip.''; print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')'; - print ' '.img_picto($langs->trans("Delete"), 'delete').''; + print ' '.img_picto($langs->trans("Delete"), 'delete').''; } print ''; @@ -4495,7 +4510,7 @@ if ($module == 'initmodule') { print '
    '; print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.''; - print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
    '; print '
    '; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index b30391becc7..97c4e9ba646 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -450,7 +450,7 @@ class MyObject extends CommonObject $sql = "SELECT "; $sql .= $this->getFieldList('t'); - $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; + $sql .= " FROM ".$this->db->prefix().$this->table_element." as t"; if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($this->element).")"; } else { diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 212f02aa4b3..99cd900b512 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -188,7 +188,7 @@ class modMyModule extends DolibarrModules // 'invoice_supplier' to add a tab in supplier invoice view // 'member' to add a tab in fundation member view // 'opensurveypoll' to add a tab in opensurvey poll view - // 'order' to add a tab in customer order view + // 'order' to add a tab in sale order view // 'order_supplier' to add a tab in supplier order view // 'payment' to add a tab in payment view // 'payment_supplier' to add a tab in supplier payment view diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 61186a3b4f3..cce647de224 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for MyObject */ class mod_myobject_advanced extends ModeleNumRefMyObject { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php index 75068cf8d57..f21ffe880d0 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php @@ -26,7 +26,7 @@ dol_include_once('/mymodule/core/modules/mymodule/modules_myobject.php'); /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for MyObject */ class mod_myobject_standard extends ModeleNumRefMyObject { diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index 2c76818ab84..8f7764ad100 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -155,7 +155,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'MYECMDIR_MODIFY': //case 'MYECMDIR_DELETE': - // Customer orders + // Sales orders //case 'ORDER_CREATE': //case 'ORDER_MODIFY': //case 'ORDER_VALIDATE': diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index d7d91414788..95f10b5b90c 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -126,11 +126,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ // Set $enablepermissioncheck to 1 to enable a minimum low level of checks $enablepermissioncheck = 0; if ($enablepermissioncheck) { - $permissiontoread = $user->rights->mymodule->myobject->read; - $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php - $permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); - $permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php - $permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php + $permissiontoread = $user->hasRight('mymodule', 'myobject', 'read'); + $permissiontoadd = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php + $permissiontodelete = $user->hasRight('mymodule', 'myobject', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); + $permissionnote = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_setnotes.inc.php + $permissiondellink = $user->hasRight('mymodule', 'myobject', 'write'); // Used by the include of actions_dellink.inc.php } else { $permissiontoread = 1; $permissiontoadd = 1; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php @@ -356,6 +356,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea }*/ $formquestion = array(); + /* $forcecombo=0; if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 8ab14a190c1..30ccdd22e44 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -136,7 +136,7 @@ if (!$sortorder) { } // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -198,7 +198,7 @@ if ($user->socid > 0) accessforbidden(); //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); if (!isModEnabled("mymodule")) { - accessforbidden(); + accessforbidden('Module mymodule not enabled'); } if (!$permissiontoread) accessforbidden(); @@ -378,7 +378,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 7f0cc15f873..f7a6ed88571 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -84,7 +84,7 @@ if (!$sortorder) { } // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -230,8 +230,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (isset($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 (t.rowid = ef.fk_object)"; } -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production lineparent ON t.fk_parent_line = lineparent.rowid"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo moparent ON lineparent.fk_mo = moparent.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid"; // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -266,17 +266,17 @@ foreach ($search as $key => $val) { $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; + $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; } } } diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 24b3516684e..64ae11909ef 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -814,6 +814,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Lines to consume + $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO" + if (!empty($object->lines)) { $nblinetoconsume = 0; foreach ($object->lines as $line) { @@ -832,7 +834,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linecost = price2num($tmpproduct->pmp, 'MT'); if ($object->qty > 0) { - // add free consume line cost to bomcost + // add free consume line cost to $bomcostupdated $costprice = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); if (empty($costprice)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; @@ -843,12 +845,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $costprice = 0; } } - $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); - $bomcost += $linecost; + $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities + $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy } - $bomcost = price2num($bomcost, 'MU'); - + $bomcostupdated = price2num($bomcostupdated, 'MU'); $arrayoflines = $object->fetchLinesLinked('consumed', $line->id); $alreadyconsumed = 0; foreach ($arrayoflines as $line2) { @@ -1136,7 +1137,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans("Product").''; print ''.$langs->trans("Qty").''; if ($permissiontoupdatecost) { - if (empty($bomcost)) { + if (empty($bomcostupdated)) { print ''.$form->textwithpicto($langs->trans("UnitCost"), $langs->trans("AmountUsedToUpdateWAP")).''; } else { print ''.$form->textwithpicto($langs->trans("ManufacturingPrice"), $langs->trans("AmountUsedToUpdateWAP")).''; @@ -1230,17 +1231,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoupdatecost) { // Defined $manufacturingcost $manufacturingcost = 0; - if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble" - $manufacturingcost = $bomcost; + $manufacturingcostsrc = ''; + if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble") + $manufacturingcost = $bomcostupdated; + $manufacturingcostsrc = $langs->trans("CalculatedFromProductsToConsume"); + if (empty($manufacturingcost)) { + $manufacturingcost = $bomcost; + $manufacturingcostsrc = $langs->trans("ValueFromBom"); + } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->cost_price, 'MU'); + $manufacturingcostsrc = $langs->trans("CostPrice"); } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->pmp, 'MU'); + $manufacturingcostsrc = $langs->trans("PMPValue"); } } - print ''; + print ''; if ($manufacturingcost) { print price($manufacturingcost); } @@ -1344,19 +1353,27 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontoupdatecost) { // Defined $manufacturingcost $manufacturingcost = 0; - if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble" - $manufacturingcost = $bomcost; + $manufacturingcostsrc = ''; + if ($object->mrptype == 0) { // If MO is a "Manufacture" type (and not "Disassemble") + $manufacturingcost = $bomcostupdated; + $manufacturingcostsrc = $langs->trans("CalculatedFromProductsToConsume"); + if (empty($manufacturingcost)) { + $manufacturingcost = $bomcost; + $manufacturingcostsrc = $langs->trans("ValueFromBom"); + } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->cost_price, 'MU'); + $manufacturingcostsrc = $langs->trans("CostPrice"); } if (empty($manufacturingcost)) { $manufacturingcost = price2num($tmpproduct->pmp, 'MU'); + $manufacturingcostsrc = $langs->trans("PMPValue"); } } if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $preselected = (GETPOSTISSET('pricetoproduce-'.$line->id.'-'.$i) ? GETPOST('pricetoproduce-'.$line->id.'-'.$i) : ($manufacturingcost ? price($manufacturingcost) : '')); - print ''; + print ''; } else { print ''; } diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 0074d2e80ee..0c42dae87d2 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -129,9 +129,6 @@ class PartnershipType extends CommonObject public function create(User $user, $notrigger = false) { $resultcreate = $this->createCommon($user, $notrigger); - - //$resultvalidate = $this->validate($user, $notrigger); - return $resultcreate; } @@ -145,9 +142,6 @@ class PartnershipType extends CommonObject public function fetch($id, $ref = null) { $result = $this->fetchCommon($id, $ref); - if ($result > 0 && !empty($this->table_element_line)) { - $this->fetchLines(); - } return $result; } @@ -253,79 +247,6 @@ class PartnershipType extends CommonObject public function delete(User $user, $notrigger = false) { return $this->deleteCommon($user, $notrigger); - //return $this->deleteCommon($user, $notrigger, 1); - } - - /** - * Set draft status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, >0 if OK - */ - public function setDraft($user, $notrigger = 0) - { - // Protection - if ($this->status <= self::STATUS_DRAFT) { - return 0; - } - - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'PARTNERSHIPTYPE_UNVALIDATE'); - } - - /** - * Set cancel status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, 0=Nothing done, >0 if OK - */ - public function cancel($user, $notrigger = 0) - { - // Protection - if ($this->status != self::STATUS_VALIDATED) { - return 0; - } - - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'PARTNERSHIPTYPE_CANCEL'); - } - - /** - * Set back to validated status - * - * @param User $user Object user that modify - * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int <0 if KO, 0=Nothing done, >0 if OK - */ - public function reopen($user, $notrigger = 0) - { - // Protection - if ($this->status != self::STATUS_CANCELED) { - return 0; - } - - /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate)))) - { - $this->error='Permission denied'; - return -1; - }*/ - - return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'PARTNERSHIPTYPE_REOPEN'); } /** @@ -445,59 +366,6 @@ class PartnershipType extends CommonObject return $result; } - /** - * Return the label of the status - * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function getLabelStatus($mode = 0) - { - return $this->LibStatut($this->status, $mode); - } - - /** - * Return the label of the status - * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function getLibStatut($mode = 0) - { - return $this->LibStatut($this->status, $mode); - } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return the status - * - * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) - { - // phpcs:enable - if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - global $langs; - //$langs->load("mymodule@mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); - } - - $statusType = 'status'.$status; - //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; - if ($status == self::STATUS_CANCELED) { - $statusType = 'status6'; - } - - return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); - } - /** * Load the info information in the object * diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index d717bdc49bf..676de032659 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/partnership/core/modules/partnership/modules_partnership.php' /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for Partnership */ class mod_partnership_advanced extends ModeleNumRefPartnership { diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php index d5a2bb326b2..5de4b07f215 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_standard.php @@ -26,7 +26,7 @@ dol_include_once('/partnership/core/modules/partnership/modules_partnership.php' /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Partnership */ class mod_partnership_standard extends ModeleNumRefPartnership { diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index bc99655efa3..838969e745e 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -359,13 +359,16 @@ foreach ($search as $key => $val) { } if ($managedfor == 'member') { if ($search_filter == 'withoutsubscription') { - $sql .= " AND (d.datefin IS NULL OR dty.subscription = 0)"; + $sql .= " AND (d.datefin IS NULL)"; + } + if ($search_filter == 'waitingsubscription') { + $sql .= " AND (d.datefin IS NULL AND t.subscription = '1')"; } if ($search_filter == 'uptodate') { - $sql .= " AND (d.datefin >= '".$db->idate($now)."' OR dty.subscription = 0)"; + $sql .= " AND (d.datefin >= '".$db->idate($now)."' OR dty.subscription = '0')"; } if ($search_filter == 'outofdate') { - $sql .= " AND (d.datefin < '".$db->idate($now)."' AND dty.subscription = 1)"; + $sql .= " AND (d.datefin < '".$db->idate($now)."' AND dty.subscription = '1')"; } } if ($search_all) { @@ -401,7 +404,7 @@ $sql=preg_replace('/,\s*$/','', $sql); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); @@ -682,7 +685,7 @@ print ''."\n"; $needToFetchEachLine = 0; if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/', $val)) { + if ($val && preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object } } diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 7462431d087..a8106a9ae88 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -133,7 +133,7 @@ if ($action == 'other') { /*$value = GETPOST('PRODUIT_SOUSPRODUITS', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_SOUSPRODUITS", $value, 'chaine', 0, '', $conf->entity);*/ - $value = GETPOST('activate_viewProdDescInForm', 'alpha'); + $value = GETPOST('PRODUIT_DESC_IN_FORM', 'alpha'); $res = dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", $value, 'chaine', 0, '', $conf->entity); $value = GETPOST('activate_viewProdTextsInThirdpartyLanguage', 'alpha'); @@ -689,7 +689,8 @@ print ''; print ''; print ''.$langs->trans("ViewProductDescInFormAbility").''; print ''; -print $form->selectyesno("activate_viewProdDescInForm", $conf->global->PRODUIT_DESC_IN_FORM, 1); +$arrayofchoices = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes").' ('.$langs->trans("DesktopsOnly").')', '2' => $langs->trans("Yes").' ('.$langs->trans("DesktopsAndSmartphones").')'); +print $form->selectarray("PRODUIT_DESC_IN_FORM", $arrayofchoices, getDolGlobalInt('PRODUIT_DESC_IN_FORM'), 0); print ''; print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 2071171feba..c1be61741bb 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1444,9 +1444,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Description (used in invoice, propal...) print ''.$langs->trans("Description").''; - $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%'); $doleditor->Create(); - print ""; if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) { @@ -1620,7 +1619,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("NoteNotVisibleOnBill").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. - $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_8, '90%'); + $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_8, '90%'); $doleditor->Create(); print ""; @@ -1866,7 +1865,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Ref - print ''; + if (empty($conf->global->MAIN_PRODUCT_REF_NOT_EDITABLE)) { + print ''; + } else { + print ''; + } + // Label print ''; @@ -2002,7 +2006,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '"; @@ -2193,7 +2197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { print '"; @@ -2831,7 +2835,7 @@ if (!empty($conf->global->PRODUCT_ADD_FORM_ADD_TO) && $object->id && ($action == //print '
    '; // Propals - if (isModEnabled("propal") && $user->rights->propale->creer) { + if (isModEnabled("propal") && $user->rights->propal->creer) { $propal = new Propal($db); $langs->load("propal"); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index a344b5b5f44..aba48b939be 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3525,7 +3525,7 @@ class Product extends CommonObject global $db, $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; - $sql .= " COUNT(fd.rowid) as nb_rows, SUM('fd.qty') as qty"; + $sql .= " COUNT(fd.rowid) as nb_rows, SUM(fd.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet_rec as fd"; $sql .= ", ".MAIN_DB_PREFIX."facture_rec as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index 764ff919cc7..412d015f8b9 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -150,6 +150,8 @@ class PriceParser "length" => $product->length, "surface" => $product->surface, "price_min" => $product->price_min, + "cost_price" => $product->cost_price, + "pmp" => $product->pmp, )); //Retrieve all extrafield for product and add it to values diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 034fa97f86f..2ccdc7409f3 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -821,7 +821,7 @@ END; print '
    '; print ''; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 281d58ea99e..9acc4232490 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -104,10 +104,10 @@ class Inventory extends CommonObject 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'get_name_url_params' => '0::0:-1:0::1', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'categories_product' => array('type'=>'chkbxlst:categorie:label:rowid::type=0:0:', 'label'=>'OrProductsWithCategories', 'visible'=>3, 'enabled'=>1, 'position'=>33, 'help'=>'', 'picto'=>'category', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx'), - 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35), // This date is not used so disabled by default. - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), - 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502), + 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>'$conf->global->STOCK_INVENTORY_ADD_A_VALUE_DATE', 'position'=>35, 'csslist'=>'nowraponall'), // This date is not used so disabled by default. + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500, 'csslist'=>'nowraponall'), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501, 'csslist'=>'nowraponall'), + 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502, 'csslist'=>'nowraponall'), 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax200'), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax200'), 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512, 'csslist'=>'tdoverflowmax200'), diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 793fedd3a2d..d9ed8a37c5e 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -270,6 +270,7 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// Search for tag/category $searchCategoryProductSqlList = array(); if ($searchCategoryProductOperator == 1) { $existsCategoryProductList = array(); @@ -314,7 +315,6 @@ if ($searchCategoryProductOperator == 1) { $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } } -//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 3561388709d..26f6a3a410c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -77,12 +77,15 @@ if (GETPOSTISSET('formfilteraction')) { $searchCategoryProductOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT; } $searchCategoryProductList = GETPOST('search_category_product_list', 'array'); +$catid = GETPOST('catid', 'int'); +if (!empty($catid) && empty($searchCategoryProductList)) { + $searchCategoryProductList = array($catid); +} $search_tosell = GETPOST("search_tosell", 'int'); $search_tobuy = GETPOST("search_tobuy", 'int'); $search_country = GETPOST("search_country", 'int'); $search_state = GETPOST("state_id", 'int'); $fourn_id = GETPOST("fourn_id", 'int'); -$catid = GETPOST('catid', 'int'); $search_tobatch = GETPOST("search_tobatch", 'int'); $search_accountancy_code_sell = GETPOST("search_accountancy_code_sell", 'alpha'); $search_accountancy_code_sell_intra = GETPOST("search_accountancy_code_sell_intra", 'alpha'); @@ -296,6 +299,7 @@ if ($search_type == '0') { $result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0); } + /* * Actions */ @@ -439,9 +443,6 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { 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."product_extrafields as ef on (p.rowid = ef.fk_object)"; } -if (!empty($searchCategoryProductList) || !empty($catid)) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ -} $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; // multilang if (getDolGlobalInt('MAIN_MULTILANGS')) { @@ -455,7 +456,6 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units cu ON cu.rowid = p.fk_unit"; } - $sql .= ' WHERE p.entity IN ('.getEntity('product').')'; if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); @@ -500,34 +500,28 @@ if ($search_vatrate) { if (dol_strlen($canvas) > 0) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } -if ($catid > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $catid); -} -if ($catid == -2) { - $sql .= " AND cp.fk_categorie IS NULL"; -} -$searchCategoryProductSqlList = array(); -if ($searchCategoryProductOperator == 1) { +// Search for tag/category ($searchCategoryProductList is an array of ID) +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; foreach ($searchCategoryProductList as $searchCategoryProduct) { if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL"; + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)"; } elseif (intval($searchCategoryProduct) > 0) { - $searchCategoryProductSqlList[] = "cp.fk_categorie = ".$db->escape($searchCategoryProduct); + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); } } - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; } -} else { - foreach ($searchCategoryProductList as $searchCategoryProduct) { - if (intval($searchCategoryProduct) == -2) { - $searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL"; - } elseif (intval($searchCategoryProduct) > 0) { - $searchCategoryProductSqlList[] = "p.rowid IN (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product WHERE fk_categorie = ".((int) $searchCategoryProduct).")"; + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } - } - if (!empty($searchCategoryProductSqlList)) { - $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; } } if ($fourn_id > 0) { @@ -693,7 +687,6 @@ if ($resql) { if ($fourn_id > 0) { $param .= "&fourn_id=".urlencode($fourn_id); } - //if ($seach_categ) $param.=($search_categ?"&search_categ=".urlencode($search_categ):""); if ($show_childproducts) { $param .= ($show_childproducts ? "&search_show_childproducts=".urlencode($show_childproducts) : ""); } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 1dda1f4c89a..2171ef4aab3 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2249,7 +2249,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { } print ''; - print ''; + print ''; print ''; // Print the search button print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -2298,6 +2298,8 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print '"; + + // VAT Rate print '"; - print '"; + print '"; - print '"; + print '"; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '"; - print ''; + print ''; } print ''; @@ -2376,6 +2378,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''; print ""; print '"; + // VAT Rate print '"; + print '"; print '"; if ($mysoc->localtax1_assuj == "1" || $mysoc->localtax2_assuj == "1") { //print '"; - print ''; + print ''; } print ''; diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index 707549655e0..66e673567a6 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -259,12 +259,11 @@ if ($id > 0 || !empty($ref)) { } $db->free($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index d2f3e2358d9..b0d06f15701 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -375,7 +375,7 @@ if ($result || !($id > 0)) { $morefilters = ' AND d.fk_product IN ('.$db->sanitize((is_array($listofprodids) && count($listofprodids)) ? join(',', $listofprodids) : '0').')'; } if ($search_categ == -2) { - $morefilters = ' AND d.fk_product NOT IN (SELECT cp.fk_product from '.MAIN_DB_PREFIX.'categorie_product as cp)'; + $morefilters = ' AND NOT EXISTS (SELECT cp.fk_product FROM '.MAIN_DB_PREFIX.'categorie_product as cp WHERE d.fk_product = cp.fk_product)'; } if ($key == 'propal') { @@ -440,7 +440,7 @@ if ($result || !($id > 0)) { continue; } - if ($graphfiles == 'propal' && !$user->rights->propale->lire) { + if ($graphfiles == 'propal' && !$user->rights->propal->lire) { continue; } if ($graphfiles == 'order' && !$user->rights->commande->lire) { diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index ed5216f85d1..5559eaf8413 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -185,13 +185,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); - $option = ''; + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index f3353fa3d5d..6ae1d7881ef 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -185,13 +185,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); - $option = ''; + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } @@ -228,7 +226,7 @@ if ($id > 0 || !empty($ref)) { $i = 0; print '
    '; - print '
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.$langs->trans("Ref").'
    '.$langs->trans("Label").'
    '.$langs->trans("Description").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. - $doleditor = new DolEditor('desc', GETPOSTISSET('desc') ? GETPOST('desc', 'restricthtml') : $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('desc', GETPOSTISSET('desc') ? GETPOST('desc', 'restricthtml') : $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%'); $doleditor->Create(); print "
    '.$langs->trans("NoteNotVisibleOnBill").''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_4, '90%'); $doleditor->Create(); print "
    '.$langs->trans('ProductSupplierDescription').''; - $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%'); + $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%'); $doleditor->Create(); print '
     '; @@ -2261,7 +2261,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print '
    '.$langs->trans("ThirdParty").'' . $langs->trans('RefCustomer') . ''.$langs->trans('RefCustomer').''.$langs->trans("AppliedPricesFrom").''.$langs->trans("PriceBase").''.$langs->trans("DefaultTaxRate").'' . $langs->trans('Default') . ''.$langs->trans($object->price_base_type)."'; $positiverates = ''; @@ -2319,12 +2321,12 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { //print $object->default_vat_code?' ('.$object->default_vat_code.')':''; print "'.price($object->price)."'.price($object->price)."'.price($object->price_ttc)."'.price($object->price_ttc)."' . price($object->price_ttc) . "'.price($resultarray[2]).''.price($resultarray[2]).''.price($object->price_min).''.dol_escape_htmltag($line->ref_customer).'".dol_print_date($line->datec, "dayhour", 'tzuserrel')."'.$langs->trans($line->price_base_type)."'; $positiverates = ''; @@ -2395,12 +2398,13 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { echo vatrate($positiverates.($line->default_vat_code ? ' ('.$line->default_vat_code.')' : ''), '%', ($line->tva_npr ? $line->tva_npr : $line->recuperableonly)); print "'.price($line->price)."'.price($line->price_ttc)."' . price($line->price_ttc) . "'.price($resultarray[2]).''.price($resultarray[2]).''.price($line->price_min).'
    '; + print '
    '; print ''; print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "c.rowid", "", $option, '', $sortfield, $sortorder); print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", "", $option, '', $sortfield, $sortorder); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 196831a5466..bcf9c8c0737 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -170,12 +170,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 4ee1e4f95b2..3ff0b00d56a 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -201,12 +201,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 6e5ed524ad9..20bb56a3c19 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -184,12 +184,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index 9415f2d6546..9b982407825 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -202,12 +202,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index a4947db1085..085a6687f5c 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -163,12 +163,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 42467368b91..b70d2e08161 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; $sql .= " p.ref_client,"; $sql .= "p.datep, p.fk_statut as statut, d.rowid, d.qty"; @@ -186,12 +186,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index ff14c764af6..50b17b0ac06 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); - if ($user->rights->propale->lire) { + if ($user->rights->propal->lire) { $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, d.total_ht as amount,"; //$sql .= " p.ref_supplier,"; $sql .= "p.date_valid, p.fk_statut as statut, d.rowid, d.qty"; @@ -185,12 +185,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option = '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 496a2720e97..af2bb49b05e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -227,9 +227,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_WAREHOUSE, "t.rowid"); -} 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 (t.rowid = ef.fk_object)"; } @@ -240,12 +237,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as ccount ON ccount.rowid = t.fk if ($separatedPMP) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as pa ON pa.fk_product = p.rowid AND pa.fk_product = ps.fk_product AND pa.entity = ". (int) $conf->entity; } - $sql .= " WHERE t.entity IN (".getEntity('stock').")"; - -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_WAREHOUSE, "t.rowid", $search_category_list); -} foreach ($search as $key => $val) { $class_key = $key; if ($class_key == 'status') { @@ -268,6 +260,33 @@ foreach ($search as $key => $val) { if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +// Search for tag/category ($searchCategoryWarehouseList is an array of ID) +$searchCategoryWarehouseList = $search_category_list; +$searchCategoryWarehouseOperator = 0; +if (!empty($searchCategoryWarehouseList)) { + $searchCategoryWarehouseSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryWarehouseList as $searchCategoryWarehouse) { + if (intval($searchCategoryWarehouse) == -2) { + $searchCategoryWarehouseSqlList[] = "NOT EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE p.rowid = ck.fk_warehouse)"; + } elseif (intval($searchCategoryWarehouse) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryWarehouse); + } + } + if ($listofcategoryid) { + $searchCategoryWarehouseSqlList[] = " EXISTS (SELECT ck.fk_warehouse FROM ".MAIN_DB_PREFIX."categorie_warehouse as ck WHERE p.rowid = ck.fk_warehouse AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryWarehouseOperator == 1) { + if (!empty($searchCategoryWarehouseSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryWarehouseSqlList).")"; + } + } else { + if (!empty($searchCategoryWarehouseSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryWarehouseSqlList).")"; + } + } +} + // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 7e34931f9a8..171ee79be9d 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -730,7 +730,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $nbtotalofrecords++; }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index c7503bb957f..faaf7e346fa 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -761,7 +761,7 @@ if ($id > 0 || $ref) { $found = 0; $helpondiff = ''.$langs->trans("StockDiffPhysicTeoric").':
    '; - // Number of customer orders running + // Number of sales orders running if (isModEnabled('commande')) { if ($found) { $helpondiff .= '
    '; @@ -776,7 +776,7 @@ if ($id > 0 || $ref) { $helpondiff .= ' ('.$langs->trans("ProductQtyInDraft").': '.$object->stats_commande['qty'].')'; } - // Number of product from customer order already sent (partial shipping) + // Number of product from sales order already sent (partial shipping) if (isModEnabled("expedition")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; $filterShipmentStatus = ''; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index c15479b1f4f..8981d1cff56 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -315,7 +315,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 6ec5c1d0b9b..be7f006d5a0 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -849,8 +849,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $desiredstock = $objp->desiredstock; $alertstock = $objp->seuil_stock_alerte; - $desiredstockwarehouse = ($objp->desiredstockpse ? $objp->desiredstockpse : 0); - $alertstockwarehouse = ($objp->seuil_stock_alertepse ? $objp->seuil_stock_alertepse : 0); + $desiredstockwarehouse = (!empty($objp->desiredstockpse) ? $objp->desiredstockpse : 0); + $alertstockwarehouse = (!empty($objp->seuil_stock_alertepse) ? $objp->seuil_stock_alertepse : 0); $warning = ''; if ($alertstock && ($stock < $alertstock)) { diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index d077c1d0ba8..c3c031b14bd 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -51,6 +51,7 @@ $search_dateyear = GETPOST('search_dateyear', 'int'); $search_datemonth = GETPOST('search_datemonth', 'int'); $search_dateday = GETPOST('search_dateday', 'int'); $search_date = dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear); +$optioncss = GETPOST('optioncss', 'alpha'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -130,9 +131,9 @@ if (empty($user->rights->societe->client->voir) && !$socid) { } $sql .= ' WHERE cf.fk_soc = s.rowid '; $sql .= ' AND cf.entity = '.$conf->entity; -if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) { +if (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { $sql .= ' AND cf.fk_statut < 3'; -} elseif ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { +} elseif (!empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE)) { $sql .= ' AND cf.fk_statut < 6'; // We want also status 5, we will keep them visible if dispatching is not yet finished (tested with function dolDispatchToDo). } else { $sql .= ' AND cf.fk_statut < 5'; diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index a71098fc2bf..5ffb56ced44 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2022 Frédéric France * * 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 @@ -229,7 +229,7 @@ class StockTransfer extends CommonObject // Translate some data of arrayofkeyval if (is_object($langs)) { foreach ($this->fields as $key => $val) { - if (is_array($val['arrayofkeyval'])) { + if (isset($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { foreach ($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php index 62921f0a6e0..144c638a1cf 100644 --- a/htdocs/product/stock/tpl/extrafields_add.tpl.php +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -38,13 +38,13 @@ if (empty($conf) || !is_object($conf)) { // Other attributes if (!isset($parameters)) $parameters = array(); -$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $movement, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; $params['cols'] = $parameters['colspanvalue']; - print $movement->showOptionals($extrafields, 'create', $params); + print $object->showOptionals($extrafields, 'create', $params); } ?> diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 40181167baa..69ae5eda5e0 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -109,7 +109,7 @@ if ($object->element == 'product') { if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) { $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE; } - print img_picto('', 'stock').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100'); + print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100 maxwidth300 widthcentpercentminusx'); print ''; } if ($object->element == 'stock') { @@ -155,10 +155,11 @@ if (ismodEnabled('productbatch') && print ''; print ''; } else { - print ''; + print img_picto('', 'barcode', 'class="pictofixedwidth"').''; } print ''; print ''; + print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ''; print ''; diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 3f536b6761a..ba4dc956d08 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -265,12 +265,12 @@ if ($action == 'edit') { print '
    '.$langs->trans("SellByDate").''; diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php index 819fa404d52..7d08f2014a0 100644 --- a/htdocs/product/stock/tpl/stocktransfer.tpl.php +++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php @@ -104,7 +104,7 @@ if (isModEnabled('productbatch') && print ''; print ''; } else { - print ''; + print img_picto('', 'barcode', 'class="pictofixedwidth"').''; } print '
    '; print ''; print ''; if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { print ''; @@ -336,13 +336,13 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service print ''; print ''; print ''; // Other field (not used) if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { print ''; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 17d5c042389..718aeecec82 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -55,13 +55,15 @@ $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $status = GETPOST('status', 'int'); $opp_status = GETPOST('opp_status', 'int'); -$opp_percent = price2num(GETPOST('opp_percent', 'alpha')); -$objcanvas = GETPOST("objcanvas", "alpha"); -$comefromclone = GETPOST("comefromclone", "alpha"); +$opp_percent = price2num(GETPOST('opp_percent', 'alphanohtml')); +$objcanvas = GETPOST("objcanvas", "alphanohtml"); +$comefromclone = GETPOST("comefromclone", "alphanohtml"); +$date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); +$date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('projectendday', 'int'), GETPOST('projectendyear', 'int')); +$date_start_event = dol_mktime(GETPOST('date_start_eventhour', 'int'), GETPOST('date_start_eventmin', 'int'), GETPOST('date_start_eventsec', 'int'), GETPOST('date_start_eventmonth', 'int'), GETPOST('date_start_eventday', 'int'), GETPOST('date_start_eventyear', 'int')); +$date_end_event = dol_mktime(GETPOST('date_end_eventhour', 'int'), GETPOST('date_end_eventmin', 'int'), GETPOST('date_end_eventsec', 'int'), GETPOST('date_end_eventmonth', 'int'), GETPOST('date_end_eventday', 'int'), GETPOST('date_end_eventyear', 'int')); +$location = GETPOST('location', 'alphanohtml'); -if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $action != "update" && !GETPOST("cancel"))) { - accessforbidden(); -} $mine = GETPOST('mode') == 'mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects @@ -88,14 +90,15 @@ if ($id > 0 || !empty($ref)) { // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); -$date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('projectendmonth', 'int'), GETPOST('projectendday', 'int'), GETPOST('projectendyear', 'int')); - // Security check $socid = GETPOST('socid', 'int'); //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. restrictedArea($user, 'projet', $object->id, 'projet&project'); +if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $action != "update" && !GETPOST("cancel"))) { + accessforbidden(); +} + $permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php @@ -187,6 +190,9 @@ if (empty($reshook)) { $object->date_c = dol_now(); $object->date_start = $date_start; $object->date_end = $date_end; + $object->date_start_event = $date_start_event; + $object->date_end_event = $date_end_event; + $object->location = $location; $object->statut = $status; $object->opp_status = $opp_status; $object->opp_percent = $opp_percent; @@ -281,6 +287,9 @@ if (empty($reshook)) { $object->public = GETPOST('public', 'alpha'); $object->date_start = (!GETPOST('projectstart')) ? '' : $date_start; $object->date_end = (!GETPOST('projectend')) ? '' : $date_end; + $object->date_start_event = (!GETPOST('date_start_event')) ? '' : $date_start_event; + $object->date_end_event = (!GETPOST('date_end_event')) ? '' : $date_end_event; + $object->location = $location; if (GETPOSTISSET('opp_amount')) { $object->opp_amount = price2num(GETPOST('opp_amount', 'alpha')); } @@ -603,6 +612,23 @@ if ($action == 'create' && $user->rights->projet->creer) { print ' '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; + print ''; } print ''; print ''; @@ -673,16 +699,6 @@ if ($action == 'create' && $user->rights->projet->creer) { } print ''; - // Date start - print ''; - - // Date end - print ''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status print ''; @@ -708,6 +724,27 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; print ''; + // Date project + print ''; + + if (isModEnabled('eventorganization')) { + // Date event + print ''; + + // Location + print ''; + print ''; + print ''; + } + // Description print ''; print ''; // Usage @@ -902,6 +940,21 @@ if ($action == 'create' && $user->rights->projet->creer) { print 'usage_organize_event ? ' checked="checked"' : '')) . '"> '; $htmltext = $langs->trans("EventOrganizationDescriptionLong"); print ''; + print ''; } print ''; } @@ -981,9 +1034,18 @@ if ($action == 'create' && $user->rights->projet->creer) { print ''; } - // Date start - print ''; + print ''; + print ''; + + // Date project + print ''; - // Date end - print ''; + if (isModEnabled('eventorganization')) { + // Date event + print ''; - // Budget - print ''; - print ''; - print ''; + // Location + print ''; + print ''; + print ''; + } // Description print ''; @@ -1043,7 +1107,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Title $morehtmlref .= dol_escape_htmltag($object->title); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '; + $morehtmlref .= '
    '; if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); } @@ -1143,18 +1207,6 @@ if ($action == 'create' && $user->rights->projet->creer) { */ } - // Date start - end - print ''; - // Budget print ''; + // Date start - end project + print ''; + // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 9987f9bc4f0..c5dcf0d4bb4 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -87,29 +87,44 @@ class Project extends CommonObject public $title; /** - * @var int Date start + * @var int Date start * @deprecated * @see $date_start */ public $dateo; /** - * @var int Date start + * @var int Date start */ public $date_start; /** - * @var int Date end + * @var int Date end * @deprecated * @see $date_end */ public $datee; /** - * @var int Date end + * @var int Date end */ public $date_end; + /** + * @var int Date start event + */ + public $date_start_event; + + /** + * @var int Date end event + */ + public $date_end_event; + + /** + * @var string Location + */ + public $location; + /** * @var int Date close */ @@ -264,30 +279,35 @@ class Project extends CommonObject 'datee' =>array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>1, 'position'=>35), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>1), 'public' =>array('type'=>'integer', 'label'=>'Visibility', 'enabled'=>1, 'visible'=>1, 'position'=>65), - 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>'!empty($conf->global->PROJECT_USE_OPPORTUNITIES)', 'visible'=>1, 'position'=>75), - 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>'!empty($conf->global->PROJECT_USE_OPPORTUNITIES)', 'visible'=>1, 'position'=>80), + 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible'=>1, 'position'=>75), + 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'visible'=>1, 'position'=>80), 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>85, 'searchall'=>1), 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>90, 'searchall'=>1), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPdf', 'enabled'=>1, 'visible'=>0, 'position'=>95), 'date_close' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>0, 'position'=>105), 'fk_user_close' =>array('type'=>'integer', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'!empty($conf->global->PROJECT_USE_OPPORTUNITIES)', 'position'=>115), + 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>'getDolGlobalString("PROJECT_USE_OPPORTUNITIES")', 'position'=>115), 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>1, 'position'=>119), 'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>-1, 'position'=>130), 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>-1, 'position'=>140), 'usage_organize_event' =>array('type'=>'integer', 'label'=>'UsageOrganizeEvent', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'accept_conference_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>146), - 'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>147), - 'price_registration' =>array('type'=>'double(24,8)', 'label'=>'PriceOfRegistration', 'enabled'=>1, 'visible'=>-1, 'position'=>148), - 'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>149), - 'max_attendees' =>array('type'=>'integer', 'label'=>'MaxNbOfAttendees', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>200), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>205), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>215), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>220), - 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>250, 'help'=>'EmailMsgIDWhenSourceisEmail'), + // Properties for event organization + 'date_start_event' =>array('type'=>'date', 'label'=>'DateStartEvent', 'enabled'=>1, 'visible'=>1, 'position'=>200), + 'date_end_event' =>array('type'=>'date', 'label'=>'DateEndEvent', 'enabled'=>1, 'visible'=>1, 'position'=>201), + 'location' =>array('type'=>'text', 'label'=>'Location', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>202), + 'accept_conference_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestConf', 'enabled'=>1, 'visible'=>-1, 'position'=>210), + 'accept_booth_suggestions' =>array('type'=>'integer', 'label'=>'AllowUnknownPeopleSuggestBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>211), + 'price_registration' =>array('type'=>'double(24,8)', 'label'=>'PriceOfRegistration', 'enabled'=>1, 'visible'=>-1, 'position'=>212), + 'price_booth' =>array('type'=>'double(24,8)', 'label'=>'PriceOfBooth', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + 'max_attendees' =>array('type'=>'integer', 'label'=>'MaxNbOfAttendees', 'enabled'=>1, 'visible'=>-1, 'position'=>215), + // Generic + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>-2, 'position'=>400), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>405), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>410), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>415), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>420), + 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>450, 'help'=>'EmailMsgIDWhenSourceisEmail'), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500) ); // END MODULEBUILDER PROPERTIES @@ -408,6 +428,9 @@ class Project extends CommonObject $sql .= ", price_registration"; $sql .= ", price_booth"; $sql .= ", max_attendees"; + $sql .= ", date_start_event"; + $sql .= ", date_end_event"; + $sql .= ", location"; $sql .= ", email_msgid"; $sql .= ", note_private"; $sql .= ", note_public"; @@ -436,6 +459,9 @@ class Project extends CommonObject $sql .= ", ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : 'null'); $sql .= ", ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : 'null'); $sql .= ", ".(strcmp($this->max_attendees, '') ? ((int) $this->max_attendees) : 'null'); + $sql .= ", ".($this->date_start_event != '' ? "'".$this->db->idate($this->date_start_event)."'" : 'null'); + $sql .= ", ".($this->date_end_event != '' ? "'".$this->db->idate($this->date_end_event)."'" : 'null'); + $sql .= ", ".($this->location ? "'".$this->db->escape($this->location)."'" : 'null'); $sql .= ", ".($this->email_msgid ? "'".$this->db->escape($this->email_msgid)."'" : 'null'); $sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : 'null'); $sql .= ", ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null'); @@ -530,11 +556,11 @@ class Project extends CommonObject $sql .= ", fk_opp_status = ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? $this->opp_status : 'null'); $sql .= ", opp_percent = ".((is_numeric($this->opp_percent) && $this->opp_percent != '') ? $this->opp_percent : 'null'); $sql .= ", public = ".($this->public ? 1 : 0); - $sql .= ", datec=".($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null'); - $sql .= ", dateo=".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); - $sql .= ", datee=".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); - $sql .= ", date_close=".($this->date_close != '' ? "'".$this->db->idate($this->date_close)."'" : 'null'); - $sql .= ", fk_user_close=".($this->fk_user_close > 0 ? $this->fk_user_close : "null"); + $sql .= ", datec = ".($this->date_c != '' ? "'".$this->db->idate($this->date_c)."'" : 'null'); + $sql .= ", dateo = ".($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); + $sql .= ", datee = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); + $sql .= ", date_close = ".($this->date_close != '' ? "'".$this->db->idate($this->date_close)."'" : 'null'); + $sql .= ", fk_user_close = ".($this->fk_user_close > 0 ? $this->fk_user_close : "null"); $sql .= ", opp_amount = ".(strcmp($this->opp_amount, '') ? price2num($this->opp_amount) : "null"); $sql .= ", budget_amount = ".(strcmp($this->budget_amount, '') ? price2num($this->budget_amount) : "null"); $sql .= ", fk_user_modif = ".$user->id; @@ -547,6 +573,9 @@ class Project extends CommonObject $sql .= ", price_registration = ".(strcmp($this->price_registration, '') ? price2num($this->price_registration) : "null"); $sql .= ", price_booth = ".(strcmp($this->price_booth, '') ? price2num($this->price_booth) : "null"); $sql .= ", max_attendees = ".(strcmp($this->max_attendees, '') ? price2num($this->max_attendees) : "null"); + $sql .= ", date_start_event = ".($this->date_start_event != '' ? "'".$this->db->idate($this->date_start_event)."'" : 'null'); + $sql .= ", date_end_event = ".($this->date_end_event != '' ? "'".$this->db->idate($this->date_end_event)."'" : 'null'); + $sql .= ", location = '".$this->db->escape($this->location)."'"; $sql .= ", entity = ".((int) $this->entity); $sql .= " WHERE rowid = ".((int) $this->id); @@ -631,9 +660,9 @@ class Project extends CommonObject } $sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,"; - $sql .= " tms, dateo, datee, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; + $sql .= " tms, dateo as date_start, datee as date_end, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; $sql .= " note_private, note_public, model_pdf, usage_opportunity, usage_task, usage_bill_time, usage_organize_event, email_msgid,"; - $sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees"; + $sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees, date_start_event, date_end_event, location"; $sql .= " FROM ".MAIN_DB_PREFIX."projet"; if (!empty($id)) { $sql .= " WHERE rowid = ".((int) $id); @@ -665,8 +694,8 @@ class Project extends CommonObject $this->datec = $this->db->jdate($obj->datec); // TODO deprecated $this->date_m = $this->db->jdate($obj->tms); $this->datem = $this->db->jdate($obj->tms); // TODO deprecated - $this->date_start = $this->db->jdate($obj->dateo); - $this->date_end = $this->db->jdate($obj->datee); + $this->date_start = $this->db->jdate($obj->date_start); + $this->date_end = $this->db->jdate($obj->date_end); $this->date_close = $this->db->jdate($obj->date_close); $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; @@ -692,6 +721,9 @@ class Project extends CommonObject $this->price_registration = $obj->price_registration; $this->price_booth = $obj->price_booth; $this->max_attendees = $obj->max_attendees; + $this->date_start_event = $this->db->jdate($obj->date_start_event); + $this->date_end_event = $this->db->jdate($obj->date_end_event); + $this->location = $obj->location; $this->email_msgid = $obj->email_msgid; $this->db->free($resql); @@ -1247,7 +1279,7 @@ class Project extends CommonObject $label .= ($label ? '
    ' : '').''.$langs->trans('Label').': '.$this->title; // The space must be after the : to not being explode when showing the title in img_picto if (isset($this->public)) { $label .= '
    '.$langs->trans("Visibility").": "; - $label .= ($this->public ? img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"').$langs->trans("SharedProject") : img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"').$langs->trans("PrivateProject")); + $label .= ($this->public ? img_picto($langs->trans('SharedProject'), 'world', 'class="pictofixedwidth"').$langs->trans("SharedProject") : img_picto($langs->trans('PrivateProject'), 'private', 'class="pictofixedwidth"').$langs->trans("PrivateProject")); } if (!empty($this->thirdparty_name)) { $label .= ($label ? '
    ' : '').''.$langs->trans('ThirdParty').': '.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto @@ -1308,14 +1340,14 @@ class Project extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip pictofixedwidth em088"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="pictofixedwidth"' : '') : 'class="'.(($withpicto != 2) ? 'pictofixedwidth ' : '').'classfortooltip pictofixedwidth em088"'), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { $result .= $this->ref; } $result .= $linkend; if ($withpicto != 2) { - $result .= (($addlabel && $this->title) ? $sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : ''); + $result .= (($addlabel && $this->title) ? ''.$sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)).'' : ''); } global $action; diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index 5ea5b920f8c..024dce3abc9 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -105,7 +105,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; @@ -134,15 +134,6 @@ if ($object->public) { } print ''; -// Date start - end -print ''; - // Budget print ''; +// Date start - end project +print ''; + // Other attributes $cols = 2; // include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index ee37aa68fdd..f6827fc19b3 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -296,7 +296,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -385,8 +385,15 @@ if ($id > 0 || !empty($ref)) { print ''; } - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 0a2acc4c3bc..bb50bf0def6 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -138,7 +138,7 @@ if ($object->id > 0) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 01ffe38cc0d..f96f5737cf4 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -218,7 +218,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; @@ -307,8 +307,15 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; } -// Date start - end -print ''; + +// Date start - end project +print ''; -// Budget -print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; @@ -388,7 +388,7 @@ $listofreferent = array( 'lang'=>'propal', 'buttonnew'=>'AddProp', 'testnew'=>$user->rights->propal->creer, - 'test'=>$conf->propal->enabled && $user->rights->propale->lire), + 'test'=>$conf->propal->enabled && $user->rights->propal->lire), 'order'=>array( 'name'=>"CustomersOrders", 'title'=>"ListOrdersAssociatedProject", diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index c5549429edb..f2889d7c469 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -117,7 +117,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -179,8 +179,15 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { } print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index ae0542d8b4b..8c6fc512509 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -43,7 +43,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $valsnb = array(); $valsamount = array(); $dataseries = array(); - // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not) + // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for sale orders), 3=Closed (Sent/Received, billed or not) while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj) { diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index ed8b87c9791..f8ac6301f99 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -132,7 +132,7 @@ $morehtmlref = '
    '; $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 29078c054a5..696888a75dd 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -143,15 +143,12 @@ $search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); $search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); $search_date_end_endday = GETPOST('search_date_end_endday', 'int'); $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver - +$search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); if ($search_status == '') { $search_status = -1; // -1 or 1 } -if (isModEnabled('categorie')) { - $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); -} // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Project($db); @@ -424,9 +421,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as p"; -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterJoinQuery(Categorie::TYPE_PROJECT, "p.rowid"); -} 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 (p.rowid = ef.fk_object)"; } @@ -447,9 +441,6 @@ if ($search_project_contact > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ecp_contact"; } $sql .= " WHERE p.entity IN (".getEntity('project').')'; -if (isModEnabled('categorie')) { - $sql .= Categorie::getFilterSelectQuery(Categorie::TYPE_PROJECT, "p.rowid", $search_category_array); -} if (empty($user->rights->projet->all->lire)) { $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users } @@ -569,6 +560,32 @@ if ($search_price_booth != '') { if ($search_login) { $sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login); } +// Search for tag/category ($searchCategoryProjectList is an array of ID) +$searchCategoryProjectList = $search_category_array; +$searchCategoryProjectOperator = 0; +if (!empty($searchCategoryProjectList)) { + $searchCategoryProjectSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProjectList as $searchCategoryProject) { + if (intval($searchCategoryProject) == -2) { + $searchCategoryProjectSqlList[] = "NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project)"; + } elseif (intval($searchCategoryProject) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + } + } + if ($listofcategoryid) { + $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProjectOperator == 1) { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProjectSqlList).")"; + } + } else { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProjectSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -1338,7 +1355,8 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date start + + // Date start project if (!empty($arrayfields['p.dateo']['checked'])) { print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; @@ -750,12 +750,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third } print ''; - // Date start + // Date start task print ''; - // Date end + // Date end task print ''; @@ -774,18 +774,14 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 1f5628bb050..4540112f4c3 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -132,7 +132,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -221,8 +221,15 @@ if ($id > 0 || !empty($ref)) { print ''; } - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 14a87b375e8..4bbc48900af 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -196,7 +196,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -257,8 +257,15 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 3e569cd557f..6a62e973a62 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -153,7 +153,7 @@ if ($object->id > 0) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -214,8 +214,15 @@ if ($object->id > 0) { } print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 2c84872bb38..76261480ffe 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -46,7 +46,7 @@ $mode = GETPOST('mode', 'aZ'); $id = GETPOST('id', 'int'); $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_categ = GETPOST("search_categ", 'alpha'); +$search_categ = GETPOST("search_categ", 'int'); $search_projectstatus = GETPOST('search_projectstatus'); if (!isset($search_projectstatus) || $search_projectstatus === '') { @@ -332,13 +332,9 @@ $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be $sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,"; $sql .= " s.nom as name, s.name_alias as alias, s.rowid as socid,"; $sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_update,"; -$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut, "; +$sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress, t.fk_statut,"; $sql .= " t.description, t.fk_task_parent"; $sql .= " ,t.budget_amount"; -// We'll need these fields in order to filter by categ -if ($search_categ > 0) { - $sql .= ", cs.fk_categorie, cs.fk_project"; -} // Add sum fields if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " , SUM(tt.task_duration * ".$db->ifsql("invoice_id IS NULL", "1", "0").") as tobill, SUM(tt.task_duration * ".$db->ifsql("invoice_id IS NULL", "0", "1").") as billed"; @@ -355,10 +351,6 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; -// We'll need this table joined to the select in order to filter by categ -if ($search_categ > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ -} $sql .= ", ".MAIN_DB_PREFIX."projet_task as t"; if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed']['checked'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tt ON tt.fk_task = t.rowid"; @@ -384,12 +376,6 @@ if (is_object($projectstatic) && $projectstatic->id > 0) { if ($socid) { $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } -if ($search_categ > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ); -} -if ($search_categ == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; -} if ($search_project_ref) { $sql .= natural_search('p.ref', $search_project_ref); } @@ -448,6 +434,32 @@ if ($search_project_user > 0) { if ($search_task_user > 0) { $sql .= " AND ect.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listoftaskcontacttype))).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".((int) $search_task_user); } +// Search for tag/category ($searchCategoryProjectList is an array of ID) +$searchCategoryProjectList = array($search_categ); +$searchCategoryProjectOperator = 0; +if (!empty($searchCategoryProjectList)) { + $searchCategoryProjectSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProjectList as $searchCategoryProject) { + if (intval($searchCategoryProject) == -2) { + $searchCategoryProjectSqlList[] = "NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project)"; + } elseif (intval($searchCategoryProject) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); + } + } + if ($listofcategoryid) { + $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProjectOperator == 1) { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProjectSqlList).")"; + } + } else { + if (!empty($searchCategoryProjectSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProjectSqlList).")"; + } + } +} // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -459,9 +471,6 @@ if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed $sql .= " s.nom, s.rowid,"; $sql .= " t.datec, t.dateo, t.datee, t.tms,"; $sql .= " t.rowid, t.ref, t.label, t.planned_workload, t.duration_effective, t.progress,t.budget_amount, t.fk_statut"; - if ($search_categ) { - $sql .= ", cs.fk_categorie, cs.fk_project"; - } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -675,7 +684,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; $tmptitle = $langs->trans('ProjectCategories'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', $search_categ, 'search_categ', 0, $tmptitle, 'maxwidth300'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', $search_categ, 'search_categ', 1, $tmptitle, 'maxwidth300'); $moreforfilter .= '
    '; } @@ -1108,7 +1117,8 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date start + + // Date start project if (!empty($arrayfields['t.dateo']['checked'])) { print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 77cd9f09c9e..8b19c8c0519 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -100,8 +100,11 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) { $object->ref = $taskref ? $taskref : GETPOST("ref", 'alpha', 2); $object->label = GETPOST("label", "alphanohtml"); - if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $object->description = GETPOST('description', "alphanohtml"); - else $object->description = GETPOST('description', "restricthtml"); + if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { + $object->description = GETPOST('description', "alphanohtml"); + } else { + $object->description = GETPOST('description', "restricthtml"); + } $object->fk_task_parent = $task_parent; $object->planned_workload = $planned_workload; $object->date_start = dol_mktime(GETPOST('dateohour', 'int'), GETPOST('dateomin', 'int'), 0, GETPOST('dateomonth', 'int'), GETPOST('dateoday', 'int'), GETPOST('dateoyear', 'int')); @@ -264,7 +267,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $projectstatic->title; // Thirdparty if (!empty($projectstatic->thirdparty->id) &&$projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -325,8 +328,15 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; @@ -491,18 +494,14 @@ if ($id > 0 || !empty($ref)) { print ''; print ''; print ''; @@ -578,7 +577,7 @@ if ($id > 0 || !empty($ref)) { } print ''; - // Date start - Date end + // Date start - Date end task print ''; - // Date start - end - print ''; + + // Date start - end project + print ''; - // Budget - print ''; - // Other attributes $cols = 2; - //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + $savobject = $object; + $object = $projectstatic; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + $object = $savobject; 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_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Other').' ('.$langs->trans("NotUsed").')'; - $doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), 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, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans('Other').' ('.$langs->trans("NotUsed").''; - $doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%'); + $doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_3, '90%'); $doleditor->Create(); print '
    '.$langs->trans("DateStart").''; - print $form->selectDate(($date_start ? $date_start : ''), 'projectstart', 0, 0, 0, '', 1, 0); - print '
    '.$langs->trans("DateEnd").''; - print $form->selectDate(($date_end ? $date_end : -1), 'projectend', 0, 0, 0, '', 1, 0); - print '
    '.$langs->trans("OpportunityStatus").'
    '.$langs->trans("Date").(isModEnabled('eventorganization') ? ' ('.$langs->trans("Project").')' : '').''; + print $form->selectDate(($date_start ? $date_start : ''), 'projectstart', 0, 0, 0, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate(($date_end ? $date_end : -1), 'projectend', 0, 0, 0, '', 1, 0); + print '
    '.$langs->trans("Date").' ('.$langs->trans("Event").')'; + print $form->selectDate(($date_start_event ? $date_start_event : -1), 'date_start_event', 1, 1, 1, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate(($date_end_event ? $date_end_event : -1), 'date_end_event', 1, 1, 1, '', 1, 0); + print '
    '.$langs->trans("Location").'
    '.$langs->trans("Description").''; @@ -852,11 +889,12 @@ if ($action == 'create' && $user->rights->projet->creer) { // Status print '
    '.$langs->trans("Status").''; - print ''; foreach ($object->statuts_short as $key => $val) { - print ''; + print ''; } print ''; + print ajax_combobox('status'); print '
    '.$langs->trans("DateStart").''; + // Budget + print '
    '.$langs->trans("Budget").''; + print $langs->getCurrencySymbol($conf->currency); + print '
    '.$langs->trans("Date").(isModEnabled('eventorganization') ? ' ('.$langs->trans("Project").')' : '').''; print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0); print '     rights->projet->creer) { print '/>'; print '
    '.$langs->trans("DateEnd").''; - print $form->selectDate($object->date_end ? $object->date_end : -1, 'projectend', 0, 0, 0, '', 1, 0); - print '
    '.$langs->trans("Date").' ('.$langs->trans("Event").')'; + print $form->selectDate(($date_start_event ? $date_start_event : ($object->date_start_event ? $object->date_start_event : -1)), 'date_start_event', 1, 1, 1, '', 1, 0); + print ' '.$langs->trans("to").' '; + print $form->selectDate(($date_end_event ? $date_end_event : ($object->date_end_event ? $object->date_end_event : -1)), 'date_end_event', 1, 1, 1, '', 1, 0); + print '
    '.$langs->trans("Budget").''; - print $langs->getCurrencySymbol($conf->currency); - print '
    '.$langs->trans("Location").'
    '.$langs->trans("Description").'
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; - $start = dol_print_date($object->date_start, 'day'); - print ($start ? $start : '?'); - $end = dol_print_date($object->date_end, 'day'); - print ' - '; - print ($end ? $end : '?'); - if ($object->hasDelay()) { - print img_warning("Late"); - } - print '
    '.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) { @@ -1162,6 +1214,18 @@ if ($action == 'create' && $user->rights->projet->creer) { } print '
    '.$langs->trans("Dates").''; + $start = dol_print_date($object->date_start, 'day'); + print ($start ? $start : '?'); + $end = dol_print_date($object->date_end, 'day'); + print ' - '; + print ($end ? $end : '?'); + if ($object->hasDelay()) { + print img_warning("Late"); + } + print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; -print dol_print_date($object->date_start, 'day'); -$end = dol_print_date($object->date_end, 'day'); -if ($end) { - print ' - '.$end; -} -print '
    '.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) { @@ -150,6 +141,15 @@ if (strcmp($object->budget_amount, '')) { } print '
    '.$langs->trans("Dates").''; +print dol_print_date($object->date_start, 'day'); +$end = dol_print_date($object->date_end, 'day'); +if ($end) { + print ' - '.$end; +} +print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print ''.price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency).''; + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -397,13 +404,6 @@ if ($id > 0 || !empty($ref)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 0, 0, 0, $conf->currency).''; - } - print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; +// Budget +print '
    '.$langs->trans("Budget").''; +if (strcmp($object->budget_amount, '')) { + print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; +} +print '
    '.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -319,13 +326,6 @@ if ($object->hasDelay()) { } print '
    '.$langs->trans("Budget").''; -if (strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; -} -print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -191,13 +198,6 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) { - print price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print '
    '; print dol_print_date($db->jdate($obj->date_start), 'day'); @@ -1347,7 +1365,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date end + // Date end project if (!empty($arrayfields['p.datee']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_end), 'day'); @@ -1356,6 +1374,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } + // Visibility if (!empty($arrayfields['p.public']['checked'])) { print ''; diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index ce099c04745..3ca7949b35a 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 73d3c238026..951406b4275 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -553,7 +553,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -614,8 +614,15 @@ if ($id > 0 || !empty($ref)) { } print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) { + print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($object->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'day'); @@ -626,13 +633,6 @@ if ($id > 0 || !empty($ref)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) { - print ''.price($object->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; - } - print '
    '.$langs->trans("DateStart").''; print $form->selectDate((!empty($date_start) ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1); print '
    '.$langs->trans("DateEnd").''; print $form->selectDate((!empty($date_end) ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1); print '
    '.$langs->trans("Description").''; - if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { - print ''; - } else { - // WYSIWYG editor - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { - $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; - } - $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); - print $doleditor->Create(); + // WYSIWYG editor + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0); + if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { + $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } + $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); + print $doleditor->Create(); print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -233,13 +240,6 @@ if ($id > 0 || !empty($ref)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -269,13 +276,6 @@ if ($id > 0 || !empty($ref)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -226,13 +233,6 @@ if ($object->id > 0) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print '
    '; print dol_print_date($db->jdate($obj->date_start), 'day'); @@ -1117,7 +1127,7 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } - // Date end + // Date end project if (!empty($arrayfields['t.datee']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_end), 'day'); diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 40f8f636e72..01c39c990f4 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -142,7 +142,7 @@ if ($object->id > 0) { $morehtmlref .= $projectstatic->title; // Thirdparty if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -203,8 +203,15 @@ if ($object->id > 0) { } print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -215,13 +222,6 @@ if ($object->id > 0) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency); - } - print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -337,13 +347,6 @@ if ($id > 0 || !empty($ref)) { } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; - } - print '
    '.$langs->trans("Description").''; - if (empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) { - print ''; - } else { - // WYSIWYG editor - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS) ? $conf->global->FCKEDITOR_ENABLE_DETAILS : 0); - if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { - $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; - } - $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); - print $doleditor->Create(); + // WYSIWYG editor + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $cked_enabled = (!empty($conf->global->FCKEDITOR_ENABLE_SOCIETE) ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0); + if (!empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) { + $nbrows = $conf->global->MAIN_INPUT_DESC_HEIGHT; } + $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); + print $doleditor->Create(); print '
    '.$langs->trans("Budget").'
    '.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; $start = dol_print_date($object->date_start, 'dayhour'); print ($start ? $start : '?'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 78f7c71ce68..8e30664232b 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -432,6 +432,9 @@ if ($action == 'confirm_generateinvoice') { $tmpinvoice->socid = $projectstatic->thirdparty->id; $tmpinvoice->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $tmpinvoice->fk_project = $projectstatic->id; + $tmpinvoice->cond_reglement_id = $projectstatic->thirdparty->cond_reglement_id; + $tmpinvoice->mode_reglement_id = $projectstatic->thirdparty->mode_reglement_id; + $tmpinvoice->fk_account = $projectstatic->thirdparty->fk_account; if ($invoiceToUse) { $tmpinvoice->fetch($invoiceToUse); @@ -903,7 +906,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $morehtmlref .= $projectstatic->title; // Thirdparty if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$projectstatic->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= ''; @@ -964,8 +967,15 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print '
    '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + // Budget + print '
    '.$langs->trans("Budget").''; + if (strcmp($projectstatic->budget_amount, '')) { + print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; + } + print '
    '.$langs->trans("Dates").''; $start = dol_print_date($projectstatic->date_start, 'day'); print ($start ? $start : '?'); $end = dol_print_date($projectstatic->date_end, 'day'); @@ -976,16 +986,12 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print '
    '.$langs->trans("Budget").''; - if (strcmp($projectstatic->budget_amount, '')) { - print ''.price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency).''; - } - print '
    '; @@ -1124,7 +1130,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } print ''; - // Date start - Date end + // Date start - Date end task print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; $start = dol_print_date($object->date_start, 'dayhour'); print ($start ? $start : '?'); diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 589bf2c8dac..8d7e4503c6b 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -475,7 +475,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); } - // Create invoice + // Create the draft invoice for the payment if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; @@ -524,12 +524,19 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); $labelforproduct = $outputlangs->trans("EventFee", $project->title); - $date_start = $project->date_start; - $date_end = $project->date_end; + if ($project->location) { + $labelforproduct .= ' - '.$project->location; + } + $date_start = $project->date_start_event; + $date_end = $project->date_end_event; // If there is no lines yet, we add one if (empty($facture->lines)) { - $result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1); + $pu_ttc = floatval($project->price_registration); + $pu_ht = 0; + $price_base_type = 'TTC'; + + $result = $facture->addline($labelforproduct, $pu_ht, 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 0, 0, '', $price_base_type, $pu_ttc, 1); if ($result <= 0) { $confattendee->error = $facture->error; $confattendee->errors = $facture->errors; @@ -642,28 +649,60 @@ print load_fiche_titre($langs->trans("NewRegistration"), '', '', 0, 0, 'center') print '
    '; print '
    '; -print '
    '; +print '
    '; // Welcome message -print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); +print ''.$langs->trans("EvntOrgWelcomeMessage").''; print '
    '; +print ''.$project->title . ' '. $conference->label.'
    '; +if ($project->date_start_event || $project->date_end_event) { + print ''; +} +if ($project->date_start_event) { + $format = 'day'; + $tmparray = dol_getdate($project->date_start_event, false, ''); + if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['minutes']) { + $format = 'dayhour'; + } + print dol_print_date($project->date_start_event, $format); +} +if ($project->date_start_event && $project->date_end_event) { + print ' - '; +} +if ($project->date_end_event) { + $format = 'day'; + $tmparray = dol_getdate($project->date_end_event, false, ''); + if ($tmparray['hours'] || $tmparray['minutes'] || $tmparray['minutes']) { + $format = 'dayhour'; + } + print dol_print_date($project->date_end_event, $format); +} +if ($project->date_start_event || $project->date_end_event) { + print '
    '; +} +if ($project->location) { + print ''.$project->location.'
    '; +} + $maxattendees = 0; -if ($conference->id) { +if ($conference->id > 0) { + /* date of project is not date of event so commented print $langs->trans("Date").': '; print dol_print_date($conference->datep); if ($conference->date_end) { print ' - '; print dol_print_date($conference->datef); - } + }*/ } else { + /* date of project is not date of event so commented print $langs->trans("Date").': '; print dol_print_date($project->date_start); if ($project->date_end) { print ' - '; print dol_print_date($project->date_end); - } - $maxattendees = $project->max_attendees; + }*/ + $maxattendees = $project->max_attendees; // Max attendeed for the project/event } print '
    '; @@ -674,7 +713,6 @@ if ($maxattendees && $currentnbofattendees >= $maxattendees) { } -print '
    '; dol_htmloutput_errors($errmsg, $errors); @@ -691,8 +729,8 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print ''; print '
    '; - - print '
    ' . $langs->trans("FieldsWithAreMandatory", '*') . '
    '; + print '
    '; + //print '' . $langs->trans("FieldsWithAreMandatory", '*') . '
    '; //print $langs->trans("FieldsWithIsForPublic",'**').'
    '; print dol_get_fiche_head(''); @@ -711,22 +749,26 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print '' . "\n"; // Email - print '' . "\n"; + print '' . "\n"; // Company - print '' . "\n"; + print 'price_registration)) ? '' : ' required').'>' . "\n"; // Email company for invoice if ($project->price_registration) { - print '' . "\n"; } @@ -743,7 +785,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print ''; // Country - print ''; } @@ -801,8 +843,8 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS } print ''; - print "\n"; + print "
    "; print ''; } diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 91c3ec2ce73..10cb5e4354f 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -78,6 +78,9 @@ $message = GETPOST('message', 'aZ09'); $suffix = GETPOST("suffix", 'aZ09'); $source = GETPOST("source", 'alpha'); $ref = $REF = GETPOST("ref", 'alpha'); +$urlok = ''; +$urlko = ''; + if (empty($source)) { $source = 'proposal'; @@ -130,6 +133,8 @@ if ($source == 'proposal') { $securekeyseed = getDolGlobalString('PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN'); } elseif ($source == 'contract') { $securekeyseed = getDolGlobalString('CONTRACT_ONLINE_SIGNATURE_SECURITY_TOKEN'); +} elseif ($source == 'fichinter') { + $securekeyseed = getDolGlobalString('FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN'); } if (!dol_verifyHash($securekeyseed.$type.$ref.(isModEnabled('multicompany') ? $entity : ''), $SECUREKEY, '0')) { httponly_accessforbidden('Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref), 403, 1); @@ -143,6 +148,10 @@ if ($source == 'proposal') { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $object = new Contrat($db); $result= $object->fetch(0, $ref); +} elseif ($source == 'fichinter') { + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $object = new Fichinter($db); + $result= $object->fetch(0, $ref); } else { httponly_accessforbidden($langs->trans('ErrorBadParameters')." - Bad value for source", 400, 1); } @@ -289,6 +298,9 @@ if (empty($text)) { } elseif ($source == 'contract') { $text .= ''."\n"; $text .= ''."\n"; + } elseif ($source == 'fichinter') { + $text .= ''."\n"; + $text .= ''."\n"; } } print $text; @@ -300,6 +312,8 @@ if ($source == 'proposal') { print ''."\n"; } elseif ($source == 'contract') { print ''."\n"; +} elseif ($source == 'fichinter') { + print ''."\n"; } $found = false; $error = 0; @@ -430,6 +444,55 @@ if ($source == 'proposal') { } + print ''; + print ''; + print ''."\n"; +} elseif ($source == 'fichinter') { // Signature on fichinter + $found = true; + $langs->load("fichinter"); + + $result = $object->fetch_thirdparty($object->socid); + // Proposer + print ''."\n"; + + // Target + print ''."\n"; + + // Object + $text = ''.$langs->trans("SignatureFichinterRef", $object->ref).''; + print ''."\n"; @@ -542,6 +605,12 @@ if ($action == "dosign" && empty($cancel)) { } else { print ''; } + } elseif ($source == 'fichinter') { + if ($message == 'signed') { + print ''.$langs->trans("FichinterSigned").''; + } else { + print ''; + } } } print ''."\n"; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index bd49b6afbe4..f11f8aea918 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -116,9 +116,9 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo if (GETPOST('nom', 'alphanohtml')) { $nouveauchoix = ''; for ($i = 0; $i < $nbcolonnes; $i++) { - if (GETPOSTISSET("choix$i") && GETPOST("choix$i") == '1') { + if (GETPOSTISSET("choix".$i) && GETPOST("choix".$i) == '1') { $nouveauchoix .= "1"; - } elseif (GETPOSTISSET("choix$i") && GETPOST("choix$i") == '2') { + } elseif (GETPOSTISSET("choix".$i) && GETPOST("choix".$i) == '2') { $nouveauchoix .= "2"; } else { $nouveauchoix .= "0"; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index d3b08e9672b..0941446b4fc 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1005,7 +1005,7 @@ if (!$source) { } -// Payment on customer order +// Payment on sales order if ($source == 'order') { $found = true; $langs->load("orders"); @@ -1361,10 +1361,6 @@ if ($source == 'contractline') { if ($contractline->description) { $text .= '
    '.dol_htmlentitiesbr($contractline->description); } - //if ($contractline->date_fin_validite) { - // $text.='
    '.$langs->trans("DateEndPlanned").': '; - // $text.=dol_print_date($contractline->date_fin_validite); - //} if ($contractline->date_end) { $text .= '
    '.$langs->trans("ExpiredSince").': '.dol_print_date($contractline->date_end); } diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 29adb2947d0..2504260cbc5 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -136,6 +136,10 @@ foreach ($_POST as $k => $v) { dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); +// Set $appli for emails title +$appli = $mysoc->name; + + if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice // Get on url call $fulltag = $FULLTAG; @@ -173,21 +177,6 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice $from = $conf->global->MAILING_EMAIL_FROM; $sendto = $sendemail; - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentFailed"); $content = ""; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 4d1336351b3..c56732f5938 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1266,7 +1266,7 @@ if ($ispaymentok) { $thirdparty = new Societe($db); $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); if ($resultthirdparty < 0) { - setEventMessages(null, $attendeetovalidate->errors, "errors"); + setEventMessages($resultthirdparty->error, $resultthirdparty->errors, "errors"); } else { require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -1289,11 +1289,10 @@ if ($ispaymentok) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = '['.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; + $subject = '['.$appli.'] '.$object->ref.' - '.$outputlangs->trans("NewRegistration").']'; $msg = $outputlangs->trans("OrganizationEventPaymentOfRegistrationWasReceived"); } - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); complete_substitutions_array($substitutionarray, $outputlangs, $object); @@ -1301,6 +1300,13 @@ if ($ispaymentok) { $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); $sendto = $attendeetovalidate->email; + $cc = ''; + if ($thirdparty->email) { + $cc = $thirdparty->email; + } + if ($attendeetovalidate->email_company && $attendeetovalidate->email_company != $thirdparty->email) { + $cc = ($cc ? ', ' : '').$attendeetovalidate->email_company; + } $from = $conf->global->MAILING_EMAIL_FROM; $urlback = $_SERVER["REQUEST_URI"]; @@ -1321,7 +1327,7 @@ if ($ispaymentok) { $listofmimes = array(dol_mimetype($file)); } - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, $listofpaths, $listofmimes, $listofnames, $cc, '', 0, $ishtml); $result = $mailfile->sendfile(); if ($result) { @@ -1493,7 +1499,7 @@ if ($ispaymentok) { $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = '['.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; + $subject = '['.$appli.'] '.$booth->ref.' - '.$outputlangs->trans("NewRegistration").']'; $msg = $outputlangs->trans("OrganizationEventPaymentOfBoothWasReceived"); } @@ -1542,6 +1548,11 @@ if ($ispaymentok) { } } + +// Set $appli for emails title +$appli = $mysoc->name; + + if ($ispaymentok) { // Get on url call $onlinetoken = empty($PAYPALTOKEN) ? $_SESSION['onlinetoken'] : $PAYPALTOKEN; @@ -1600,19 +1611,6 @@ if ($ispaymentok) { //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); @@ -1740,21 +1738,6 @@ if ($ispaymentok) { $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current - // Define link to login card - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - if (preg_match('/\d\.\d/', $appli)) { - if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) { - $appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core - } - } else { - $appli .= " ".DOL_VERSION; - } - } else { - $appli .= " ".DOL_VERSION; - } - $urlback = $_SERVER["REQUEST_URI"]; $topic = '['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content = ""; diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 24c0eaf6088..57cb82d9b08 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -94,7 +94,7 @@ if ($cancel) { $action = 'view'; } -if ($action == "view" || $action == "presend" || $action == "close" || $action == "confirm_public_close" || $action == "add_message") { +if ($action == "view" || $action == "presend" || $action == "dosubmit") { $error = 0; $display_ticket = false; if (!strlen($ref)) { @@ -119,11 +119,11 @@ if ($action == "view" || $action == "presend" || $action == "close" || $action = } /* - if (!$error && $action == "add_message" && $display_ticket && GETPOSTISSET('btn_add_message')) + if (!$error && $action == "dosubmit") { - // TODO Add message... - $ret = $object->newMessage($user, $action, 0, 1); + // Test MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS + // TODO Create job application @@ -136,7 +136,7 @@ if ($action == "view" || $action == "presend" || $action == "close" || $action = if ($error || $errors) { setEventMessages($object->error, $object->errors, 'errors'); - if ($action == "add_message") { + if ($action == "dosubmit") { $action = 'presend'; } else { $action = ''; @@ -185,7 +185,7 @@ print ''."\n"; print '
    '."\n"; print '
    '."\n"; print ''."\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 3f137148a89..bab3c501ca3 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -371,7 +371,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) { // New message - print ''; + print ''; // Close ticket if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) { diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index d69806f2517..9afa6ec57d8 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -51,10 +51,8 @@ if (isModEnabled("product") || isModEnabled("service")) { if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order")) { - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; if (isModEnabled('productbatch')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } @@ -1102,14 +1100,14 @@ if ($action == 'create') { $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($line->desc)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($line->desc)); print $form->textwithtooltip($text, $description, 3, '', '', $i); // Show range print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print ($line->desc && $line->desc != $line->product_label) ? '
    '.dol_htmlentitiesbr($line->desc) : ''; } } @@ -1380,39 +1378,25 @@ if ($action == 'create') { $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on reception - if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on reception, so we will use the project or source object instead - // TODO Add project on reception - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } @@ -1825,10 +1809,10 @@ if ($action == 'create') { if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { $text = $lines[$i]->product->getNomUrl(1); $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); print $form->textwithtooltip($text, $description, 3, '', '', $i); print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : 0, !empty($lines[$i]->date_end) ? $lines[$i]->date_end : 0); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ? '
    '.dol_htmlentitiesbr($lines[$i]->description) : ''; } } diff --git a/htdocs/reception/class/receptionstats.class.php b/htdocs/reception/class/receptionstats.class.php index a27f458d01a..7a8562b706d 100644 --- a/htdocs/reception/class/receptionstats.class.php +++ b/htdocs/reception/class/receptionstats.class.php @@ -69,7 +69,7 @@ class ReceptionStats extends Stats $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; - $this->where .= " AND c.entity = ".$conf->entity; + $this->where .= " AND c.entity IN (".getEntity('reception').")"; if (empty($user->rights->societe->client->voir) && !$this->socid) { $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } @@ -128,6 +128,54 @@ class ReceptionStats extends Stats return $this->_getNbByYear($sql); } + /** + * Return the orders amount by month for a year + * + * @param int $year Year to scan + * @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month + * @return array Array with amount by month + */ + public function getAmountByMonth($year, $format = 0) + { + global $user; + + $sql = "SELECT date_format(c.date_valid,'%m') as dm, SUM(c.".$this->field.")"; + $sql .= " FROM ".$this->from; + if (empty($user->rights->societe->client->voir) && !$this->socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + $res = $this->_getAmountByMonth($year, $sql, $format); + return $res; + } + + /** + * Return the orders amount average by month for a year + * + * @param int $year year for stats + * @return array array with number by month + */ + public function getAverageByMonth($year) + { + global $user; + + $sql = "SELECT date_format(c.date_valid,'%m') as dm, AVG(c.".$this->field.")"; + $sql .= " FROM ".$this->from; + if (empty($user->rights->societe->client->voir) && !$this->socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE c.date_valid BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; + $sql .= " AND ".$this->where; + $sql .= " GROUP BY dm"; + $sql .= $this->db->order('dm', 'DESC'); + + return $this->_getAverageByMonth($year, $sql); + } + /** * Return nb, total and average * diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 442657ecf43..a03460b1e49 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -35,6 +35,8 @@ if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; $langs->loadLangs(array("orders", "receptions", "companies")); @@ -75,6 +77,20 @@ if ($origin == 'reception') { } } +if (isModEnabled("reception")) { + $permissiontoread = $user->rights->reception->lire; + $permissiontoadd = $user->rights->reception->creer; + $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); + $permissiontodelete = $user->rights->reception->supprimer; +} else { + $permissiontoread = $user->rights->fournisseur->commande->receptionner; + $permissiontoadd = $user->rights->fournisseur->commande->receptionner; + $permissiondellink = $user->rights->fournisseur->commande->receptionner; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); + $permissiontodelete = $user->rights->fournisseur->commande->receptionner; +} + /* * Actions @@ -146,39 +162,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on reception - if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on reception, so we will use the project or source object instead - // TODO Add project on reception - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); + $morehtmlref .= $proj->getNomUrl(1); if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; } - } else { - $morehtmlref .= ''; } } } @@ -191,7 +193,7 @@ if ($id > 0 || !empty($ref)) { //print '
    '; print '
    '; - print '
    ' . $langs->trans("EmailAttendee") . '*'; + print '
    ' . $langs->trans("EmailAttendee") . ''; print img_picto('', 'email', 'class="pictofixedwidth"'); - print '
    ' . $langs->trans("Company"); + print '
    '; if (!empty(floatval($project->price_registration))) { - print '*'; + print ''; } - print ' '; + print $langs->trans("Company"); + if (!empty(floatval($project->price_registration))) { + print ''; + } + print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); - print '
    ' . $langs->trans("EmailCompanyForInvoice") . ''; + print '
    ' . $form->textwithpicto($langs->trans("EmailCompany"), $langs->trans("EmailCompanyForInvoice")) . ''; print img_picto('', 'email', 'class="pictofixedwidth"'); print '
    ' . $langs->trans('Country') . '*'; + print '
    trans('Country') . ''; print img_picto('', 'country', 'class="pictofixedwidth"'); $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { @@ -777,7 +819,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS if ($project->price_registration) { print '
    ' . $langs->trans('Price') . ''; - print price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency); + print ''.price($project->price_registration, 1, $langs, 1, -1, -1, $conf->currency).''; print '

    '.$langs->trans("WelcomeOnOnlineSignaturePageContract", $mysoc->name).'
    '.$langs->trans("ThisScreenAllowsYouToSignDocFromContract", $creditor).'


    '.$langs->trans("WelcomeOnOnlineSignaturePageFichinter", $mysoc->name).'
    '.$langs->trans("ThisScreenAllowsYouToSignDocFromFichinter", $creditor).'

    '.$langs->trans("ThisIsInformationOnDocumentToSignProposal").' :
    '.$langs->trans("ThisIsInformationOnDocumentToSignContract").' :
    '.$langs->trans("ThisIsInformationOnDocumentToSignFichinter").' :
    '.$langs->trans("Proposer"); + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$creditor.''; + print ''; + print '
    '.$langs->trans("ThirdParty"); + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print ''.$object->thirdparty->name.''; + print '
    '.$langs->trans("Designation"); + print ''.$text; + + $last_main_doc_file = $object->last_main_doc; + + if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT.'/'.$object->last_main_doc)) { + // It seems document has never been generated, or was generated and then deleted. + // So we try to regenerate it with its default template. + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. + $object->generateDocument($defaulttemplate, $langs); + } + + $directdownloadlink = $object->getLastMainDocLink('fichinter'); + if ($directdownloadlink) { + print '
    '; + print img_mime($object->last_main_doc, ''); + if ($message == "signed") { + print $langs->trans("DownloadSignedDocument").''; + } else { + print $langs->trans("DownloadDocument").''; + } + } + + print ''; print ''; print '
    '; + print '
    '; // Linked documents if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { print ''; if ($action != 'progression' && isset($object->status) && $object->status < $object::STATUS_CLOSED && !$user->socid) { - print ''; + print ''; } print '
    '; diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index 10227373015..980b5e50a33 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -37,6 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'other')); @@ -65,19 +67,48 @@ if (!$sortfield) { } $object = new Reception($db); - -if ($object->fetch($id, $ref)) { +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); $object->fetch_thirdparty(); + + if (!empty($object->origin)) { + $origin = $object->origin; + + $object->fetch_origin(); + $typeobject = $object->origin; + } + + // Linked documents + if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { + $objectsrc = new CommandeFournisseur($db); + $objectsrc->fetch($object->$typeobject->id); + } + $upload_dir = $conf->reception->dir_output."/".dol_sanitizeFileName($object->ref); } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('receptiondocument')); + // Security check -if ($user->socid) { +if ($user->socid > 0) { $socid = $user->socid; } $result = restrictedArea($user, 'reception', $object->id, ''); -$permissiontoadd = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php +if (isModEnabled("reception")) { + $permissiontoread = $user->rights->reception->lire; + $permissiontoadd = $user->rights->reception->creer; + $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); + $permissiontodelete = $user->rights->reception->supprimer; +} else { + $permissiontoread = $user->rights->fournisseur->commande->receptionner; + $permissiontoadd = $user->rights->fournisseur->commande->receptionner; + $permissiondellink = $user->rights->fournisseur->commande->receptionner; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); + $permissiontodelete = $user->rights->fournisseur->commande->receptionner; +} /* @@ -117,41 +148,30 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; + // Ref customer reception + $morehtmlref .= $form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if (0) { // Do not change on shipment - if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
    '; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= '
    '; + if (0) { // Do not change on reception + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on shipment, so we will use the project or source object instead - // TODO Add project on shipment - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->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/reception/note.php b/htdocs/reception/note.php index 617d260e643..d916099b872 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -28,11 +28,12 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; -dol_include_once('/fourn/class/fournisseur.commande.class.php'); if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; $langs->loadLangs(array("receptions", "companies", "bills", 'deliveries', 'orders', 'stocks', 'other', 'propal')); @@ -46,32 +47,41 @@ if ($id > 0 || !empty($ref)) { $object->fetch_thirdparty(); if (!empty($object->origin)) { - $typeobject = $object->origin; $origin = $object->origin; + $object->fetch_origin(); + $typeobject = $object->origin; } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { - $objectsrc = new Commande($db); - $objectsrc->fetch($object->$typeobject->id); - } - if ($typeobject == 'propal' && $object->$typeobject->id && isModEnabled("propal")) { - $objectsrc = new Propal($db); + if ($origin == 'order_supplier' && $object->$typeobject->id && (isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || isModEnabled("supplier_order"))) { + $objectsrc = new CommandeFournisseur($db); $objectsrc->fetch($object->$typeobject->id); } } -$permissionnote = $user->rights->reception->creer; // Used by the include of actions_setnotes.inc.php +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('receptionnote')); // Security check if ($user->socid > 0) { $socid = $user->socid; } - -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('receptionnote')); +if (isModEnabled("reception")) { + $permissiontoread = $user->rights->reception->lire; + $permissiontoadd = $user->rights->reception->creer; + $permissiondellink = $user->rights->reception->creer; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate))); + $permissiontodelete = $user->rights->reception->supprimer; +} else { + $permissiontoread = $user->rights->fournisseur->commande->receptionner; + $permissiontoadd = $user->rights->fournisseur->commande->receptionner; + $permissiondellink = $user->rights->fournisseur->commande->receptionner; // Used by the include of actions_dellink.inc.php + $permissiontovalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check))); + $permissiontodelete = $user->rights->fournisseur->commande->receptionner; +} +$permissionnote = $user->rights->reception->creer; // Used by the include of actions_setnotes.inc.php if ($origin == 'reception') { $result = restrictedArea($user, $origin, $object->id); @@ -106,7 +116,7 @@ if (empty($reshook)) { * View */ -llxHeader('', 'Reception'); +llxHeader('', $langs->trans('Reception')); $form = new Form($db); @@ -123,39 +133,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", '', $object->ref_supplier, $object, $user->rights->reception->creer, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if (0) { // Do not change on reception - if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; - } - if ($action == 'classify') { - // $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= '
    '; - } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify' && $permissiontoadd) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' '; } + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, ''); } else { - // We don't have project on reception, so we will use the project or source object instead - // TODO Add project on reception - $morehtmlref .= ' : '; - if (!empty($objectsrc->fk_project)) { + if (!empty($objectsrc) && !empty($objectsrc->fk_project)) { $proj = new Project($db); $proj->fetch($objectsrc->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/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php index 8772e97bf77..9635eba3e58 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentcandi /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for Job application */ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandidature { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php index ce96d1cd67b..4221915eb29 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_standard.php @@ -26,7 +26,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentcandi /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Job application */ class mod_recruitmentcandidature_standard extends ModeleNumRefRecruitmentCandidature { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index c280153f9c8..4f781a18214 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -30,7 +30,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentjobpo /** - * Class to manage customer Bom numbering rules advanced + * Class to manage the Advanced numbering rule for Job position */ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosition { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php index b2b413ee508..260ee510c5b 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_standard.php @@ -26,7 +26,7 @@ dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentjobpo /** - * Class to manage customer order numbering rules standard + * Class to manage the Standard numbering rule for Job positions */ class mod_recruitmentjobposition_standard extends ModeleNumRefRecruitmentJobPosition { diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 34b852574f6..0489d68bffb 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -303,7 +303,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 5b1bee43e56..b2edac8dd4d 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -300,7 +300,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ /* - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); print $sqlforcount; $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index a5ca456310e..c063e049f44 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -350,21 +350,29 @@ if (!$ret) { // Thirdparty //$morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project + $savobject = $object; + $object = $act; if (isModEnabled('project')) { $langs->load("projects"); - //$morehtmlref.='
    '.$langs->trans('Project') . ' '; - $morehtmlref .= $langs->trans('Project').': '; - if (!empty($act->fk_project)) { - $proj = new Project($db); - $proj->fetch($act->fk_project); - $morehtmlref .= ' : '.$proj->getNomUrl(1); - if ($proj->title) { - $morehtmlref .= ' - '.$proj->title; + //$morehtmlref .= '
    '; + if (0) { + $morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"'); + if ($action != 'classify') { + $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 { - $morehtmlref .= ''; + if (!empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref .= $proj->getNomUrl(1); + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } + } } } + $object = $savobject; $morehtmlref .= '
    '; dol_banner_tab($act, 'element_id', $linkback, ($user->socid ? 0 : 1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', ''); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 639879f8e17..e0efb53915b 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -403,10 +403,10 @@ print ''; // Ref print ''; // Label -print ''; +print ''; // Date start print ''; // Type print ''; // Bank account if (isModEnabled("banque")) { print ''; } @@ -546,7 +546,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Label payment - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } @@ -564,7 +564,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Employee - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c01f83401cf..66f7cb6ee79 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2268,14 +2268,15 @@ class Societe extends CommonObject /** * Add a discount for third party * - * @param float $remise Amount of discount - * @param User $user User adding discount - * @param string $desc Reason of discount - * @param string $vatrate VAT rate (may contain the vat code too). Exemple: '1.23', '1.23 (ABC)', ... - * @param int $discount_type 0 => customer discount, 1 => supplier discount - * @return int <0 if KO, id of discount record if OK + * @param float $remise Amount of discount + * @param User $user User adding discount + * @param string $desc Reason of discount + * @param string $vatrate VAT rate (may contain the vat code too). Exemple: '1.23', '1.23 (ABC)', ... + * @param int $discount_type 0 => customer discount, 1 => supplier discount + * @param string $price_base_type Price base type 'HT' or 'TTC' + * @return int <0 if KO, id of discount record if OK */ - public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0) + public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0, $price_base_type = 'HT') { // phpcs:enable global $langs; @@ -2310,9 +2311,15 @@ class Societe extends CommonObject $discount->discount_type = $discount_type; - $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT'); - $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $vatrate / 100, 'MT'); - $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($discount->amount_ht + $discount->amount_tva, 'MT'); + if ($price_base_type == 'TTC') { + $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($remise, 'MT'); + $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise / (1 + $vatrate / 100), 'MT'); + $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($discount->amount_ttc - $discount->amount_ht, 'MT'); + } else { + $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT'); + $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $vatrate / 100, 'MT'); + $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($discount->amount_ht + $discount->amount_tva, 'MT'); + } $discount->tva_tx = price2num($vatrate); $discount->vat_src_code = $vat_src_code; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 0ddbe7f2ad5..c74b5e68985 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -564,7 +564,7 @@ if ($sql_select) { } $text .= ' - '.(!empty($objp->label) ? $objp->label : $label); - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description)); + $description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description)); } if (($objp->info_bits & 2) == 2) { ?> @@ -619,7 +619,7 @@ if ($sql_select) { echo get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { print (!empty($objp->description) && $objp->description != $objp->product_label) ? '
    '.dol_htmlentitiesbr($objp->description) : ''; } } else { @@ -656,7 +656,7 @@ if ($sql_select) { // Show range $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) + if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) { $prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'
    '.dol_htmlentitiesbr($objp->description):''; } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 96e22d4d0b7..f32317163ad 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -478,13 +478,6 @@ $sql .= " region.code_region as region_code, region.nom as region_name"; if ($search_sale && $search_sale != '-1') { $sql .= ", sc.fk_soc, sc.fk_user"; } -// We'll need these fields in order to filter by categ -if ($search_categ_cus && $search_categ_cus != -1) { - $sql .= ", cc.fk_categorie, cc.fk_soc"; -} -if ($search_categ_sup && $search_categ_sup != -1) { - $sql .= ", cs.fk_categorie, cs.fk_soc"; -} // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -505,13 +498,6 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_ty $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_effectif)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region.code_region = state.fk_region)"; -// We'll need this table joined to the select in order to filter by categ -if (!empty($search_categ_cus) && $search_categ_cus != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ -} -if (!empty($search_categ_sup) && $search_categ_sup != '-1') { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ -} $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; // We'll need this table joined to the select in order to filter by sale if ($search_sale == -2) { @@ -540,26 +526,64 @@ if ($search_sale == -2) { } elseif ($search_sale > 0) { $sql .= " AND sc.fk_user = ".((int) $search_sale); } -if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); +$searchCategoryCustomerList = $search_categ_cus ? array($search_categ_cus) : array();; +$searchCategoryCustomerOperator = 0; +// Search for tag/category ($searchCategoryCustomerList is an array of ID) +if (!empty($searchCategoryCustomerList)) { + $searchCategoryCustomerSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryCustomerList as $searchCategoryCustomer) { + if (intval($searchCategoryCustomer) == -2) { + $searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategoryCustomer) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer); + } + } + if ($listofcategoryid) { + $searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryCustomerOperator == 1) { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryCustomerSqlList).")"; + } + } else { + if (!empty($searchCategoryCustomerSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryCustomerSqlList).")"; + } + } } -if ($search_categ_sup > 0) { - $sql .= " AND cs.fk_categorie = ".((int) $search_categ_sup); +$searchCategorySupplierList = $search_categ_sup ? array($search_categ_sup) : array(); +$searchCategorySupplierOperator = 0; +// Search for tag/category ($searchCategorySupplierList is an array of ID) +if (!empty($searchCategorySupplierList)) { + $searchCategorySupplierSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategorySupplierList as $searchCategorySupplier) { + if (intval($searchCategorySupplier) == -2) { + $searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)"; + } elseif (intval($searchCategorySupplier) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier); + } + } + if ($listofcategoryid) { + $searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategorySupplierOperator == 1) { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategorySupplierSqlList).")"; + } + } else { + if (!empty($searchCategorySupplierSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategorySupplierSqlList).")"; + } + } } -if ($search_categ_cus == -2) { - $sql .= " AND cc.fk_categorie IS NULL"; -} -if ($search_categ_sup == -2) { - $sql .= " AND cs.fk_categorie IS NULL"; -} - if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } if (strlen($search_cti)) { $sql .= natural_search('s.phone', $search_cti); } - if ($search_id > 0) { $sql .= natural_search("s.rowid", $search_id, 1); } @@ -698,7 +722,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { dol_print_error($db); }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 2ba271cd936..a7a7cd44972 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1591,16 +1591,16 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ($permissiontoaddupdatepaymentinformation) { if (empty($rib->stripe_card_ref)) { // Add link to create BAN on Stripe - print ''; + print ''; print img_picto($langs->trans("CreateBANOnStripe"), 'stripe'); print ''; } - print ''; + print ''; print img_picto($langs->trans("Modify"), 'edit'); print ''; - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; } diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index cc8178d2a01..25a4edb6123 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -908,7 +908,7 @@ class Stripe extends CommonObject $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.iban_prefix"; // stripe_card_ref is src_ for sepa $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; - $sql .= " WHERE sa.rowid = '".$this->db->escape($object->id)."'"; // We get record from ID, no need for filter on entity + $sql .= " WHERE sa.rowid = ".((int) $object->id); // We get record from ID, no need for filter on entity $sql .= " AND sa.type = 'ban'"; //type ban to get normal bank account of customer (prelevement) $soc = new Societe($this->db); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 76c4784b013..37853d1488a 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1613,7 +1613,7 @@ if ($action == 'create') { print '
    '; -print ''; +print ''; print ''; @@ -435,13 +435,13 @@ print ''; -print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, '', 1); +print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth125', 1); print ''; - $form->select_comptes($search_account, 'search_account', 0, '', 1); + print $form->select_comptes($search_account, 'search_account', 0, '', 1, '', 0, 'maxwidth125', 1); print '".dol_trunc($obj->label, 40)."'.dol_escape_htmltag($obj->label)."".$userstatic->getNomUrl(1)."'.$userstatic->getNomUrl(1)."
    '; // Relative and absolute discounts - if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { + if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) { $filterabsolutediscount = "fk_invoice_supplier_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_invoice_supplier_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice } else { diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index fde016c78c4..1fa344cbb5e 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php'; // Load translation files required by the page $langs->loadLangs(array("propal", "supplier_proposal", "facture", "orders", "sendings", "companies")); @@ -133,37 +135,25 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1); // Thirdparty - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1); // Project if (!empty($conf->project->enabled)) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; + $morehtmlref .= '
    '; if ($permissiontoedit) { + $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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $object->socid : -1), $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/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index a77c4eac47d..40cca19a8b1 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -90,7 +90,7 @@ if ($resql) { $dataseries = array(); $colorseries = array(); $vals = array(); - // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not) + // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for sales orders), 3=Closed (Sent/Received, billed or not) while ($i < $num) { $row = $db->fetch_row($resql); if ($row) { diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 9cd1a5fd5f0..c511d3e0529 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -414,7 +414,7 @@ $htmltext .= ''; print '
    '; print load_fiche_titre($langs->trans('FreeLegalTextOnInvoices'), '', ''); -print '
    '; +print '
    '; print '
    '; print ''; print ''; diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 1ee27c51f8b..671ef27ba96 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -84,6 +84,7 @@ if ($action == 'getProducts') { } unset($prod->fields); unset($prod->db); + $prod->price_formated=price(price2num($prod->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency); $res[] = $prod; } } @@ -301,7 +302,7 @@ if ($action == 'getProducts') { 'object' => 'product', 'img' => $ig, 'qty' => 1, - //'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) + 'price_formated' => price(price2num($obj->price, 'MU'), 1, $langs, 1, -1, -1, $conf->currency) ); // Add entries to row from hooks $parameters=array(); diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 1ffe5c63db3..f4a130dc5f1 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -825,3 +825,108 @@ div#moreinfo, div#infowarehouse { display: table; clear: both; } + +.div5 .imgadd { + display: none; +} + +@media screen and (max-width: 767px) { + .div4 { + height: auto; + width: 100%; + float: left; + box-sizing: border-box; + font-size: 6px; + padding-top: 10px; + padding-bottom: 2px; + margin-left: 2px; + } + + .div4 .wrapper.divempty, .div4 img, .div4 .wrapper:nth-last-child(1), .div4 .wrapper:nth-last-child(2), #prodiv22, #prodiv23, .catwatermark { + display: none!important; + } + + .tab-category { + float: left; + position: relative; + width: 25%; + height: 33%; + margin: 0; + padding: 1px; + border: 2px solid #EEE; + text-align: center; + box-sizing: border-box; + background-color: #fff; + } + + .div4 .wrapper, .tab-category { + width: auto; + height: auto; + padding: 6px; + text-align: center; + cursor: pointer; + border: 1px solid #FFF!important; + border-top: 3px solid #FFF!important; + } + + .div4 .tab-category.active { + border-right: 1px solid #CCC !important; + border-left: 1px solid #CCC !important; + border-top: 3px solid var(--colorbackhmenu1) !important; + } + + .div5 { + height: 100%; + width: 100%; + padding-top: 0px; + } + + div.description { + position: initial; + width: auto; + background-color: black; + opacity: 1; + text-align: center; + padding-top: 0px; + background: -webkit-linear-gradient(top, rgba(250,250,250,0), rgba(250,250,250,0.5), rgba(250,250,250,0.95), rgba(250,250,250,1)); + } + + .div5 .description .description_content { + font-weight: bold; + font-size: 14px; + padding-left: 10px; + } + + .div5 .wrapper2 { + width: 100%; + display: inline-flex; + align-items: center; + padding: 10px; + } + + .div5 .wrapper2.divempty { + display: none; + } + + div.wrapper2 { + float: none; + } + + .div5 .arrow { + width: auto; + height: auto; + display: none!important; + } + + .div5 .arrow .centerinmiddle { + transform: translate(0, 0); + } + + .div5 .imgadd { + display: flex; + } + + div.wrapper2{ + height:10%; + } +} \ No newline at end of file diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index c43d0ec092f..8be5a97e465 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -587,7 +587,9 @@ function New() { * return {void} */ function Search2(keyCodeForEnter, moreorless) { - console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter); + var eventKeyCode = window.event.keyCode; + + console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+", eventKeyCode="+eventKeyCode); var search_term = $('#search').val(); var search_start = 0; @@ -610,20 +612,19 @@ function Search2(keyCodeForEnter, moreorless) { } var search = false; - var eventKeyCode = window.event.keyCode; - if (keyCodeForEnter == '' || eventKeyCode == keyCodeForEnter) { + if (keyCodeForEnter != '' || eventKeyCode == keyCodeForEnter) { search = true; } if (search === true) { - - // temporization time to give time to type + // if a timer has been already started (search2_timer is a global js variable), we cancel it now + // we click onto another key, we will restart another timer just after if (search2_timer) { clearTimeout(search2_timer); } + // temporization time to give time to type search2_timer = setTimeout(function(){ - pageproducts = 0; jQuery(".wrapper2 .catwatermark").hide(); var nbsearchresults = 0; @@ -695,8 +696,8 @@ function Search2(keyCodeForEnter, moreorless) { if (data.length == 0) { $('#search').val('load('errors'); - echo dol_escape_js($langs->trans("ErrorRecordNotFound")); - ?>'); + echo dol_escape_js($langs->transnoentitiesnoconv("ErrorRecordNotFoundShort")); + ?> ('+search_term+')'); $('#search').select(); } else ClearSearch(); @@ -1345,7 +1346,7 @@ if (!empty($conf->global->TAKEPOS_WEIGHING_SCALE)) { onclick="MoreProducts('less');" : 4px; } +.paddingleftimp { + padding-: 4px !important; +} .paddingleft2 { padding-: 2px; } @@ -855,6 +858,9 @@ textarea.centpercent { .paddingright { padding-: 4px; } +.paddingrightimp { + padding-: 4px !important; +} .paddingright2 { padding-: 2px; } @@ -1295,6 +1301,10 @@ select.flat.selectlimit { text-overflow: ellipsis; white-space: nowrap; } +.spanoverflow { + overflow-x: clip; + text-overflow: ellipsis; +} .tdoverflowmax50 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 50px; overflow: hidden; @@ -1383,6 +1393,7 @@ select.flat.selectlimit { -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; + height: auto !important; } .tablelistofcalendars { @@ -1572,6 +1583,7 @@ table[summary="list_of_modules"] .fa-cog { .widthauto { width: auto; } .width20 { width: 20px; } .width25 { width: 25px; } +.width40 { width: 40px; } .width50 { width: 50px; } .width75 { width: 75px; } .width100 { width: 100px; } @@ -3318,7 +3330,14 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { font-weight: bold !important; } +.divfmdirlia { + width: calc(100% - 100px); +} +a.fmdirlia { + white-space: break-spaces; + word-break: break-all; +} /* ============================================================================== */ @@ -4318,9 +4337,9 @@ div.tabBar .noborder { /* Prepare to remove class pair - impair */ -.noborder:not(.editmode) > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) +.noborder:not(.editmode) > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre):not(.nooddeven) { background: linear-gradient(bottom, var(----colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); @@ -4333,9 +4352,9 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nt border-bottom: 1px solid #e0e0e0; } -.noborder:not(.editmode) > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) +.noborder:not(.editmode) > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre):not(.nooddeven) { background: linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklinepair2) 0%, var(--colorbacklinepair2) 100%); @@ -4858,8 +4877,13 @@ input#cardholder-name { } .divmainbodylarge { margin-left: 40px; margin-right: 40px; } +.publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } +#divsubscribe .eventlabel { font-size: 1.5em; } #tablesubscribe { width: 100%; } +#tablesubscribe tr td { font-size: 1.15em; } +#tablesubscribe .price-registration { font-size: 1.5em; } + div#card-element { border: 1px solid #ccc; @@ -5589,7 +5613,13 @@ a.cke_dialog_ui_button } .cke_dialog_ui_hbox_last { - vertical-align: bottom ! important; + vertical-align: bottom !important; +} +.cke_dialog_ui_hbox_first { + vertical-align: middle !important; +} +.cke_combo_text { + width: 40px !important; } /* .cke_editable @@ -5883,6 +5913,12 @@ ul.ecmjqft a { font-weight:normal; display: inline-block !important; } +ul.ecmjqft > a { + width: calc(100% - 100px); + overflow: hidden; + white-space: break-spaces; + word-break: break-all; +} ul.ecmjqft a:active { font-weight: bold !important; } @@ -6406,9 +6442,14 @@ ul.select2-results__options li { @media only screen and (min-width: 767px) { + /* CSS to have the dropdown boxes larger that the input search area */ .select2-container.select2-container--open .select2-dropdown.ui-dialog { - min-width: 200px !important; + min-width: 220px !important; } + .select2-container.select2-container--open .select2-dropdown--below { + min-width: 220px !important; + } + .select2-container--open .select2-dropdown--below { border-top: 1px solid var(--inputbordercolor); /* border-top: 1px solid #aaaaaa; */ @@ -6583,6 +6624,7 @@ dl.dropdown { max-height: 264px; overflow: auto; border-radius: 2px; + z-index: 1; } .dropdown dd ul.selectedfieldsleft { right: auto; diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php index 4a36177e852..cfa1afbc9f2 100644 --- a/htdocs/theme/md/badges.inc.php +++ b/htdocs/theme/md/badges.inc.php @@ -69,6 +69,7 @@ span.badgeneutral { background-color: #e4e4e4; color: #666; border-radius: 10px; + white-space: nowrap; } diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js index 06fa5746e7f..c7e10f9a123 100644 --- a/htdocs/theme/md/ckeditor/config.js +++ b/htdocs/theme/md/ckeditor/config.js @@ -46,8 +46,8 @@ CKEDITOR.editorConfig = function( config ) ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], ['BidiLtr', 'BidiRtl'], - ['Link','Unlink','Anchor'], - ['Image','Table','HorizontalRule','Smiley','SpecialChar'], + ['Link','Unlink'], + ['Image','Table','HorizontalRule','Smiley'], ['Styles','Format','Font','FontSize'], ['TextColor','BGColor'], ['Source'] @@ -64,7 +64,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'], + ['Link','Unlink','Image','Table','HorizontalRule'], ['Source'] ]; @@ -78,7 +78,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'], + ['Link','Unlink','Image','Table','HorizontalRule'], ['Source'] ]; @@ -91,7 +91,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','-','TextColor','RemoveFormat'], // ,'Subscript','Superscript' useless ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','SpecialChar'], + ['Link','Unlink'], ['Source'] ]; @@ -100,6 +100,7 @@ CKEDITOR.editorConfig = function( config ) [ ['Maximize'], ['Find'], + ['Image'], ['Source'] ]; }; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 874e77985a2..002166968cd 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -997,6 +997,9 @@ textarea.centpercent { .paddingleft { padding-: 4px; } +.paddingleftimp { + padding-: 4px !important; +} .paddingleft2 { padding-: 2px; } @@ -1006,6 +1009,9 @@ textarea.centpercent { .paddingright { padding-: 4px; } +.paddingrightimp { + padding-: 4px !important; +} .paddingright2 { padding-: 2px; } @@ -1405,12 +1411,19 @@ select.flat.selectlimit { width: 130px; } /* using a tdoverflowxxx make the min-width not working */ +.tdnooverflowimp { + text-overflow: none; +} .tdoverflow { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.spanoverflow { + overflow-x: clip; + text-overflow: ellipsis; +} .tdoverflowmax50 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 50px; overflow: hidden; @@ -1499,6 +1512,7 @@ select.flat.selectlimit { -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; + height: auto !important; } .tablelistofcalendars { @@ -1663,6 +1677,7 @@ tr.nobottom td { .widthauto { width: auto; } .width20 { width: 20px; } .width25 { width: 25px; } +.width40 { width: 40px; } .width50 { width: 50px; } .width75 { width: 75px; } .width100 { width: 100px; } @@ -3303,6 +3318,11 @@ li.expanded > a.fmdirlia.jqft.ecmjqft { font-weight: bold !important; } +a.fmdirlia { + white-space: break-spaces; + word-break: break-all; +} + /* ============================================================================== */ /* Onglets */ @@ -4262,9 +4282,9 @@ div .tdtop:not(.tagtdnote) { /* Prepare to remove class pair - impair */ -.noborder > tbody > tr:nth-child(even):not(.liste_titre), .liste > tbody > tr:nth-child(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre), .liste > tbody > tr:nth-of-type(even):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre) +.noborder > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-child(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(even):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(even):not(.liste_titre):not(.nooddeven) { background: linear-gradient(to bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklineimpair2) 0%, var(--colorbacklineimpair2) 100%); @@ -4277,9 +4297,9 @@ div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nt border-bottom: 1px solid #ddd; } -.noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre), -div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre) +.noborder > tbody > tr:nth-child(odd):not(.liste_titre), .liste > tbody > tr:nth-child(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) > .border > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), .liste > tbody > tr:nth-of-type(odd):not(.liste_titre):not(.nooddeven), +div:not(.fichecenter):not(.fichehalfleft):not(.fichehalfright) .oddeven.tagtr:nth-of-type(odd):not(.liste_titre):not(.nooddeven) { background: linear-gradient(to bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); background: -o-linear-gradient(bottom, var(--colorbacklinepair1) 0%, var(--colorbacklinepair2) 100%); @@ -4710,8 +4730,13 @@ span.buttonpaymentsmall { #tablepublicpayment tr.liste_total td { border-top: none; } .divmainbodylarge { margin-left: 40px; margin-right: 40px; } +.publicnewmemberform div.titre { font-size: 2em; } #divsubscribe { max-width: 900px; } +#divsubscribe .eventlabel { font-size: 1.5em; } #tablesubscribe { width: 100%; } +#tablesubscribe tr td { font-size: 1.15em; } +#tablesubscribe .price-registration { font-size: 1.5em; } + div#card-element { border: 1px solid #ccc; @@ -5430,7 +5455,14 @@ a.cke_dialog_ui_button } .cke_dialog_ui_hbox_last { - vertical-align: bottom ! important; + vertical-align: bottom !important; +} +.cke_dialog_ui_hbox_last +{ + vertical-align: bottom !important; +} +.cke_combo_text { + width: 40px !important; } /* .cke_editable @@ -5718,6 +5750,12 @@ ul.ecmjqft a { font-weight:normal; display: inline-block !important; } +ul.ecmjqft > a { + width: calc(100% - 100px); + overflow: hidden; + white-space: break-spaces; + word-break: break-all; +} ul.ecmjqft a:active { font-weight: bold !important; } @@ -6171,9 +6209,14 @@ ul.select2-results__options li { @media only screen and (min-width: 767px) { + /* CSS to have the dropdown boxes larger that the input search area */ .select2-container.select2-container--open .select2-dropdown.ui-dialog { - min-width: 200px !important; + min-width: 220px !important; } + .select2-container.select2-container--open .select2-dropdown--below { + min-width: 220px !important; + } + .select2-container--open .select2-dropdown--below { border-top: 1px solid var(--inputbordercolor); /* border-top: 1px solid #aaaaaa; */ @@ -6341,6 +6384,7 @@ dl.dropdown { list-style:none; max-height: 264px; overflow: auto; + z-index: 1; } .dropdown dd ul.selectedfieldsleft { right: auto; diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9adffdfd720..9111faedcb7 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'other', 'ticket')); @@ -94,6 +99,7 @@ if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && accessforbidden(); } +$permissiontoadd = $user->rights->ticket->write; /* @@ -177,45 +183,33 @@ if ($object->fk_user_create > 0) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; - }*/ - $morehtmlref .= ' : '; - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= '
    '; + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project'); - if ($user->rights->ticket->write) { + if (0) { + $morehtmlref .= '
    '; + $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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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)) { + $morehtmlref .= '
    '; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } @@ -259,7 +253,7 @@ if (!empty($object->id)) { // Show link to add event (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep=now&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 0bd6a98cab9..20cee1a2cfa 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -126,6 +126,8 @@ $permissiontoadd = $user->rights->ticket->write; $actionobject = new ActionsTicket($db); +$upload_dir = $conf->ticket->dir_output; + $now = dol_now(); @@ -444,11 +446,7 @@ if (empty($reshook)) { if ($ret > 0) { if (!empty($backtopage)) { - if (empty($id)) { - $url = $backtopage; - } else { - $url = 'card.php?track_id='.urlencode($object->track_id); - } + $url = $backtopage; } else { $url = 'card.php?track_id='.urlencode($object->track_id); } @@ -456,7 +454,7 @@ if (empty($reshook)) { header("Location: ".$url); exit; } else { - setEventMessages($object->error, null, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action = 'presend'; } } @@ -686,10 +684,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once // Actions to build doc - $upload_dir = $conf->ticket->dir_output; $permissiontoadd = $user->rights->ticket->write; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; //var_dump($action);exit; + // Actions to send emails $triggersendname = 'TICKET_SENTBYMAIL'; $paramname = 'id'; @@ -943,53 +941,47 @@ if ($action == 'create' || $action == 'presend') { } elseif (!empty($object->email_msgid)) { $morehtmlref .= '
    '.$langs->trans("CreatedBy").' : '; $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; + $htmltooltip = $langs->trans("EmailMsgID").': '.$object->email_msgid; + $htmltooltip .= '
    '.$langs->trans("EmailDate").': '.dol_print_date($object->email_date, 'dayhour'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' - '.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $htmltooltip, 1, 'help', '', 0, 3, 'tooltip').''; } elseif (!empty($object->origin_email)) { $morehtmlref .= '
    '.$langs->trans("CreatedBy").' : '; $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; + $htmltooptip = $langs->trans("IP").': '.$object->ip; + $morehtmlref .= dol_escape_htmltag($object->origin_email).' - '.$form->textwithpicto($langs->trans("CreatedByPublicPortal"), $htmltooptip, 1, 'help', '', 0, 3, 'tooltip').''; } + $permissiontoedit = $object->status < 8 && !$user->socid && $user->rights->ticket->write; + //$permissiontoedit = 0; + // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' '; - if ($action != 'editcustomer' && $object->status < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('Edit'), 0).' : '; - } - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= '
    '; + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && $permissiontoedit) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->ticket->write) { + $morehtmlref .= '
    '; + if ($permissiontoedit) { + $object->fetch_project(); + $morehtmlref .= img_picto($langs->trans("Project"), 'project'.((is_object($object->project) && $object->project->public) ? 'pub' : ''), '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 .= ''; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); - $morehtmlref .= ''; - $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); - } else { - $morehtmlref .= ''; + $object->fetch_project(); + $morehtmlref .= $object->project->getNomUrl(1); + if ($object->project->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($object->project->title).''; + } } } } @@ -1071,7 +1063,7 @@ if ($action == 'create' || $action == 'presend') { print '
    '.$langs->trans("Parameters").''.$langs->trans('Value').'
    '; print $langs->trans("AssignedTo"); if (isset($object->status) && $object->status < $object::STATUS_CLOSED && GETPOST('set', 'alpha') != "assign_ticket" && $user->rights->ticket->manage) { - print ''.img_edit($langs->trans('Modify'), '').''; + print ''.img_edit($langs->trans('Modify'), '').''; } print '
    '; print '
    '; @@ -1099,7 +1091,7 @@ if ($action == 'create' || $action == 'presend') { print $langs->trans('Progression').''; print ''.img_edit($langs->trans('Modify')).''.img_edit($langs->trans('Modify')).'
    '; print ''; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 9a01c5cf7d2..133fb72e7f2 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -164,7 +164,7 @@ class ActionsTicket } elseif ($action == 'view') { return $langs->trans("TicketCard"); } elseif ($action == 'add_message') { - return $langs->trans("AddMessage"); + return $langs->trans("TicketAddMessage"); } else { return $langs->trans("TicketsManagement"); } diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 2fd77693984..e7930569bdd 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -181,36 +181,6 @@ class Tickets extends DolibarrApi $this->ticket->messages = $messages; } - // History - $history = array(); - $this->ticket->loadCacheLogsTicket(); - if (is_array($this->ticket->cache_logs_ticket) && count($this->ticket->cache_logs_ticket) > 0) { - $num = count($this->ticket->cache_logs_ticket); - $i = 0; - $user_action = new User($this->db); - - while ($i < $num) { - $userstring = ''; - if ($this->ticket->cache_logs_ticket[$i]['fk_user_create'] > 0) { - $user_action->fetch($this->ticket->cache_logs_ticket[$i]['fk_user_create']); - - $userstring = dolGetFirstLastname($user_action->firstname, $user_action->lastname); - } - - // Now define messages - $history[] = array( - 'id' => $this->ticket->cache_logs_ticket[$i]['id'], - 'fk_user_author' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'], - 'fk_user_action' => $this->ticket->cache_logs_ticket[$i]['fk_user_create'], - 'fk_user_action_string' => $userstring, - 'message' => $this->ticket->cache_logs_ticket[$i]['message'], - 'datec' => $this->ticket->cache_logs_ticket[$i]['datec'], - ); - $i++; - } - $this->ticket->history = $history; - } - if (!DolibarrApi::_checkAccessToResource('ticket', $this->ticket->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -246,6 +216,7 @@ class Tickets extends DolibarrApi $socid = DolibarrApiAccess::$user->socid; } + $search_sale = null; // If the internal user must only see his customers, force searching by him $search_sale = 0; if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 4acc9104454..3a6adeb6c20 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1580,144 +1580,6 @@ class Ticket extends CommonObject } } - - /** - * Send notification of changes by email - * - * @param User $user User that create - * @param string $message Log message - * @return int <0 if KO, >0 if OK (number of emails sent) - */ - private function sendLogByEmail($user, $message) - { - global $conf, $langs; - - $nb_sent = 0; - - $langs->load('ticket'); - - // Retrieve email of all contacts (internal and external) - $contacts = $this->listeContact(-1, 'internal'); - $contacts = array_merge($contacts, $this->listeContact(-1, 'external')); - - /* If origin_email and no socid, we add email to the list * */ - if (!empty($this->origin_email) && empty($this->fk_soc)) { - $array_ext = array(array('firstname' => '', 'lastname' => '', 'email' => $this->origin_email, 'libelle' => $langs->transnoentities('TicketEmailOriginIssuer'), 'socid' => "-1")); - $contacts = array_merge($contacts, $array_ext); - } - - if (!empty($this->fk_soc)) { - $this->fetch_thirdparty($this->fk_soc); - $array_company = array(array('firstname' => '', 'lastname' => $this->client->name, 'email' => $this->client->email, 'libelle' => $langs->transnoentities('Customer'), 'socid' => $this->client->id)); - $contacts = array_merge($contacts, $array_company); - } - - // foreach contact send email with notification message - if (count($contacts) > 0) { - foreach ($contacts as $key => $info_sendto) { - $tmpmessage = ''; - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNotificationEmailSubject', $this->track_id); - $tmpmessage .= $langs->transnoentities('TicketNotificationEmailBody', $this->track_id)."\n\n"; - $tmpmessage .= $langs->transnoentities('Title').' : '.$this->subject."\n"; - - $recipient_name = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1'); - $recipient = (!empty($recipient_name) ? $recipient_name : $info_sendto['email']).' ('.strtolower($info_sendto['libelle']).')'; - $tmpmessage .= $langs->transnoentities('TicketNotificationRecipient').' : '.$recipient."\n"; - $tmpmessage .= "\n"; - $tmpmessage .= '* '.$langs->transnoentities('TicketNotificationLogMessage').' *'."\n"; - $tmpmessage .= dol_html_entity_decode($message, ENT_QUOTES | ENT_HTML5)."\n"; - - if ($info_sendto['source'] == 'internal') { - $url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$this->track_id; - $tmpmessage .= "\n".$langs->transnoentities('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$this->track_id.''."\n"; - } else { - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$this->track_id; - $tmpmessage .= "\n".$langs->transnoentities('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$this->track_id.''."\n"; - } - - $tmpmessage .= "\n"; - $tmpmessage .= $langs->transnoentities('TicketEmailPleaseDoNotReplyToThisEmail')."\n"; - - $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; - $replyto = $from; - - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); - - $tmpmessage = dol_nl2br($tmpmessage); - - if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $sendtocc = ''; - $deliveryreceipt = 0; - $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $tmpmessage, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error || !empty($mailfile->errors)) { - setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } else { - $result = $mailfile->sendfile(); - if ($result > 0) { - $nb_sent++; - } - } - if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } - } - - setEventMessages($langs->trans('TicketNotificationNumberEmailSent', $nb_sent), null, 'mesgs'); - } - - return $nb_sent; - } - - /** - * Charge la liste des actions sur le ticket - * - * @return int Number of lines loaded, 0 if already loaded, <0 if KO - */ - public function loadCacheLogsTicket() - { - global $langs; - - if (is_array($this->cache_logs_ticket) && count($this->cache_logs_ticket)) { - return 0; - } - // Cache deja charge - - // TODO Read the table llx_actioncomm - /* - $sql = "SELECT rowid, fk_user_create, datec, message"; - $sql .= " FROM " . MAIN_DB_PREFIX . "ticket_logs"; - $sql .= " WHERE fk_track_id ='" . $this->db->escape($this->track_id) . "'"; - $sql .= " ORDER BY datec DESC"; - - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < $num) { - $obj = $this->db->fetch_object($resql); - $this->cache_logs_ticket[$i]['id'] = $obj->rowid; - $this->cache_logs_ticket[$i]['fk_user_create'] = $obj->fk_user_create; - $this->cache_logs_ticket[$i]['datec'] = $this->db->jdate($obj->datec); - $this->cache_logs_ticket[$i]['message'] = $obj->message; - $i++; - } - return $num; - } else { - $this->error = "Error " . $this->db->lasterror(); - dol_syslog(get_class($this) . "::loadCacheLogsTicket " . $this->error, LOG_ERR); - return -1; - }*/ - - return 0; - } - /** * Add message into database * @@ -2792,7 +2654,7 @@ class Ticket extends CommonObject if ($result) { // update last_msg_sent date $this->date_last_msg_sent = dol_now(); - $this->update($user); + $this->update($user, 1); // disable trigger when updatin date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table. } } } @@ -2800,8 +2662,8 @@ class Ticket extends CommonObject } } - // Set status to "answered" if not set yet, but only if internal user - if ($object->status < 3 && !$user->socid) { + // Set status to "answered" if not set yet, but only if internal user and not private message + if ($object->status < 3 && !$user->socid && !$private) { $object->setStatut(3); } return 1; @@ -2869,9 +2731,11 @@ class Ticket extends CommonObject $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } + $upload_dir_tmp = $conf->user->dir_output."/".$user->id.'/temp'; + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $trackid = "tic".$this->id; - $mailfile = new CMailFile($subject, $receiver, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, '', 'ticket'); + $mailfile = new CMailFile($subject, $receiver, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', $trackid, '', 'ticket', '', $upload_dir_tmp); if ($mailfile->error) { setEventMessages($mailfile->error, null, 'errors'); } else { diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index bf39f123708..7f5a36faf1b 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -34,6 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'ticket')); @@ -212,45 +217,33 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; - }*/ - $morehtmlref .= ' : '; - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= '
    '; + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->ticket->write) { + if (0) { + $morehtmlref .= '
    '; + $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 .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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)) { + $morehtmlref .= '
    '; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 5a7d46540c4..8015cb32145 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -33,6 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array("companies", "other", "ticket", "mails")); @@ -147,45 +152,33 @@ if ($object->id) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; - }*/ - $morehtmlref .= ' : '; - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + $morehtmlref .= '
    '; + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project').' '; - if ($user->rights->ticket->write) { + if (0) { + $morehtmlref .= '
    '; + $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 .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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)) { + $morehtmlref .= '
    '; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index fd4d7f15f9e..66bda452ccf 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -397,6 +397,12 @@ foreach ($search as $key => $val) { $sql .= natural_search($key, $search[$key], 2); } continue; + } elseif ($key == 'type_code') { + $newarrayoftypecodes = is_array($search[$key]) ? $search[$key] : (!empty($search[$key]) ? explode(',', $search[$key]) : array()); + if (count($newarrayoftypecodes)) { + $sql .= natural_search($key, join(',', $newarrayoftypecodes), 3); + } + continue; } $mode_search = ((!empty($object->fields[$key]) && ($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key]))) ? 1 : 0); @@ -452,7 +458,7 @@ $sql .= $hookmanager->resPrint; $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); $objforcount = $db->fetch_object($resql); $nbtotalofrecords = $objforcount->nbtotalofrecords; @@ -572,7 +578,7 @@ if ($projectid > 0 || $project_ref) { $morehtmlref .= $object->title; // Thirdparty if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= '
    '.$object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref .= '
    '; @@ -587,7 +593,7 @@ if ($projectid > 0 || $project_ref) { print '
    '; print '
    '; - print ''; + print '
    '; // Visibility print ''; } elseif ($key == 'type_code') { print ''; } elseif ($key == 'category_code') { print '\n"; - // Signature print ''; print ''; + // Note private + print '\n"; + + // Note private + print '\n"; print '
    '.$langs->trans("Visibility").''; @@ -814,7 +820,7 @@ foreach ($object->fields as $key => $val) { print ''; - $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); + $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150'), 1); print ''; diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index fb95c5a66f1..bd06bd32e94 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -30,6 +30,11 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +if (isModEnabled('project')) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} // Load translation files required by the page $langs->loadLangs(array('companies', 'other', 'ticket')); @@ -173,46 +178,34 @@ if ($object->fk_user_create > 0) { // Thirdparty if (isModEnabled("societe")) { - $morehtmlref .= '
    '.$langs->trans('ThirdParty'); - /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . ''; - }*/ - $morehtmlref .= ' : '; - if ($action == 'editcustomer') { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'editcustomer', '', 1, 0, 0, array(), 1); - } else { - $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, 'none', '', 1, 0, 0, array(), 1); + if (isModEnabled("societe")) { + $morehtmlref .= '
    '; + $morehtmlref .= img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth"'); + if ($action != 'editcustomer' && 0) { + $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetThirdParty'), 0).' '; + } + $morehtmlref .= $form->form_thirdparty($url_page_current.'?track_id='.$object->track_id, $object->socid, $action == 'editcustomer' ? 'editcustomer' : 'none', '', 1, 0, 0, array(), 1); } } // Project if (isModEnabled('project')) { $langs->load("projects"); - $morehtmlref .= '
    '.$langs->trans('Project'); - if ($user->rights->ticket->write) { + $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 .= '
    '; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $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)) { - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $proj = new Project($db); $proj->fetch($object->fk_project); $morehtmlref .= $proj->getNomUrl(1); - } else { - $morehtmlref .= ''; + if ($proj->title) { + $morehtmlref .= ' - '.dol_escape_htmltag($proj->title).''; + } } } } @@ -256,7 +249,7 @@ if (!empty($object->id)) { // Show link to add event (if read and not closed) $btnstatus = $object->status < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage"; - $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); + $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep=now&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id); $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3c65d018e6b..905be457810 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -276,8 +276,8 @@ if (empty($reshook)) { $object->job = GETPOST("job", 'alphanohtml'); $object->signature = GETPOST("signature", 'restricthtml'); $object->accountancy_code = GETPOST("accountancy_code", 'alphanohtml'); - $object->note = GETPOST("note", 'restricthtml'); - $object->note_private = GETPOST("note", 'restricthtml'); + $object->note_public = GETPOST("note_public", 'restricthtml'); + $object->note_private = GETPOST("note_private", 'restricthtml'); $object->ldap_sid = GETPOST("ldap_sid", 'alphanohtml'); $object->fk_user = GETPOST("fk_user", 'int') > 0 ? GETPOST("fk_user", 'int') : 0; $object->fk_user_expense_validator = GETPOST("fk_user_expense_validator", 'int') > 0 ? GETPOST("fk_user_expense_validator", 'int') : 0; @@ -1205,15 +1205,6 @@ if ($action == 'create' || $action == 'adduserldap') { $parameters = array(); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - // Note - print '
    '; - print $langs->trans("Note"); - print ''; - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); - $doleditor->Create(); - print "
    '.$langs->trans("Signature").''; @@ -1222,6 +1213,23 @@ if ($action == 'create' || $action == 'adduserldap') { print $doleditor->Create(1); print '
    '; + print $langs->trans("NotePublic"); + print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('note_public', GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC'), ROWS_3, '90%'); + $doleditor->Create(); + print "
    '; + print $langs->trans("NotePrivate"); + print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor('note_private', GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : '', '', 100, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE'), ROWS_3, '90%'); + $doleditor->Create(); + print "

    '; @@ -2829,7 +2837,7 @@ if ($action == 'create' || $action == 'adduserldap') { // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'user', $socid, 1); + $somethingshown = $formactions->showactions($object, 'user', $socid, 1, 'listactions', 0, '', '', $object->id); print ''; } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index c17893e7eb4..a9a16826ee3 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -418,6 +418,7 @@ if ($action == 'create') { print ''."\n"; print ''; print ''; + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
    '."\n"; print ''."\n"; print ''."\n"; - print '
    '.$langs->trans("NonAffectedUsers").''; @@ -426,8 +427,10 @@ if ($action == 'create') { print ''; print ''; print '
    '."\n"; - print '
    '; + print ''; + print '
    '; + print ''."\n"; + //print '
    '; } /* diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 04f8e5679fd..05d2f88c035 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -163,9 +163,11 @@ $search_statut = GETPOST('search_statut', 'intcomma'); $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_supervisor = GETPOST('search_supervisor', 'intcomma'); -$optioncss = GETPOST('optioncss', 'alpha'); $search_categ = GETPOST("search_categ", 'int'); $catid = GETPOST('catid', 'int'); +if (!empty($catid) && empty($search_categ)) { + $search_categ = $catid; +} // Default search if ($search_statut == '') { @@ -368,9 +370,6 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; -if (!empty($search_categ) || !empty($catid)) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_user as cu ON u.rowid = cu.fk_user"; // We'll need this table joined to the select in order to filter by categ -} // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -428,17 +427,31 @@ if ($search_statut != '' && $search_statut >= 0) { if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } -if ($catid > 0) { - $sql .= " AND cu.fk_categorie = ".((int) $catid); -} -if ($catid == -2) { - $sql .= " AND cu.fk_categorie IS NULL"; -} -if ($search_categ > 0) { - $sql .= " AND cu.fk_categorie = ".((int) $search_categ); -} -if ($search_categ == -2) { - $sql .= " AND cu.fk_categorie IS NULL"; + +// Search for tag/category ($searchCategoryProductList is an array of ID) +$searchCategoryProductList = array($search_categ); +if (!empty($searchCategoryProductList)) { + $searchCategoryProductSqlList = array(); + $listofcategoryid = ''; + foreach ($searchCategoryProductList as $searchCategoryProduct) { + if (intval($searchCategoryProduct) == -2) { + $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user)"; + } elseif (intval($searchCategoryProduct) > 0) { + $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct); + } + } + if ($listofcategoryid) { + $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX."categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))"; + } + if ($searchCategoryProductOperator == 1) { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")"; + } + } else { + if (!empty($searchCategoryProductSqlList)) { + $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")"; + } + } } if ($search_warehouse > 0) { $sql .= " AND u.fk_warehouse = ".((int) $search_warehouse); @@ -470,7 +483,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } }*/ /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); + $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $resql = $db->query($sqlforcount); if ($resql) { $objforcount = $db->fetch_object($resql); @@ -591,9 +604,12 @@ if ($permissiontoadd) { if (isModEnabled('category') && $permissiontoadd) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } +if ($permissiontoadd) { + $arrayofmassactions['presetsupervisor'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("SetSupervisor"); +} //if ($permissiontodelete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'presetsupervisor'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index eee3816ca67..658c45a3753 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -128,36 +128,34 @@ if (empty($reshook)) { $result = $edituser->fetch('', '', '', 1, -1, $username); } + // Set the message to show (must be the same if login/email exists or not + // to avoid to guess them. + $messagewarning = ''; + if ($result <= 0 && $edituser->error == 'USERNOTFOUND') { - $message = ''; + $message .= $messagewarning; $username = ''; } else { - if (!$edituser->email) { - $message = '
    '.$langs->trans("ErrorLoginHasNoEmail").'
    '; + if (empty($edituser->email)) { + $message .= $messagewarning; } else { $newpassword = $edituser->setPassword($user, '', 1); if ($newpassword < 0) { - // Failed + // Technical failure $message = '
    '.$langs->trans("ErrorFailedToChangePassword").'
    '; } else { // Success if ($edituser->send_password($user, $newpassword, 1) > 0) { - $message = ''; + $message .= $messagewarning; $username = ''; } else { + // Technical failure $message .= '
    '.$edituser->error.'
    '; } } diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index 8f522bb8107..1867eb368de 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -74,7 +74,7 @@ if ($prodattr->fetch($id) < 0) { $prodattrval = new ProductAttributeValue($db); -$res = $prodattrval->fetchAllByProductAttribute($id); +$res = $prodattrval->fetchAllByProductAttribute($id, false, 1); if ($res == -1) { print json_encode(array( diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index 99eef366345..734e82b7c27 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -261,9 +261,10 @@ class ProductAttributeValue extends CommonObjectLine * * @param int $prodattr_id Product attribute id * @param bool $only_used Fetch only used attribute values + * @param int $returnonlydata 0: return object, 1: return only data * @return ProductAttributeValue[] Array of object */ - public function fetchAllByProductAttribute($prodattr_id, $only_used = false) + public function fetchAllByProductAttribute($prodattr_id, $only_used = false, $returnonlydata = 0) { $return = array(); @@ -290,7 +291,12 @@ class ProductAttributeValue extends CommonObjectLine $query = $this->db->query($sql); while ($result = $this->db->fetch_object($query)) { - $tmp = new ProductAttributeValue($this->db); + if (empty($returnonlydata)) { + $tmp = new ProductAttributeValue($this->db); + } else { + $tmp = new stdClass(); + } + $tmp->fk_product_attribute = $result->fk_product_attribute; $tmp->id = $result->rowid; $tmp->ref = $result->ref; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 0f149a4dd6a..64a18cf2a74 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -496,7 +496,7 @@ if (!empty($id) || !empty($ref)) { } if ($action == 'add') { - $prodattr_all = $prodattr->fetchAll(); + $prodattr_all = $prodattr->fetchAll(1); if (!$selected) { $selected = $prodattr_all[key($prodattr_all)]->id; @@ -507,7 +507,6 @@ if (!empty($id) || !empty($ref)) { foreach ($prodattr_all as $each) { $prodattr_alljson[$each->id] = $each; } - ?>