merge
This commit is contained in:
commit
84ec5ef218
@ -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
|
||||
|
||||
81
ChangeLog
81
ChangeLog
@ -26,8 +26,88 @@ 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.
|
||||
* Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead.
|
||||
|
||||
|
||||
***** 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 +316,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 *****
|
||||
|
||||
@ -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.
|
||||
|
||||
|
||||
@ -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*").
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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+
|
||||
|
||||
@ -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 "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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`;
|
||||
|
||||
@ -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 "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -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 "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -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 "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -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 "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@
|
||||
<exclude-pattern type="relative">htdocs/install/doctemplates/websites</exclude-pattern>
|
||||
<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||
<exclude-pattern type="relative">source</exclude-pattern>
|
||||
<exclude-pattern type="relative">.git</exclude-pattern>
|
||||
<exclude-pattern>htdocs/includes</exclude-pattern>
|
||||
<exclude-pattern>htdocs/install/doctemplates/websites</exclude-pattern>
|
||||
|
||||
<!-- List of all tests -->
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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[@]}"
|
||||
|
||||
16
dev/tools/github_lines_perusers.sh
Executable file
16
dev/tools/github_lines_perusers.sh
Executable file
@ -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]; } '
|
||||
|
||||
@ -121,9 +121,11 @@ main()
|
||||
|
||||
# Search of all jpg/jpeg/png in $INPUT
|
||||
# We remove images from $OUTPUT if $OUTPUT is a subdirectory of $INPUT
|
||||
echo "Scan $INPUT to find images with find $INPUT -regextype posix-extended -regex '.*\.(jpg|jpeg|png)' | grep -v '/gource/' | grep -v '/includes/' | grep -v '/custom/' | grep -v $OUTPUT"
|
||||
echo "Scan $INPUT to find images with find $INPUT -regextype posix-extended -regex '.*\.(jpg|jpeg|png)' | grep -v '/gource/' | grep -v '/includes/' | grep -v '/custom/' | grep -v '/documents/' | grep -v $OUTPUT"
|
||||
#echo "Scan $INPUT to find images with find $INPUT -regextype posix-extended -regex '.*\.(jpg|jpeg|png)' | grep -v '/gource/' | grep -v '/includes/' | grep -v '/custom/'"
|
||||
IMAGES=$(find $INPUT -regextype posix-extended -regex '.*\.(jpg|jpeg|png)' | grep -v '/gource/' | grep -v '/includes/' | grep -v '/custom/' | grep -v '/documents/' | grep -v $OUTPUT)
|
||||
|
||||
#IMAGES=$(find $INPUT -regextype posix-extended -regex '.*\.(jpg|jpeg|png)' | grep -v '/gource/' | grep -v '/includes/' | grep -v '/custom/')
|
||||
|
||||
if [ "$QUIET" == "0" ]; then
|
||||
echo --- Optimizing $INPUT ---
|
||||
echo
|
||||
|
||||
@ -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);
|
||||
@ -426,11 +426,9 @@ if ($action == 'create') {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
if ($user->hasRight('accounting', 'chartofaccount')) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Delete').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
// Delete
|
||||
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ if ($action == 'create') {
|
||||
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||
|
||||
// print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&token='.newToken().'&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
|
||||
//print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@ -266,6 +266,9 @@ if (!$user->admin) {
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ $param = '';
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'preunlettering' && $massaction != 'predeletebookkeepingwriting') {
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'preunletteringauto' && $massaction != 'preunletteringmanual' && $massaction != 'predeletebookkeepingwriting') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
@ -487,43 +487,60 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
$db->begin();
|
||||
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->bookkeepingLetteringAll($toselect, true);
|
||||
if ($nb_lettering < 0) {
|
||||
setEventMessages('', $lettering->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $object->fetch($toselectid);
|
||||
if ($result > 0 && (!isset($object->date_validation) || $object->date_validation === '')) {
|
||||
$result = $object->deleteMvtNum($object->piece_num);
|
||||
if ($result > 0) {
|
||||
$nbok++;
|
||||
} else {
|
||||
if (!$error) {
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $object->fetch($toselectid);
|
||||
if ($result > 0 && (!isset($object->date_validation) || $object->date_validation === '')) {
|
||||
$result = $object->deleteMvtNum($object->piece_num);
|
||||
if ($result > 0) {
|
||||
$nbok++;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Message for elements well deleted
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||
} elseif ($nbok > 0) {
|
||||
setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||
} elseif (!$error) {
|
||||
setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
|
||||
// Message for elements well deleted
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||
} elseif ($nbok > 0) {
|
||||
setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?noreset=1".($param ? '&'.$param : ''));
|
||||
exit;
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
// others mass actions
|
||||
if (!$error && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
|
||||
if ($massaction == 'lettering') {
|
||||
if ($massaction == 'letteringauto') {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
|
||||
if ($nb_lettering < 0) {
|
||||
@ -544,7 +561,17 @@ if (empty($reshook)) {
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'unlettering' && $confirm == "yes") {
|
||||
} elseif ($massaction == 'letteringmanual') {
|
||||
$lettering = new Lettering($db);
|
||||
$result = $lettering->updateLettering($toselect);
|
||||
if ($result < 0) {
|
||||
setEventMessages('', $lettering->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs');
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'unletteringauto' && $confirm == "yes") {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->bookkeepingLetteringAll($toselect, true);
|
||||
if ($nb_lettering < 0) {
|
||||
@ -565,6 +592,16 @@ if (empty($reshook)) {
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'unletteringmanual' && $confirm == "yes") {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->deleteLettering($toselect);
|
||||
if ($result < 0) {
|
||||
setEventMessages('', $lettering->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs');
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -846,16 +883,16 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
/*
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting->mouvements->creer) {
|
||||
$arrayofmassactions['lettering'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('Lettering');
|
||||
$arrayofmassactions['preunlettering'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('Unlettering');
|
||||
$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
|
||||
$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
|
||||
$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
|
||||
$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual');
|
||||
}
|
||||
*/
|
||||
if ($user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
$arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunlettering', 'predeletebookkeepingwriting'))) {
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
|
||||
@ -905,8 +942,10 @@ if (empty($reshook)) {
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
if ($massaction == 'preunlettering') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassUnlettering"), $langs->trans("ConfirmMassUnletteringQuestion", count($toselect)), "unlettering", null, '', 0, 200, 500, 1);
|
||||
if ($massaction == 'preunletteringauto') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassUnletteringAuto"), $langs->trans("ConfirmMassUnletteringQuestion", count($toselect)), "unletteringauto", null, '', 0, 200, 500, 1);
|
||||
} elseif ($massaction == 'preunletteringmanual') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassUnletteringManual"), $langs->trans("ConfirmMassUnletteringQuestion", count($toselect)), "unletteringmanual", null, '', 0, 200, 500, 1);
|
||||
} elseif ($massaction == 'predeletebookkeepingwriting') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeleteBookkeepingWriting"), $langs->trans("ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)), "deletebookkeepingwriting", null, '', 0, 200, 500, 1);
|
||||
}
|
||||
@ -946,7 +985,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
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 '</td>';
|
||||
}
|
||||
// Date document
|
||||
|
||||
@ -209,7 +209,7 @@ if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'preunlettering' && $massaction != 'predeletebookkeepingwriting') {
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'preunletteringauto' && $massaction != 'preunletteringmanual' && $massaction != 'predeletebookkeepingwriting') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
@ -402,43 +402,60 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
$db->begin();
|
||||
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->bookkeepingLetteringAll($toselect, true);
|
||||
if ($nb_lettering < 0) {
|
||||
setEventMessages('', $lettering->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$nbok = 0;
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $object->fetch($toselectid);
|
||||
if ($result > 0 && (!isset($object->date_validation) || $object->date_validation === '')) {
|
||||
$result = $object->deleteMvtNum($object->piece_num);
|
||||
if ($result > 0) {
|
||||
$nbok++;
|
||||
} else {
|
||||
if (!$error) {
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $object->fetch($toselectid);
|
||||
if ($result > 0 && (!isset($object->date_validation) || $object->date_validation === '')) {
|
||||
$result = $object->deleteMvtNum($object->piece_num);
|
||||
if ($result > 0) {
|
||||
$nbok++;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Message for elements well deleted
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||
} elseif ($nbok > 0) {
|
||||
setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||
} elseif (!$error) {
|
||||
setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
|
||||
// Message for elements well deleted
|
||||
if ($nbok > 1) {
|
||||
setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||
} elseif ($nbok > 0) {
|
||||
setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||
} elseif (!$error) {
|
||||
setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
|
||||
}
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?noreset=1".($param ? '&'.$param : ''));
|
||||
exit;
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
// others mass actions
|
||||
if (!$error && getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
|
||||
if ($massaction == 'lettering') {
|
||||
if ($massaction == 'letteringauto') {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->bookkeepingLetteringAll($toselect);
|
||||
if ($nb_lettering < 0) {
|
||||
@ -459,7 +476,17 @@ if (empty($reshook)) {
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'unlettering' && $confirm == "yes") {
|
||||
} elseif ($massaction == 'letteringmanual') {
|
||||
$lettering = new Lettering($db);
|
||||
$result = $lettering->updateLettering($toselect);
|
||||
if ($result < 0) {
|
||||
setEventMessages('', $lettering->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('AccountancyOneLetteringModifiedSuccessfully'), array(), 'mesgs');
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'unletteringauto' && $confirm == "yes") {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->bookkeepingLetteringAll($toselect, true);
|
||||
if ($nb_lettering < 0) {
|
||||
@ -480,6 +507,16 @@ if (empty($reshook)) {
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'unletteringmanual' && $confirm == "yes") {
|
||||
$lettering = new Lettering($db);
|
||||
$nb_lettering = $lettering->deleteLettering($toselect);
|
||||
if ($result < 0) {
|
||||
setEventMessages('', $lettering->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('AccountancyOneUnletteringModifiedSuccessfully'), array(), 'mesgs');
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?noreset=1' . $param);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -580,13 +617,15 @@ print $formconfirm;
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
|
||||
$arrayofmassactions['lettering'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('Lettering');
|
||||
$arrayofmassactions['preunlettering'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('Unlettering');
|
||||
$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
|
||||
$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
|
||||
$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
|
||||
$arrayofmassactions['preunletteringmanual'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringManual');
|
||||
}
|
||||
if ($user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
$arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunlettering', 'predeletebookkeepingwriting'))) {
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
|
||||
@ -626,8 +665,10 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
if ($massaction == 'preunlettering') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassUnlettering"), $langs->trans("ConfirmMassUnletteringQuestion", count($toselect)), "unlettering", null, '', 0, 200, 500, 1);
|
||||
if ($massaction == 'preunletteringauto') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassUnletteringAuto"), $langs->trans("ConfirmMassUnletteringQuestion", count($toselect)), "unletteringauto", null, '', 0, 200, 500, 1);
|
||||
} elseif ($massaction == 'preunletteringmanual') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassUnletteringManual"), $langs->trans("ConfirmMassUnletteringQuestion", count($toselect)), "unletteringmanual", null, '', 0, 200, 500, 1);
|
||||
} elseif ($massaction == 'predeletebookkeepingwriting') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeleteBookkeepingWriting"), $langs->trans("ConfirmMassDeleteBookkeepingWritingQuestion", count($toselect)), "deletebookkeepingwriting", null, '', 0, 200, 500, 1);
|
||||
}
|
||||
@ -702,12 +743,12 @@ print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
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 '</td>';
|
||||
}
|
||||
// Date document
|
||||
|
||||
@ -456,7 +456,7 @@ class AccountingJournal extends CommonObject
|
||||
$sql .= " SELECT DISTINCT fk_docdet";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping";
|
||||
$sql .= " WHERE doc_type = 'asset'";
|
||||
$sql .= ")";
|
||||
$sql .= ") ";
|
||||
}*/
|
||||
|
||||
$sql .= "SELECT ad.fk_asset AS rowid, a.ref AS asset_ref, a.label AS asset_label, a.acquisition_value_ht AS asset_acquisition_value_ht";
|
||||
|
||||
@ -33,11 +33,52 @@ include_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
|
||||
*/
|
||||
class Lettering extends BookKeeping
|
||||
{
|
||||
/**
|
||||
* @var BookKeeping[] Bookkeeping cached
|
||||
*/
|
||||
public static $bookkeeping_cached = array();
|
||||
|
||||
public static $doc_type_infos = array(
|
||||
'customer_invoice' => array(
|
||||
'payment_table' => 'paiement',
|
||||
'payment_table_fk_bank' => 'fk_bank',
|
||||
'doc_payment_table' => 'paiement_facture',
|
||||
'doc_payment_table_fk_payment' => 'fk_paiement',
|
||||
'doc_payment_table_fk_doc' => 'fk_facture',
|
||||
'linked_info' => array(
|
||||
array(
|
||||
'table' => 'paiement_facture',
|
||||
'fk_doc' => 'fk_facture',
|
||||
'fk_link' => 'fk_paiement',
|
||||
'prefix' => 'p',
|
||||
),
|
||||
array(
|
||||
'table' => 'societe_remise_except',
|
||||
'fk_doc' => 'fk_facture_source',
|
||||
'fk_link' => 'fk_facture',
|
||||
'prefix' => 'a',
|
||||
'is_fk_link_is_also_fk_doc' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
'supplier_invoice' => array(
|
||||
'payment_table' => 'paiementfourn',
|
||||
'payment_table_fk_bank' => 'fk_bank',
|
||||
'doc_payment_table' => 'paiementfourn_facturefourn',
|
||||
'doc_payment_table_fk_payment' => 'fk_paiementfourn',
|
||||
'doc_payment_table_fk_doc' => 'fk_facturefourn',
|
||||
'linked_info' => array(
|
||||
array(
|
||||
'table' => 'paiementfourn_facturefourn',
|
||||
'fk_doc' => 'fk_facturefourn',
|
||||
'fk_link' => 'fk_paiementfourn',
|
||||
'prefix' => 'p',
|
||||
),
|
||||
array(
|
||||
'table' => 'societe_remise_except',
|
||||
'fk_doc' => 'fk_invoice_supplier_source',
|
||||
'fk_link' => 'fk_invoice_supplier',
|
||||
'prefix' => 'a',
|
||||
'is_fk_link_is_also_fk_doc' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* letteringThirdparty
|
||||
@ -250,26 +291,17 @@ class Lettering extends BookKeeping
|
||||
$lettre = 'AAA';
|
||||
|
||||
$sql = "SELECT DISTINCT ab2.lettering_code";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping As ab";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url AS bu ON bu.fk_bank = ab.fk_doc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url AS bu2 ON bu2.url_id = bu.url_id";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab2 ON ab2.fk_doc = bu2.fk_bank";
|
||||
$sql .= " WHERE ab.rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ")";
|
||||
$sql .= " AND ab.doc_type = 'bank'";
|
||||
$sql .= " AND ab2.doc_type = 'bank'";
|
||||
$sql .= " AND bu.type = 'company'";
|
||||
$sql .= " AND bu2.type = 'company'";
|
||||
$sql .= " AND ab.subledger_account != ''";
|
||||
$sql .= " AND ab2.subledger_account != ''";
|
||||
$sql .= " AND ab.lettering_code IS NULL";
|
||||
$sql .= " AND ab2.lettering_code != ''";
|
||||
$sql .= " ORDER BY ab2.lettering_code DESC";
|
||||
$sql .= " LIMIT 1 ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab2 ON ab2.subledger_account = ab.subledger_account";
|
||||
$sql .= " WHERE ab.rowid IN (" . $this->db->sanitize(implode(',', $ids)) . ")";
|
||||
$sql .= " AND ab2.lettering_code != ''";
|
||||
$sql .= " ORDER BY ab2.lettering_code DESC";
|
||||
$sql .= " LIMIT 1 ";
|
||||
|
||||
$resqla = $this->db->query($sql);
|
||||
if ($resqla) {
|
||||
$obj = $this->db->fetch_object($resqla);
|
||||
$lettre = (empty($obj->lettering_code) ? 'AAA' : $obj->lettering_code);
|
||||
$lettre = (empty($obj->lettering_code) ? $lettre : $obj->lettering_code);
|
||||
if (!empty($obj->lettering_code)) {
|
||||
$lettre++;
|
||||
}
|
||||
@ -301,7 +333,7 @@ class Lettering extends BookKeeping
|
||||
if (!$error) {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET";
|
||||
$sql .= " lettering_code='".$this->db->escape($lettre)."'";
|
||||
$sql .= " , date_lettering = '".$this->db->idate($now)."'"; // todo correct date it's false
|
||||
$sql .= ", date_lettering = '".$this->db->idate($now)."'"; // todo correct date it's false
|
||||
$sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $ids)).") AND lettering_code IS NULL AND subledger_account != ''";
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
@ -336,7 +368,7 @@ class Lettering extends BookKeeping
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET";
|
||||
$sql .= " lettering_code = NULL";
|
||||
$sql .= " , date_lettering = NULL";
|
||||
$sql .= ", date_lettering = NULL";
|
||||
$sql .= " WHERE rowid IN (".$this->db->sanitize(implode(',', $ids)).")";
|
||||
$sql .= " AND subledger_account != ''";
|
||||
|
||||
@ -374,16 +406,7 @@ class Lettering extends BookKeeping
|
||||
$errors = array();
|
||||
$nb_lettering = 0;
|
||||
|
||||
$result = $this->bookkeepingLettering($bookkeeping_ids, 'customer_invoice', $unlettering);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errors = array_merge($errors, $this->errors);
|
||||
$nb_lettering += abs($result) - 2;
|
||||
} else {
|
||||
$nb_lettering += $result;
|
||||
}
|
||||
|
||||
$result = $this->bookkeepingLettering($bookkeeping_ids, 'supplier_invoice', $unlettering);
|
||||
$result = $this->bookkeepingLettering($bookkeeping_ids, $unlettering);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errors = array_merge($errors, $this->errors);
|
||||
@ -404,11 +427,10 @@ class Lettering extends BookKeeping
|
||||
* Lettering bookkeeping lines
|
||||
*
|
||||
* @param array $bookkeeping_ids Lettering specific list of bookkeeping id
|
||||
* @param string $type Type of bookkeeping type to lettering ('customer_invoice' or 'supplier_invoice')
|
||||
* @param bool $unlettering Do unlettering
|
||||
* @return int <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered)
|
||||
*/
|
||||
public function bookkeepingLettering($bookkeeping_ids, $type = 'customer_invoice', $unlettering = false)
|
||||
public function bookkeepingLettering($bookkeeping_ids, $unlettering = false)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -416,11 +438,14 @@ class Lettering extends BookKeeping
|
||||
|
||||
// Clean parameters
|
||||
$bookkeeping_ids = is_array($bookkeeping_ids) ? $bookkeeping_ids : array();
|
||||
$type = trim($type);
|
||||
|
||||
$error = 0;
|
||||
$nb_lettering = 0;
|
||||
$grouped_lines = $this->getLinkedLines($bookkeeping_ids, $type);
|
||||
$grouped_lines = $this->getLinkedLines($bookkeeping_ids);
|
||||
if (!is_array($grouped_lines)) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
foreach ($grouped_lines as $lines) {
|
||||
$group_error = 0;
|
||||
$total = 0;
|
||||
@ -478,52 +503,214 @@ class Lettering extends BookKeeping
|
||||
/**
|
||||
* Lettering bookkeeping lines
|
||||
*
|
||||
* @param array $bookkeeping_ids Lettering specific list of bookkeeping id
|
||||
* @param string $type Type of bookkeeping type to lettering ('customer_invoice' or 'supplier_invoice')
|
||||
* @return array|int <0 if error otherwise all linked lines by block
|
||||
* @param array $bookkeeping_ids Lettering specific list of bookkeeping id
|
||||
* @param bool $only_has_subledger_account Get only lines who have subledger account
|
||||
* @return array|int <0 if error otherwise all linked lines by block
|
||||
*/
|
||||
public function getLinkedLines($bookkeeping_ids, $type = 'customer_invoice')
|
||||
public function getLinkedLines($bookkeeping_ids, $only_has_subledger_account = true)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$this->errors = array();
|
||||
|
||||
// Clean parameters
|
||||
$bookkeeping_ids = is_array($bookkeeping_ids) ? $bookkeeping_ids : array();
|
||||
$type = trim($type);
|
||||
|
||||
if ($type == 'customer_invoice') {
|
||||
$doc_type = 'customer_invoice';
|
||||
$bank_url_type = 'payment';
|
||||
$payment_element = 'paiement_facture';
|
||||
$fk_payment_element = 'fk_paiement';
|
||||
$fk_element = 'fk_facture';
|
||||
$account_number = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
} elseif ($type == 'supplier_invoice') {
|
||||
$doc_type = 'supplier_invoice';
|
||||
$bank_url_type = 'payment_supplier';
|
||||
$payment_element = 'paiementfourn_facturefourn';
|
||||
$fk_payment_element = 'fk_paiementfourn';
|
||||
$fk_element = 'fk_facturefourn';
|
||||
$account_number = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
} else {
|
||||
// Get all bookkeeping lines
|
||||
$sql = "SELECT DISTINCT ab.doc_type, ab.fk_doc";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
|
||||
$sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql .= " AND ab.fk_doc > 0";
|
||||
if (!empty($bookkeeping_ids)) {
|
||||
// Get all bookkeeping lines of piece number
|
||||
$sql .= " AND EXISTS (";
|
||||
$sql .= " SELECT rowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS pn";
|
||||
$sql .= " WHERE pn.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql .= " AND pn.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")";
|
||||
$sql .= " AND pn.piece_num = ab.piece_num";
|
||||
$sql .= " )";
|
||||
}
|
||||
if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$bookkeeping_lines_by_type = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$bookkeeping_lines_by_type[$obj->doc_type][$obj->fk_doc] = $obj->fk_doc;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if (empty($bookkeeping_lines_by_type)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if (!empty($bookkeeping_lines_by_type['bank'])) {
|
||||
$new_bookkeeping_lines_by_type = $this->getDocTypeAndFkDocFromBankLines($bookkeeping_lines_by_type['bank']);
|
||||
if (!is_array($new_bookkeeping_lines_by_type)) {
|
||||
return -1;
|
||||
}
|
||||
foreach ($new_bookkeeping_lines_by_type as $doc_type => $fk_docs) {
|
||||
foreach ($fk_docs as $fk_doc) {
|
||||
$bookkeeping_lines_by_type[$doc_type][$fk_doc] = $fk_doc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$grouped_lines = array();
|
||||
foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
|
||||
if (!is_array($bookkeeping_lines_by_type[$doc_type])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get all document ids grouped
|
||||
$doc_grouped = $this->getLinkedDocumentByGroup($bookkeeping_lines_by_type[$doc_type], $doc_type);
|
||||
if (!is_array($doc_grouped)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Group all lines by document/piece number
|
||||
foreach ($doc_grouped as $doc_ids) {
|
||||
$bank_ids = $this->getBankLinesFromFkDocAndDocType($doc_ids, $doc_type);
|
||||
if (!is_array($bank_ids)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Get all bookkeeping lines linked
|
||||
$sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.debit, ab.credit, ab.lettering_code";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
|
||||
$sql .= " WHERE ab.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql .= " AND (";
|
||||
if (!empty($bank_ids)) {
|
||||
$sql .= " EXISTS (";
|
||||
$sql .= " SELECT bpn.rowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS bpn";
|
||||
$sql .= " WHERE bpn.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql .= " AND bpn.doc_type = 'bank'";
|
||||
$sql .= " AND bpn.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")";
|
||||
$sql .= " AND bpn ON bpn.piece_num = ab.piece_num";
|
||||
$sql .= " ) OR ";
|
||||
}
|
||||
$sql .= " EXISTS (";
|
||||
$sql .= " SELECT dpn.rowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS dpn";
|
||||
$sql .= " WHERE dpn.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql .= " AND dpn.doc_type = '" . $this->db->escape($doc_type) . "'";
|
||||
$sql .= " AND dpn.fk_doc IN (" . $this->db->sanitize(implode(',', $doc_ids)) . ")";
|
||||
$sql .= " AND dpn.piece_num = ab.piece_num";
|
||||
$sql .= " )";
|
||||
$sql .= ")";
|
||||
if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$group = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$group[$obj->rowid] = array(
|
||||
'id' => $obj->rowid,
|
||||
'piece_num' => $obj->piece_num,
|
||||
'debit' => $obj->debit,
|
||||
'credit' => $obj->credit,
|
||||
'lettering_code' => $obj->lettering_code,
|
||||
);
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if (!empty($group)) $grouped_lines[] = $group;
|
||||
}
|
||||
}
|
||||
|
||||
return $grouped_lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all fk_doc by doc_type from list of bank ids
|
||||
*
|
||||
* @param array $bank_ids List of bank ids
|
||||
* @return array|int <0 if error otherwise all fk_doc by doc_type
|
||||
*/
|
||||
public function getDocTypeAndFkDocFromBankLines($bank_ids)
|
||||
{
|
||||
dol_syslog(__METHOD__ . " - bank_ids=".json_encode($bank_ids), LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
$bank_ids = is_array($bank_ids) ? $bank_ids : array();
|
||||
|
||||
if (empty($bank_ids)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$bookkeeping_lines_by_type = array();
|
||||
foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
|
||||
// Get all fk_doc by doc_type from bank ids
|
||||
$sql = "SELECT DISTINCT dp." . $doc_type_info['doc_payment_table_fk_doc'] . " AS fk_doc";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . $doc_type_info['payment_table'] . " AS p";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $doc_type_info['doc_payment_table'] . " AS dp ON dp." . $doc_type_info['doc_payment_table_fk_payment'] . " = p.rowid";
|
||||
$sql .= " WHERE p." . $doc_type_info['payment_table_fk_bank'] . " IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")";
|
||||
$sql .= " AND dp." . $doc_type_info['doc_payment_table_fk_doc'] . " > 0";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get all fk_doc by doc_type from list of bank ids for '" . $doc_type . "'", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$bookkeeping_lines_by_type[$doc_type][$obj->fk_doc] = $obj->fk_doc;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
return $bookkeeping_lines_by_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all bank ids from list of document ids of a type
|
||||
*
|
||||
* @param array $document_ids List of document id
|
||||
* @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...)
|
||||
* @return array|int <0 if error otherwise all all bank ids from list of document ids of a type
|
||||
*/
|
||||
public function getBankLinesFromFkDocAndDocType($document_ids, $doc_type)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
dol_syslog(__METHOD__ . " - bank_ids=".json_encode($document_ids) . ", doc_type=$doc_type", LOG_DEBUG);
|
||||
|
||||
// Clean parameters
|
||||
$document_ids = is_array($document_ids) ? $document_ids : array();
|
||||
$doc_type = trim($doc_type);
|
||||
|
||||
if (empty($document_ids)) {
|
||||
return array();
|
||||
}
|
||||
if (!is_array(self::$doc_type_infos[$doc_type])) {
|
||||
$langs->load('errors');
|
||||
$this->errors[] = $langs->trans('ErrorBadParameters');
|
||||
return -1;
|
||||
}
|
||||
|
||||
$payment_ids = array();
|
||||
$doc_type_info = self::$doc_type_infos[$doc_type];
|
||||
$bank_ids = array();
|
||||
|
||||
// Get all payment id from bank lines
|
||||
$sql = "SELECT DISTINCT bu.url_id AS payment_id";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url AS bu ON bu.fk_bank = ab.fk_doc";
|
||||
$sql .= " WHERE ab.doc_type = 'bank'";
|
||||
// $sql .= " AND ab.subledger_account != ''";
|
||||
// $sql .= " AND ab.numero_compte = '" . $this->db->escape($account_number) . "'";
|
||||
$sql .= " AND bu.type = '" . $this->db->escape($bank_url_type) . "'";
|
||||
if (!empty($bookkeeping_ids)) $sql .= " AND ab.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")";
|
||||
// Get all fk_doc by doc_type from bank ids
|
||||
$sql = "SELECT DISTINCT p." . $doc_type_info['payment_table_fk_bank'] . " AS fk_doc";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . $doc_type_info['payment_table'] . " AS p";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $doc_type_info['doc_payment_table'] . " AS dp ON dp." . $doc_type_info['doc_payment_table_fk_payment'] . " = p.rowid";
|
||||
$sql .= " WHERE dp." . $doc_type_info['doc_payment_table_fk_doc'] . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
|
||||
$sql .= " AND p." . $doc_type_info['payment_table_fk_bank'] . " > 0";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get all payment id from bank lines", LOG_DEBUG);
|
||||
dol_syslog(__METHOD__ . " - Get all bank ids from list of document ids of a type '" . $doc_type . "'", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
@ -531,218 +718,137 @@ class Lettering extends BookKeeping
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$payment_ids[$obj->payment_id] = $obj->payment_id;
|
||||
$bank_ids[$obj->fk_doc] = $obj->fk_doc;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
// Get all payment id from payment lines
|
||||
$sql = "SELECT DISTINCT pe.$fk_payment_element AS payment_id";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "$payment_element AS pe ON pe.$fk_element = ab.fk_doc";
|
||||
$sql .= " WHERE ab.doc_type = '" . $this->db->escape($doc_type) . "'";
|
||||
// $sql .= " AND ab.subledger_account != ''";
|
||||
// $sql .= " AND ab.numero_compte = '" . $this->db->escape($account_number) . "'";
|
||||
$sql .= " AND pe.$fk_payment_element IS NOT NULL";
|
||||
if (!empty($bookkeeping_ids)) $sql .= " AND ab.rowid IN (" . $this->db->sanitize(implode(',', $bookkeeping_ids)) . ")";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get all payment id from bank lines", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$payment_ids[$obj->payment_id] = $obj->payment_id;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if (empty($payment_ids)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
// Get all payments linked by group
|
||||
$payment_by_group = $this->getLinkedPaymentByGroup($payment_ids, $type);
|
||||
|
||||
$groups = array();
|
||||
foreach ($payment_by_group as $payment_list) {
|
||||
$lines = array();
|
||||
|
||||
// Get bank lines
|
||||
$sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.lettering_code, ab.debit, ab.credit";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "bank_url AS bu";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab ON ab.fk_doc = bu.fk_bank";
|
||||
$sql .= " WHERE bu.url_id IN (" . $this->db->sanitize(implode(',', $payment_list)) . ")";
|
||||
$sql .= " AND bu.type = '" . $this->db->escape($bank_url_type) . "'";
|
||||
$sql .= " AND ab.doc_type = 'bank'";
|
||||
$sql .= " AND ab.subledger_account != ''";
|
||||
$sql .= " AND ab.numero_compte = '" . $this->db->escape($account_number) . "'";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get bank lines", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$lines[$obj->rowid] = array('id' => $obj->rowid, 'piece_num' => $obj->piece_num, 'lettering_code' => $obj->lettering_code, 'debit' => $obj->debit, 'credit' => $obj->credit);
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
// Get payment lines
|
||||
$sql = "SELECT DISTINCT ab.rowid, ab.piece_num, ab.lettering_code, ab.debit, ab.credit";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "$payment_element AS pe";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping AS ab ON ab.fk_doc = pe.$fk_element";
|
||||
$sql .= " WHERE pe.$fk_payment_element IN (" . $this->db->sanitize(implode(',', $payment_list)) . ")";
|
||||
$sql .= " AND ab.doc_type = '" . $this->db->escape($doc_type) . "'";
|
||||
$sql .= " AND ab.subledger_account != ''";
|
||||
$sql .= " AND ab.numero_compte = '" . $this->db->escape($account_number) . "'";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get payment lines", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$lines[$obj->rowid] = array('id' => $obj->rowid, 'piece_num' => $obj->piece_num, 'lettering_code' => $obj->lettering_code, 'debit' => $obj->debit, 'credit' => $obj->credit);
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if (!empty($lines)) {
|
||||
$groups[] = $lines;
|
||||
}
|
||||
}
|
||||
|
||||
return $groups;
|
||||
return $bank_ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Linked payment by group
|
||||
* Get all linked document ids by group and type
|
||||
*
|
||||
* @param array $payment_ids list of payment id
|
||||
* @param string $type Type of bookkeeping type to lettering ('customer_invoice' or 'supplier_invoice')
|
||||
* @return array|int <0 if error otherwise all linked lines by block
|
||||
* @param array $document_ids List of document id
|
||||
* @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...)
|
||||
* @return array|int <0 if error otherwise all linked document ids by group and type [ [ 'doc_type' => [ doc_id, ... ], ... ], ... ]
|
||||
*/
|
||||
public function getLinkedPaymentByGroup($payment_ids, $type)
|
||||
public function getLinkedDocumentByGroup($document_ids, $doc_type)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
// Clean parameters
|
||||
$payment_ids = is_array($payment_ids) ? $payment_ids : array();
|
||||
$type = trim($type);
|
||||
$document_ids = is_array($document_ids) ? $document_ids : array();
|
||||
$doc_type = trim($doc_type);
|
||||
|
||||
if (empty($payment_ids)) {
|
||||
if (empty($document_ids)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if ($type == 'customer_invoice') {
|
||||
$payment_element = 'paiement_facture';
|
||||
$fk_payment_element = 'fk_paiement';
|
||||
$fk_element = 'fk_facture';
|
||||
} elseif ($type == 'supplier_invoice') {
|
||||
$payment_element = 'paiementfourn_facturefourn';
|
||||
$fk_payment_element = 'fk_paiementfourn';
|
||||
$fk_element = 'fk_facturefourn';
|
||||
} else {
|
||||
if (!is_array(self::$doc_type_infos[$doc_type])) {
|
||||
$langs->load('errors');
|
||||
$this->errors[] = $langs->trans('ErrorBadParameters');
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Get payment lines
|
||||
$sql = "SELECT DISTINCT pe2.$fk_payment_element, pe2.$fk_element";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "$payment_element AS pe";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "$payment_element AS pe2 ON pe2.$fk_element = pe.$fk_element";
|
||||
$sql .= " WHERE pe.$fk_payment_element IN (" . $this->db->sanitize(implode(',', $payment_ids)) . ")";
|
||||
$doc_type_info = self::$doc_type_infos[$doc_type];
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get payment lines", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
// Get document lines
|
||||
$current_document_ids = array();
|
||||
$link_by_element = array();
|
||||
$element_by_link = array();
|
||||
foreach ($doc_type_info['linked_info'] as $linked_info) {
|
||||
$sql = "SELECT DISTINCT tl2." . $linked_info['fk_link'] . " AS fk_link, tl2." . $linked_info['fk_doc'] . " AS fk_doc";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $linked_info['table'] . " AS tl2 ON tl2." . $linked_info['fk_link'] . " = tl." . $linked_info['fk_link'];
|
||||
$sql .= " WHERE tl." . $linked_info['fk_doc'] . " IN (" . $this->db->sanitize(implode(',', $document_ids)) . ")";
|
||||
|
||||
dol_syslog(__METHOD__ . " - Get document lines", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$is_fk_link_is_also_fk_doc = !empty($linked_info['is_fk_link_is_also_fk_doc']);
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$current_document_ids[$obj->fk_doc] = $obj->fk_doc;
|
||||
|
||||
$link_key = $linked_info['prefix'] . $obj->fk_link;
|
||||
$element_by_link[$link_key][$obj->fk_doc] = $obj->fk_doc;
|
||||
$link_by_element[$obj->fk_doc][$link_key] = $link_key;
|
||||
if ($is_fk_link_is_also_fk_doc) {
|
||||
$element_by_link[$link_key][$obj->fk_link] = $obj->fk_link;
|
||||
$link_by_element[$obj->fk_link][$link_key] = $link_key;
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
$current_payment_ids = array();
|
||||
$payment_by_element = array();
|
||||
$element_by_payment = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$current_payment_ids[$obj->$fk_payment_element] = $obj->$fk_payment_element;
|
||||
$element_by_payment[$obj->$fk_payment_element][$obj->$fk_element] = $obj->$fk_element;
|
||||
$payment_by_element[$obj->$fk_element][$obj->$fk_payment_element] = $obj->$fk_payment_element;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if (count(array_diff($payment_ids, $current_payment_ids))) {
|
||||
return $this->getLinkedPaymentByGroup($current_payment_ids, $type);
|
||||
if (count(array_diff($document_ids, $current_document_ids))) {
|
||||
return $this->getLinkedDocumentByGroup($current_document_ids, $doc_type);
|
||||
}
|
||||
|
||||
return $this->getGroupElements($payment_by_element, $element_by_payment);
|
||||
return $this->getGroupElements($link_by_element, $element_by_link);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get payment ids grouped by payment id and element id in common
|
||||
* Get element ids grouped by link or element in common
|
||||
*
|
||||
* @param array $payment_by_element List of payment ids by element id
|
||||
* @param array $element_by_payment List of element ids by payment id
|
||||
* @param int $element_id Element Id (used for recursive function)
|
||||
* @param array $current_group Current group (used for recursive function)
|
||||
* @return array List of payment ids grouped by payment id and element id in common
|
||||
* @param array $link_by_element List of payment ids by link key
|
||||
* @param array $element_by_link List of element ids by link key
|
||||
* @param string $link_key Link key (used for recursive function)
|
||||
* @param array $current_group Current group (used for recursive function)
|
||||
* @return array List of element ids grouped by link or element in common
|
||||
*/
|
||||
public function getGroupElements(&$payment_by_element, &$element_by_payment, $element_id = 0, &$current_group = array())
|
||||
public function getGroupElements(&$link_by_element, &$element_by_link, $link_key = '', &$current_group = array())
|
||||
{
|
||||
$grouped_payments = array();
|
||||
if ($element_id > 0 && !isset($payment_by_element[$element_id])) {
|
||||
// Return if specific element id not found
|
||||
return $grouped_payments;
|
||||
$grouped_elements = array();
|
||||
if (!empty($link_key) && !isset($element_by_link[$link_key])) {
|
||||
// Return if specific link key not found
|
||||
return $grouped_elements;
|
||||
}
|
||||
|
||||
$save_payment_by_element = null;
|
||||
$save_element_by_payment = null;
|
||||
if ($element_id == 0) {
|
||||
if (empty($link_key)) {
|
||||
// Save list when is the begin of recursive function
|
||||
$save_payment_by_element = $payment_by_element;
|
||||
$save_element_by_payment = $element_by_payment;
|
||||
$save_link_by_element = $link_by_element;
|
||||
$save_element_by_link = $element_by_link;
|
||||
}
|
||||
|
||||
do {
|
||||
// Get current element id, get this payment id list and delete the entry
|
||||
$current_element_id = $element_id > 0 ? $element_id : array_keys($payment_by_element)[0];
|
||||
$payment_ids = $payment_by_element[$current_element_id];
|
||||
unset($payment_by_element[$current_element_id]);
|
||||
$current_link_key = !empty($link_key) ? $link_key : array_keys($element_by_link)[0];
|
||||
$element_ids = $element_by_link[$current_link_key];
|
||||
unset($element_by_link[$current_link_key]);
|
||||
|
||||
foreach ($payment_ids as $payment_id) {
|
||||
// Continue if payment id in not found
|
||||
if (!isset($element_by_payment[$payment_id])) continue;
|
||||
foreach ($element_ids as $element_id) {
|
||||
// Continue if element id in not found
|
||||
if (!isset($link_by_element[$element_id])) continue;
|
||||
|
||||
// Set the payment in the current group
|
||||
$current_group[$payment_id] = $payment_id;
|
||||
// Set the element in the current group
|
||||
$current_group[$element_id] = $element_id;
|
||||
|
||||
// Get current element ids, get this payment id list and delete the entry
|
||||
$element_ids = $element_by_payment[$payment_id];
|
||||
unset($element_by_payment[$payment_id]);
|
||||
// Get current link keys, get this element id list and delete the entry
|
||||
$link_keys = $link_by_element[$element_id];
|
||||
unset($link_by_element[$element_id]);
|
||||
|
||||
// Set payment id on the current group for each element id of the payment
|
||||
foreach ($element_ids as $id) {
|
||||
$this->getGroupElements($payment_by_element, $element_by_payment, $id, $current_group);
|
||||
// Set element id on the current group for each link key of the element
|
||||
foreach ($link_keys as $key) {
|
||||
$this->getGroupElements($link_by_element, $element_by_link, $key, $current_group);
|
||||
}
|
||||
}
|
||||
|
||||
if ($element_id == 0) {
|
||||
if (empty($link_key)) {
|
||||
// Save current group and reset the current group when is the begin of recursive function
|
||||
$grouped_payments[] = $current_group;
|
||||
$grouped_elements[] = $current_group;
|
||||
$current_group = array();
|
||||
}
|
||||
} while (!empty($payment_by_element) && $element_id == 0);
|
||||
} while (!empty($element_by_link) && empty($link_key));
|
||||
|
||||
if ($element_id == 0) {
|
||||
if (empty($link_key)) {
|
||||
// Restore list when is the begin of recursive function
|
||||
$payment_by_element = $save_payment_by_element;
|
||||
$element_by_payment = $save_element_by_payment;
|
||||
$link_by_element = $save_link_by_element;
|
||||
$element_by_link = $save_element_by_link;
|
||||
}
|
||||
|
||||
return $grouped_payments;
|
||||
return $grouped_elements;
|
||||
}
|
||||
}
|
||||
|
||||
@ -725,7 +725,7 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
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 '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
|
||||
@ -503,7 +503,7 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
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 '</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
|
||||
@ -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.")";
|
||||
@ -379,7 +379,7 @@ if ($action == 'writebookkeeping') {
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||
$lettering_static = new Lettering($db);
|
||||
$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id), 'supplier_invoice');
|
||||
$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -764,7 +764,7 @@ if (empty($action) || $action == 'view') {
|
||||
$exportlink = '';
|
||||
$builddate = dol_now();
|
||||
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
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");
|
||||
|
||||
@ -393,7 +393,7 @@ if ($action == 'writebookkeeping') {
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php';
|
||||
$lettering_static = new Lettering($db);
|
||||
$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id), 'customer_invoice');
|
||||
$nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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"));
|
||||
|
||||
@ -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 '<td>';
|
||||
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 '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
|
||||
@ -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 '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateall">';
|
||||
print '<input type="hidden" name="action" value="updatemainoptions">';
|
||||
|
||||
|
||||
// Mains options
|
||||
// Main options
|
||||
|
||||
print load_fiche_titre($langs->trans("MemberMainOptions"), '', '');
|
||||
|
||||
@ -294,6 +324,8 @@ print '</form>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// 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 '</div>';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
TODO Use a global form instead of embeded form into table
|
||||
|
||||
// Generation of cards for members
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateall">';
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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 '<input type="hidden" name="action" value="updatememberscards">';
|
||||
|
||||
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 '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("Value"), $helptext, 1, 'help', '', 0, 2, 'idhelptext').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Format of cards page
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_TYPE").'</td><td>';
|
||||
|
||||
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 "</td></tr>\n";
|
||||
|
||||
// Text printed on top of member cards
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_HEADER_TEXT").'</td><td>';
|
||||
print '<input type="text" class="flat minwidth300" name="ADHERENT_CARD_HEADER_TEXT" value="'.dol_escape_htmltag(getDolGlobalString('ADHERENT_CARD_HEADER_TEXT')).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Text printed on member cards (align on left)
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_TEXT").'</td><td>';
|
||||
print '<textarea class="flat" name="ADHERENT_CARD_TEXT" cols="50" rows="5" wrap="soft">'."\n";
|
||||
print getDolGlobalString('ADHERENT_CARD_TEXT');
|
||||
print '</textarea>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Text printed on member cards (align on right)
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_TEXT_RIGHT").'</td><td>';
|
||||
print '<textarea class="flat" name="ADHERENT_CARD_TEXT_RIGHT" cols="50" rows="5" wrap="soft">'."\n";
|
||||
print getDolGlobalString('ADHERENT_CARD_TEXT_RIGHT');
|
||||
print '</textarea>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Text printed on bottom of member cards
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_CARD_FOOTER_TEXT").'</td><td>';
|
||||
print '<input type="text" class="flat minwidth300" name="ADHERENT_CARD_FOOTER_TEXT" value="'.dol_escape_htmltag(getDolGlobalString('ADHERENT_CARD_FOOTER_TEXT')).'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Membership address sheet
|
||||
|
||||
/*
|
||||
* Edit info of model document
|
||||
*/
|
||||
$constantes = array('ADHERENT_ETIQUETTE_TYPE', 'ADHERENT_ETIQUETTE_TEXT');
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updatememberstickets">';
|
||||
|
||||
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 '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("Value"), $helptext, 1, 'help', '', 0, 2, 'idhelptext').'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
//print '</form>';
|
||||
// Format of labels page
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_ETIQUETTE_TYPE").'</td><td>';
|
||||
|
||||
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 "</td></tr>\n";
|
||||
|
||||
// Text printed on member address sheets
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DescADHERENT_ETIQUETTE_TEXT").'</td><td>';
|
||||
print '<textarea class="flat" name="ADHERENT_ETIQUETTE_TEXT" cols="50" rows="5" wrap="soft">'."\n";
|
||||
print getDolGlobalString('ADHERENT_ETIQUETTE_TEXT');
|
||||
print '</textarea>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ if (empty($user->socid)) {
|
||||
}
|
||||
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
echo '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Delete').'</a>';
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas, 'delete', $user->rights->adherent->supprimer);
|
||||
}
|
||||
|
||||
echo '</div><br>';
|
||||
|
||||
@ -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 '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $soc->email).'"></td></tr>';
|
||||
|
||||
// Website
|
||||
print '<tr><td>'.$form->editfieldkey('Web', 'member_url', '', $object, 0).'</td>';
|
||||
print '<td>'.img_picto('', 'globe').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.$object->url.'"></td></tr>';
|
||||
print '<tr><td>'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).'</td>';
|
||||
print '<td>'.img_picto('', 'globe').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(GETPOSTISSET('member_url', 'alpha') ? GETPOST('member_url', 'alpha') : $object->url).'"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||
@ -1725,7 +1728,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib('', 1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
@ -1894,7 +1897,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Send
|
||||
if (empty($user->socid)) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1914,7 +1917,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Modify
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\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 '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a>'."\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=valid&token='.newToken().'">'.$langs->trans("Validate").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\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 '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\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 '<a class="butAction" href="card.php?rowid='.$id.'&action=resiliate">'.$langs->trans("Resiliate")."</a></span>\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=resiliate">'.$langs->trans("Resiliate")."</a></span>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate").'</span>'."\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 '<a class="butAction" href="card.php?rowid='.$id.'&action=exclude">'.$langs->trans("Exclude")."</a></span>\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=exclude">'.$langs->trans("Exclude")."</a></span>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Exclude").'</span>'."\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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.((int) $object->id).'&action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.((int) $object->id).'&action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
}
|
||||
@ -1986,16 +1989,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$isinspip = $mailmanspip->is_in_spip($object);
|
||||
|
||||
if ($isinspip == 1) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$object->id.'&action=del_spip&token='.newToken().'">'.$langs->trans("DeleteIntoSpip").'</a>'."\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=del_spip&token='.newToken().'">'.$langs->trans("DeleteIntoSpip").'</a>'."\n";
|
||||
}
|
||||
if ($isinspip == 0) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$object->id.'&action=add_spip&token='.newToken().'">'.$langs->trans("AddIntoSpip").'</a>'."\n";
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=add_spip&token='.newToken().'">'.$langs->trans("AddIntoSpip").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
print '<a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="card.php?rowid='.((int) $object->id).'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete").'</span>'."\n";
|
||||
}
|
||||
|
||||
@ -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 .= '<span class="customer-back paddingleftimp paddingrightimp" title="'.$langs->trans("Physical").'">'.$labeltoshow.'</span>';
|
||||
}
|
||||
if ($morphy == 'mor') {
|
||||
if ($addbadge == 2) {
|
||||
$labeltoshow = dol_substr($langs->trans("Moral"), 0, 1);
|
||||
} else {
|
||||
$labeltoshow = $langs->trans("Moral");
|
||||
}
|
||||
$s .= '<span class="vendor-back paddingleftimp paddingrightimp" title="'.$langs->trans("Moral").'">'.$labeltoshow.'</span>';
|
||||
}
|
||||
} 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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 .='<tr><td class="center" colspan="2">';
|
||||
|
||||
$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 .= '</td></tr>';
|
||||
$boxgraph .= '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
|
||||
$boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated;
|
||||
$boxgraph .= $SumToValidate + $SumWaitingSubscription + $SumUpToDate + $SumExpired + $SumExcluded + $SumResiliated;
|
||||
$boxgraph .= '</td></tr>';
|
||||
$boxgraph .= '</table>';
|
||||
$boxgraph .= '</div>';
|
||||
|
||||
@ -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 .= '<div class="divsearchfield">';
|
||||
$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 .= '</div>';
|
||||
}
|
||||
$parameters = array();
|
||||
@ -741,10 +731,11 @@ if (!empty($arrayfields['d.login']['checked'])) {
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
||||
}
|
||||
// Nature
|
||||
if (!empty($arrayfields['d.morphy']['checked'])) {
|
||||
print '<td class="liste_titre left">';
|
||||
print '<td class="liste_titre center">';
|
||||
$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 '</td>';
|
||||
}
|
||||
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 '<td class="liste_titre center">';
|
||||
$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 '</td>';
|
||||
}
|
||||
@ -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 '<td class="center">';
|
||||
$s = '';
|
||||
if ($obj->morphy == 'phy') {
|
||||
$s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>';
|
||||
}
|
||||
if ($obj->morphy == 'mor') {
|
||||
$s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>';
|
||||
}
|
||||
print $s;
|
||||
print $memberstatic->getmorphylib('', 2);
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -1183,7 +1170,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
} else {
|
||||
if (!empty($obj->subscription)) {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
print '<span class="opacitymedium">'.$langs->trans("SubscriptionNotReceived").'</span>';
|
||||
if ($obj->statut > 0) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
|
||||
@ -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 "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
|
||||
print "<td>".$adh->getmorphylib($objp->morphy, 1)."</td>\n";
|
||||
|
||||
// EMail
|
||||
print "<td>".dol_print_email($objp->email, 0, 0, 1)."</td>\n";
|
||||
@ -740,9 +741,9 @@ if ($rowid > 0) {
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap left">';
|
||||
print '<td class="nowrap center">';
|
||||
if (!empty($objp->subscription)) {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
print '<span class="opacitymedium">'.$langs->trans("SubscriptionNotReceived").'</span>';
|
||||
if ($objp->status > 0) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
@ -758,7 +759,7 @@ if ($rowid > 0) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resign&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
@ -845,7 +846,7 @@ if ($rowid > 0) {
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
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 "</td></tr>";
|
||||
|
||||
|
||||
@ -226,7 +226,7 @@ if ($action == 'edit') {
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
print '</td></tr>';
|
||||
@ -289,7 +289,7 @@ if ($action == 'create' && $user->rights->adherent->configurer) {
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" class="minwidth300" value="'.dol_escape_htmltag(GETPOST("libelle", 'alphanohtml')).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
|
||||
@ -65,18 +65,21 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("Bank");
|
||||
$help_url = '';
|
||||
$page_name = "BankSetupModule";
|
||||
|
||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url);
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
|
||||
$head = bank_admin_prepare_head(null);
|
||||
|
||||
print dol_get_fiche_head($head, 'attributes', $langs->trans("BankSetupModule"), -1, 'account');
|
||||
print dol_get_fiche_head($head, 'attributes', $langs->trans($page_name), -1, 'account');
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("Bank");
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file admin/bankline_extrafields.php
|
||||
* \file htdocs/admin/bankline_extrafields.php
|
||||
* \ingroup bank
|
||||
* \brief Page to setup extra fields of bankline
|
||||
*/
|
||||
@ -41,7 +41,7 @@ $form = new Form($db);
|
||||
|
||||
// List of supported format
|
||||
$tmptype2label = ExtraFields::$type2label;
|
||||
$type2label = [];
|
||||
$type2label = array();
|
||||
foreach ($tmptype2label as $key => $val) {
|
||||
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||
}
|
||||
@ -80,6 +80,8 @@ $head = bank_admin_prepare_head(null);
|
||||
|
||||
print dol_get_fiche_head($head, 'bankline_extrafields', $langs->trans($page_name), -1, 'account');
|
||||
|
||||
$textobject = $langs->transnoentitiesnoconv("BankTransaction");
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -220,7 +220,7 @@ if ($action == 'edit') {
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<tr class="oddeven"><td><!-- '.$constname.' -->';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\n".$langs->trans($constname . 'Tooltip2') : '');
|
||||
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
||||
@ -302,7 +302,8 @@ if ($action == 'edit') {
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><!-- '.$constname.' -->';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
$tooltiphelp .= (($langs->trans($constname . 'Tooltip2') && $langs->trans($constname . 'Tooltip2') != $constname . 'Tooltip2') ? '<br><br>'."\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 '</td></tr>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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 '<!-- constant = '.$constante.' -->'."\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="16">'.img_object("", $picto[$const]).'</td>';
|
||||
print '<td>'.$langs->trans($desc).'</td>';
|
||||
print '<td>';
|
||||
print $langs->trans($desc);
|
||||
if ($const == 'DETAILS') {
|
||||
print '<br><span class="warning">'.$langs->trans("FCKeditorForProductDetails2").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center" width="100">';
|
||||
$value = (isset($conf->global->$constante) ? $conf->global->$constante : 0);
|
||||
if ($value == 0) {
|
||||
@ -185,6 +190,7 @@ if (empty($conf->use_javascript_ajax)) {
|
||||
|
||||
print '<form name="formtest" method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
// Skins
|
||||
show_skin(null, 1);
|
||||
@ -219,7 +225,7 @@ if (empty($conf->use_javascript_ajax)) {
|
||||
print $conf->global->FCKEDITOR_TEST;
|
||||
print '</div>';
|
||||
}
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
print $form->buttonsSaveCancel("Save", '', null, 0, 'reposition');
|
||||
print '<div id="divforlog"></div>';
|
||||
print '</form>'."\n";
|
||||
|
||||
|
||||
@ -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 '<input type="submit" class="button button-edit" value="'.$langs->trans("M
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// Allow online signing
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_ONLINE_SIGN">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("AllowOnlineSign");
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_ALLOW_ONLINE_SIGN"'.(getDolGlobalString("FICHINTER_ALLOW_ONLINE_SIGN") ? ' checked' : '').'>';
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// Allow external download
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("AllowExternalDownload");
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"'.(getDolGlobalString("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") ? ' checked' : '').'>';
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -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 '<input type="hidden" name="MAIN_MAIL_SENDMODE" value="'.$conf->global->MAIN_MAIL_SENDMODE.'">';
|
||||
print '<input type="hidden" name="MAIN_MAIL_SENDMODE" value="'.getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail').'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Host server
|
||||
print '<tr class="oddeven">';
|
||||
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 '<td>';
|
||||
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
||||
print '</td><td>';
|
||||
@ -423,7 +428,7 @@ if ($action == 'edit') {
|
||||
|
||||
// Port
|
||||
print '<tr class="oddeven"><td>';
|
||||
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 '</td><td>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||
@ -451,7 +456,7 @@ if ($action == 'edit') {
|
||||
print '</td></tr>';
|
||||
|
||||
// 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 '<tr class="drag drop oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>';
|
||||
// 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 '<tr class="oddeven smtp_auth_method"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>';
|
||||
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
|
||||
print '<input type="radio" id="radio_pw" name="MAIN_MAIL_SMTPS_AUTH_TYPE" value="LOGIN"'.(getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') == 'LOGIN' ? ' checked' : '').'> ';
|
||||
@ -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 '<tr class="drag drop oddeven smtp_pw"><td>';
|
||||
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 '<tr class="oddeven smtp_oauth_service"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>';
|
||||
|
||||
// SuperAdministrator access only
|
||||
@ -521,7 +526,7 @@ if ($action == 'edit') {
|
||||
}
|
||||
// TLS
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||
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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||
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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
||||
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 '<tr class="oddeven dkim"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
|
||||
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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SENDMODE").'</td><td>';
|
||||
$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").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$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").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD");
|
||||
print $form->textwithpicto('', $textwarning, 1, 'warning');
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Host server
|
||||
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'mail')) {
|
||||
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'</td></tr>';
|
||||
@ -692,31 +698,31 @@ if ($action == 'edit') {
|
||||
|
||||
|
||||
// Port
|
||||
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE') == 'mail')) {
|
||||
if ($linuxlike && (getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail') == 'mail')) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").'</td><td><span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span></td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).'</td><td>'.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'</td></tr>';
|
||||
}
|
||||
|
||||
// SMTPS ID
|
||||
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE'), array('smtps', 'swiftmailer'))) {
|
||||
if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer'))) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>'.$conf->global->MAIN_MAIL_SMTPS_ID.'</td></tr>';
|
||||
}
|
||||
|
||||
// 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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_AUTH_TYPE").'</td><td>'.$text.'</td></tr>';
|
||||
}
|
||||
|
||||
// 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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>'.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'</td></tr>';
|
||||
}
|
||||
|
||||
// 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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||
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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||
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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
||||
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 '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
|
||||
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 '</table>';
|
||||
print '</div>';
|
||||
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
||||
print info_admin($langs->trans("WarningPHPMail").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$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").'<br>'.$langs->trans("WarningPHPMailA").'<br>'.$langs->trans("WarningPHPMailB").'<br>'.$langs->trans("WarningPHPMailC").'<br><br>'.$langs->trans("WarningPHPMailD");
|
||||
$messagetoshow .= ' '.$langs->trans("WarningPHPMailDbis", '{s1}', '{s2}');
|
||||
$linktosetvar1 = '<a href="'.$_SERVER["PHP_SELF"].'?action=disablephpmailwarning&token='.newToken().'">';
|
||||
$linktosetvar2 = '</a>';
|
||||
$messagetoshow = str_replace('{s1}', $linktosetvar1, $messagetoshow);
|
||||
$messagetoshow = str_replace('{s2}', $linktosetvar2, $messagetoshow);
|
||||
print info_admin($messagetoshow, 0, 0, 'warning');
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
@ -903,7 +915,7 @@ if ($action == 'edit') {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&date='.dol_now().'#formmailaftertstconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
}
|
||||
@ -921,7 +933,7 @@ if ($action == 'edit') {
|
||||
print '</div>';
|
||||
|
||||
|
||||
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 ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -282,10 +282,9 @@ if (count($listinsetup) > 0) {
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Delete
|
||||
print '<td>';
|
||||
|
||||
$label = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&provider='.$keyforprovider.'&label='.$label.'">';
|
||||
print img_picto('', 'delete');
|
||||
print '</a>';
|
||||
@ -300,41 +299,53 @@ if (count($listinsetup) > 0) {
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td><input style="width: 80%" type"text" name="uri'.$keyforsupportedoauth2array.'" value="'.$redirect_uri.'" disabled>';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') {
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("URLOfServiceForAuthorization").'</td>';
|
||||
print '<td><input style="width: 80%" type"text" name="'.$key[3].'" value="'.getDolGlobalString($key[3]).'" >';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Api Id
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td><label for="'.$key[1].'">'.$langs->trans("OAUTH_ID").'</label></td>';
|
||||
print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.getDolGlobalString($key[1]).'">';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Api Secret
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_SECRET").'</label></td>';
|
||||
print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.getDolGlobalString($key[2]).'">';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
// TODO Move this into token generation
|
||||
// TODO Move this into token generation ?
|
||||
if ($supported) {
|
||||
if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') {
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("Scopes").'</td>';
|
||||
print '<td>';
|
||||
print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
$availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes']));
|
||||
$currentscopes = explode(',', getDolGlobalString($key[4]));
|
||||
@ -354,13 +365,17 @@ if (count($listinsetup) > 0) {
|
||||
print '<input type="checkbox" id="'.$keyforprovider.$scope.'" name="'.$key[4].'[]" value="'.$scope.'"'.($val ? ' checked' : '').'>';
|
||||
print '<label style="margin-right: 10px" for="'.$keyforprovider.$scope.'">'.$scope.'</label>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven value">';
|
||||
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
|
||||
print '</td></tr>';
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
@ -193,7 +193,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MaxNumberOfPostOnPublicPagesByIP").'</td><td class="right">';
|
||||
print '</td>';
|
||||
print '<td class="nowrap">';
|
||||
print '<input class="flat right width50" name="MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS" type="text" value="'.getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000).'"> '.strtolower($langs->trans("Posts"));
|
||||
print '<input class="flat right width50" name="MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS" type="text" value="'.getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 1000).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -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 '<td class="center">';
|
||||
$constforvar = 'STOCKTRANSFER_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $file) {
|
||||
if (getDolGlobalString($constforvar) == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&object='.strtolower($myTmpObjectKey).'&value='.$file.'">';
|
||||
@ -428,7 +419,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
// Default
|
||||
print '<td class="center">';
|
||||
$constforvar = strtoupper($myTmpObjectKey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforvar == $name) {
|
||||
if (getDolGlobalString($constforvar) == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&object='.$myTmpObjectKey.'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -570,9 +570,10 @@ print 'For a higher security, we also recommend to implement limits and mitigati
|
||||
print '</span>';
|
||||
|
||||
print '<br>';
|
||||
print 'Login process -> This can be done using a fail2ban rule (see example into dev/setup)'."<br>";
|
||||
print DOL_URL_ROOT.'/passwordforgotten.php (see example into dev/setup)'."<br>";
|
||||
print DOL_URL_ROOT.'/public/* (see example into dev/setup)'."<br>";
|
||||
$urlexamplebase = 'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/fail2ban/filter.d/';
|
||||
print '- Login process (see fail2ban example on <a target="_blank" rel="noopener" href="'.$urlexamplebase.'web-dolibarr-rulesbruteforce.conf">GitHub</a>)<br>';
|
||||
print '- '.DOL_URL_ROOT.'/passwordforgotten.php (see fail2ban example on <a target="_blank" rel="noopener" href="'.$urlexamplebase.'web-dolibarr-rulespassgorgotten.conf">GitHub</a>)<br>';
|
||||
print '- '.DOL_URL_ROOT.'/public/* (see fail2ban example on <a target="_blank" rel="noopener" href="'.$urlexamplebase.'web-dolibarr-limitpublic.conf">GitHub</a>)<br>';
|
||||
|
||||
|
||||
|
||||
|
||||
@ -419,7 +419,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
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 '</td>';
|
||||
print '<td class="center">';
|
||||
@ -431,7 +431,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
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 '</td>';
|
||||
print '<td class="center">';
|
||||
|
||||
@ -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")).'...";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -79,7 +79,7 @@ $workflowcodes = array(
|
||||
'picto'=>'ticket'
|
||||
),
|
||||
|
||||
'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>''),
|
||||
'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('commande')) || (isModEnabled('commande') && isModEnabled('facture')) || (isModEnabled('ticket') && isModEnabled('ficheinter')))),
|
||||
|
||||
// Automatic classification of proposal
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array(
|
||||
@ -118,8 +118,6 @@ $workflowcodes = array(
|
||||
'warning'=>''
|
||||
), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
|
||||
|
||||
'separator2'=>array('family'=>'separator', 'position'=>50),
|
||||
|
||||
// Automatic classification supplier proposal
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array(
|
||||
'family'=>'classify_supplier_proposal',
|
||||
@ -154,14 +152,6 @@ $workflowcodes = array(
|
||||
'warning'=>''
|
||||
),
|
||||
|
||||
// Automatic classification reception
|
||||
'WORKFLOW_BILL_ON_RECEPTION'=>array(
|
||||
'family'=>'classify_reception',
|
||||
'position'=>80,
|
||||
'enabled'=>(isModEnabled("reception") && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
'picto'=>'reception'
|
||||
),
|
||||
|
||||
// Automatic classification shipping
|
||||
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
|
||||
'family' => 'classify_shipping',
|
||||
@ -170,17 +160,27 @@ $workflowcodes = array(
|
||||
'picto' => 'shipment'
|
||||
),
|
||||
|
||||
// Automatic classification reception
|
||||
'WORKFLOW_EXPEDITION_CLASSIFY_CLOSED_INVOICE'=>array(
|
||||
'family'=>'classify_reception',
|
||||
'position'=>95,
|
||||
'enabled'=>(isModEnabled("reception") && ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice"))),
|
||||
'picto'=>'reception'
|
||||
),
|
||||
|
||||
'separator2'=>array('family'=>'separator', 'position'=>400, 'enabled' => (isModEnabled('ticket') && isModEnabled('contract'))),
|
||||
|
||||
// Automatic link ticket -> contract
|
||||
'WORKFLOW_TICKET_LINK_CONTRACT' => array(
|
||||
'family' => 'link_ticket',
|
||||
'position' => 75,
|
||||
'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
|
||||
'position' => 500,
|
||||
'enabled' => (isModEnabled('ticket') && isModEnabled('contract')),
|
||||
'picto' => 'ticket'
|
||||
),
|
||||
'WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS' => array(
|
||||
'family' => 'link_ticket',
|
||||
'position' => 76,
|
||||
'enabled' => isModEnabled('ticket') && !empty($conf->contract->enabled),
|
||||
'position' => 501,
|
||||
'enabled' => (isModEnabled('ticket') && isModEnabled('contract')),
|
||||
'picto' => 'ticket'
|
||||
),
|
||||
);
|
||||
@ -235,6 +235,7 @@ foreach ($workflowcodes as $key => $params) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$reg = array();
|
||||
if ($oldfamily != $params['family']) {
|
||||
if ($params['family'] == 'create') {
|
||||
$header = $langs->trans("AutomaticCreation");
|
||||
@ -269,7 +270,7 @@ foreach ($workflowcodes as $key => $params) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$header.'</th>';
|
||||
print '<th align="center">'.$langs->trans("Status").'</th>';
|
||||
print '<th class="right">'.$langs->trans("Status").'</th>';
|
||||
print '</tr>';
|
||||
|
||||
$oldfamily = $params['family'];
|
||||
@ -286,7 +287,7 @@ foreach ($workflowcodes as $key => $params) {
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<td class="right">';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff($key);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -704,7 +704,7 @@ if (empty($reshook)) {
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&object=bom&token='.newToken().'">'.$langs->trans("ToClone").'</a>'."\n";
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=bom', 'clone', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Close / Cancel
|
||||
@ -726,11 +726,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
*/
|
||||
|
||||
if ($permissiontodelete) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Delete').'</a>'."\n";
|
||||
}
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ function printDropdownBookmarksList()
|
||||
if ($sortorder) {
|
||||
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder);
|
||||
}
|
||||
if (is_array($_POST)) {
|
||||
if (!empty($_POST) && is_array($_POST)) {
|
||||
foreach ($_POST as $key => $val) {
|
||||
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
||||
&& $val != ''
|
||||
|
||||
@ -247,7 +247,7 @@ if ($user->rights->categorie->creer) {
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
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 '</td></tr>';
|
||||
|
||||
|
||||
@ -694,6 +694,7 @@ class Categorie extends CommonObject
|
||||
* @param CommonObject $obj Object to link to category
|
||||
* @param string $type Type of category ('product', ...). Use '' to take $obj->element.
|
||||
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
|
||||
* @see del_type()
|
||||
*/
|
||||
public function add_type($obj, $type = '')
|
||||
{
|
||||
@ -785,8 +786,8 @@ class Categorie extends CommonObject
|
||||
*
|
||||
* @param CommonObject $obj Object
|
||||
* @param string $type Type of category ('customer', 'supplier', 'contact', 'product', 'member')
|
||||
*
|
||||
* @return int 1 if OK, -1 if KO
|
||||
* @see add_type()
|
||||
*/
|
||||
public function del_type($obj, $type)
|
||||
{
|
||||
@ -1980,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)
|
||||
{
|
||||
@ -1997,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)
|
||||
{
|
||||
|
||||
@ -267,7 +267,7 @@ if ($action == 'edit') {
|
||||
// Desc
|
||||
$desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']);
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
@ -327,7 +327,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td>';
|
||||
print '<td><input name="libelle" class="minwidth200 maxwidth300" value="'.GETPOST('libelle', 'alpha').'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Description').'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
|
||||
@ -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 '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
$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 '</td></tr>';
|
||||
}
|
||||
|
||||
@ -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 '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
@ -1694,7 +1708,7 @@ if ($id > 0) {
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : dol_htmlentities($_SERVER["HTTP_REFERER"])).'">';
|
||||
}
|
||||
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->code != "TICKET_MSG_PRIVATE") {
|
||||
print '<input type="hidden" name="actioncode" value="'.$object->type_code.'">';
|
||||
}
|
||||
|
||||
@ -1706,7 +1720,7 @@ if ($id > 0) {
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td colspan="3">'.$object->id.'</td></tr>';
|
||||
|
||||
// Type of event
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != "ticket") {
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td colspan="3">';
|
||||
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 '</td></tr>';
|
||||
}
|
||||
|
||||
// Private
|
||||
if ($object->elementtype == 'ticket') print '<tr><td>'.$langs->trans("PrivateEventMessage").'</td><td colspan="3"><input type="checkbox" id="private" name="private" '.(($object->code == 'TICKET_MSG_PRIVATE') ? ' checked' : '').'></td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE) ? ' class="fieldrequired titlefieldcreate"' : '').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="soixantepercent" value="'.$object->label.'"></td></tr>';
|
||||
|
||||
@ -1865,7 +1882,7 @@ if ($id > 0) {
|
||||
|
||||
// Location
|
||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="width500" value="'.$object->location.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth300 maxwidth150onsmartphone" value="'.$object->location.'"></td></tr>';
|
||||
}
|
||||
|
||||
// Status
|
||||
@ -1997,7 +2014,7 @@ if ($id > 0) {
|
||||
print '</table>';
|
||||
|
||||
// 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.='<br>'.$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 .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button button-save valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2184,13 +2188,16 @@ if ($id > 0) {
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
// Type
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $object->elementtype != 'ticket') {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
|
||||
print $object->getTypePicto();
|
||||
print $langs->trans("Action".$object->type_code);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Private
|
||||
if ($object->elementtype == 'ticket') print '<tr><td class="titlefield">'.$langs->trans("PrivateEventMessage").'</td><td>'.yn(($object->code == 'TICKET_MSG_PRIVATE') ? 1 : 0, 3).'</td></tr>';
|
||||
|
||||
// Full day event
|
||||
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
|
||||
|
||||
|
||||
@ -1591,16 +1591,16 @@ class ActionComm extends CommonObject
|
||||
|
||||
$tooltip = img_picto('', $this->picto).' <u>'.$langs->trans('Action').'</u>';
|
||||
if (!empty($this->ref)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.dol_escape_htmltag($this->ref);
|
||||
}
|
||||
if (!empty($label)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Title').':</b> '.$label;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Title').':</b> '.dol_escape_htmltag($label);
|
||||
}
|
||||
if (!empty($labeltype)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.$labeltype;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.dol_escape_htmltag($labeltype);
|
||||
}
|
||||
if (!empty($this->location)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.$this->location;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.dol_escape_htmltag($this->location);
|
||||
}
|
||||
if (isset($this->transparency)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Busy').':</b> '.yn($this->transparency);
|
||||
@ -1609,7 +1609,7 @@ class ActionComm extends CommonObject
|
||||
$langs->load("mails");
|
||||
$tooltip .= '<br>';
|
||||
//$tooltip .= '<br><b>'.img_picto('', 'email').' '.$langs->trans("Email").'</b>';
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTopic').':</b> '.$this->email_subject;
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTopic').':</b> '.dol_escape_htmltag($this->email_subject);
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailFrom').':</b> '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_from);
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTo').':</b> '.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;
|
||||
|
||||
@ -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)))) {
|
||||
|
||||
@ -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.='<br>'.$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 .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 = '<div class="refidno">';
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
//$morehtmlref.='<br>'.$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 .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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 '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="title" value="'.dol_escape_htmltag(GETPOST('title')).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO) ? $conf->global->MAILING_EMAIL_ERRORSTO : $conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||
|
||||
// Other attributes
|
||||
@ -742,7 +747,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</br><br>';
|
||||
print '<br><br>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input class="flat minwidth200 quatrevingtpercent" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet', 'alphanohtml')).'"></td></tr>';
|
||||
@ -887,16 +892,16 @@ if ($action == 'create') {
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield">';
|
||||
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 '</td><td>';
|
||||
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 '</td></tr>';
|
||||
|
||||
// From
|
||||
print '<tr><td>';
|
||||
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 '</td><td>';
|
||||
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 '<tr><td>';
|
||||
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 '</td><td>';
|
||||
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<div class=\"tabsAction\">\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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&token='.newToken().'&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
|
||||
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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("EditWithEditor").'</a>';
|
||||
} 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 '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("SendingFromWebInterfaceIsNotAllowed")).'">'.$langs->trans("SendMailing").'</a>';
|
||||
} 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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=clone&object=emailing&id='.$object->id.'">'.$langs->trans("ToClone").'</a>';
|
||||
}
|
||||
|
||||
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 '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("ResetMailing").'</a>';
|
||||
} 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 '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("DeleteMailing").'</a>';
|
||||
} else {
|
||||
@ -1262,8 +1267,9 @@ if ($action == 'create') {
|
||||
$out .= '<br></div>';
|
||||
}
|
||||
} else {
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
//$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
}
|
||||
|
||||
// Add link to add file
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
@ -1272,7 +1278,7 @@ if ($action == 'create') {
|
||||
}
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
print $out;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -544,7 +544,7 @@ if ($object->fetch($id) >= 0) {
|
||||
if ($allowaddtarget) {
|
||||
$morehtmlcenter = '<span class="opacitymedium hideonsmartphone">'.$langs->trans("ToClearAllRecipientsClickHere").'</span> <a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").'</a>';
|
||||
}
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=exportcsv&token='.newToken().'&exportcsv=1&id='.$object->id.'">'.img_picto('', 'download', 'class="pictofixedwidth"').$langs->trans("Download").'</a>';
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
|
||||
@ -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 .= '<br><span class="hideonsmartphone">'.$langs->trans('ThirdParty').' : </span>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br><span class="paddingrightonly">'.$langs->trans('Project').'</span>';
|
||||
$morehtmlref .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2343,7 +2332,7 @@ if ($action == 'create') {
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Link for thirdparty discounts
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
@ -2403,7 +2392,7 @@ if ($action == 'create') {
|
||||
// Date end proposal
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('DateEndPropal');
|
||||
print '</td>';
|
||||
if ($action != 'editecheance' && $usercancreate && $caneditfield) {
|
||||
@ -2933,10 +2922,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($usercandelete) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'"';
|
||||
print '>'.$langs->trans('Delete').'</a>';
|
||||
}
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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 .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$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 .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$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 .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -53,6 +53,8 @@ if (!empty($user->socid)) {
|
||||
}
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -82,37 +84,25 @@ $morehtmlref = '<div class="refidno">';
|
||||
$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 .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$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 .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 .= '</div>';
|
||||
}
|
||||
$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 '</table>'."\n";
|
||||
|
||||
@ -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 .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$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 .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
print '<td class="linkedcol-ref" >'.$objectlink->ref_client.'</td>';
|
||||
print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
print '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->propale->lire) {
|
||||
if ($user->rights->propal->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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 '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
|
||||
@ -262,6 +265,7 @@ if ($socid > 0) {
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="border centpercent tableforfield borderbottom">';
|
||||
|
||||
if ($isCustomer) { // Calcul avoirs client en cours
|
||||
@ -324,9 +328,10 @@ if ($socid > 0) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '</div>'; // close fichecenter
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
@ -346,6 +351,8 @@ if ($socid > 0) {
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="border centpercent">';
|
||||
if ($isCustomer && $isSupplier) {
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>';
|
||||
@ -353,9 +360,19 @@ if ($socid > 0) {
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1" value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.price2num(GETPOST("amount_ht")).'" autofocus>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Amount").'</td>';
|
||||
print '<td><input type="text" size="5" name="amount" value="'.price2num(GETPOST("amount")).'" autofocus>';
|
||||
print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||
|
||||
// Price base (HT / TTC)
|
||||
print '<tr><td class="titlefield">'.$langs->trans("PriceBase").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectPriceBaseType(GETPOST("price_base_type"), "price_base_type");
|
||||
print '</td></tr>';
|
||||
|
||||
// VAT
|
||||
print '<tr><td>'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
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 '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc', 'alphanohtml').'"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
@ -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 .= '<br>'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
$morehtmlref .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$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 .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2899,7 +2888,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
// Delete order
|
||||
if ($usercandelete) {
|
||||
if ($numshipping == 0) {
|
||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
|
||||
print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
|
||||
} else {
|
||||
print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user