Merge remote-tracking branch 'upstream/develop' into adminbadgeextrafields
This commit is contained in:
commit
a8a745d95e
86
.travis.yml
86
.travis.yml
@ -2,10 +2,9 @@
|
|||||||
# from Dolibarr GitHub repository.
|
# from Dolibarr GitHub repository.
|
||||||
# For syntax, see https://docs.travis-ci.com/user/languages/php/
|
# For syntax, see https://docs.travis-ci.com/user/languages/php/
|
||||||
|
|
||||||
# We use dist: xenial to have php 5.6+ available
|
# We use dist: bionic = 18.04
|
||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: bionic
|
||||||
#dist: bionic
|
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
@ -18,21 +17,42 @@ services:
|
|||||||
- mysql
|
- mysql
|
||||||
- postgresql
|
- postgresql
|
||||||
|
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- |
|
||||||
|
echo "Add ondrej PPA"
|
||||||
|
sudo add-apt-repository -y ppa:ondrej/php
|
||||||
|
sudo apt-get update
|
||||||
|
echo "Disabling Xdebug for composer"
|
||||||
|
export PHP_VERSION_NAME=$(phpenv version-name)
|
||||||
|
echo $PHP_VERSION_NAME
|
||||||
|
ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/
|
||||||
|
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
|
||||||
|
phpenv config-rm xdebug.ini
|
||||||
|
phpenv rehash
|
||||||
|
echo
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
# Force postgresql to 9.4 (the oldest availablable on xenial)
|
# Force postgresql version
|
||||||
postgresql: '9.4'
|
postgresql: '10'
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
# To use the last version of pgloader, we add repo of postgresql with a name available in http://apt.postgresql.org/pub/repos/apt/
|
- sourceline: 'ppa:ondrej/php'
|
||||||
- pgdg-xenial
|
|
||||||
packages:
|
packages:
|
||||||
# We need a webserver to test the webservices
|
# We need a webserver to test the webservices
|
||||||
# Let's install Apache with.
|
# Let's install Apache with.
|
||||||
- apache2
|
- apache2
|
||||||
# mod_php is not supported by Travis. Add fcgi. We install FPM later on.
|
|
||||||
- libapache2-mod-fastcgi
|
|
||||||
# We need pgloader for import mysql database into pgsql
|
# We need pgloader for import mysql database into pgsql
|
||||||
- pgloader
|
- pgloader
|
||||||
|
- php
|
||||||
|
- php7.1-pgsql
|
||||||
|
- php7.1-mysqli
|
||||||
|
- php7.1-xml
|
||||||
|
- php7.1-intl
|
||||||
|
- php8.1-pgsql
|
||||||
|
- php8.1-mysqli
|
||||||
|
- php8.1-xml
|
||||||
|
- php8.1-intl
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
@ -44,20 +64,20 @@ jobs:
|
|||||||
#allow_failures:
|
#allow_failures:
|
||||||
#- php: nightly
|
#- php: nightly
|
||||||
include:
|
include:
|
||||||
- stage: PHP 5.6-7.4
|
- stage: PHP 7.0-8.1
|
||||||
if: type = push
|
if: type = push
|
||||||
php: '5.6'
|
php: '7.1'
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- stage: PHP 5.6-7.4
|
- stage: PHP 7.0-8.1
|
||||||
if: type = pull_request OR type = push
|
if: type = pull_request OR type = push
|
||||||
php: '7.4.22'
|
php: '8.1'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- stage: PHP Dev
|
- stage: PHP Dev
|
||||||
if: type = push AND branch = develop
|
if: type = push AND branch = develop
|
||||||
php: nightly
|
php: nightly
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- stage: PHP Dev
|
- stage: PHP Dev
|
||||||
if: type = push AND branch = 15.0
|
if: type = push AND branch = 17.0
|
||||||
php: nightly
|
php: nightly
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
|
|
||||||
@ -72,13 +92,6 @@ notifications:
|
|||||||
on_failure: always
|
on_failure: always
|
||||||
use_notice: true
|
use_notice: true
|
||||||
|
|
||||||
before_install:
|
|
||||||
- |
|
|
||||||
echo "Disabling Xdebug for composer"
|
|
||||||
export PHP_VERSION_NAME=$(phpenv version-name)
|
|
||||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
|
|
||||||
phpenv config-rm xdebug.ini
|
|
||||||
echo
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- |
|
- |
|
||||||
@ -94,13 +107,6 @@ install:
|
|||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer, PHP Vardump check - for $TRAVIS_PHP_VERSION"
|
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer, PHP Vardump check - for $TRAVIS_PHP_VERSION"
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then
|
|
||||||
composer -n require phpunit/phpunit ^5 \
|
|
||||||
php-parallel-lint/php-parallel-lint ^1 \
|
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
|
||||||
php-parallel-lint/php-var-dump-check ~0.4 \
|
|
||||||
squizlabs/php_codesniffer ^3
|
|
||||||
fi
|
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
||||||
composer -n require phpunit/phpunit ^6 \
|
composer -n require phpunit/phpunit ^6 \
|
||||||
php-parallel-lint/php-parallel-lint ^1 \
|
php-parallel-lint/php-parallel-lint ^1 \
|
||||||
@ -116,8 +122,8 @@ install:
|
|||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
fi
|
||||||
# phpunit 9 is required for php 8
|
# phpunit 9 is required for php 8
|
||||||
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \
|
composer -n require --ignore-platform-reqs phpunit/phpunit ^7.5.20 \
|
||||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
php-parallel-lint/php-var-dump-check ~0.4 \
|
php-parallel-lint/php-var-dump-check ~0.4 \
|
||||||
@ -246,6 +252,10 @@ before_script:
|
|||||||
|
|
||||||
|
|
||||||
- echo "Setting up Apache + FPM"
|
- echo "Setting up Apache + FPM"
|
||||||
|
# setup link for php legacy
|
||||||
|
- sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php
|
||||||
|
# install apache web server
|
||||||
|
- sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php
|
||||||
# enable php-fpm
|
# enable php-fpm
|
||||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||||
- |
|
- |
|
||||||
@ -253,10 +263,11 @@ before_script:
|
|||||||
# Copy the included pool
|
# Copy the included pool
|
||||||
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
||||||
fi
|
fi
|
||||||
- sudo a2enmod rewrite actions fastcgi alias
|
- sudo a2enmod proxy_fcgi rewrite setenvif cgi alias
|
||||||
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||||
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
|
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
|
||||||
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
|
#- sudo chown -R travis:travis /var/lib/apache2/fastcgi
|
||||||
|
# start php-fpm
|
||||||
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
||||||
# configure apache virtual hosts
|
# configure apache virtual hosts
|
||||||
- sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf
|
- sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf
|
||||||
@ -471,6 +482,9 @@ after_script:
|
|||||||
ls $TRAVIS_BUILD_DIR/documents
|
ls $TRAVIS_BUILD_DIR/documents
|
||||||
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
|
echo "After script - Output last lines of apache error.log"
|
||||||
|
sudo ls /var/log/apache2
|
||||||
|
sudo tail -n 50 /var/log/apache2/travis_error_log
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- |
|
- |
|
||||||
@ -479,16 +493,16 @@ after_success:
|
|||||||
after_failure:
|
after_failure:
|
||||||
- |
|
- |
|
||||||
echo Failure detected, so we show samples of log to help diagnose
|
echo Failure detected, so we show samples of log to help diagnose
|
||||||
# This part of code is executed only if previous command that fails are enclosed with set +e
|
# This part of code is executed only if the command that fails are enclosed with set +e
|
||||||
# Upgrade log files
|
# Show upgrade log files
|
||||||
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
|
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
|
||||||
do
|
do
|
||||||
echo "Debugging informations for file $ficlog"
|
echo "Debugging informations for file $ficlog"
|
||||||
#cat $ficlog
|
#cat $ficlog
|
||||||
done
|
done
|
||||||
# Apache log file
|
# Show Apache log file
|
||||||
echo "Debugging informations for file apache error.log"
|
echo "Debugging informations for file apache error.log"
|
||||||
sudo cat /var/log/apache2/travis_error_log
|
sudo tail -n 50 /var/log/apache2/travis_error_log
|
||||||
if [ "$DEBUG" = true ]; then
|
if [ "$DEBUG" = true ]; then
|
||||||
# Dolibarr log file
|
# Dolibarr log file
|
||||||
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
||||||
|
|||||||
@ -35,7 +35,7 @@ PCLZip 2.8.4 LGPL-3+ Yes
|
|||||||
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
|
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
|
||||||
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
|
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
|
||||||
PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||||
php-iban 4.1 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
php-iban 4.1.1 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||||
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||||
PSR/Logs 1.0 MIT License Yes Library for logs (used by DebugBar)
|
PSR/Logs 1.0 MIT License Yes Library for logs (used by DebugBar)
|
||||||
|
|||||||
@ -7,6 +7,8 @@ English Dolibarr ChangeLog
|
|||||||
For users:
|
For users:
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
@ -28,8 +30,8 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
For users:
|
For users:
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
NEW: PHP 8.1 compatibility:
|
NEW: PHP 8.0 and 8.1 compatibility:
|
||||||
Warning!! Application works correctly with PHP8 and 8.1 but you will experience a lot of PHP warnings into the PHP server
|
Warning!! Application works correctly with PHP 8.0 and 8.1 but you will experience a lot of PHP warnings into the PHP server
|
||||||
log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17.
|
log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17.
|
||||||
NEW: Support for recurring purchase invoices.
|
NEW: Support for recurring purchase invoices.
|
||||||
NEW: #20292 Include German public holidays
|
NEW: #20292 Include German public holidays
|
||||||
|
|||||||
20
dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf
Normal file
20
dev/setup/fail2ban/filter.d/web-dolibarr-limitpublic.conf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
|
||||||
|
[Definition]
|
||||||
|
|
||||||
|
# To test, you can inject this example into log
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
# To test rule file on a existing log file
|
||||||
|
# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-limitpublic.conf
|
||||||
|
|
||||||
|
failregex = ^ [A-Z\s]+ <HOST>\s+--- Access to .*/public/
|
||||||
|
ignoreregex =
|
||||||
@ -8,21 +8,35 @@
|
|||||||
enabled = true
|
enabled = true
|
||||||
port = http,https
|
port = http,https
|
||||||
filter = web-dolibarr-rulespassforgotten
|
filter = web-dolibarr-rulespassforgotten
|
||||||
logpath = >> /mypath/documents/documents/dolibarr.log
|
logpath = /mypath/documents/documents/dolibarr.log
|
||||||
action = %(action_mw)s
|
action = %(action_mw)s
|
||||||
bantime = 4320000 ; 50 days
|
bantime = 4320000 ; 50 days
|
||||||
findtime = 86400 ; 1 day
|
findtime = 86400 ; 1 day
|
||||||
maxretry = 10
|
maxretry = 10
|
||||||
|
|
||||||
|
|
||||||
[web-dol-bruteforce]
|
[web-dol-bruteforce]
|
||||||
|
|
||||||
; rule against bruteforce hacking (login + api)
|
; rule against bruteforce hacking (login + api)
|
||||||
enabled = true
|
enabled = true
|
||||||
port = http,https
|
port = http,https
|
||||||
filter = web-dolibarr-rulesbruteforce
|
filter = web-dolibarr-rulesbruteforce
|
||||||
logpath = >> /mypath/documents/documents/dolibarr.log
|
logpath = /mypath/documents/documents/dolibarr.log
|
||||||
action = %(action_mw)s
|
action = %(action_mw)s
|
||||||
bantime = 86400 ; 1 day
|
bantime = 86400 ; 1 day
|
||||||
findtime = 3600 ; 1 hour
|
findtime = 3600 ; 1 hour
|
||||||
maxretry = 10
|
maxretry = 10
|
||||||
|
|
||||||
|
|
||||||
|
[web-dol-limitpublic]
|
||||||
|
|
||||||
|
; rule to add rate limit on some public pages
|
||||||
|
enabled = true
|
||||||
|
port = http,https
|
||||||
|
filter = web-dolibarr-limitpublic
|
||||||
|
logpath = /mypath/documents/documents/dolibarr.log
|
||||||
|
action = %(action_mw)s
|
||||||
|
bantime = 86400 ; 1 day
|
||||||
|
findtime = 86400 ; 1 day
|
||||||
|
maxretry = 500
|
||||||
|
|
||||||
|
|||||||
@ -653,21 +653,28 @@ if (!empty($sortfield)) {
|
|||||||
// Export into a file with format defined into setup (FEC, CSV, ...)
|
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||||
// Must be after definition of $sql
|
// Must be after definition of $sql
|
||||||
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
||||||
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them.
|
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumes too much memory on large export.
|
||||||
|
// Replace this with the query($sql) and loop on each line to export them.
|
||||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
|
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
// Export files
|
// Export files then exit
|
||||||
$accountancyexport = new AccountancyExport($db);
|
$accountancyexport = new AccountancyExport($db);
|
||||||
|
|
||||||
|
$mimetype = $accountancyexport->getMimeType($formatexportset);
|
||||||
|
|
||||||
|
top_httphead($mimetype, 1);
|
||||||
|
|
||||||
|
// Output data on screen
|
||||||
$accountancyexport->export($object->lines, $formatexportset);
|
$accountancyexport->export($object->lines, $formatexportset);
|
||||||
|
|
||||||
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
|
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
|
||||||
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
|
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
|
||||||
|
|
||||||
if (!empty($accountancyexport->errors)) {
|
if (!empty($accountancyexport->errors)) {
|
||||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
dol_print_error('', '', $accountancyexport->errors);
|
||||||
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
|
||||||
// Specify as export : update field date_export or date_validated
|
// Specify as export : update field date_export or date_validated
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -701,11 +708,10 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
|||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
|
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
|
dol_print_error('', $langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
@ -861,8 +867,8 @@ if ($optioncss != '') {
|
|||||||
print '<input type="hidden" name="optioncss" value="'.urlencode($optioncss).'">';
|
print '<input type="hidden" name="optioncss" value="'.urlencode($optioncss).'">';
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
if (count($filter)) {
|
if (count($filter)) {
|
||||||
@ -883,7 +889,7 @@ if (empty($reshook)) {
|
|||||||
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
|
||||||
|
|
||||||
if (!empty($user->rights->accounting->mouvements->export)) {
|
if (!empty($user->rights->accounting->mouvements->export)) {
|
||||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file&token='.newToken().($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
||||||
}
|
}
|
||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
@ -983,14 +989,14 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) {
|
|||||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount');
|
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
|
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.dol_escape_htmltag($search_accountancy_aux_code).'">';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Label operation
|
// Label operation
|
||||||
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<input type="text" size="7" class="flat" name="search_mvt_label" value="'.$search_mvt_label.'"/>';
|
print '<input type="text" size="7" class="flat" name="search_mvt_label" value="'.dol_escape_htmltag($search_mvt_label).'"/>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Debit
|
// Debit
|
||||||
@ -1008,7 +1014,7 @@ if (!empty($arrayfields['t.credit']['checked'])) {
|
|||||||
// Lettering code
|
// Lettering code
|
||||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.dol_escape_htmltag($search_lettering_code).'"/>';
|
||||||
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
print '<br><span class="nowrap"><input type="checkbox" name="search_not_reconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1116,10 +1122,10 @@ if (!empty($arrayfields['t.tms']['checked'])) {
|
|||||||
print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated,t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.import_key']['checked'])) {
|
if (!empty($arrayfields['t.import_key']['checked'])) {
|
||||||
print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
|||||||
@ -286,6 +286,28 @@ class AccountancyExport
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the MIME type of a file
|
||||||
|
*
|
||||||
|
* @param int $formatexportset Id of export format
|
||||||
|
* @return string MIME type.
|
||||||
|
*/
|
||||||
|
public function getMimeType($formatexportset)
|
||||||
|
{
|
||||||
|
$mime = 'text/csv';
|
||||||
|
|
||||||
|
switch ($formatexportset) {
|
||||||
|
case self::$EXPORT_TYPE_FEC:
|
||||||
|
$mime = 'text/tab-separated-values';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$mime = 'text/csv';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $mime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function who chose which export to use with the default config, and make the export into a file
|
* Function who chose which export to use with the default config, and make the export into a file
|
||||||
*
|
*
|
||||||
|
|||||||
@ -169,6 +169,16 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $piece_num;
|
public $piece_num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date of movement validated & lock
|
||||||
|
*/
|
||||||
|
public $date_validation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var integer|string date of movement who are noticed like exported
|
||||||
|
*/
|
||||||
|
public $date_export;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
*/
|
*/
|
||||||
@ -788,8 +798,7 @@ class BookKeeping extends CommonObject
|
|||||||
$this->piece_num = $obj->piece_num;
|
$this->piece_num = $obj->piece_num;
|
||||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||||
$this->date_export = $this->db->jdate($obj->date_export);
|
$this->date_export = $this->db->jdate($obj->date_export);
|
||||||
$this->date_validation = $this->db->jdate($obj->date_validated);
|
$this->date_validation = isset($obj->date_validated) ? $this->db->jdate($obj->date_validated) : '';
|
||||||
$this->date_validation = $this->db->jdate($obj->date_validation);
|
|
||||||
}
|
}
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
@ -294,9 +294,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
|
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
|
||||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
|
||||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||||
$companystatic->fournisseur = 1;
|
$companystatic->fournisseur = 1;
|
||||||
|
|
||||||
@ -636,9 +634,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
foreach ($tabfac as $key => $val) {
|
foreach ($tabfac as $key => $val) {
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
|
||||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
|
||||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||||
$companystatic->fournisseur = 1;
|
$companystatic->fournisseur = 1;
|
||||||
|
|
||||||
@ -767,7 +763,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
$periodlink = '';
|
$periodlink = '';
|
||||||
$exportlink = '';
|
$exportlink = '';
|
||||||
$builddate = dol_now();
|
$builddate = dol_now();
|
||||||
$description .= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||||
$description .= $langs->trans("DepositsAreNotIncluded");
|
$description .= $langs->trans("DepositsAreNotIncluded");
|
||||||
} else {
|
} else {
|
||||||
@ -847,9 +843,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
foreach ($tabfac as $key => $val) {
|
foreach ($tabfac as $key => $val) {
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
|
||||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
|
||||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||||
$companystatic->fournisseur = 1;
|
$companystatic->fournisseur = 1;
|
||||||
|
|
||||||
|
|||||||
@ -311,9 +311,7 @@ if ($action == 'writebookkeeping') {
|
|||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
|
||||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
|
||||||
$companystatic->client = 3;
|
$companystatic->client = 3;
|
||||||
|
|
||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
@ -601,9 +599,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
|
||||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
|
||||||
$companystatic->client = 3;
|
$companystatic->client = 3;
|
||||||
|
|
||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
@ -791,9 +787,7 @@ if (empty($action) || $action == 'view') {
|
|||||||
$companystatic->id = $tabcompany[$key]['id'];
|
$companystatic->id = $tabcompany[$key]['id'];
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
$companystatic->name = $tabcompany[$key]['name'];
|
||||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
|
||||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
|
||||||
$companystatic->client = 3;
|
$companystatic->client = 3;
|
||||||
|
|
||||||
$invoicestatic->id = $key;
|
$invoicestatic->id = $key;
|
||||||
|
|||||||
@ -1405,7 +1405,7 @@ class Adherent extends CommonObject
|
|||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
$this->url = $obj->url;
|
$this->url = $obj->url;
|
||||||
|
|
||||||
$this->socialnetworks = (array) json_decode($obj->socialnetworks, true);
|
$this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array());
|
||||||
|
|
||||||
$this->photo = $obj->photo;
|
$this->photo = $obj->photo;
|
||||||
$this->statut = $obj->statut;
|
$this->statut = $obj->statut;
|
||||||
|
|||||||
@ -843,7 +843,7 @@ if (empty($reshook)) {
|
|||||||
$_POST["accountancy_code_buy"] = ''; // If empty, we force to null
|
$_POST["accountancy_code_buy"] = ''; // If empty, we force to null
|
||||||
}
|
}
|
||||||
if ($id == 10 && GETPOSTISSET("code")) { // Spaces are not allowed into code for tax dictionary
|
if ($id == 10 && GETPOSTISSET("code")) { // Spaces are not allowed into code for tax dictionary
|
||||||
$_POST["code"] = preg_replace('/[^a-zA-Z0-9\-\+]/', '', GETPOST("code"));
|
$_POST["code"] = preg_replace('/[^a-zA-Z0-9_\-\+]/', '', GETPOST("code"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$tablename = $tabname[$id];
|
$tablename = $tabname[$id];
|
||||||
|
|||||||
@ -146,6 +146,7 @@ if (GETPOST('addfilter', 'alpha')) {
|
|||||||
$emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha');
|
$emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha');
|
||||||
$emailcollectorfilter->fk_emailcollector = $object->id;
|
$emailcollectorfilter->fk_emailcollector = $object->id;
|
||||||
$emailcollectorfilter->status = 1;
|
$emailcollectorfilter->status = 1;
|
||||||
|
|
||||||
$result = $emailcollectorfilter->create($user);
|
$result = $emailcollectorfilter->create($user);
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@ -235,10 +236,25 @@ if ($action == 'deleteoperation') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'collecttest') {
|
||||||
|
dol_include_once('/emailcollector/class/emailcollector.class.php');
|
||||||
|
|
||||||
|
$res = $object->doCollectOneCollector(1);
|
||||||
|
if ($res > 0) {
|
||||||
|
$debuginfo = $object->debuginfo;
|
||||||
|
setEventMessages($object->lastresult, null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
$debuginfo = $object->debuginfo;
|
||||||
|
setEventMessages($object->error, null, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_collect') {
|
if ($action == 'confirm_collect') {
|
||||||
dol_include_once('/emailcollector/class/emailcollector.class.php');
|
dol_include_once('/emailcollector/class/emailcollector.class.php');
|
||||||
|
|
||||||
$res = $object->doCollectOneCollector();
|
$res = $object->doCollectOneCollector(0);
|
||||||
if ($res > 0) {
|
if ($res > 0) {
|
||||||
$debuginfo = $object->debuginfo;
|
$debuginfo = $object->debuginfo;
|
||||||
setEventMessages($object->lastresult, null, 'mesgs');
|
setEventMessages($object->lastresult, null, 'mesgs');
|
||||||
@ -784,6 +800,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'&object=order">'.$langs->trans("ToClone").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=clone&token='.newToken().'&object=order">'.$langs->trans("ToClone").'</a></div>';
|
||||||
|
|
||||||
// Collect now
|
// Collect now
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collecttest&token='.newToken().'">'.$langs->trans("TestCollectNow").'</a></div>';
|
||||||
|
|
||||||
if (count($object->actions) > 0) {
|
if (count($object->actions) > 0) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collect&token='.newToken().'">'.$langs->trans("CollectNow").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=collect&token='.newToken().'">'.$langs->trans("CollectNow").'</a></div>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -143,7 +143,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescContact").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescContact").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||||
|
|||||||
@ -117,7 +117,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescGroups").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescGroups").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -191,7 +191,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescMembers").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembers").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|||||||
@ -109,7 +109,7 @@ if (!function_exists("ldap_connect")) {
|
|||||||
print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
|
|
||||||
print $langs->trans("LDAPDescMembersTypes").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembersTypes").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -180,7 +180,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
|||||||
|
|
||||||
print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
||||||
|
|
||||||
print $langs->trans("LDAPDescUsers").'<br>';
|
print '<span class="opacitymedium">'.$langs->trans("LDAPDescUsers").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
@ -501,9 +501,9 @@ if (function_exists("ldap_connect")) {
|
|||||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||||
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
||||||
|
|
||||||
// Get from LDAP database an array of results
|
// Get from LDAP database an array of results by making a search on
|
||||||
|
// $filter = '('.ldap_escape(getDolGlobalString('LDAP_KEY_USERS'), '', LDAP_ESCAPE_FILTER).'=*)';
|
||||||
$ldapusers = $ldap->getRecords('*', getDolGlobalString('LDAP_USER_DN'), getDolGlobalString('LDAP_KEY_USERS'), $required_fields, 1);
|
$ldapusers = $ldap->getRecords('*', getDolGlobalString('LDAP_USER_DN'), getDolGlobalString('LDAP_KEY_USERS'), $required_fields, 1);
|
||||||
//$ldapusers = $ldap->getRecords('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, '', 1);
|
|
||||||
|
|
||||||
if (is_array($ldapusers)) {
|
if (is_array($ldapusers)) {
|
||||||
$liste = array();
|
$liste = array();
|
||||||
@ -526,7 +526,7 @@ if (function_exists("ldap_connect")) {
|
|||||||
print "search: *<br>\n";
|
print "search: *<br>\n";
|
||||||
print "userDN: ".getDolGlobalString('LDAP_USER_DN')."<br>\n";
|
print "userDN: ".getDolGlobalString('LDAP_USER_DN')."<br>\n";
|
||||||
print "useridentifier: ".getDolGlobalString('LDAP_KEY_USERS')."<br>\n";
|
print "useridentifier: ".getDolGlobalString('LDAP_KEY_USERS')."<br>\n";
|
||||||
print "required_fields: ".implode(',', $required_fields)."<br>\n";
|
print "requested fields: ".implode(',', $required_fields)."<br>\n";
|
||||||
print "=> ".count($liste)." records<br>\n";
|
print "=> ".count($liste)." records<br>\n";
|
||||||
print "\n<br>";
|
print "\n<br>";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,6 +23,7 @@
|
|||||||
* \brief Setup page to configure oauth access api
|
* \brief Setup page to configure oauth access api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Load Dolibarr environment
|
// Load Dolibarr environment
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
@ -37,7 +37,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
|
|||||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'oauth'));
|
$langs->loadLangs(array('admin', 'oauth', 'modulebuilder'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
@ -85,7 +85,12 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GETPOSTISSET($constvalue.'_SCOPE')) {
|
if (GETPOSTISSET($constvalue.'_SCOPE')) {
|
||||||
if (!dolibarr_set_const($db, $constvalue.'_SCOPE', GETPOST($constvalue.'_SCOPE'), 'chaine', 0, '', $conf->entity)) {
|
$scopestring = implode(',', GETPOST($constvalue.'_SCOPE'));
|
||||||
|
if (!dolibarr_set_const($db, $constvalue.'_SCOPE', $scopestring, 'chaine', 0, '', $conf->entity)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!dolibarr_set_const($db, $constvalue.'_SCOPE', '', 'chaine', 0, '', $conf->entity)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,7 +116,7 @@ $form = new Form($db);
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans('ConfigOAuth'), $linkback, 'title_setup');
|
print load_fiche_titre($langs->trans('ConfigOAuth'), $linkback, 'title_setup');
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
@ -141,22 +146,16 @@ foreach ($list as $key) {
|
|||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
print ajax_combobox('provider');
|
print ajax_combobox('provider');
|
||||||
print ' <input type="text" name="label" value="" placeholder="'.$langs->trans("Label").'">';
|
print ' <input type="text" name="label" value="" placeholder="'.$langs->trans("Label").'" pattern="^\S+$" title="'.$langs->trans("SpaceOrSpecialCharAreNotAllowed").'">';
|
||||||
print ' <input type="submit" class="button small" name="add" value="'.$langs->trans("Add").'">';
|
print ' <input type="submit" class="button small" name="add" value="'.$langs->trans("Add").'">';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '<br>';
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
||||||
print '<input type="hidden" name="action" value="update">';
|
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
|
||||||
print '<table class="noborder centpercent">';
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
// Define $listinsetup
|
// Define $listinsetup
|
||||||
foreach ($conf->global as $key => $val) {
|
foreach ($conf->global as $key => $val) {
|
||||||
@ -172,8 +171,18 @@ foreach ($conf->global as $key => $val) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
|
|
||||||
foreach ($listinsetup as $key) {
|
if (count($listinsetup) > 0) {
|
||||||
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
|
||||||
|
foreach ($listinsetup as $key) {
|
||||||
$supported = 0;
|
$supported = 0;
|
||||||
$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
|
$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
|
||||||
$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
|
$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
|
||||||
@ -195,10 +204,12 @@ foreach ($listinsetup as $key) {
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
// Api Name
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
|
// OAUTH service name
|
||||||
$label = $langs->trans($keyforsupportedoauth2array);
|
$label = $langs->trans($keyforsupportedoauth2array);
|
||||||
print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
|
print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
|
||||||
print '<td>';
|
print '<td class="titlefieldcreate">';
|
||||||
print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
|
print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
|
||||||
if ($label == $keyforsupportedoauth2array) {
|
if ($label == $keyforsupportedoauth2array) {
|
||||||
print $supportedoauth2array[$keyforsupportedoauth2array]['name'];
|
print $supportedoauth2array[$keyforsupportedoauth2array]['name'];
|
||||||
@ -259,25 +270,45 @@ foreach ($listinsetup as $key) {
|
|||||||
print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
|
print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
} else {
|
} else {
|
||||||
|
$availablescopes = array_flip(explode(',', $supportedoauth2array[$keyforsupportedoauth2array]['availablescopes']));
|
||||||
|
$currentscopes = explode(',', getDolGlobalString($key[4]));
|
||||||
|
$scopestodispay = array();
|
||||||
|
foreach ($availablescopes as $keyscope => $valscope) {
|
||||||
|
if (in_array($keyscope, $currentscopes)) {
|
||||||
|
$scopestodispay[$keyscope] = 1;
|
||||||
|
} else {
|
||||||
|
$scopestodispay[$keyscope] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Api Scope
|
||||||
print '<tr class="oddeven value">';
|
print '<tr class="oddeven value">';
|
||||||
print '<td>'.$langs->trans("Scopes").'</td>';
|
print '<td>'.$langs->trans("Scopes").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
|
foreach ($scopestodispay as $scope => $val) {
|
||||||
print $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope'];
|
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></tr>';
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print '<tr class="oddeven value">';
|
||||||
|
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
|
||||||
|
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
|
||||||
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</table>'."\n";
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print $form->buttonsSaveCancel("Modify", '');
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>'."\n";
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
|
||||||
|
|
||||||
print $form->buttonsSaveCancel("Modify", '');
|
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -172,7 +172,7 @@ if ($mode == 'setup' && $user->admin) {
|
|||||||
|
|
||||||
$OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : ''));
|
$OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : ''));
|
||||||
|
|
||||||
$shortscope = $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope'];
|
$shortscope = '';
|
||||||
if (getDolGlobalString($key[4])) {
|
if (getDolGlobalString($key[4])) {
|
||||||
$shortscope = getDolGlobalString($key[4]);
|
$shortscope = getDolGlobalString($key[4]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT');
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>';
|
||||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_LEFT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_LEFT) ? 10 : $conf->global->MAIN_PDF_MARGIN_LEFT).'">';
|
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_LEFT" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>';
|
||||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_RIGHT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_RIGHT) ? 10 : $conf->global->MAIN_PDF_MARGIN_RIGHT).'">';
|
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_RIGHT" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>';
|
||||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_TOP" value="'.(empty($conf->global->MAIN_PDF_MARGIN_TOP) ? 10 : $conf->global->MAIN_PDF_MARGIN_TOP).'">';
|
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_TOP" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.(empty($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? 10 : $conf->global->MAIN_PDF_MARGIN_BOTTOM).'">';
|
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -163,6 +163,7 @@ class DolibarrApi
|
|||||||
unset($object->statuts_short);
|
unset($object->statuts_short);
|
||||||
unset($object->statuts_logo);
|
unset($object->statuts_logo);
|
||||||
unset($object->statuts_long);
|
unset($object->statuts_long);
|
||||||
|
|
||||||
//unset($object->labelStatus);
|
//unset($object->labelStatus);
|
||||||
//unset($object->labelStatusShort);
|
//unset($object->labelStatusShort);
|
||||||
|
|
||||||
@ -184,6 +185,7 @@ class DolibarrApi
|
|||||||
unset($object->picto);
|
unset($object->picto);
|
||||||
|
|
||||||
unset($object->fieldsforcombobox);
|
unset($object->fieldsforcombobox);
|
||||||
|
unset($object->regeximgext);
|
||||||
|
|
||||||
unset($object->skip_update_total);
|
unset($object->skip_update_total);
|
||||||
unset($object->context);
|
unset($object->context);
|
||||||
@ -259,6 +261,11 @@ class DolibarrApi
|
|||||||
if (!empty($object->thirdparty) && is_object($object->thirdparty)) {
|
if (!empty($object->thirdparty) && is_object($object->thirdparty)) {
|
||||||
$this->_cleanObjectDatas($object->thirdparty);
|
$this->_cleanObjectDatas($object->thirdparty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($object->product) && is_object($object->product)) {
|
||||||
|
$this->_cleanObjectDatas($object->product);
|
||||||
|
}
|
||||||
|
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1320,12 +1320,19 @@ class BOM extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function calculateCosts()
|
public function calculateCosts()
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $hookmanager;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
$this->unit_cost = 0;
|
$this->unit_cost = 0;
|
||||||
$this->total_cost = 0;
|
$this->total_cost = 0;
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$reshook = $hookmanager->executeHooks('calculateCostsBom', $parameters, $this); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
if ($reshook > 0) {
|
||||||
|
return $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($this->lines) && count($this->lines)) {
|
if (is_array($this->lines) && count($this->lines)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
$productFournisseur = new ProductFournisseur($this->db);
|
$productFournisseur = new ProductFournisseur($this->db);
|
||||||
@ -1369,8 +1376,7 @@ class BOM extends CommonObject
|
|||||||
$unit = measuringUnitString($line->fk_unit, '', '', 1);
|
$unit = measuringUnitString($line->fk_unit, '', '', 1);
|
||||||
$qty = convertDurationtoHour($line->qty, $unit);
|
$qty = convertDurationtoHour($line->qty, $unit);
|
||||||
|
|
||||||
if ($conf->workstation->enabled) {
|
if ($conf->workstation->enabled && !empty($tmpproduct->fk_default_workstation)) {
|
||||||
if ($tmpproduct->fk_default_workstation) {
|
|
||||||
$workstation = new Workstation($this->db);
|
$workstation = new Workstation($this->db);
|
||||||
$res = $workstation->fetch($tmpproduct->fk_default_workstation);
|
$res = $workstation->fetch($tmpproduct->fk_default_workstation);
|
||||||
|
|
||||||
@ -1379,7 +1385,6 @@ class BOM extends CommonObject
|
|||||||
$this->error = $workstation->error;
|
$this->error = $workstation->error;
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT');
|
$line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,12 @@ function printDropdownBookmarksList()
|
|||||||
if (!empty($_SERVER["QUERY_STRING"])) {
|
if (!empty($_SERVER["QUERY_STRING"])) {
|
||||||
if (is_array($_GET)) {
|
if (is_array($_GET)) {
|
||||||
foreach ($_GET as $key => $val) {
|
foreach ($_GET as $key => $val) {
|
||||||
if ($val != '') {
|
if (is_array($val)) {
|
||||||
$url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
foreach ($val as $tmpsubval) {
|
||||||
|
$url_param[] = http_build_query(array(dol_escape_htmltag($key).'[]' => dol_escape_htmltag($tmpsubval)));
|
||||||
|
}
|
||||||
|
} elseif ($val != '') {
|
||||||
|
$url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,10 +65,11 @@ function printDropdownBookmarksList()
|
|||||||
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var))
|
||||||
&& $val != ''
|
&& $val != ''
|
||||||
&& !array_key_exists($key, $url_param)) {
|
&& !array_key_exists($key, $url_param)) {
|
||||||
$url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
$url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$url .= ($tmpurl ? '?'.$tmpurl : '');
|
$url .= ($tmpurl ? '?'.$tmpurl : '');
|
||||||
if (!empty($url_param)) {
|
if (!empty($url_param)) {
|
||||||
$url .= '&'.implode('&', $url_param);
|
$url .= '&'.implode('&', $url_param);
|
||||||
|
|||||||
@ -1262,7 +1262,7 @@ class Propal extends CommonObject
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0) {
|
if ($result > 0 && $line->product_type == 9) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -435,7 +435,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0) {
|
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1073,7 +1073,7 @@ class Commande extends CommonOrder
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0) {
|
if ($result > 0 && $line->product_type == 9) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
|
||||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||||
|
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,13 +30,16 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies'));
|
$langs->loadLangs(array('banks', 'bills', 'categories', 'companies', 'salaries'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (GETPOSTISSET("account") || GETPOSTISSET("ref")) {
|
if (GETPOSTISSET("account") || GETPOSTISSET("ref")) {
|
||||||
@ -59,9 +63,12 @@ $hookmanager->initHooks(array('banktreso', 'globalcard'));
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
$societestatic = new Societe($db);
|
$societestatic = new Societe($db);
|
||||||
|
$userstatic = new User($db);
|
||||||
$facturestatic = new Facture($db);
|
$facturestatic = new Facture($db);
|
||||||
$facturefournstatic = new FactureFournisseur($db);
|
$facturefournstatic = new FactureFournisseur($db);
|
||||||
$socialcontribstatic = new ChargeSociales($db);
|
$socialcontribstatic = new ChargeSociales($db);
|
||||||
|
$salarystatic = new Salary($db);
|
||||||
|
$vatstatic = new TVA($db);
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
@ -134,6 +141,27 @@ if (GETPOST("account") || GETPOST("ref")) {
|
|||||||
$sql .= " ORDER BY dlr ASC";
|
$sql .= " ORDER BY dlr ASC";
|
||||||
$sqls[] = $sql;
|
$sqls[] = $sql;
|
||||||
|
|
||||||
|
// Salaries
|
||||||
|
$sql = " SELECT 'salary' as family, sa.rowid as objid, sa.label as ref, (-1*sa.amount) as total_ttc, sa.dateep as dlr,";
|
||||||
|
$sql .= " s.rowid as socid, CONCAT(s.firstname, ' ', s.lastname) as name, 0 as fournisseur";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."salary as sa";
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as s ON sa.fk_user = s.rowid";
|
||||||
|
$sql .= " WHERE sa.entity = ".$conf->entity;
|
||||||
|
$sql .= " AND sa.paye = 0"; // Not paid
|
||||||
|
$sql .= " AND (sa.fk_account IN (0, ".$object->id.") OR sa.fk_account IS NULL)"; // Id bank account of salary
|
||||||
|
$sql .= " ORDER BY dlr ASC";
|
||||||
|
$sqls[] = $sql;
|
||||||
|
|
||||||
|
// VAT
|
||||||
|
$sql = " SELECT 'vat' as family, t.rowid as objid, t.label as ref, (-1*t.amount) as total_ttc, t.datev as dlr,";
|
||||||
|
$sql .= " 0 as socid, 'noname' as name, 0 as fournisseur";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."tva as t";
|
||||||
|
$sql .= " WHERE t.entity = ".$conf->entity;
|
||||||
|
$sql .= " AND t.paye = 0"; // Not paid
|
||||||
|
$sql .= " AND (t.fk_account IN (-1, 0, ".$object->id.") OR t.fk_account IS NULL)"; // Id bank account of vat
|
||||||
|
$sql .= " ORDER BY dlr ASC";
|
||||||
|
$sqls[] = $sql;
|
||||||
|
|
||||||
// others sql
|
// others sql
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('addMoreSQL', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreSQL', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
@ -267,6 +295,26 @@ if (GETPOST("account") || GETPOST("ref")) {
|
|||||||
|
|
||||||
$totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done
|
$totalpayment = -1 * $socialcontribstatic->getSommePaiement(); // Payment already done
|
||||||
}
|
}
|
||||||
|
if ($tmpobj->family == 'salary') {
|
||||||
|
$salarystatic->ref = $tmpobj->ref;
|
||||||
|
$salarystatic->id = $tmpobj->objid;
|
||||||
|
$salarystatic->label = $langs->trans("SalaryPayment");
|
||||||
|
$ref = $salarystatic->getNomUrl(1, '');
|
||||||
|
|
||||||
|
$userstatic->id = $tmpobj->socid;
|
||||||
|
$userstatic->name = $tmpobj->name;
|
||||||
|
$refcomp = $userstatic->getNomUrl(1);
|
||||||
|
|
||||||
|
$totalpayment = -1 * $salarystatic->getSommePaiement(); // Payment already done
|
||||||
|
}
|
||||||
|
if ($tmpobj->family == 'vat') {
|
||||||
|
$vatstatic->ref = $tmpobj->ref;
|
||||||
|
$vatstatic->id = $tmpobj->objid;
|
||||||
|
$vatstatic->type = $tmpobj->type;
|
||||||
|
$ref = $vatstatic->getNomUrl(1, '');
|
||||||
|
|
||||||
|
$totalpayment = -1 * $vatstatic->getSommePaiement(); // Payment already done
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = array('obj' => $tmpobj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment);
|
$parameters = array('obj' => $tmpobj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment);
|
||||||
$reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook
|
$reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook
|
||||||
|
|||||||
@ -1251,7 +1251,7 @@ if (empty($reshook)) {
|
|||||||
$object->lines[] = $line; // insert new line in current object
|
$object->lines[] = $line; // insert new line in current object
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0) {
|
if ($result > 0 && $line->product_type == 9) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1772,7 +1772,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0) {
|
if ($result > 0 && $lines[$i]->product_type == 9) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -872,7 +872,7 @@ class Facture extends CommonInvoice
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
if ($result > 0) {
|
if ($result > 0 && $newinvoiceline->product_type == 9) {
|
||||||
$fk_parent_line = $result;
|
$fk_parent_line = $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,9 +71,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||||||
print '<td class="linkedcol-ref left">'.$objectlink->ref_client.'</td>';
|
print '<td class="linkedcol-ref left">'.$objectlink->ref_client.'</td>';
|
||||||
print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||||
print '<td class="linkedcol-amount right">';
|
print '<td class="linkedcol-amount right">';
|
||||||
if ($user->rights->facture->lire) {
|
if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) {
|
||||||
$sign = 1;
|
$sign = 1;
|
||||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) {
|
||||||
$sign = -1;
|
$sign = -1;
|
||||||
}
|
}
|
||||||
if ($objectlink->statut != 3) {
|
if ($objectlink->statut != 3) {
|
||||||
|
|||||||
@ -454,9 +454,6 @@ class BonPrelevement extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error);
|
dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//var_dump($paiement->amounts);
|
|
||||||
//var_dump($thirdpartyid);
|
|
||||||
//var_dump($cursoramounts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update withdrawal line
|
// Update withdrawal line
|
||||||
@ -2208,7 +2205,8 @@ class BonPrelevement extends CommonObject
|
|||||||
$XML_SEPA_INFO .= ' </CdtrSchmeId>'.$CrLf;*/
|
$XML_SEPA_INFO .= ' </CdtrSchmeId>'.$CrLf;*/
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf);
|
fputs($this->file, 'INCORRECT EMETTEUR '.$this->raison_sociale.$CrLf);
|
||||||
|
$XML_SEPA_INFO = '';
|
||||||
}
|
}
|
||||||
return $XML_SEPA_INFO;
|
return $XML_SEPA_INFO;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -286,8 +286,8 @@ if ($nb) {
|
|||||||
|
|
||||||
if ($type != 'bank-transfer') {
|
if ($type != 'bank-transfer') {
|
||||||
print '<select name="format">';
|
print '<select name="format">';
|
||||||
print '<option value="FRST"'.(GETPOST('format', 'aZ09') == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>';
|
print '<option value="FRST"'.($format == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>';
|
||||||
print '<option value="RCUR"'.(GETPOST('format', 'aZ09') == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>';
|
print '<option value="RCUR"'.($format == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>';
|
||||||
print '</select>';
|
print '</select>';
|
||||||
}
|
}
|
||||||
print '<input type="submit" class="butAction" value="'.$title.'"/>';
|
print '<input type="submit" class="butAction" value="'.$title.'"/>';
|
||||||
|
|||||||
@ -270,8 +270,8 @@ if ($result) {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0;
|
$cum_ht[$obj->dm] = empty($obj->amount) ? 0 : $obj->amount;
|
||||||
$cum[$obj->dm] = $obj->amount_ttc;
|
$cum[$obj->dm] = empty($obj->amount_ttc) ? 0 : $obj->amount_ttc;
|
||||||
if ($obj->amount_ttc) {
|
if ($obj->amount_ttc) {
|
||||||
$minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm);
|
$minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm);
|
||||||
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
||||||
@ -303,7 +303,11 @@ if ($modecompta == 'RECETTES-DEPENSES') {
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
if (empty($cum[$obj->dm])) {
|
||||||
|
$cum[$obj->dm] = $obj->amount_ttc;
|
||||||
|
} else {
|
||||||
$cum[$obj->dm] += $obj->amount_ttc;
|
$cum[$obj->dm] += $obj->amount_ttc;
|
||||||
|
}
|
||||||
if ($obj->amount_ttc) {
|
if ($obj->amount_ttc) {
|
||||||
$minyearmonth = ($minyearmonth ?min($minyearmonth, $obj->dm) : $obj->dm);
|
$minyearmonth = ($minyearmonth ?min($minyearmonth, $obj->dm) : $obj->dm);
|
||||||
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
$maxyearmonth = max($maxyearmonth, $obj->dm);
|
||||||
@ -405,12 +409,6 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
|||||||
$case = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage), "%Y-%m");
|
$case = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage), "%Y-%m");
|
||||||
$caseprev = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage - 1), "%Y-%m");
|
$caseprev = dol_print_date(dol_mktime(1, 1, 1, $mois_modulo, 1, $annee_decalage - 1), "%Y-%m");
|
||||||
|
|
||||||
$total_ht[$annee]=0;
|
|
||||||
$total[$annee]=0;
|
|
||||||
$cum_ht[$case]=0;
|
|
||||||
$cum[$case]=0;
|
|
||||||
|
|
||||||
|
|
||||||
if ($annee >= $year_start) { // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
if ($annee >= $year_start) { // We ignore $annee < $year_start, we loop on it to be able to make delta, nothing is output.
|
||||||
if ($modecompta == 'CREANCES-DETTES') {
|
if ($modecompta == 'CREANCES-DETTES') {
|
||||||
// Value turnover of month w/o VAT
|
// Value turnover of month w/o VAT
|
||||||
@ -453,7 +451,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
|||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Percentage of month
|
// Percentage of month
|
||||||
print '<td class="borderrightlight right">';
|
print '<td class="borderrightlight right"><span class="opacitymedium">';
|
||||||
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
|
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
|
||||||
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
|
||||||
if ($annee_decalage > $minyear && $case <= $casenow) {
|
if ($annee_decalage > $minyear && $case <= $casenow) {
|
||||||
@ -483,7 +481,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</span></td>';
|
||||||
|
|
||||||
if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) {
|
if ($annee_decalage < $year_end || ($annee_decalage == $year_end && $mois > 12 && $annee < $year_end)) {
|
||||||
print '<td width="15"> </td>';
|
print '<td width="15"> </td>';
|
||||||
|
|||||||
@ -1068,7 +1068,7 @@ class Contact extends CommonObject
|
|||||||
$this->phone_mobile = trim($obj->phone_mobile);
|
$this->phone_mobile = trim($obj->phone_mobile);
|
||||||
|
|
||||||
$this->email = $obj->email;
|
$this->email = $obj->email;
|
||||||
$this->socialnetworks = (array) json_decode($obj->socialnetworks, true);
|
$this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array());
|
||||||
$this->photo = $obj->photo;
|
$this->photo = $obj->photo;
|
||||||
$this->priv = $obj->priv;
|
$this->priv = $obj->priv;
|
||||||
$this->mail = $obj->email;
|
$this->mail = $obj->email;
|
||||||
|
|||||||
@ -8119,7 +8119,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case "view":
|
case "view":
|
||||||
$value = $this->array_options["options_".$key.$keysuffix]; // Value may be clean or formated later
|
$value = ((!empty($this->array_options) && array_key_exists("options_".$key.$keysuffix, $this->array_options)) ? $this->array_options["options_".$key.$keysuffix] : null); // Value may be cleaned or formated later
|
||||||
break;
|
break;
|
||||||
case "create":
|
case "create":
|
||||||
case "edit":
|
case "edit":
|
||||||
|
|||||||
@ -163,7 +163,7 @@ class DolEditor
|
|||||||
$skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa
|
$skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa
|
||||||
}
|
}
|
||||||
|
|
||||||
$pluginstodisable = 'elementspath,save,flash';
|
$pluginstodisable = 'elementspath,save,flash,div';
|
||||||
if (!empty($conf->dol_optimize_smallscreen)) {
|
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||||
$pluginstodisable .= ',scayt,wsc,find,undo';
|
$pluginstodisable .= ',scayt,wsc,find,undo';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1691,8 +1691,8 @@ class ExtraFields
|
|||||||
if (!empty($obj->$field_toshow)) {
|
if (!empty($obj->$field_toshow)) {
|
||||||
$translabel = $langs->trans($obj->$field_toshow);
|
$translabel = $langs->trans($obj->$field_toshow);
|
||||||
}
|
}
|
||||||
if ($translabel != $field_toshow) {
|
if ($translabel != $obj->$field_toshow) {
|
||||||
$value .= dol_trunc($translabel, 18).' ';
|
$value .= dol_trunc($translabel, 24).' ';
|
||||||
} else {
|
} else {
|
||||||
$value .= $obj->$field_toshow.' ';
|
$value .= $obj->$field_toshow.' ';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4886,7 +4886,7 @@ class Form
|
|||||||
* @param string $action Action
|
* @param string $action Action
|
||||||
* @param array $formquestion An array with forms complementary inputs
|
* @param array $formquestion An array with forms complementary inputs
|
||||||
* @param string $selectedchoice "" or "no" or "yes"
|
* @param string $selectedchoice "" or "no" or "yes"
|
||||||
* @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx
|
* @param int|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
||||||
* @param int $height Force height of box
|
* @param int $height Force height of box
|
||||||
* @param int $width Force width of box
|
* @param int $width Force width of box
|
||||||
* @return void
|
* @return void
|
||||||
@ -4919,7 +4919,7 @@ class Form
|
|||||||
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss',
|
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss',
|
||||||
* 'other', 'onecolumn' or 'hidden'...
|
* 'other', 'onecolumn' or 'hidden'...
|
||||||
* @param int|string $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0
|
* @param int|string $selectedchoice '' or 'no', or 'yes' or '1', 1, '0' or 0
|
||||||
* @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
* @param int|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx
|
||||||
* @param int|string $height Force height of box (0 = auto)
|
* @param int|string $height Force height of box (0 = auto)
|
||||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
||||||
* @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a <form> section.
|
* @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a <form> section.
|
||||||
@ -5150,6 +5150,14 @@ class Form
|
|||||||
},';
|
},';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$jsforcursor = '';
|
||||||
|
if ($useajax == 1) {
|
||||||
|
$jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n";
|
||||||
|
$jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$postconfirmas = 'GET';
|
||||||
|
|
||||||
$formconfirm .= '
|
$formconfirm .= '
|
||||||
resizable: false,
|
resizable: false,
|
||||||
height: "'.$height.'",
|
height: "'.$height.'",
|
||||||
@ -5178,16 +5186,20 @@ class Form
|
|||||||
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
|
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "&") + options;
|
||||||
if (pageyes.length > 0) {
|
if (pageyes.length > 0) {';
|
||||||
// The call to urljump can be slow, so we set the wait cursor
|
if ($postconfirmas == 'GET') {
|
||||||
jQuery("html,body,#id-container").addClass("cursorwait");
|
$formconfirm .= 'location.href = urljump;';
|
||||||
var post = $.post(
|
} else {
|
||||||
|
$formconfirm .= $jsforcursor;
|
||||||
|
$formconfirm .= 'var post = $.post(
|
||||||
pageyes,
|
pageyes,
|
||||||
options,
|
options,
|
||||||
(data) => {$("body").html(data)}
|
function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); }
|
||||||
);
|
);';
|
||||||
console.log("after post");
|
}
|
||||||
|
$formconfirm .= '
|
||||||
|
console.log("after post ok");
|
||||||
}
|
}
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
},
|
},
|
||||||
@ -5205,15 +5217,21 @@ class Form
|
|||||||
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
|
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "&") + options;
|
||||||
//alert(urljump);
|
//alert(urljump);
|
||||||
if (pageno.length > 0) {
|
if (pageno.length > 0) {';
|
||||||
var post = $.post(
|
if ($postconfirmas == 'GET') {
|
||||||
|
$formconfirm .= 'location.href = urljump;';
|
||||||
|
} else {
|
||||||
|
$formconfirm .= $jsforcursor;
|
||||||
|
$formconfirm .= 'var post = $.post(
|
||||||
pageno,
|
pageno,
|
||||||
options,
|
options,
|
||||||
(data) => {$("body").html(data)}
|
function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); }
|
||||||
);
|
);';
|
||||||
console.log("after location.href");
|
}
|
||||||
|
$formconfirm .= '
|
||||||
|
console.log("after post ko");
|
||||||
}
|
}
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -822,7 +822,7 @@ class FormMail extends Form
|
|||||||
$out .= '<br></div>';
|
$out .= '<br></div>';
|
||||||
}
|
}
|
||||||
} elseif (empty($this->withmaindocfile)) {
|
} elseif (empty($this->withmaindocfile)) {
|
||||||
$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
//$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||||
}
|
}
|
||||||
if ($this->withfile == 2) {
|
if ($this->withfile == 2) {
|
||||||
$maxfilesizearray = getMaxFileSizeArray();
|
$maxfilesizearray = getMaxFileSizeArray();
|
||||||
@ -831,13 +831,13 @@ class FormMail extends Form
|
|||||||
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
|
||||||
}
|
}
|
||||||
// Can add other files
|
// Can add other files
|
||||||
if (!empty($conf->global->FROM_MAIL_USE_INPUT_FILE_MULTIPLE)) {
|
if (empty($conf->global->FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE)) {
|
||||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile[]" value="'.$langs->trans("Upload").'" multiple />';
|
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile[]" value="'.$langs->trans("Upload").'" multiple />';
|
||||||
} else {
|
} else {
|
||||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||||
}
|
}
|
||||||
$out .= ' ';
|
$out .= ' ';
|
||||||
$out .= '<input type="submit" class="button small" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
$out .= '<input type="submit" class="button smallpaddingimp" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$out .= $this->withfile;
|
$out .= $this->withfile;
|
||||||
@ -947,10 +947,13 @@ class FormMail extends Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$out .= '<tr>';
|
$out .= '<tr>';
|
||||||
$out .= '<td class="tdtop">';
|
$out .= '<td colspan="2">';
|
||||||
$out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');
|
$out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');
|
||||||
$out .= '</td>';
|
$out .= '</td>';
|
||||||
$out .= '<td>';
|
$out .= '</tr>';
|
||||||
|
|
||||||
|
$out .= '<tr>';
|
||||||
|
$out .= '<td colspan="2">';
|
||||||
if ($this->withbodyreadonly) {
|
if ($this->withbodyreadonly) {
|
||||||
$out .= nl2br($defaultmessage);
|
$out .= nl2br($defaultmessage);
|
||||||
$out .= '<input type="hidden" id="message" name="message" value="'.$defaultmessage.'" />';
|
$out .= '<input type="hidden" id="message" name="message" value="'.$defaultmessage.'" />';
|
||||||
@ -1202,8 +1205,8 @@ class FormMail extends Form
|
|||||||
*/
|
*/
|
||||||
public function getHtmlForDeliveryreceipt()
|
public function getHtmlForDeliveryreceipt()
|
||||||
{
|
{
|
||||||
global $conf, $langs, $form;
|
global $conf, $langs;
|
||||||
$out = '<tr><td>'.$langs->trans("DeliveryReceipt").'</td><td>';
|
$out = '<tr><td><label for="deliveryreceipt">'.$langs->trans("DeliveryReceipt").'</label></td><td>';
|
||||||
|
|
||||||
if (!empty($this->withdeliveryreceiptreadonly)) {
|
if (!empty($this->withdeliveryreceiptreadonly)) {
|
||||||
$out .= yn($this->withdeliveryreceipt);
|
$out .= yn($this->withdeliveryreceipt);
|
||||||
@ -1224,7 +1227,8 @@ class FormMail extends Form
|
|||||||
if (!empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_ORDER) && !empty($this->param['models']) && $this->param['models'] == 'order_supplier_send') {
|
if (!empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_ORDER) && !empty($this->param['models']) && $this->param['models'] == 'order_supplier_send') {
|
||||||
$defaultvaluefordeliveryreceipt = 1;
|
$defaultvaluefordeliveryreceipt = 1;
|
||||||
}
|
}
|
||||||
$out .= $form->selectyesno('deliveryreceipt', (GETPOSTISSET("deliveryreceipt") ? GETPOST("deliveryreceipt") : $defaultvaluefordeliveryreceipt), 1);
|
//$out .= $form->selectyesno('deliveryreceipt', (GETPOSTISSET("deliveryreceipt") ? GETPOST("deliveryreceipt") : $defaultvaluefordeliveryreceipt), 1);
|
||||||
|
$out .= '<input type="checkbox" id="deliveryreceipt" name="deliveryreceipt" value="1"'.((GETPOSTISSET("deliveryreceipt") ? GETPOST("deliveryreceipt") : $defaultvaluefordeliveryreceipt) ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
$out .= "</td></tr>\n";
|
$out .= "</td></tr>\n";
|
||||||
return $out;
|
return $out;
|
||||||
|
|||||||
@ -73,6 +73,8 @@ class FormTicket
|
|||||||
public $withfile;
|
public $withfile;
|
||||||
public $withfilereadonly;
|
public $withfilereadonly;
|
||||||
|
|
||||||
|
public $backtopage;
|
||||||
|
|
||||||
public $ispublic; // To show information or not into public form
|
public $ispublic; // To show information or not into public form
|
||||||
|
|
||||||
public $withtitletopic;
|
public $withtitletopic;
|
||||||
@ -1363,6 +1365,7 @@ class FormTicket
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="'.$this->action.'">';
|
print '<input type="hidden" name="action" value="'.$this->action.'">';
|
||||||
print '<input type="hidden" name="actionbis" value="add_message">';
|
print '<input type="hidden" name="actionbis" value="add_message">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$this->backtopage.'">';
|
||||||
foreach ($this->param as $key => $value) {
|
foreach ($this->param as $key => $value) {
|
||||||
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -263,6 +263,7 @@ class Ldap
|
|||||||
if ($this->result) {
|
if ($this->result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
$connected = 2;
|
$connected = 2;
|
||||||
|
$this->connectedServer = $host;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
@ -275,6 +276,7 @@ class Ldap
|
|||||||
if ($this->result) {
|
if ($this->result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
$connected = 2;
|
$connected = 2;
|
||||||
|
$this->connectedServer = $host;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
@ -287,6 +289,7 @@ class Ldap
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$this->bind = $this->result;
|
$this->bind = $this->result;
|
||||||
$connected = 1;
|
$connected = 1;
|
||||||
|
$this->connectedServer = $host;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||||
@ -297,10 +300,8 @@ class Ldap
|
|||||||
|
|
||||||
if (!$connected) {
|
if (!$connected) {
|
||||||
$this->unbind();
|
$this->unbind();
|
||||||
} else {
|
|
||||||
$this->connectedServer = $host;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} // End loop on each server
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($connected) {
|
if ($connected) {
|
||||||
@ -997,12 +998,12 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array containing a details or list of LDAP record(s)
|
* Returns an array containing a details or list of LDAP record(s).
|
||||||
* ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword
|
* ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword
|
||||||
*
|
*
|
||||||
* @param string $search Value of field to search, '*' for all. Not used if $activefilter is set.
|
* @param string $search Value of field to search, '*' for all. Not used if $activefilter is set.
|
||||||
* @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org)
|
* @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org)
|
||||||
* @param string $useridentifier Name of key field (Ex: uid)
|
* @param string $useridentifier Name of key field (Ex: uid).
|
||||||
* @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword)
|
* @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword)
|
||||||
* @param int $activefilter '1' or 'user'=use field this->filter as filter instead of parameter $search, 'group'=use field this->filtergroup as filter, 'member'=use field this->filtermember as filter
|
* @param int $activefilter '1' or 'user'=use field this->filter as filter instead of parameter $search, 'group'=use field this->filtergroup as filter, 'member'=use field this->filtermember as filter
|
||||||
* @param array $attributeAsArray Array of fields wanted as an array not a string
|
* @param array $attributeAsArray Array of fields wanted as an array not a string
|
||||||
|
|||||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/db/Database.interface.php';
|
|||||||
*/
|
*/
|
||||||
abstract class DoliDB implements Database
|
abstract class DoliDB implements Database
|
||||||
{
|
{
|
||||||
/** @var bool|resource|SQLite3 Database handler */
|
/** @var bool|resource|SQLite3|PgSql\connection Database handler */
|
||||||
public $db;
|
public $db;
|
||||||
/** @var string Database type */
|
/** @var string Database type */
|
||||||
public $type;
|
public $type;
|
||||||
|
|||||||
@ -274,6 +274,9 @@ function getDefaultDatesForTransfer()
|
|||||||
{
|
{
|
||||||
global $db, $conf;
|
global $db, $conf;
|
||||||
|
|
||||||
|
$pastmonth = 0;
|
||||||
|
$pastmonthyear = 0;
|
||||||
|
|
||||||
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
|
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
|
||||||
$periodbydefaultontransfer = (empty($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? 0 : $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER);
|
$periodbydefaultontransfer = (empty($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? 0 : $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER);
|
||||||
if ($periodbydefaultontransfer == 2) {
|
if ($periodbydefaultontransfer == 2) {
|
||||||
|
|||||||
@ -923,6 +923,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
$search_status = 1; // always display active customer first
|
$search_status = 1; // always display active customer first
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$search_rowid = GETPOST("search_rowid", 'int');
|
||||||
$search_name = GETPOST("search_name", 'alpha');
|
$search_name = GETPOST("search_name", 'alpha');
|
||||||
$search_address = GETPOST("search_address", 'alpha');
|
$search_address = GETPOST("search_address", 'alpha');
|
||||||
$search_poste = GETPOST("search_poste", 'alpha');
|
$search_poste = GETPOST("search_poste", 'alpha');
|
||||||
@ -971,6 +972,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
$extrafields->fetch_name_optionals_label($contactstatic->table_element);
|
$extrafields->fetch_name_optionals_label($contactstatic->table_element);
|
||||||
|
|
||||||
$contactstatic->fields = array(
|
$contactstatic->fields = array(
|
||||||
|
'rowid' =>array('type'=>'integer', 'label'=>"TechnicalID", 'enabled'=>1, 'visible'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1),
|
||||||
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||||
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20),
|
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20),
|
||||||
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30),
|
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30),
|
||||||
@ -1012,6 +1014,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
|
|
||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||||
|
$search_rowid = '';
|
||||||
$search_status = '';
|
$search_status = '';
|
||||||
$search_name = '';
|
$search_name = '';
|
||||||
$search_roles = array();
|
$search_roles = array();
|
||||||
@ -1055,6 +1058,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
print "\n".'<table class="tagtable liste">'."\n";
|
print "\n".'<table class="tagtable liste">'."\n";
|
||||||
|
|
||||||
$param = "socid=".urlencode($object->id);
|
$param = "socid=".urlencode($object->id);
|
||||||
|
if ($search_rowid != '') {
|
||||||
|
$param .= '&search_rowid='.urlencode($search_rowid);
|
||||||
|
}
|
||||||
if ($search_status != '') {
|
if ($search_status != '') {
|
||||||
$param .= '&search_status='.urlencode($search_status);
|
$param .= '&search_status='.urlencode($search_status);
|
||||||
}
|
}
|
||||||
@ -1083,6 +1089,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||||
$sql .= " WHERE t.fk_soc = ".((int) $object->id);
|
$sql .= " WHERE t.fk_soc = ".((int) $object->id);
|
||||||
|
if ($search_rowid) {
|
||||||
|
$sql .= natural_search('t.rowid', $search_rowid);
|
||||||
|
}
|
||||||
if ($search_status != '' && $search_status != '-1') {
|
if ($search_status != '' && $search_status != '-1') {
|
||||||
$sql .= " AND t.statut = ".((int) $search_status);
|
$sql .= " AND t.statut = ".((int) $search_status);
|
||||||
}
|
}
|
||||||
@ -1146,7 +1155,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($showuserlogin) {
|
if ($showuserlogin) {
|
||||||
print '<td></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
$extrafieldsobjectkey = $contactstatic->table_element;
|
$extrafieldsobjectkey = $contactstatic->table_element;
|
||||||
@ -1188,7 +1197,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($showuserlogin) {
|
if ($showuserlogin) {
|
||||||
print '<td>'.$langs->trans("DolibarrLogin").'</td>';
|
print '<th class="wrapcolumntitle liste_titre">'.$langs->trans("DolibarrLogin").'</th>';
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
$extrafieldsobjectkey = $contactstatic->table_element;
|
$extrafieldsobjectkey = $contactstatic->table_element;
|
||||||
|
|||||||
@ -121,7 +121,9 @@ function getServerTimeZoneInt($refgmtdate = 'now')
|
|||||||
function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0)
|
function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
if ($duration_unit == 's') {
|
||||||
|
return $time + ($duration_value);
|
||||||
|
}
|
||||||
if ($duration_value == 0) {
|
if ($duration_value == 0) {
|
||||||
return $time;
|
return $time;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2992,10 +2992,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
// Wrapping for import module
|
// Wrapping for import module
|
||||||
$accessallowed = $user->rights->import->run;
|
$accessallowed = $user->rights->import->run;
|
||||||
$original_file = $conf->import->dir_temp.'/'.$original_file;
|
$original_file = $conf->import->dir_temp.'/'.$original_file;
|
||||||
} elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_temp)) {
|
} elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_output)) {
|
||||||
// Wrapping for recruitment module
|
// Wrapping for recruitment module
|
||||||
$accessallowed = $user->rights->$modulepart->recruitmentjobposition->read;
|
$accessallowed = $user->rights->recruitment->recruitmentjobposition->read;
|
||||||
$original_file = $conf->recruitment->dir_output .'/'. $original_file;
|
$original_file = $conf->recruitment->dir_output.'/'.$original_file;
|
||||||
} elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) {
|
} elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) {
|
||||||
// Wrapping for wysiwyg editor
|
// Wrapping for wysiwyg editor
|
||||||
$accessallowed = 1;
|
$accessallowed = 1;
|
||||||
|
|||||||
@ -470,6 +470,7 @@ function GETPOSTISARRAY($paramname, $method = 0)
|
|||||||
* 'alphanohtml'=check there is no html content and no " and no ../
|
* 'alphanohtml'=check there is no html content and no " and no ../
|
||||||
* 'aZ'=check it's a-z only
|
* 'aZ'=check it's a-z only
|
||||||
* 'aZ09'=check it's simple alpha string (recommended for keys)
|
* 'aZ09'=check it's simple alpha string (recommended for keys)
|
||||||
|
* 'aZ09comma'=check it's a string for a sortfield or sortorder
|
||||||
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
|
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
|
||||||
* 'nohtml'=check there is no html content and no " and no ../
|
* 'nohtml'=check there is no html content and no " and no ../
|
||||||
* 'restricthtml'=check html content is restricted to some tags only
|
* 'restricthtml'=check html content is restricted to some tags only
|
||||||
@ -1164,7 +1165,17 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
|||||||
function dol_clone($object, $native = 0)
|
function dol_clone($object, $native = 0)
|
||||||
{
|
{
|
||||||
if (empty($native)) {
|
if (empty($native)) {
|
||||||
|
$tmpsavdb = null;
|
||||||
|
if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') {
|
||||||
|
$tmpsavdb = $object->db;
|
||||||
|
unset($object->db); // Such property can not be serialized when PgSql/Connection
|
||||||
|
}
|
||||||
|
|
||||||
$myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields
|
$myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields
|
||||||
|
|
||||||
|
if ($tmpsavdb) {
|
||||||
|
$object->db = $tmpsavdb;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable)
|
$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable)
|
||||||
}
|
}
|
||||||
@ -3723,6 +3734,8 @@ function isValidMXRecord($domain)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function idn_to_ascii or checkdnsrr does not exists
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4957,7 +4970,9 @@ function dol_print_error($db = '', $error = '', $errors = null)
|
|||||||
|
|
||||||
// Return a http header with error code if possible
|
// Return a http header with error code if possible
|
||||||
if (!headers_sent()) {
|
if (!headers_sent()) {
|
||||||
|
if (function_exists('top_httphead')) { // In CLI context, the method does not exists
|
||||||
top_httphead();
|
top_httphead();
|
||||||
|
}
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2655,7 +2655,7 @@ function getModuleDirForApiClass($moduleobject)
|
|||||||
$moduledirforclass = 'fichinter';
|
$moduledirforclass = 'fichinter';
|
||||||
} elseif ($moduleobject == 'mos') {
|
} elseif ($moduleobject == 'mos') {
|
||||||
$moduledirforclass = 'mrp';
|
$moduledirforclass = 'mrp';
|
||||||
} elseif (in_array($moduleobject, array('products', 'expensereports', 'users', 'tickets', 'boms'))) {
|
} elseif (in_array($moduleobject, array('products', 'expensereports', 'users', 'tickets', 'boms', 'receptions'))) {
|
||||||
$moduledirforclass = preg_replace('/s$/', '', $moduleobject);
|
$moduledirforclass = preg_replace('/s$/', '', $moduleobject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,29 +23,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
$shortscopegoogle = 'userinfo_email,userinfo_profile';
|
|
||||||
$shortscopegoogle .= ',openid,email,profile'; // For openid connect
|
|
||||||
if (!empty($conf->printing->enabled)) {
|
|
||||||
$shortscopegoogle .= ',cloud_print';
|
|
||||||
}
|
|
||||||
if (!empty($conf->global->OAUTH_GOOGLE_GSUITE)) {
|
|
||||||
$shortscopegoogle .= ',admin_directory_user';
|
|
||||||
}
|
|
||||||
if (!empty($conf->global->OAUTH_GOOGLE_GMAIL)) {
|
|
||||||
$shortscopegoogle.=',gmail_full';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth)
|
// Supported OAUTH (a provider is supported when a file xxx_oauthcallback.php is available into htdocs/core/modules/oauth)
|
||||||
$supportedoauth2array = array(
|
$supportedoauth2array = array(
|
||||||
'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'defaultscope'=>$shortscopegoogle),
|
'OAUTH_GOOGLE_NAME'=>array('callbackfile' => 'google', 'picto' => 'google', 'urlforapp' => 'OAUTH_GOOGLE_DESC', 'name'=>'Google', 'urlforcredentials'=>'https://console.developers.google.com/', 'availablescopes'=> 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print,admin_directory_user,gmail_full'),
|
||||||
);
|
);
|
||||||
if (!empty($conf->stripe->enabled)) {
|
if (!empty($conf->stripe->enabled)) {
|
||||||
$supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'defaultscope'=>'read_write');
|
$supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'availablescopes'=>'read_write');
|
||||||
$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'defaultscope'=>'read_write');
|
$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', 'urlforcredentials'=>'', 'availablescopes'=>'read_write');
|
||||||
}
|
}
|
||||||
$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub', 'urlforcredentials'=>'https://github.com/settings/developers', 'defaultscope'=>'user,public_repo');
|
$supportedoauth2array['OAUTH_GITHUB_NAME'] = array('callbackfile' => 'github', 'picto' => 'github', 'urlforapp' => 'OAUTH_GITHUB_DESC', 'name'=>'GitHub', 'urlforcredentials'=>'https://github.com/settings/developers', 'availablescopes'=>'user,public_repo');
|
||||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||||
$supportedoauth2array['OAUTH_OTHER_NAME'] = array('callbackfile' => 'generic', 'picto' => 'generic', 'urlforapp' => 'OAUTH_OTHER_DESC', 'name'=>'Other', 'urlforcredentials'=>'', 'defaultscope'=>'ToComplete');
|
$supportedoauth2array['OAUTH_OTHER_NAME'] = array('callbackfile' => 'generic', 'picto' => 'generic', 'urlforapp' => 'OAUTH_OTHER_DESC', 'name'=>'Other', 'urlforcredentials'=>'', 'availablescopes'=>'Standard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -471,7 +471,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
|
|||||||
|
|
||||||
print '<div class="center paddingleft paddingright">'."\n";
|
print '<div class="center paddingleft paddingright">'."\n";
|
||||||
if ($addformmessage) {
|
if ($addformmessage) {
|
||||||
print '<!-- object = '.$object->element.' -->';
|
print '<!-- object = '.(empty($object) ? 'undefined' : $object->element).' -->';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
|
$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
|
||||||
@ -482,7 +482,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add other message if VAT exists
|
// Add other message if VAT exists
|
||||||
if (!empty($object->total_vat) || $object->total_tva != 0) {
|
if (!empty($object->total_vat) || !empty($object->total_tva)) {
|
||||||
$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix;
|
$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix;
|
||||||
if (!empty($conf->global->$parammessageform)) {
|
if (!empty($conf->global->$parammessageform)) {
|
||||||
print $langs->transnoentities($conf->global->$parammessageform);
|
print $langs->transnoentities($conf->global->$parammessageform);
|
||||||
|
|||||||
@ -1644,7 +1644,17 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||||||
//print $libelleproduitservice;
|
//print $libelleproduitservice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Show information for lot
|
||||||
if ($dbatch) {
|
if ($dbatch) {
|
||||||
|
// $object is a shipment.
|
||||||
|
//var_dump($object->lines[$i]->details_entrepot); // array from llx_expeditiondet (we can have seral lines for one fk_origin_line)
|
||||||
|
//var_dump($object->lines[$i]->detail_batch); // array from llx_expeditiondet_batch (each line with a lot is linked to llx_expeditiondet)
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
|
||||||
|
$tmpwarehouse = new Entrepot($db);
|
||||||
|
$tmpproductbatch = new Productbatch($db);
|
||||||
|
|
||||||
$format = 'day';
|
$format = 'day';
|
||||||
foreach ($dbatch as $detail) {
|
foreach ($dbatch as $detail) {
|
||||||
$dte = array();
|
$dte = array();
|
||||||
@ -1658,8 +1668,24 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
|||||||
$dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch);
|
$dte[] = $outputlangs->transnoentitiesnoconv('printBatch', $detail->batch);
|
||||||
}
|
}
|
||||||
$dte[] = $outputlangs->transnoentitiesnoconv('printQty', $detail->qty);
|
$dte[] = $outputlangs->transnoentitiesnoconv('printQty', $detail->qty);
|
||||||
|
|
||||||
|
// Add also info of planned warehouse for lot
|
||||||
|
if ($object->element == 'shipping' && $detail->fk_origin_stock > 0 && getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) {
|
||||||
|
$resproductbatch = $tmpproductbatch->fetch($detail->fk_origin_stock);
|
||||||
|
if ($resproductbatch > 0) {
|
||||||
|
$reswarehouse = $tmpwarehouse->fetch($tmpproductbatch->warehouseid);
|
||||||
|
if ($reswarehouse > 0) {
|
||||||
|
$dte[] = $tmpwarehouse->ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$libelleproduitservice .= "__N__ ".implode(" - ", $dte);
|
$libelleproduitservice .= "__N__ ".implode(" - ", $dte);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) {
|
||||||
|
// TODO Show warehouse for shipment line without batch
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we convert \n into br
|
// Now we convert \n into br
|
||||||
|
|||||||
@ -120,7 +120,7 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
|
|||||||
{
|
{
|
||||||
global $dolibarr_main_instance_unique_id;
|
global $dolibarr_main_instance_unique_id;
|
||||||
|
|
||||||
if ($chain === '') {
|
if ($chain === '' || is_null($chain)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ function dolDecrypt($chain, $key = '')
|
|||||||
{
|
{
|
||||||
global $dolibarr_main_instance_unique_id;
|
global $dolibarr_main_instance_unique_id;
|
||||||
|
|
||||||
if ($chain === '') {
|
if ($chain === '' || is_null($chain)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -643,7 +643,7 @@ function showWebsiteTemplates(Website $website)
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')';
|
print $subdir.' ('.dol_print_size(dol_filesize($dirtheme."/".$subdir), 1, 1).')';
|
||||||
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&website='.$website->ref.'&templateuserfile='.$subdir.'" class="button">'.$langs->trans("Load").'</a>';
|
print '<br><a href="'.$_SERVER["PHP_SELF"].'?action=importsiteconfirm&token='.newToken().'&website='.urlencode($website->ref).'&templateuserfile='.urlencode($subdir).'" class="button">'.$langs->trans("Load").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -124,8 +124,8 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
|
|||||||
if ($passok) {
|
if ($passok) {
|
||||||
$login = $obj->login;
|
$login = $obj->login;
|
||||||
} else {
|
} else {
|
||||||
sleep(2); // Anti brut force protection
|
|
||||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE);
|
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO bad password for '".$usertotest."', cryptType=".$cryptType, LOG_NOTICE);
|
||||||
|
sleep(1); // Anti brut force protection. Must be same delay when login is not valid
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('main', 'errors'));
|
$langs->loadLangs(array('main', 'errors'));
|
||||||
@ -153,7 +153,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE);
|
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO user not found for '".$usertotest."'", LOG_NOTICE);
|
||||||
sleep(1);
|
sleep(1); // Anti brut force protection. Must be same delay when password is not valid
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('main', 'errors'));
|
$langs->loadLangs(array('main', 'errors'));
|
||||||
|
|||||||
@ -122,7 +122,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
print "DEBUG: User ".$usertotest." must change password<br>\n";
|
print "DEBUG: User ".$usertotest." must change password<br>\n";
|
||||||
}
|
}
|
||||||
$ldap->unbind();
|
$ldap->unbind();
|
||||||
sleep(1);
|
sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid.
|
||||||
$langs->load('ldap');
|
$langs->load('ldap');
|
||||||
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
|
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
|
||||||
return '';
|
return '';
|
||||||
@ -233,6 +233,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
|
|
||||||
$usertmp = new User($db);
|
$usertmp = new User($db);
|
||||||
$usertmp->fetch('', $login);
|
$usertmp->fetch('', $login);
|
||||||
|
if (is_object($mc)) {
|
||||||
$ret = $mc->checkRight($usertmp->id, $entitytotest);
|
$ret = $mc->checkRight($usertmp->id, $entitytotest);
|
||||||
if ($ret < 0) {
|
if ($ret < 0) {
|
||||||
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE);
|
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE);
|
||||||
@ -241,9 +242,10 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
unset($usertmp);
|
unset($usertmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($result == 1) {
|
if ($result == 1) {
|
||||||
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO bad user/password for '".$usertotest."'", LOG_NOTICE);
|
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO bad user/password for '".$usertotest."'", LOG_NOTICE);
|
||||||
sleep(1);
|
sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid.
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('main', 'other'));
|
$langs->loadLangs(array('main', 'other'));
|
||||||
@ -265,7 +267,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
|||||||
$ldap->ldapErrorText = ldap_error($ldap->connection);
|
$ldap->ldapErrorText = ldap_error($ldap->connection);
|
||||||
dol_syslog("functions_ldap::check_user_password_ldap ".$ldap->ldapErrorCode." ".$ldap->ldapErrorText);
|
dol_syslog("functions_ldap::check_user_password_ldap ".$ldap->ldapErrorCode." ".$ldap->ldapErrorText);
|
||||||
}
|
}
|
||||||
sleep(2); // Anti brut force protection
|
sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid.
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('main', 'other', 'errors'));
|
$langs->loadLangs(array('main', 'other', 'errors'));
|
||||||
|
|||||||
@ -114,7 +114,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"',
|
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"',
|
||||||
'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'),
|
'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'),
|
||||||
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
|
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
|
||||||
'loadLangs' => array(),
|
'loadLangs' => array("members"),
|
||||||
'submenus' => array(),
|
'submenus' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"',
|
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"',
|
||||||
'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'),
|
'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'),
|
||||||
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
|
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
|
||||||
'loadLangs' => array("products"),
|
'loadLangs' => array("products", "stocks"),
|
||||||
'submenus' => array(),
|
'submenus' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"',
|
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"',
|
||||||
'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'),
|
'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'),
|
||||||
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
|
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
|
||||||
'loadLangs' => array("holiday"),
|
'loadLangs' => array("hrm", "holiday"),
|
||||||
'submenus' => array(),
|
'submenus' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -410,7 +410,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
|
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
|
||||||
'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'),
|
'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'),
|
||||||
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
|
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
|
||||||
'loadLangs' => array("other"),
|
'loadLangs' => array("ticket", "knowledgemanagement"),
|
||||||
'submenus' => array(),
|
'submenus' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -98,10 +98,10 @@ class CommActionRapport
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
$this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
||||||
$this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
$this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
|
||||||
|
|||||||
@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur = $mysoc;
|
$this->emetteur = $mysoc;
|
||||||
|
|||||||
@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
// Retrieves transmitter
|
// Retrieves transmitter
|
||||||
$this->emetteur = $mysoc;
|
$this->emetteur = $mysoc;
|
||||||
|
|||||||
@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|||||||
@ -135,10 +135,10 @@ class pdf_merou extends ModelePdfExpedition
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = round($formatarray['height'] / 2);
|
$this->page_hauteur = round($formatarray['height'] / 2);
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
|
|
||||||
|
|||||||
@ -135,10 +135,10 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|||||||
@ -119,10 +119,10 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -155,10 +155,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
@ -1195,7 +1195,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$langs->loadLangs(array('payment', 'paybox'));
|
$langs->loadLangs(array('payment', 'paybox', 'stripe'));
|
||||||
$servicename = $langs->transnoentities('Online');
|
$servicename = $langs->transnoentities('Online');
|
||||||
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||||
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||||
|
|||||||
@ -182,10 +182,10 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -137,10 +137,10 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -217,7 +217,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$s .= '<select id="filter_services_expired" name="filter" class="flat">';
|
$s = '<select id="filter_services_expired" name="filter" class="flat">';
|
||||||
if (count($this->arrayofproducts)) {
|
if (count($this->arrayofproducts)) {
|
||||||
$s .= '<option value="-1">'.$langs->trans("ProductOrService").'</option>';
|
$s .= '<option value="-1">'.$langs->trans("ProductOrService").'</option>';
|
||||||
} else {
|
} else {
|
||||||
@ -228,6 +228,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
|
|||||||
}
|
}
|
||||||
$s .= '</select>';
|
$s .= '</select>';
|
||||||
$s .= ajax_combobox("filter_services_expired");
|
$s .= ajax_combobox("filter_services_expired");
|
||||||
|
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2021 SuperAdmin
|
|
||||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -63,8 +62,6 @@ class modStockTransfer extends DolibarrModules
|
|||||||
$this->description = $langs->trans("ModuleStockTransferDesc");
|
$this->description = $langs->trans("ModuleStockTransferDesc");
|
||||||
// Used only if file README.md and README-LL.md not found.
|
// Used only if file README.md and README-LL.md not found.
|
||||||
$this->descriptionlong = "StockTransfer description (Long)";
|
$this->descriptionlong = "StockTransfer description (Long)";
|
||||||
$this->editor_name = 'Editor name';
|
|
||||||
$this->editor_url = 'https://www.example.com';
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = 'development';
|
$this->version = 'development';
|
||||||
// Url to the file with your last numberversion of this module
|
// Url to the file with your last numberversion of this module
|
||||||
@ -127,7 +124,7 @@ class modStockTransfer extends DolibarrModules
|
|||||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||||
$this->langfiles = array("stocktransfer@stocktransfer");
|
$this->langfiles = array("stocktransfer@stocktransfer");
|
||||||
$this->phpmin = array(5, 5); // Minimum version of PHP required by module
|
$this->phpmin = array(5, 6); // Minimum version of PHP required by module
|
||||||
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
||||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2022 SuperAdmin <test@dolibarr.com>
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -67,10 +66,6 @@ class modWebhook extends DolibarrModules
|
|||||||
// Used only if file README.md and README-LL.md not found.
|
// Used only if file README.md and README-LL.md not found.
|
||||||
$this->descriptionlong = "WebhookDescription";
|
$this->descriptionlong = "WebhookDescription";
|
||||||
|
|
||||||
// Author
|
|
||||||
$this->editor_name = 'Editor name';
|
|
||||||
$this->editor_url = 'https://www.example.com';
|
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = 'development';
|
$this->version = 'development';
|
||||||
// Url to the file with your last numberversion of this module
|
// Url to the file with your last numberversion of this module
|
||||||
|
|||||||
@ -116,10 +116,10 @@ class pdf_standard extends ModelePDFMovement
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_codestockservice = 0; // Display stock-service code
|
$this->option_codestockservice = 0; // Display stock-service code
|
||||||
|
|||||||
@ -144,10 +144,10 @@ class pdf_vinci extends ModelePDFMo
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_multilang = 1; //Available in several languages
|
$this->option_multilang = 1; //Available in several languages
|
||||||
|
|||||||
@ -89,10 +89,13 @@ if ($state) {
|
|||||||
$requestedpermissionsarray = explode(',', $statewithscopeonly); // Example: 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print'.
|
$requestedpermissionsarray = explode(',', $statewithscopeonly); // Example: 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print'.
|
||||||
$statewithanticsrfonly = preg_replace('/^.*\-/', '', $state);
|
$statewithanticsrfonly = preg_replace('/^.*\-/', '', $state);
|
||||||
}
|
}
|
||||||
if ($action != 'delete' && empty($requestedpermissionsarray)) {
|
|
||||||
print 'Error, parameter state is not defined';
|
if ($action != 'delete' && (empty($statewithscopeonly) || empty($requestedpermissionsarray))) {
|
||||||
exit;
|
setEventMessages($langs->trans('ScopeUndefined'), null, 'errors');
|
||||||
|
header('Location: '.$backtourl);
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($requestedpermissionsarray);exit;
|
//var_dump($requestedpermissionsarray);exit;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -97,10 +97,10 @@ class pdf_standard extends ModelePDFProduct
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_multilang = 1; // Available in several languages
|
$this->option_multilang = 1; // Available in several languages
|
||||||
|
|||||||
@ -139,10 +139,10 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -175,10 +175,10 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
}
|
}
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -138,10 +138,10 @@ class pdf_timespent extends ModelePDFProjects
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -145,10 +145,10 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -148,10 +148,10 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -54,10 +54,10 @@ class pdf_paiement
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->tab_top = 30;
|
$this->tab_top = 30;
|
||||||
|
|
||||||
|
|||||||
@ -57,10 +57,10 @@ class pdf_squille extends ModelePdfReception
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|||||||
@ -111,10 +111,10 @@ class pdf_standard extends ModelePDFStock
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_codestockservice = 0; // Display product-service code
|
$this->option_codestockservice = 0; // Display product-service code
|
||||||
|
|||||||
@ -131,10 +131,10 @@ class pdf_eagle extends ModelePdfStockTransfer
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
|
|
||||||
|
|||||||
@ -145,10 +145,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -141,10 +141,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -143,10 +143,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -143,10 +143,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
|
|||||||
@ -114,10 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur, $this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
|
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
|
||||||
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
|
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
|
||||||
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
|
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
|
||||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
|
||||||
|
|
||||||
$this->option_logo = 1; // Display logo
|
$this->option_logo = 1; // Display logo
|
||||||
$this->option_multilang = 1; // Available in several languages
|
$this->option_multilang = 1; // Available in several languages
|
||||||
|
|||||||
@ -101,7 +101,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
|
|||||||
if ($action == 'edit_extras') {
|
if ($action == 'edit_extras') {
|
||||||
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
|
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
|
||||||
} else {
|
} else {
|
||||||
$value = (!empty($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : '');
|
$value = (isset($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : '');
|
||||||
//var_dump($tmpkeyextra.' - '.$value);
|
//var_dump($tmpkeyextra.' - '.$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
168
htdocs/debugbar/class/DataCollector/DolPhpCollector.php
Normal file
168
htdocs/debugbar/class/DataCollector/DolPhpCollector.php
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use DebugBar\DataCollector\DataCollector;
|
||||||
|
use DebugBar\DataCollector\Renderable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PhpCollector
|
||||||
|
*
|
||||||
|
* This class collects all PHP errors, notice, advices, trigger_error,...
|
||||||
|
* Supports 15 different types included.
|
||||||
|
*/
|
||||||
|
class PhpCollector extends DataCollector implements Renderable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Collector name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of messages. Each item includes:
|
||||||
|
* 'message', 'message_html', 'is_string', 'label', 'time'.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $messages = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHPCollector constructor.
|
||||||
|
*
|
||||||
|
* @param string $name The name used by this collector widget.
|
||||||
|
*/
|
||||||
|
public function __construct($name = 'Error handler')
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
set_error_handler([$this, 'errorHandler'], E_ALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by the DebugBar when data needs to be collected.
|
||||||
|
*
|
||||||
|
* @return array Collected data.
|
||||||
|
*/
|
||||||
|
public function collect()
|
||||||
|
{
|
||||||
|
$messages = $this->getMessages();
|
||||||
|
return [
|
||||||
|
'count' => count($messages),
|
||||||
|
'messages' => $messages,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of messages ordered by their timestamp.
|
||||||
|
*
|
||||||
|
* @return array A list of messages ordered by time.
|
||||||
|
*/
|
||||||
|
public function getMessages()
|
||||||
|
{
|
||||||
|
$messages = $this->messages;
|
||||||
|
|
||||||
|
usort($messages, function ($itemA, $itemB) {
|
||||||
|
if ($itemA['time'] === $itemB['time']) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return $itemA['time'] < $itemB['time'] ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
return $messages;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a hash where keys are control names and their values an array of options as defined in
|
||||||
|
* {@see DebugBar\JavascriptRenderer::addControl()}
|
||||||
|
*
|
||||||
|
* @return array Needed details to render the widget.
|
||||||
|
*/
|
||||||
|
public function getWidgets()
|
||||||
|
{
|
||||||
|
$name = $this->getName();
|
||||||
|
return [
|
||||||
|
$name => [
|
||||||
|
'icon' => 'list',
|
||||||
|
'widget' => 'PhpDebugBar.Widgets.MessagesWidget',
|
||||||
|
'map' => "$name.messages",
|
||||||
|
'default' => '[]',
|
||||||
|
],
|
||||||
|
"$name:badge" => [
|
||||||
|
'map' => "$name.count",
|
||||||
|
'default' => 'null',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the unique name of the collector.
|
||||||
|
*
|
||||||
|
* @return string The widget name.
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception error handler. Called from constructor with set_error_handler to add all details.
|
||||||
|
*
|
||||||
|
* @param int $severity Error type.
|
||||||
|
* @param string $message Message of error.
|
||||||
|
* @param string $fileName File where error is generated.
|
||||||
|
* @param int $line Line number where error is generated.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function errorHandler($severity, $message, $fileName, $line)
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 15; $i++) {
|
||||||
|
if ($type = $severity & (2 ** $i)) {
|
||||||
|
$label = $this->friendlyErrorType($type);
|
||||||
|
$this->messages[] = [
|
||||||
|
'message' => $message . ' (' . $fileName . ':' . $line . ')',
|
||||||
|
'message_html' => null,
|
||||||
|
'is_string' => true,
|
||||||
|
'label' => $label,
|
||||||
|
'time' => microtime(true),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return error name from error code.
|
||||||
|
*
|
||||||
|
* @info http://php.net/manual/es/errorfunc.constants.php
|
||||||
|
*
|
||||||
|
* @param int $type Error code.
|
||||||
|
*
|
||||||
|
* @return string Error name.
|
||||||
|
*/
|
||||||
|
private function friendlyErrorType($type)
|
||||||
|
{
|
||||||
|
$errors = [
|
||||||
|
E_ERROR => 'ERROR',
|
||||||
|
E_WARNING => 'WARNING',
|
||||||
|
E_PARSE => 'PARSE',
|
||||||
|
E_NOTICE => 'NOTICE',
|
||||||
|
E_CORE_ERROR => 'CORE_ERROR',
|
||||||
|
E_CORE_WARNING => 'CORE_WARNING',
|
||||||
|
E_COMPILE_ERROR => 'COMPILE_ERROR',
|
||||||
|
E_COMPILE_WARNING => 'COMPILE_WARNING',
|
||||||
|
E_USER_ERROR => 'USER_ERROR',
|
||||||
|
E_USER_WARNING => 'USER_WARNING',
|
||||||
|
E_USER_NOTICE => 'USER_NOTICE',
|
||||||
|
E_STRICT => 'STRICT',
|
||||||
|
E_RECOVERABLE_ERROR => 'RECOVERABLE_ERROR',
|
||||||
|
E_DEPRECATED => 'DEPRECATED',
|
||||||
|
E_USER_DEPRECATED => 'USER_DEPRECATED',
|
||||||
|
];
|
||||||
|
|
||||||
|
$result = '';
|
||||||
|
if (isset($errors[$type])) {
|
||||||
|
$result = $errors[$type];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,6 +10,7 @@ dol_include_once('/debugbar/class/DataCollector/DolRequestDataCollector.php');
|
|||||||
dol_include_once('/debugbar/class/DataCollector/DolConfigCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolConfigCollector.php');
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolTimeDataCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolTimeDataCollector.php');
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolMemoryCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolMemoryCollector.php');
|
||||||
|
dol_include_once('/debugbar/class/DataCollector/DolPhpCollector.php');
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolExceptionsCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolExceptionsCollector.php');
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolQueryCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolQueryCollector.php');
|
||||||
dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php');
|
dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php');
|
||||||
@ -36,6 +37,7 @@ class DolibarrDebugBar extends DebugBar
|
|||||||
$this->addCollector(new DolRequestDataCollector());
|
$this->addCollector(new DolRequestDataCollector());
|
||||||
//$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
|
//$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
|
||||||
$this->addCollector(new DolTimeDataCollector());
|
$this->addCollector(new DolTimeDataCollector());
|
||||||
|
$this->addCollector(new PhpCollector());
|
||||||
$this->addCollector(new DolMemoryCollector());
|
$this->addCollector(new DolMemoryCollector());
|
||||||
//$this->addCollector(new DolExceptionsCollector());
|
//$this->addCollector(new DolExceptionsCollector());
|
||||||
$this->addCollector(new DolQueryCollector());
|
$this->addCollector(new DolQueryCollector());
|
||||||
|
|||||||
@ -973,7 +973,7 @@ class Delivery extends CommonObject
|
|||||||
$sqlSourceLine .= ", p.ref, p.label";
|
$sqlSourceLine .= ", p.ref, p.label";
|
||||||
$sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st";
|
$sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st";
|
||||||
$sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid";
|
$sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid";
|
||||||
$sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
|
$sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
|
||||||
|
|
||||||
$resultSourceLine = $this->db->query($sqlSourceLine);
|
$resultSourceLine = $this->db->query($sqlSourceLine);
|
||||||
if ($resultSourceLine) {
|
if ($resultSourceLine) {
|
||||||
@ -986,12 +986,12 @@ class Delivery extends CommonObject
|
|||||||
// Get lines of sources alread delivered
|
// Get lines of sources alread delivered
|
||||||
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
|
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,";
|
||||||
$sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c";
|
$sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c";
|
||||||
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd";
|
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd";
|
||||||
$sql .= " WHERE ld.fk_delivery = l.rowid";
|
$sql .= " WHERE ld.fk_delivery = l.rowid";
|
||||||
$sql .= " AND ld.fk_origin_line = cd.rowid";
|
$sql .= " AND ld.fk_origin_line = cd.rowid";
|
||||||
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid";
|
$sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid";
|
||||||
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
|
$sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
|
||||||
$sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid);
|
$sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid);
|
||||||
$sql .= " GROUP BY ld.fk_origin_line";
|
$sql .= " GROUP BY ld.fk_origin_line";
|
||||||
|
|
||||||
|
|||||||
@ -16,37 +16,38 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file emailcollector/class/emailcollector.class.php
|
* \file htdocs/emailcollector/class/emailcollector.class.php
|
||||||
* \ingroup emailcollector
|
* \ingroup emailcollector
|
||||||
* \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete)
|
* \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Put here all includes required by your class file
|
// Put here all includes required by your class file
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
|
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // customer proposal
|
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // customer order
|
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipment
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // supplier invoice
|
require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // supplier order
|
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order
|
||||||
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // supplier proposal
|
require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice
|
||||||
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // reception
|
require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address
|
||||||
include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
|
require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery
|
||||||
//require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; // Holidays (leave request)
|
require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order
|
||||||
//require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // expernse repor
|
require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket
|
||||||
|
//require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report
|
||||||
|
//require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request)
|
||||||
|
|
||||||
|
|
||||||
// use Webklex\PHPIMAP;
|
// use Webklex\PHPIMAP;
|
||||||
require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php';
|
require DOL_DOCUMENT_ROOT .'/includes/webklex/php-imap/vendor/autoload.php';
|
||||||
use Webklex\PHPIMAP\ClientManager;
|
|
||||||
|
|
||||||
|
use Webklex\PHPIMAP\ClientManager;
|
||||||
use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
|
use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
|
||||||
use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException;
|
use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException;
|
||||||
use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException;
|
use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException;
|
||||||
@ -64,14 +65,17 @@ class EmailCollector extends CommonObject
|
|||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element = 'emailcollector';
|
public $element = 'emailcollector';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = 'emailcollector_emailcollector';
|
public $table_element = 'emailcollector_emailcollector';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
* @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
*/
|
*/
|
||||||
public $ismultientitymanaged = 1;
|
public $ismultientitymanaged = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Does emailcollector support extrafields ? 0=No, 1=Yes
|
* @var int Does emailcollector support extrafields ? 0=No, 1=Yes
|
||||||
*/
|
*/
|
||||||
@ -91,6 +95,7 @@ class EmailCollector extends CommonObject
|
|||||||
* @var array List of child tables. To test if we can delete object.
|
* @var array List of child tables. To test if we can delete object.
|
||||||
*/
|
*/
|
||||||
protected $childtables = array();
|
protected $childtables = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array List of child tables. To know object to delete on cascade.
|
* @var array List of child tables. To know object to delete on cascade.
|
||||||
*/
|
*/
|
||||||
@ -126,8 +131,8 @@ class EmailCollector extends CommonObject
|
|||||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax150'),
|
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'help'=>'Example: MyCollector1', 'csslist'=>'tdoverflowmax150'),
|
||||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'),
|
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>'Example: My Email collector', 'csslist'=>'tdoverflowmax150'),
|
||||||
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'),
|
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>60, 'notnull'=>-1, 'csslist'=>'small'),
|
||||||
'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflow125'),
|
'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflowmax125'),
|
||||||
'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflow125', 'default'=>'993'),
|
'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflowmax50', 'default'=>'993'),
|
||||||
'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'),
|
'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'),
|
||||||
'acces_type' => array('type'=>'integer', 'label'=>'accessType', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>101, 'notnull'=>1, 'index'=>1, 'comment'=>"IMAP login type", 'arrayofkeyval'=>array('0'=>'loginPassword', '1'=>'oauthToken'), 'default'=>'0', 'help'=>''),
|
'acces_type' => array('type'=>'integer', 'label'=>'accessType', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>101, 'notnull'=>1, 'index'=>1, 'comment'=>"IMAP login type", 'arrayofkeyval'=>array('0'=>'loginPassword', '1'=>'oauthToken'), 'default'=>'0', 'help'=>''),
|
||||||
'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'),
|
'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'),
|
||||||
@ -206,7 +211,6 @@ class EmailCollector extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $import_key;
|
public $import_key;
|
||||||
|
|
||||||
|
|
||||||
public $host;
|
public $host;
|
||||||
public $port;
|
public $port;
|
||||||
public $hostcharset;
|
public $hostcharset;
|
||||||
@ -851,7 +855,7 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
// Loop on each collector
|
// Loop on each collector
|
||||||
foreach ($arrayofcollectors as $emailcollector) {
|
foreach ($arrayofcollectors as $emailcollector) {
|
||||||
$result = $emailcollector->doCollectOneCollector();
|
$result = $emailcollector->doCollectOneCollector(0);
|
||||||
dol_syslog("doCollect result = ".$result." for emailcollector->id = ".$emailcollector->id);
|
dol_syslog("doCollect result = ".$result." for emailcollector->id = ".$emailcollector->id);
|
||||||
|
|
||||||
$this->error .= 'EmailCollector ID '.$emailcollector->id.':'.$emailcollector->error.'<br>';
|
$this->error .= 'EmailCollector ID '.$emailcollector->id.':'.$emailcollector->error.'<br>';
|
||||||
@ -872,9 +876,10 @@ class EmailCollector extends CommonObject
|
|||||||
* @param string $messagetext Body
|
* @param string $messagetext Body
|
||||||
* @param string $subject Subject
|
* @param string $subject Subject
|
||||||
* @param string $header Header
|
* @param string $header Header
|
||||||
|
* @param string $operationslog String with logs of operations done
|
||||||
* @return int 0=OK, Nb of error if error
|
* @return int 0=OK, Nb of error if error
|
||||||
*/
|
*/
|
||||||
private function overwritePropertiesOfObject(&$object, $actionparam, $messagetext, $subject, $header)
|
private function overwritePropertiesOfObject(&$object, $actionparam, $messagetext, $subject, $header, &$operationslog)
|
||||||
{
|
{
|
||||||
$errorforthisaction = 0;
|
$errorforthisaction = 0;
|
||||||
|
|
||||||
@ -909,6 +914,7 @@ class EmailCollector extends CommonObject
|
|||||||
$sourcefield = $regforregex[1];
|
$sourcefield = $regforregex[1];
|
||||||
$regexstring = $regforregex[2];
|
$regexstring = $regforregex[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($sourcefield) && !empty($regexstring)) {
|
if (!empty($sourcefield) && !empty($regexstring)) {
|
||||||
if (strtolower($sourcefield) == 'body') {
|
if (strtolower($sourcefield) == 'body') {
|
||||||
$sourcestring = $messagetext;
|
$sourcestring = $messagetext;
|
||||||
@ -930,7 +936,6 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
//var_dump($tmpproperty.' - '.$regexstring.' - '.$regexoptions.' - '.$sourcestring);
|
//var_dump($tmpproperty.' - '.$regexstring.' - '.$regexoptions.' - '.$sourcestring);
|
||||||
if (preg_match('/'.$regexstring.'/'.$regexoptions, $sourcestring, $regforval)) {
|
if (preg_match('/'.$regexstring.'/'.$regexoptions, $sourcestring, $regforval)) {
|
||||||
//var_dump($regforval[count($regforval)-1]);exit;
|
|
||||||
// Overwrite param $tmpproperty
|
// Overwrite param $tmpproperty
|
||||||
$valueextracted = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null;
|
$valueextracted = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null;
|
||||||
if (strtolower($sourcefield) == 'header') {
|
if (strtolower($sourcefield) == 'header') {
|
||||||
@ -946,9 +951,16 @@ class EmailCollector extends CommonObject
|
|||||||
$object->$tmpproperty = $this->decodeSMTPSubject($valueextracted);
|
$object->$tmpproperty = $this->decodeSMTPSubject($valueextracted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (preg_match('/^options_/', $tmpproperty)) {
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/'.dol_escape_htmltag($regexoptions).' into '.strtolower($sourcefield).' -> found '.dol_escape_htmltag(dol_trunc($object->array_options[preg_replace('/^options_/', '', $tmpproperty)], 128));
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/'.dol_escape_htmltag($regexoptions).' into '.strtolower($sourcefield).' -> found '.dol_escape_htmltag(dol_trunc($object->$tmpproperty, 128));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Regex not found
|
// Regex not found
|
||||||
$object->$tmpproperty = null;
|
$object->$tmpproperty = null;
|
||||||
|
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/'.dol_escape_htmltag($regexoptions).' into '.strtolower($sourcefield).' -> not found, so property '.dol_escape_htmltag($tmpproperty).' is set to null.';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Nothing can be done for this param
|
// Nothing can be done for this param
|
||||||
@ -986,6 +998,8 @@ class EmailCollector extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$object->$tmpproperty = $valuetouse;
|
$object->$tmpproperty = $valuetouse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$operationslog .= '<br>Set value '.dol_escape_htmltag($valuetouse).' into variable '.dol_escape_htmltag($tmpproperty);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errorforthisaction++;
|
$errorforthisaction++;
|
||||||
@ -1001,9 +1015,10 @@ class EmailCollector extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Execute collect for current collector loaded previously with fetch.
|
* Execute collect for current collector loaded previously with fetch.
|
||||||
*
|
*
|
||||||
|
* @param int $mode 0=Mode production, 1=Mode test (read IMAP and try SQL update then rollback), 2=Mode test with no SQL updates
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function doCollectOneCollector()
|
public function doCollectOneCollector($mode = 0)
|
||||||
{
|
{
|
||||||
global $db, $conf, $langs, $user;
|
global $db, $conf, $langs, $user;
|
||||||
global $hookmanager;
|
global $hookmanager;
|
||||||
@ -1019,6 +1034,15 @@ class EmailCollector extends CommonObject
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
$this->output = '';
|
$this->output = '';
|
||||||
$this->error = '';
|
$this->error = '';
|
||||||
|
$this->debuginfo = '';
|
||||||
|
|
||||||
|
$search = '';
|
||||||
|
$searchhead = '';
|
||||||
|
$searchfilterdoltrackid = 0;
|
||||||
|
$searchfilternodoltrackid = 0;
|
||||||
|
$searchfilterisanswer = 0;
|
||||||
|
$searchfilterisnotanswer = 0;
|
||||||
|
$operationslog = '';
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
@ -1166,12 +1190,6 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
||||||
$criteria = array(array('UNDELETED')); // Seems not supported by some servers
|
$criteria = array(array('UNDELETED')); // Seems not supported by some servers
|
||||||
$search = '';
|
|
||||||
$searchhead = '';
|
|
||||||
$searchfilterdoltrackid = 0;
|
|
||||||
$searchfilternodoltrackid = 0;
|
|
||||||
$searchfilterisanswer = 0;
|
|
||||||
$searchfilterisnotanswer = 0;
|
|
||||||
foreach ($this->filters as $rule) {
|
foreach ($this->filters as $rule) {
|
||||||
if (empty($rule['status'])) {
|
if (empty($rule['status'])) {
|
||||||
continue;
|
continue;
|
||||||
@ -1269,11 +1287,6 @@ class EmailCollector extends CommonObject
|
|||||||
$search = var_export($criteria, true);
|
$search = var_export($criteria, true);
|
||||||
} else {
|
} else {
|
||||||
$search = 'UNDELETED'; // Seems not supported by some servers
|
$search = 'UNDELETED'; // Seems not supported by some servers
|
||||||
$searchhead = '';
|
|
||||||
$searchfilterdoltrackid = 0;
|
|
||||||
$searchfilternodoltrackid = 0;
|
|
||||||
$searchfilterisanswer = 0;
|
|
||||||
$searchfilterisnotanswer = 0;
|
|
||||||
foreach ($this->filters as $rule) {
|
foreach ($this->filters as $rule) {
|
||||||
if (empty($rule['status'])) {
|
if (empty($rule['status'])) {
|
||||||
continue;
|
continue;
|
||||||
@ -1480,7 +1493,7 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
$emailto = $this->decodeSMTPSubject($overview[0]->to);
|
$emailto = $this->decodeSMTPSubject($overview[0]->to);
|
||||||
|
|
||||||
|
$operationslog .= '<br>Process email '.dol_escape_htmltag($iforemailloop)." - References: ".dol_escape_htmltag($headers['References'])." - Subject: ".dol_escape_htmltag($headers['Subject']);
|
||||||
dol_syslog("** Process email ".$iforemailloop." References: ".$headers['References']." Subject: ".$headers['Subject']);
|
dol_syslog("** Process email ".$iforemailloop." References: ".$headers['References']." Subject: ".$headers['Subject']);
|
||||||
|
|
||||||
|
|
||||||
@ -1738,61 +1751,61 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
$objectid = $reg[2];
|
$objectid = $reg[2];
|
||||||
// See also list into interface_50_modAgenda_ActionsAuto
|
// See also list into interface_50_modAgenda_ActionsAuto
|
||||||
if ($reg[1] == 'thi') {
|
if ($reg[1] == 'thi') { // Third-party
|
||||||
$objectemail = new Societe($this->db);
|
$objectemail = new Societe($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'ctc') {
|
if ($reg[1] == 'ctc') { // Contact
|
||||||
$objectemail = new Contact($this->db);
|
$objectemail = new Contact($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'inv') { // customer invoices
|
if ($reg[1] == 'inv') { // Customer Invoice
|
||||||
$objectemail = new Facture($this->db);
|
$objectemail = new Facture($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'sinv') { // supplier invoices
|
if ($reg[1] == 'sinv') { // Supplier Invoice
|
||||||
$objectemail = new FactureFournisseur($this->db);
|
$objectemail = new FactureFournisseur($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'pro') { // customer proposals
|
if ($reg[1] == 'pro') { // Customer Proposal
|
||||||
$objectemail = new Propal($this->db);
|
$objectemail = new Propal($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'ord') { // customer orders
|
if ($reg[1] == 'ord') { // Customer Order
|
||||||
$objectemail = new Commande($this->db);
|
$objectemail = new Commande($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'shi') { // shipments
|
if ($reg[1] == 'shi') { // Shipment
|
||||||
$objectemail = new Expedition($this->db);
|
$objectemail = new Expedition($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'spro') { // supplier proposal
|
if ($reg[1] == 'spro') { // Supplier Proposal
|
||||||
$objectemail = new SupplierProposal($this->db);
|
$objectemail = new SupplierProposal($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'sord') { // supplier order
|
if ($reg[1] == 'sord') { // Supplier Order
|
||||||
$objectemail = new CommandeFournisseur($this->db);
|
$objectemail = new CommandeFournisseur($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'rec') { // Reception
|
if ($reg[1] == 'rec') { // Reception
|
||||||
$objectemail = new Reception($this->db);
|
$objectemail = new Reception($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'proj') {
|
if ($reg[1] == 'proj') { // Project
|
||||||
$objectemail = new Project($this->db);
|
$objectemail = new Project($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'tas') {
|
if ($reg[1] == 'tas') { // Task
|
||||||
$objectemail = new Task($this->db);
|
$objectemail = new Task($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'con') {
|
if ($reg[1] == 'con') { // Contact
|
||||||
$objectemail = new Contact($this->db);
|
$objectemail = new Contact($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'use') {
|
if ($reg[1] == 'use') { // User
|
||||||
$objectemail = new User($this->db);
|
$objectemail = new User($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'tic') {
|
if ($reg[1] == 'tic') { // Ticket
|
||||||
$objectemail = new Ticket($this->db);
|
$objectemail = new Ticket($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'recruitmentcandidature') {
|
if ($reg[1] == 'recruitmentcandidature') { // Recruiting Candidate
|
||||||
$objectemail = new RecruitmentCandidature($this->db);
|
$objectemail = new RecruitmentCandidature($this->db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'mem') {
|
if ($reg[1] == 'mem') { // Member
|
||||||
$objectemail = new Adherent($this->db);
|
$objectemail = new Adherent($this->db);
|
||||||
}
|
}
|
||||||
/*if ($reg[1] == 'leav') {
|
/*if ($reg[1] == 'leav') { // Leave / Holiday
|
||||||
$objectemail = new Holiday($db);
|
$objectemail = new Holiday($db);
|
||||||
}
|
}
|
||||||
if ($reg[1] == 'exp') {
|
if ($reg[1] == 'exp') { // ExpenseReport
|
||||||
$objectemail = new ExpenseReport($db);
|
$objectemail = new ExpenseReport($db);
|
||||||
}*/
|
}*/
|
||||||
} elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) {
|
} elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) {
|
||||||
@ -1950,6 +1963,7 @@ class EmailCollector extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do operations
|
// Do operations
|
||||||
|
if ($mode < 2) {
|
||||||
foreach ($this->actions as $operation) {
|
foreach ($this->actions as $operation) {
|
||||||
$errorforthisaction = 0;
|
$errorforthisaction = 0;
|
||||||
|
|
||||||
@ -2026,22 +2040,30 @@ class EmailCollector extends CommonObject
|
|||||||
// Overwrite param $tmpproperty
|
// Overwrite param $tmpproperty
|
||||||
if ($propertytooverwrite == 'id') {
|
if ($propertytooverwrite == 'id') {
|
||||||
$idtouseforthirdparty = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
|
$idtouseforthirdparty = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
|
||||||
|
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/ms into '.strtolower($sourcefield).' -> Found idtouseforthirdparty='.dol_escape_htmltag($idtouseforthirdparty);
|
||||||
} elseif ($propertytooverwrite == 'email') {
|
} elseif ($propertytooverwrite == 'email') {
|
||||||
$emailtouseforthirdparty = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
|
$emailtouseforthirdparty = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
|
||||||
|
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/ms into '.strtolower($sourcefield).' -> Found propertytooverwrite='.dol_escape_htmltag($propertytooverwrite);
|
||||||
} else {
|
} else {
|
||||||
$nametouseforthirdparty = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
|
$nametouseforthirdparty = isset($regforval[count($regforval) - 1]) ? trim($regforval[count($regforval) - 1]) : null;
|
||||||
|
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/ms into '.strtolower($sourcefield).' -> Found nametouseforthirdparty='.dol_escape_htmltag($nametouseforthirdparty);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Regex not found
|
// Regex not found
|
||||||
$idtouseforthirdparty = null;
|
$idtouseforthirdparty = null;
|
||||||
$nametouseforthirdparty = null;
|
$nametouseforthirdparty = null;
|
||||||
$emailtouseforthirdparty = null;
|
$emailtouseforthirdparty = null;
|
||||||
|
|
||||||
|
$operationslog .= '<br>Regex /'.dol_escape_htmltag($regexstring).'/ms into '.strtolower($sourcefield).' -> Not found';
|
||||||
}
|
}
|
||||||
//var_dump($object->$tmpproperty);exit;
|
//var_dump($object->$tmpproperty);exit;
|
||||||
} else {
|
} else {
|
||||||
// Nothing can be done for this param
|
// Nothing can be done for this param
|
||||||
$errorforactions++;
|
$errorforactions++;
|
||||||
$this->error = 'The extract rule to use to load thirdparty has on an unknown source (must be HEADER, SUBJECT or BODY)';
|
$this->error = 'The extract rule to use to load thirdparty has an unknown source (must be HEADER, SUBJECT or BODY)';
|
||||||
$this->errors[] = $this->error;
|
$this->errors[] = $this->error;
|
||||||
}
|
}
|
||||||
} elseif (preg_match('/^(SET|SETIFEMPTY):(.*)$/', $valueforproperty, $reg)) {
|
} elseif (preg_match('/^(SET|SETIFEMPTY):(.*)$/', $valueforproperty, $reg)) {
|
||||||
@ -2049,10 +2071,16 @@ class EmailCollector extends CommonObject
|
|||||||
//else $object->$tmpproperty = $reg[1];
|
//else $object->$tmpproperty = $reg[1];
|
||||||
if ($propertytooverwrite == 'id') {
|
if ($propertytooverwrite == 'id') {
|
||||||
$idtouseforthirdparty = $reg[2];
|
$idtouseforthirdparty = $reg[2];
|
||||||
|
|
||||||
|
$operationslog .= '<br>We set property idtouseforthrdparty='.dol_escape_htmltag($idtouseforthirdparty);
|
||||||
} elseif ($propertytooverwrite == 'email') {
|
} elseif ($propertytooverwrite == 'email') {
|
||||||
$emailtouseforthirdparty = $reg[2];
|
$emailtouseforthirdparty = $reg[2];
|
||||||
|
|
||||||
|
$operationslog .= '<br>We set property emailtouseforthrdparty='.dol_escape_htmltag($emailtouseforthirdparty);
|
||||||
} else {
|
} else {
|
||||||
$nametouseforthirdparty = $reg[2];
|
$nametouseforthirdparty = $reg[2];
|
||||||
|
|
||||||
|
$operationslog .= '<br>We set property nametouseforthirdparty='.dol_escape_htmltag($nametouseforthirdparty);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errorforactions++;
|
$errorforactions++;
|
||||||
@ -2088,7 +2116,7 @@ class EmailCollector extends CommonObject
|
|||||||
$thirdpartystatic->email = ($emailtouseforthirdparty ? $emailtouseforthirdparty : $from);
|
$thirdpartystatic->email = ($emailtouseforthirdparty ? $emailtouseforthirdparty : $from);
|
||||||
|
|
||||||
// Overwrite values with values extracted from source email
|
// Overwrite values with values extracted from source email
|
||||||
$errorforthisaction = $this->overwritePropertiesOfObject($thirdpartystatic, $operation['actionparam'], $messagetext, $subject, $header);
|
$errorforthisaction = $this->overwritePropertiesOfObject($thirdpartystatic, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||||
|
|
||||||
if ($thirdpartystatic->client && empty($thirdpartystatic->code_client)) {
|
if ($thirdpartystatic->client && empty($thirdpartystatic->code_client)) {
|
||||||
$thirdpartystatic->code_client = 'auto';
|
$thirdpartystatic->code_client = 'auto';
|
||||||
@ -2105,6 +2133,8 @@ class EmailCollector extends CommonObject
|
|||||||
$errorforactions++;
|
$errorforactions++;
|
||||||
$this->error = $thirdpartystatic->error;
|
$this->error = $thirdpartystatic->error;
|
||||||
$this->errors = $thirdpartystatic->errors;
|
$this->errors = $thirdpartystatic->errors;
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Thirdparty created -> id = '.dol_escape_htmltag($thirdpartystatic->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2181,7 +2211,7 @@ class EmailCollector extends CommonObject
|
|||||||
//$actioncomm->extraparams = $extraparams;
|
//$actioncomm->extraparams = $extraparams;
|
||||||
|
|
||||||
// Overwrite values with values extracted from source email
|
// Overwrite values with values extracted from source email
|
||||||
$errorforthisaction = $this->overwritePropertiesOfObject($actioncomm, $operation['actionparam'], $messagetext, $subject, $header);
|
$errorforthisaction = $this->overwritePropertiesOfObject($actioncomm, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||||
|
|
||||||
//var_dump($fk_element_id);
|
//var_dump($fk_element_id);
|
||||||
//var_dump($fk_element_type);
|
//var_dump($fk_element_type);
|
||||||
@ -2197,6 +2227,8 @@ class EmailCollector extends CommonObject
|
|||||||
if ($result <= 0) {
|
if ($result <= 0) {
|
||||||
$errorforactions++;
|
$errorforactions++;
|
||||||
$this->errors = $actioncomm->errors;
|
$this->errors = $actioncomm->errors;
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Event created -> id='.dol_escape_htmltag($actioncomm->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2361,8 +2393,12 @@ class EmailCollector extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$operationslog .= '<br>Save attachment files on disk';
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = 'no joined piece';
|
$this->errors[] = 'no joined piece';
|
||||||
|
|
||||||
|
$operationslog .= '<br>No joinded files';
|
||||||
}
|
}
|
||||||
} elseif ($operation['type'] == 'project') {
|
} elseif ($operation['type'] == 'project') {
|
||||||
// Create project / lead
|
// Create project / lead
|
||||||
@ -2411,7 +2447,7 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
// Overwrite values with values extracted from source email.
|
// Overwrite values with values extracted from source email.
|
||||||
// This may overwrite any $projecttocreate->xxx properties.
|
// This may overwrite any $projecttocreate->xxx properties.
|
||||||
$errorforthisaction = $this->overwritePropertiesOfObject($projecttocreate, $operation['actionparam'], $messagetext, $subject, $header);
|
$errorforthisaction = $this->overwritePropertiesOfObject($projecttocreate, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||||
|
|
||||||
// Set project ref if not yet defined
|
// Set project ref if not yet defined
|
||||||
if (empty($projecttocreate->ref)) {
|
if (empty($projecttocreate->ref)) {
|
||||||
@ -2477,6 +2513,10 @@ class EmailCollector extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$this->getmsg($connection, $imapemail, $destdir);
|
$this->getmsg($connection, $imapemail, $destdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$operationslog .= '<br>Project created with attachments -> id='.dol_escape_htmltag($projecttocreate->id);
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Project created without attachments -> id='.dol_escape_htmltag($projecttocreate->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2534,7 +2574,7 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
// Overwrite values with values extracted from source email.
|
// Overwrite values with values extracted from source email.
|
||||||
// This may overwrite any $projecttocreate->xxx properties.
|
// This may overwrite any $projecttocreate->xxx properties.
|
||||||
$errorforthisaction = $this->overwritePropertiesOfObject($tickettocreate, $operation['actionparam'], $messagetext, $subject, $header);
|
$errorforthisaction = $this->overwritePropertiesOfObject($tickettocreate, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||||
|
|
||||||
// Set ticket ref if not yet defined
|
// Set ticket ref if not yet defined
|
||||||
if (empty($tickettocreate->ref)) {
|
if (empty($tickettocreate->ref)) {
|
||||||
@ -2599,6 +2639,10 @@ class EmailCollector extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$this->getmsg($connection, $imapemail, $destdir);
|
$this->getmsg($connection, $imapemail, $destdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$operationslog .= '<br>Ticket created with attachments -> id='.dol_escape_htmltag($tickettocreate->id);
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Ticket created without attachments -> id='.dol_escape_htmltag($tickettocreate->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2640,7 +2684,7 @@ class EmailCollector extends CommonObject
|
|||||||
|
|
||||||
// Overwrite values with values extracted from source email.
|
// Overwrite values with values extracted from source email.
|
||||||
// This may overwrite any $projecttocreate->xxx properties.
|
// This may overwrite any $projecttocreate->xxx properties.
|
||||||
$errorforthisaction = $this->overwritePropertiesOfObject($candidaturetocreate, $operation['actionparam'], $messagetext, $subject, $header);
|
$errorforthisaction = $this->overwritePropertiesOfObject($candidaturetocreate, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||||
|
|
||||||
// Set candidature ref if not yet defined
|
// Set candidature ref if not yet defined
|
||||||
/*if (empty($candidaturetocreate->ref)) We do not need this because we create object in draft status
|
/*if (empty($candidaturetocreate->ref)) We do not need this because we create object in draft status
|
||||||
@ -2692,6 +2736,8 @@ class EmailCollector extends CommonObject
|
|||||||
$this->error = 'Failed to create ticket: '.join(', ', $candidaturetocreate->errors);
|
$this->error = 'Failed to create ticket: '.join(', ', $candidaturetocreate->errors);
|
||||||
$this->errors = $candidaturetocreate->errors;
|
$this->errors = $candidaturetocreate->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$operationslog .= '<br>Candidature created without attachments -> id='.dol_escape_htmltag($candidaturetocreate->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (substr($operation['type'], 0, 4) == 'hook') {
|
} elseif (substr($operation['type'], 0, 4) == 'hook') {
|
||||||
@ -2721,7 +2767,7 @@ class EmailCollector extends CommonObject
|
|||||||
'header'=>$header,
|
'header'=>$header,
|
||||||
'attachments'=>$attachments,
|
'attachments'=>$attachments,
|
||||||
);
|
);
|
||||||
$reshook = $hookmanager->executeHooks('doColleimapctOneCollector', $parameters, $this, $operation['type']);
|
$reshook = $hookmanager->executeHooks('doCollectImapOneCollector', $parameters, $this, $operation['type']);
|
||||||
|
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
$errorforthisaction++;
|
$errorforthisaction++;
|
||||||
@ -2729,19 +2775,22 @@ class EmailCollector extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($errorforthisaction) {
|
if ($errorforthisaction) {
|
||||||
$errorforactions++;
|
$errorforactions++;
|
||||||
|
$operationslog .= '<br>Hook doCollectImapOneCollector executed with error';
|
||||||
|
} else {
|
||||||
|
$operationslog .= '<br>Hook doCollectImapOneCollector executed without error';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!$errorforactions) {
|
if (!$errorforactions) {
|
||||||
$nbactiondoneforemail++;
|
$nbactiondoneforemail++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Error for email or not ?
|
// Error for email or not ?
|
||||||
if (!$errorforactions) {
|
if (!$errorforactions) {
|
||||||
|
if ($targetdir && empty($mode)) {
|
||||||
if (empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
if (empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
||||||
if ($targetdir) {
|
|
||||||
dol_syslog("EmailCollector::doCollectOneCollector move message ".$imapemail." to ".$connectstringtarget, LOG_DEBUG);
|
dol_syslog("EmailCollector::doCollectOneCollector move message ".$imapemail." to ".$connectstringtarget, LOG_DEBUG);
|
||||||
$res = imap_mail_move($connection, $imapemail, $targetdir, 0);
|
$res = imap_mail_move($connection, $imapemail, $targetdir, 0);
|
||||||
if ($res == false) {
|
if ($res == false) {
|
||||||
@ -2751,9 +2800,10 @@ class EmailCollector extends CommonObject
|
|||||||
dol_syslog(imap_last_error());
|
dol_syslog(imap_last_error());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dol_syslog("EmailCollector::doCollectOneCollector message ".$imapemail." to ".$connectstringtarget." was set to read", LOG_DEBUG);
|
// TODO Move mail using PHP-IMAP
|
||||||
// TODO Make the move
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
dol_syslog("EmailCollector::doCollectOneCollector message ".$imapemail." to ".$connectstringtarget." was set to read", LOG_DEBUG);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errorforemail++;
|
$errorforemail++;
|
||||||
@ -2771,7 +2821,11 @@ class EmailCollector extends CommonObject
|
|||||||
$nbactiondone += $nbactiondoneforemail;
|
$nbactiondone += $nbactiondoneforemail;
|
||||||
$nbemailok++;
|
$nbemailok++;
|
||||||
|
|
||||||
|
if (empty($mode)) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
}
|
||||||
|
|
||||||
// Stop the loop to process email if we reach maximum collected per collect
|
// Stop the loop to process email if we reach maximum collected per collect
|
||||||
if ($this->maxemailpercollect > 0 && $nbemailok >= $this->maxemailpercollect) {
|
if ($this->maxemailpercollect > 0 && $nbemailok >= $this->maxemailpercollect) {
|
||||||
@ -2795,19 +2849,23 @@ class EmailCollector extends CommonObject
|
|||||||
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
||||||
$client->disconnect();
|
$client->disconnect();
|
||||||
} else {
|
} else {
|
||||||
|
if (empty($mode)) {
|
||||||
imap_expunge($connection); // To validate any move
|
imap_expunge($connection); // To validate any move
|
||||||
|
}
|
||||||
imap_close($connection);
|
imap_close($connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->datelastresult = $now;
|
$this->datelastresult = $now;
|
||||||
$this->lastresult = $output;
|
$this->lastresult = $output;
|
||||||
$this->debuginfo = 'IMAP search string used : '.$search;
|
$this->debuginfo .= 'IMAP search string used : '.$search;
|
||||||
if ($searchhead) {
|
if ($searchhead) {
|
||||||
$this->debuginfo .= '<br>Then search string into email header : '.$searchhead;
|
$this->debuginfo .= '<br>Then search string into email header : '.dol_escape_htmltag($searchhead);
|
||||||
|
}
|
||||||
|
if ($operationslog) {
|
||||||
|
$this->debuginfo .= $operationslog;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (empty($error) && empty($mode)) {
|
||||||
$this->datelastok = $now;
|
$this->datelastok = $now;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2815,11 +2873,14 @@ class EmailCollector extends CommonObject
|
|||||||
$this->lastresult .= "<br>".join("<br>", $this->errors);
|
$this->lastresult .= "<br>".join("<br>", $this->errors);
|
||||||
}
|
}
|
||||||
$this->codelastresult = ($error ? 'KO' : 'OK');
|
$this->codelastresult = ($error ? 'KO' : 'OK');
|
||||||
|
|
||||||
|
if (empty($mode)) {
|
||||||
$this->update($user);
|
$this->update($user);
|
||||||
|
}
|
||||||
|
|
||||||
dol_syslog("EmailCollector::doCollectOneCollector end", LOG_DEBUG);
|
dol_syslog("EmailCollector::doCollectOneCollector end", LOG_DEBUG);
|
||||||
|
|
||||||
return $error ?-1 : 1;
|
return $error ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2875,6 +2936,7 @@ class EmailCollector extends CommonObject
|
|||||||
2.2.1 text/plain
|
2.2.1 text/plain
|
||||||
2.2.2 text/html
|
2.2.2 text/html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sub function for getpart(). Only called by createPartArray() and itself.
|
* Sub function for getpart(). Only called by createPartArray() and itself.
|
||||||
*
|
*
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user