Merge remote-tracking branch 'upstream/develop' into adminbadgeextrafields

This commit is contained in:
Frédéric FRANCE 2022-09-21 13:41:40 +02:00
commit a8a745d95e
172 changed files with 2514 additions and 1835 deletions

View File

@ -2,10 +2,9 @@
# from Dolibarr GitHub repository.
# 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
dist: xenial
#dist: bionic
dist: bionic
language: php
@ -18,22 +17,43 @@ services:
- mysql
- 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:
# Force postgresql to 9.4 (the oldest availablable on xenial)
postgresql: '9.4'
# Force postgresql version
postgresql: '10'
apt:
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/
- pgdg-xenial
- sourceline: 'ppa:ondrej/php'
packages:
# We need a webserver to test the webservices
# Let's install Apache with.
- 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
- 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:
global:
# Set to true for very verbose output
@ -44,20 +64,20 @@ jobs:
#allow_failures:
#- php: nightly
include:
- stage: PHP 5.6-7.4
- stage: PHP 7.0-8.1
if: type = push
php: '5.6'
php: '7.1'
env: DB=postgresql
- stage: PHP 5.6-7.4
- stage: PHP 7.0-8.1
if: type = pull_request OR type = push
php: '7.4.22'
php: '8.1'
env: DB=mysql
- stage: PHP Dev
if: type = push AND branch = develop
php: nightly
env: DB=mysql
- stage: PHP Dev
if: type = push AND branch = 15.0
if: type = push AND branch = 17.0
php: nightly
env: DB=mysql
@ -72,13 +92,6 @@ notifications:
on_failure: always
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:
- |
@ -94,13 +107,6 @@ install:
- |
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
composer -n require phpunit/phpunit ^6 \
php-parallel-lint/php-parallel-lint ^1 \
@ -116,8 +122,8 @@ install:
squizlabs/php_codesniffer ^3
fi
# phpunit 9 is required for php 8
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \
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.5.20 \
php-parallel-lint/php-parallel-lint ^1.2 \
php-parallel-lint/php-console-highlighter ^0 \
php-parallel-lint/php-var-dump-check ~0.4 \
@ -246,6 +252,10 @@ before_script:
- 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
- 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
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
- 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
- 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
# configure apache virtual hosts
- 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
#cat $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:
- |
@ -479,16 +493,16 @@ after_success:
after_failure:
- |
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
# Upgrade log files
# This part of code is executed only if the command that fails are enclosed with set +e
# Show upgrade log files
for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
do
echo "Debugging informations for file $ficlog"
#cat $ficlog
done
# Apache log file
# Show Apache log file
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
# Dolibarr log file
echo "Debugging informations for file dolibarr.log (latest 50 lines)"

View File

@ -13,7 +13,7 @@ The Dolibarr images resources (available in the doc directory) is distributed un
The name Dolibarr is a trademark initially registered by Laurent Destailleur and ceased to the Dolibarr foundation. You can use the name Dolibarr
for your own need as long as you follow the rules defined on the page https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22
for your own need as long as you follow the rules defined on the page https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22
The use of the name DoliStore is also restricted to the same rules defined on https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22
@ -31,11 +31,11 @@ Mobiledetect 2.8.39 MIT License Yes
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
ParseDown 1.6 MIT License Yes Markdown parser
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
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
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
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)

View File

@ -7,6 +7,8 @@ English Dolibarr ChangeLog
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:
---------------
NEW: PHP 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
NEW: PHP 8.0 and 8.1 compatibility:
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.
NEW: Support for recurring purchase invoices.
NEW: #20292 Include German public holidays

View 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 =

View File

@ -8,21 +8,35 @@
enabled = true
port = http,https
filter = web-dolibarr-rulespassforgotten
logpath = >> /mypath/documents/documents/dolibarr.log
logpath = /mypath/documents/documents/dolibarr.log
action = %(action_mw)s
bantime = 4320000 ; 50 days
findtime = 86400 ; 1 day
maxretry = 10
[web-dol-bruteforce]
; rule against bruteforce hacking (login + api)
enabled = true
port = http,https
filter = web-dolibarr-rulesbruteforce
logpath = >> /mypath/documents/documents/dolibarr.log
logpath = /mypath/documents/documents/dolibarr.log
action = %(action_mw)s
bantime = 86400 ; 1 day
findtime = 3600 ; 1 hour
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

View File

@ -653,21 +653,28 @@ if (!empty($sortfield)) {
// Export into a file with format defined into setup (FEC, CSV, ...)
// Must be after definition of $sql
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));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
// Export files
// Export files then exit
$accountancyexport = new AccountancyExport($db);
$mimetype = $accountancyexport->getMimeType($formatexportset);
top_httphead($mimetype, 1);
// Output data on screen
$accountancyexport->export($object->lines, $formatexportset);
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
if (!empty($accountancyexport->errors)) {
setEventMessages('', $accountancyexport->errors, 'errors');
dol_print_error('', '', $accountancyexport->errors);
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
// Specify as export : update field date_export or date_validated
$error = 0;
@ -701,11 +708,10 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
if (!$error) {
$db->commit();
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
} else {
$error++;
$db->rollback();
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
dol_print_error('', $langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"));
}
}
exit;
@ -861,8 +867,8 @@ if ($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="sortfield" value="'.urlencode($sortfield).'">';
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
if (count($filter)) {
@ -883,7 +889,7 @@ if (empty($reshook)) {
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
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'));
@ -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 '</div>';
} 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>';
}
// Label operation
if (!empty($arrayfields['t.label_operation']['checked'])) {
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>';
}
// Debit
@ -1008,7 +1014,7 @@ if (!empty($arrayfields['t.credit']['checked'])) {
// Lettering code
if (!empty($arrayfields['t.lettering_code']['checked'])) {
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 '</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 ');
}
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'])) {
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'])) {
print_liste_field_titre($arrayfields['t.import_key']['label'], $_SERVER["PHP_SELF"], "t.import_key", "", $param, '', $sortfield, $sortorder, 'center ');

View File

@ -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
*

View File

@ -169,6 +169,16 @@ class BookKeeping extends CommonObject
*/
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
*/
@ -788,8 +798,7 @@ class BookKeeping extends CommonObject
$this->piece_num = $obj->piece_num;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_export = $this->db->jdate($obj->date_export);
$this->date_validation = $this->db->jdate($obj->date_validated);
$this->date_validation = $this->db->jdate($obj->date_validation);
$this->date_validation = isset($obj->date_validated) ? $this->db->jdate($obj->date_validated) : '';
}
$this->db->free($resql);

View File

@ -294,9 +294,7 @@ if ($action == 'writebookkeeping') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$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_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->fournisseur = 1;
@ -636,9 +634,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ($tabfac as $key => $val) {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$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_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->fournisseur = 1;
@ -767,7 +763,7 @@ if (empty($action) || $action == 'view') {
$periodlink = '';
$exportlink = '';
$builddate = dol_now();
$description .= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$description .= $langs->trans("DepositsAreNotIncluded");
} else {
@ -847,9 +843,7 @@ if (empty($action) || $action == 'view') {
foreach ($tabfac as $key => $val) {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$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_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->fournisseur = 1;

View File

@ -311,9 +311,7 @@ if ($action == 'writebookkeeping') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$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_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->client = 3;
$invoicestatic->id = $key;
@ -601,9 +599,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$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_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->client = 3;
$invoicestatic->id = $key;
@ -791,9 +787,7 @@ if (empty($action) || $action == 'view') {
$companystatic->id = $tabcompany[$key]['id'];
$companystatic->name = $tabcompany[$key]['name'];
$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_fournisseur = $tabcompany[$key]['code_fournisseur'];
$companystatic->client = 3;
$invoicestatic->id = $key;

View File

@ -1405,7 +1405,7 @@ class Adherent extends CommonObject
$this->email = $obj->email;
$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->statut = $obj->statut;

View File

@ -843,7 +843,7 @@ if (empty($reshook)) {
$_POST["accountancy_code_buy"] = ''; // If empty, we force to null
}
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];

View File

@ -146,6 +146,7 @@ if (GETPOST('addfilter', 'alpha')) {
$emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha');
$emailcollectorfilter->fk_emailcollector = $object->id;
$emailcollectorfilter->status = 1;
$result = $emailcollectorfilter->create($user);
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') {
dol_include_once('/emailcollector/class/emailcollector.class.php');
$res = $object->doCollectOneCollector();
$res = $object->doCollectOneCollector(0);
if ($res > 0) {
$debuginfo = $object->debuginfo;
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>';
// 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) {
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 {

View File

@ -143,7 +143,7 @@ if (!function_exists("ldap_connect")) {
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 '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';

View File

@ -117,7 +117,7 @@ if (!function_exists("ldap_connect")) {
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>';

View File

@ -191,7 +191,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
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 '<table class="noborder centpercent">';

View File

@ -109,7 +109,7 @@ if (!function_exists("ldap_connect")) {
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>';

View File

@ -180,7 +180,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
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>';
@ -501,9 +501,9 @@ if (function_exists("ldap_connect")) {
// 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")));
// 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('*', $conf->global->LDAP_USER_DN, $conf->global->LDAP_KEY_USERS, '', 1);
if (is_array($ldapusers)) {
$liste = array();
@ -526,7 +526,7 @@ if (function_exists("ldap_connect")) {
print "search: *<br>\n";
print "userDN: ".getDolGlobalString('LDAP_USER_DN')."<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 "\n<br>";
} else {

View File

@ -15,7 +15,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/**
@ -24,6 +23,7 @@
* \brief Setup page to configure oauth access api
*/
// Load Dolibarr environment
require '../main.inc.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
// Load translation files required by the page
$langs->loadLangs(array('admin', 'oauth'));
$langs->loadLangs(array('admin', 'oauth', 'modulebuilder'));
// Security check
if (!$user->admin) {
@ -85,7 +85,12 @@ if ($action == 'update') {
}
}
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++;
}
}
@ -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>';
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="action" value="add">';
@ -141,22 +146,16 @@ foreach ($list as $key) {
}
print '</select>';
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 '<br>';
print '<br>';
print dol_get_fiche_end();
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
foreach ($conf->global as $key => $val) {
@ -172,112 +171,144 @@ foreach ($conf->global as $key => $val) {
}
}
// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
foreach ($listinsetup as $key) {
$supported = 0;
$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
$keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
$keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
} else {
$keyforprovider = '';
}
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
$supported = 1;
}
if (!$supported) {
continue; // show only supported
}
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">';
$i++;
print '<div class="div-table-responsive-no-min">';
// Api Name
$label = $langs->trans($keyforsupportedoauth2array);
print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
print '<td>';
print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
if ($label == $keyforsupportedoauth2array) {
print $supportedoauth2array[$keyforsupportedoauth2array]['name'];
} else {
print $label;
}
if ($keyforprovider) {
print ' (<b>'.$keyforprovider.'</b>)';
} else {
print ' (<b>'.$langs->trans("NoName").'</b>)';
}
print '</td>';
print '<td>';
if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
}
print '</td>';
print '</tr>';
$i = 0;
if ($supported) {
$redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td><input style="width: 80%" type"text" name="uri'.$keyforsupportedoauth2array.'" value="'.$redirect_uri.'" disabled>';
print '</td></tr>';
if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') {
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("URLOfServiceForAuthorization").'</td>';
print '<td><input style="width: 80%" type"text" name="'.$key[3].'" value="'.getDolGlobalString($key[3]).'" >';
print '</td></tr>';
// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
foreach ($listinsetup as $key) {
$supported = 0;
$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
$keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
$keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array);
} else {
$keyforprovider = '';
}
} else {
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
print '</td></tr>';
}
$keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array);
$keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME';
// Api Id
print '<tr class="oddeven value">';
print '<td><label for="'.$key[1].'">'.$langs->trans("OAUTH_ID").'</label></td>';
print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.getDolGlobalString($key[1]).'">';
print '</td></tr>';
if (in_array($keyforsupportedoauth2array, array_keys($supportedoauth2array))) {
$supported = 1;
}
if (!$supported) {
continue; // show only supported
}
// Api Secret
print '<tr class="oddeven value">';
print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_SECRET").'</label></td>';
print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.getDolGlobalString($key[2]).'">';
print '</td></tr>';
$i++;
// TODO Move this into token generation
if ($supported) {
if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') {
print '<table class="noborder centpercent">';
// OAUTH service name
$label = $langs->trans($keyforsupportedoauth2array);
print '<tr class="liste_titre'.($i > 1 ? ' liste_titre_add' : '').'">';
print '<td class="titlefieldcreate">';
print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"');
if ($label == $keyforsupportedoauth2array) {
print $supportedoauth2array[$keyforsupportedoauth2array]['name'];
} else {
print $label;
}
if ($keyforprovider) {
print ' (<b>'.$keyforprovider.'</b>)';
} else {
print ' (<b>'.$langs->trans("NoName").'</b>)';
}
print '</td>';
print '<td>';
if (!empty($supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials'])) {
print $langs->trans("OAUTH_URL_FOR_CREDENTIAL", $supportedoauth2array[$keyforsupportedoauth2array]['urlforcredentials']);
}
print '</td>';
print '</tr>';
if ($supported) {
$redirect_uri = $urlwithroot.'/core/modules/oauth/'.$supportedoauth2array[$keyforsupportedoauth2array]['callbackfile'].'_oauthcallback.php';
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("Scopes").'</td>';
print '<td>';
print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td><input style="width: 80%" type"text" name="uri'.$keyforsupportedoauth2array.'" value="'.$redirect_uri.'" disabled>';
print '</td></tr>';
if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') {
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("URLOfServiceForAuthorization").'</td>';
print '<td><input style="width: 80%" type"text" name="'.$key[3].'" value="'.getDolGlobalString($key[3]).'" >';
print '</td></tr>';
}
} else {
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("Scopes").'</td>';
print '<td>';
//print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
print $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope'];
print '<td>'.$langs->trans("UseTheFollowingUrlAsRedirectURI").'</td>';
print '<td>'.$langs->trans("FeatureNotYetSupported").'</td>';
print '</td></tr>';
}
// Api Id
print '<tr class="oddeven value">';
print '<td><label for="'.$key[1].'">'.$langs->trans("OAUTH_ID").'</label></td>';
print '<td><input type="text" size="100" id="'.$key[1].'" name="'.$key[1].'" value="'.getDolGlobalString($key[1]).'">';
print '</td></tr>';
// Api Secret
print '<tr class="oddeven value">';
print '<td><label for="'.$key[2].'">'.$langs->trans("OAUTH_SECRET").'</label></td>';
print '<td><input type="password" size="100" id="'.$key[2].'" name="'.$key[2].'" value="'.getDolGlobalString($key[2]).'">';
print '</td></tr>';
// TODO Move this into token generation
if ($supported) {
if ($keyforsupportedoauth2array == 'OAUTH_OTHER_NAME') {
print '<tr class="oddeven value">';
print '<td>'.$langs->trans("Scopes").'</td>';
print '<td>';
print '<input style="width: 80%" type"text" name="'.$key[4].'" value="'.getDolGlobalString($key[4]).'" >';
print '</td></tr>';
} 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 '<td>'.$langs->trans("Scopes").'</td>';
print '<td>';
foreach ($scopestodispay as $scope => $val) {
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>';
}
} 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
llxFooter();
$db->close();

View File

@ -172,7 +172,7 @@ if ($mode == 'setup' && $user->admin) {
$OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : ''));
$shortscope = $supportedoauth2array[$keyforsupportedoauth2array]['defaultscope'];
$shortscope = '';
if (getDolGlobalString($key[4])) {
$shortscope = getDolGlobalString($key[4]);
}

View File

@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT');
print '</td></tr>';
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 '<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 '<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 '<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 '</table>';

View File

@ -163,6 +163,7 @@ class DolibarrApi
unset($object->statuts_short);
unset($object->statuts_logo);
unset($object->statuts_long);
//unset($object->labelStatus);
//unset($object->labelStatusShort);
@ -184,6 +185,7 @@ class DolibarrApi
unset($object->picto);
unset($object->fieldsforcombobox);
unset($object->regeximgext);
unset($object->skip_update_total);
unset($object->context);
@ -259,6 +261,11 @@ class DolibarrApi
if (!empty($object->thirdparty) && is_object($object->thirdparty)) {
$this->_cleanObjectDatas($object->thirdparty);
}
if (!empty($object->product) && is_object($object->product)) {
$this->_cleanObjectDatas($object->product);
}
return $object;
}

View File

@ -1320,12 +1320,19 @@ class BOM extends CommonObject
*/
public function calculateCosts()
{
global $conf;
global $conf, $hookmanager;
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$this->unit_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)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
@ -1369,16 +1376,14 @@ class BOM extends CommonObject
$unit = measuringUnitString($line->fk_unit, '', '', 1);
$qty = convertDurationtoHour($line->qty, $unit);
if ($conf->workstation->enabled) {
if ($tmpproduct->fk_default_workstation) {
$workstation = new Workstation($this->db);
$res = $workstation->fetch($tmpproduct->fk_default_workstation);
if ($conf->workstation->enabled && !empty($tmpproduct->fk_default_workstation)) {
$workstation = new Workstation($this->db);
$res = $workstation->fetch($tmpproduct->fk_default_workstation);
if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
else {
$this->error = $workstation->error;
if ($res > 0) $line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
else {
$this->error = $workstation->error;
return -3;
}
}
} else {
$line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT');

View File

@ -42,8 +42,12 @@ function printDropdownBookmarksList()
if (!empty($_SERVER["QUERY_STRING"])) {
if (is_array($_GET)) {
foreach ($_GET as $key => $val) {
if ($val != '') {
$url_param[$key]=http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val)));
if (is_array($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))
&& $val != ''
&& !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 : '');
if (!empty($url_param)) {
$url .= '&'.implode('&', $url_param);

View File

@ -1262,7 +1262,7 @@ class Propal extends CommonObject
break;
}
// Defined the new fk_parent_line
if ($result > 0) {
if ($result > 0 && $line->product_type == 9) {
$fk_parent_line = $result;
}
}

View File

@ -435,7 +435,7 @@ if (empty($reshook)) {
}
// Defined the new fk_parent_line
if ($result > 0) {
if ($result > 0 && $lines[$i]->product_type == 9) {
$fk_parent_line = $result;
}
}

View File

@ -1073,7 +1073,7 @@ class Commande extends CommonOrder
return -1;
}
// Defined the new fk_parent_line
if ($result > 0) {
if ($result > 0 && $line->product_type == 9) {
$fk_parent_line = $result;
}
}

View File

@ -4,6 +4,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
* 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
* it under the terms of the GNU General Public License as published by
@ -29,13 +30,16 @@
require '../../main.inc.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.'/user/class/user.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.'/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';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'bills', 'companies'));
$langs->loadLangs(array('banks', 'bills', 'categories', 'companies', 'salaries'));
// Security check
if (GETPOSTISSET("account") || GETPOSTISSET("ref")) {
@ -59,9 +63,12 @@ $hookmanager->initHooks(array('banktreso', 'globalcard'));
* View
*/
$societestatic = new Societe($db);
$userstatic = new User($db);
$facturestatic = new Facture($db);
$facturefournstatic = new FactureFournisseur($db);
$socialcontribstatic = new ChargeSociales($db);
$salarystatic = new Salary($db);
$vatstatic = new TVA($db);
$form = new Form($db);
@ -134,6 +141,27 @@ if (GETPOST("account") || GETPOST("ref")) {
$sql .= " ORDER BY dlr ASC";
$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
$parameters = array();
$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
}
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);
$reshook = $hookmanager->executeHooks('moreFamily', $parameters, $tmpobject, $action); // Note that $action and $tmpobject may have been modified by hook

View File

@ -1251,7 +1251,7 @@ if (empty($reshook)) {
$object->lines[] = $line; // insert new line in current object
// Defined the new fk_parent_line
if ($result > 0) {
if ($result > 0 && $line->product_type == 9) {
$fk_parent_line = $result;
}
}
@ -1772,7 +1772,7 @@ if (empty($reshook)) {
}
// Defined the new fk_parent_line
if ($result > 0) {
if ($result > 0 && $lines[$i]->product_type == 9) {
$fk_parent_line = $result;
}
}

View File

@ -872,7 +872,7 @@ class Facture extends CommonInvoice
);
// Defined the new fk_parent_line
if ($result > 0) {
if ($result > 0 && $newinvoiceline->product_type == 9) {
$fk_parent_line = $result;
}
}

View File

@ -71,9 +71,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
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-amount right">';
if ($user->rights->facture->lire) {
if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) {
$sign = 1;
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) {
$sign = -1;
}
if ($objectlink->statut != 3) {

View File

@ -454,9 +454,6 @@ class BonPrelevement extends CommonObject
dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error ".$this->error);
}
}
//var_dump($paiement->amounts);
//var_dump($thirdpartyid);
//var_dump($cursoramounts);
}
// Update withdrawal line
@ -1057,9 +1054,9 @@ class BonPrelevement extends CommonObject
$this->emetteur_iban = $account->iban;
$this->emetteur_bic = $account->bic;
$this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics);
$this->emetteur_ics = ($type == 'bank-transfer' ? $account->ics_transfer : $account->ics);
$this->raison_sociale = $account->proprio;
$this->raison_sociale = $account->proprio;
}
$this->factures = $factures_prev_id;
@ -2208,7 +2205,8 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' </CdtrSchmeId>'.$CrLf;*/
}
} 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;
}

View File

@ -286,8 +286,8 @@ if ($nb) {
if ($type != 'bank-transfer') {
print '<select name="format">';
print '<option value="FRST"'.(GETPOST('format', 'aZ09') == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>';
print '<option value="RCUR"'.(GETPOST('format', 'aZ09') == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>';
print '<option value="FRST"'.($format == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>';
print '<option value="RCUR"'.($format == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>';
print '</select>';
}
print '<input type="submit" class="butAction" value="'.$title.'"/>';

View File

@ -270,8 +270,8 @@ if ($result) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$cum_ht[$obj->dm] = !empty($obj->amount) ? $obj->amount : 0;
$cum[$obj->dm] = $obj->amount_ttc;
$cum_ht[$obj->dm] = empty($obj->amount) ? 0 : $obj->amount;
$cum[$obj->dm] = empty($obj->amount_ttc) ? 0 : $obj->amount_ttc;
if ($obj->amount_ttc) {
$minyearmonth = ($minyearmonth ? min($minyearmonth, $obj->dm) : $obj->dm);
$maxyearmonth = max($maxyearmonth, $obj->dm);
@ -303,7 +303,11 @@ if ($modecompta == 'RECETTES-DEPENSES') {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($result);
$cum[$obj->dm] += $obj->amount_ttc;
if (empty($cum[$obj->dm])) {
$cum[$obj->dm] = $obj->amount_ttc;
} else {
$cum[$obj->dm] += $obj->amount_ttc;
}
if ($obj->amount_ttc) {
$minyearmonth = ($minyearmonth ?min($minyearmonth, $obj->dm) : $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");
$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 ($modecompta == 'CREANCES-DETTES') {
// 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>";
// Percentage of month
print '<td class="borderrightlight right">';
print '<td class="borderrightlight right"><span class="opacitymedium">';
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
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)) {
print '<td width="15">&nbsp;</td>';

View File

@ -1068,7 +1068,7 @@ class Contact extends CommonObject
$this->phone_mobile = trim($obj->phone_mobile);
$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->priv = $obj->priv;
$this->mail = $obj->email;

View File

@ -8119,7 +8119,7 @@ abstract class CommonObject
switch ($mode) {
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;
case "create":
case "edit":

View File

@ -163,7 +163,7 @@ class DolEditor
$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)) {
$pluginstodisable .= ',scayt,wsc,find,undo';
}

View File

@ -1691,8 +1691,8 @@ class ExtraFields
if (!empty($obj->$field_toshow)) {
$translabel = $langs->trans($obj->$field_toshow);
}
if ($translabel != $field_toshow) {
$value .= dol_trunc($translabel, 18).' ';
if ($translabel != $obj->$field_toshow) {
$value .= dol_trunc($translabel, 24).' ';
} else {
$value .= $obj->$field_toshow.' ';
}

View File

@ -4886,7 +4886,7 @@ class Form
* @param string $action Action
* @param array $formquestion An array with forms complementary inputs
* @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 $width Force width of box
* @return void
@ -4919,7 +4919,7 @@ class Form
* 'type' can be 'text', 'password', 'checkbox', 'radio', 'date', 'select', 'multiselect', 'morecss',
* 'other', 'onecolumn' or 'hidden'...
* @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 $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.
@ -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 .= '
resizable: false,
height: "'.$height.'",
@ -5178,16 +5186,20 @@ class Form
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
});
}
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
if (pageyes.length > 0) {
// The call to urljump can be slow, so we set the wait cursor
jQuery("html,body,#id-container").addClass("cursorwait");
var post = $.post(
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "&") + options;
if (pageyes.length > 0) {';
if ($postconfirmas == 'GET') {
$formconfirm .= 'location.href = urljump;';
} else {
$formconfirm .= $jsforcursor;
$formconfirm .= 'var post = $.post(
pageyes,
options,
(data) => {$("body").html(data)}
);
console.log("after post");
function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); }
);';
}
$formconfirm .= '
console.log("after post ok");
}
$(this).dialog("close");
},
@ -5205,15 +5217,21 @@ class Form
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
});
}
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options;
var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "&") + options;
//alert(urljump);
if (pageno.length > 0) {
var post = $.post(
if (pageno.length > 0) {';
if ($postconfirmas == 'GET') {
$formconfirm .= 'location.href = urljump;';
} else {
$formconfirm .= $jsforcursor;
$formconfirm .= 'var post = $.post(
pageno,
options,
(data) => {$("body").html(data)}
);
console.log("after location.href");
function(data) { $("body").html(data); jQuery("html,body,#id-container").removeClass("cursorwait"); }
);';
}
$formconfirm .= '
console.log("after post ko");
}
$(this).dialog("close");
}

View File

@ -822,7 +822,7 @@ class FormMail extends Form
$out .= '<br></div>';
}
} 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) {
$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
}
// 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 />';
} else {
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
}
$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 {
$out .= $this->withfile;
@ -947,10 +947,13 @@ class FormMail extends Form
}
$out .= '<tr>';
$out .= '<td class="tdtop">';
$out .= '<td colspan="2">';
$out .= $form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');
$out .= '</td>';
$out .= '<td>';
$out .= '</tr>';
$out .= '<tr>';
$out .= '<td colspan="2">';
if ($this->withbodyreadonly) {
$out .= nl2br($defaultmessage);
$out .= '<input type="hidden" id="message" name="message" value="'.$defaultmessage.'" />';
@ -1202,8 +1205,8 @@ class FormMail extends Form
*/
public function getHtmlForDeliveryreceipt()
{
global $conf, $langs, $form;
$out = '<tr><td>'.$langs->trans("DeliveryReceipt").'</td><td>';
global $conf, $langs;
$out = '<tr><td><label for="deliveryreceipt">'.$langs->trans("DeliveryReceipt").'</label></td><td>';
if (!empty($this->withdeliveryreceiptreadonly)) {
$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') {
$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";
return $out;

View File

@ -73,6 +73,8 @@ class FormTicket
public $withfile;
public $withfilereadonly;
public $backtopage;
public $ispublic; // To show information or not into public form
public $withtitletopic;
@ -1363,6 +1365,7 @@ class FormTicket
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="'.$this->action.'">';
print '<input type="hidden" name="actionbis" value="add_message">';
print '<input type="hidden" name="backtopage" value="'.$this->backtopage.'">';
foreach ($this->param as $key => $value) {
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
}

View File

@ -263,6 +263,7 @@ class Ldap
if ($this->result) {
$this->bind = $this->result;
$connected = 2;
$this->connectedServer = $host;
break;
} else {
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
@ -275,6 +276,7 @@ class Ldap
if ($this->result) {
$this->bind = $this->result;
$connected = 2;
$this->connectedServer = $host;
break;
} else {
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
@ -287,6 +289,7 @@ class Ldap
if ($result) {
$this->bind = $this->result;
$connected = 1;
$this->connectedServer = $host;
break;
} else {
$this->error = ldap_errno($this->connection).' '.ldap_error($this->connection);
@ -297,10 +300,8 @@ class Ldap
if (!$connected) {
$this->unbind();
} else {
$this->connectedServer = $host;
}
}
} // End loop on each server
}
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
*
* @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 $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 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

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/db/Database.interface.php';
*/
abstract class DoliDB implements Database
{
/** @var bool|resource|SQLite3 Database handler */
/** @var bool|resource|SQLite3|PgSql\connection Database handler */
public $db;
/** @var string Database type */
public $type;

View File

@ -274,6 +274,9 @@ function getDefaultDatesForTransfer()
{
global $db, $conf;
$pastmonth = 0;
$pastmonthyear = 0;
// 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);
if ($periodbydefaultontransfer == 2) {

View File

@ -923,6 +923,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$search_status = 1; // always display active customer first
}
$search_rowid = GETPOST("search_rowid", 'int');
$search_name = GETPOST("search_name", 'alpha');
$search_address = GETPOST("search_address", '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);
$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),
'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),
@ -1012,6 +1014,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
// 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
$search_rowid = '';
$search_status = '';
$search_name = '';
$search_roles = array();
@ -1055,6 +1058,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
print "\n".'<table class="tagtable liste">'."\n";
$param = "socid=".urlencode($object->id);
if ($search_rowid != '') {
$param .= '&search_rowid='.urlencode($search_rowid);
}
if ($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 .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
$sql .= " WHERE t.fk_soc = ".((int) $object->id);
if ($search_rowid) {
$sql .= natural_search('t.rowid', $search_rowid);
}
if ($search_status != '' && $search_status != '-1') {
$sql .= " AND t.statut = ".((int) $search_status);
}
@ -1146,7 +1155,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
}
}
if ($showuserlogin) {
print '<td></td>';
print '<td class="liste_titre"></td>';
}
// Extra fields
$extrafieldsobjectkey = $contactstatic->table_element;
@ -1188,7 +1197,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
}
}
if ($showuserlogin) {
print '<td>'.$langs->trans("DolibarrLogin").'</td>';
print '<th class="wrapcolumntitle liste_titre">'.$langs->trans("DolibarrLogin").'</th>';
}
// Extra fields
$extrafieldsobjectkey = $contactstatic->table_element;

View File

@ -121,7 +121,9 @@ function getServerTimeZoneInt($refgmtdate = 'now')
function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0)
{
global $conf;
if ($duration_unit == 's') {
return $time + ($duration_value);
}
if ($duration_value == 0) {
return $time;
}

View File

@ -2992,10 +2992,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
// Wrapping for import module
$accessallowed = $user->rights->import->run;
$original_file = $conf->import->dir_temp.'/'.$original_file;
} elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_temp)) {
// Wrapping for recruitment module
$accessallowed = $user->rights->$modulepart->recruitmentjobposition->read;
$original_file = $conf->recruitment->dir_output .'/'. $original_file;
} elseif ($modulepart == 'recruitment' && !empty($conf->recruitment->dir_output)) {
// Wrapping for recruitment module
$accessallowed = $user->rights->recruitment->recruitmentjobposition->read;
$original_file = $conf->recruitment->dir_output.'/'.$original_file;
} elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) {
// Wrapping for wysiwyg editor
$accessallowed = 1;

View File

@ -470,6 +470,7 @@ function GETPOSTISARRAY($paramname, $method = 0)
* 'alphanohtml'=check there is no html content and no " and no ../
* 'aZ'=check it's a-z only
* '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)
* 'nohtml'=check there is no html content and no " and no ../
* '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)
{
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
if ($tmpsavdb) {
$object->db = $tmpsavdb;
}
} 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)
}
@ -3723,6 +3734,8 @@ function isValidMXRecord($domain)
return 0;
}
}
// function idn_to_ascii or checkdnsrr does not exists
return -1;
}
@ -4957,7 +4970,9 @@ function dol_print_error($db = '', $error = '', $errors = null)
// Return a http header with error code if possible
if (!headers_sent()) {
top_httphead();
if (function_exists('top_httphead')) { // In CLI context, the method does not exists
top_httphead();
}
http_response_code(500);
}

View File

@ -2655,7 +2655,7 @@ function getModuleDirForApiClass($moduleobject)
$moduledirforclass = 'fichinter';
} elseif ($moduleobject == 'mos') {
$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);
}

View File

@ -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)
$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)) {
$supportedoauth2array['OAUTH_STRIPE_TEST_NAME'] = array('callbackfile' => 'stripetest', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeTest', 'urlforcredentials'=>'', 'defaultscope'=>'read_write');
$supportedoauth2array['OAUTH_STRIPE_LIVE_NAME'] = array('callbackfile' => 'stripelive', 'picto' => 'stripe', 'urlforapp' => '', 'name'=>'StripeLive', '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'=>'', '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) {
$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');
}

View File

@ -471,7 +471,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
print '<div class="center paddingleft paddingright">'."\n";
if ($addformmessage) {
print '<!-- object = '.$object->element.' -->';
print '<!-- object = '.(empty($object) ? 'undefined' : $object->element).' -->';
print '<br>';
$parammessageform = 'ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix;
@ -482,7 +482,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0,
}
// 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;
if (!empty($conf->global->$parammessageform)) {
print $langs->transnoentities($conf->global->$parammessageform);

View File

@ -1644,7 +1644,17 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
//print $libelleproduitservice;
}
// Show information for lot
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';
foreach ($dbatch as $detail) {
$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('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);
}
} else {
if (getDolGlobalInt('PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) {
// TODO Show warehouse for shipment line without batch
}
}
// Now we convert \n into br

View File

@ -120,7 +120,7 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
{
global $dolibarr_main_instance_unique_id;
if ($chain === '') {
if ($chain === '' || is_null($chain)) {
return '';
}
@ -166,7 +166,7 @@ function dolDecrypt($chain, $key = '')
{
global $dolibarr_main_instance_unique_id;
if ($chain === '') {
if ($chain === '' || is_null($chain)) {
return '';
}

View File

@ -643,7 +643,7 @@ function showWebsiteTemplates(Website $website)
print '<br>';
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>';
$i++;

View File

@ -124,8 +124,8 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
if ($passok) {
$login = $obj->login;
} 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);
sleep(1); // Anti brut force protection. Must be same delay when login is not valid
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
@ -153,7 +153,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
}
} else {
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
$langs->loadLangs(array('main', 'errors'));

View File

@ -122,7 +122,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
print "DEBUG: User ".$usertotest." must change password<br>\n";
}
$ldap->unbind();
sleep(1);
sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid.
$langs->load('ldap');
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
return '';
@ -233,17 +233,19 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
$usertmp = new User($db);
$usertmp->fetch('', $login);
$ret = $mc->checkRight($usertmp->id, $entitytotest);
if ($ret < 0) {
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE);
$login = ''; // force authentication failure
if (is_object($mc)) {
$ret = $mc->checkRight($usertmp->id, $entitytotest);
if ($ret < 0) {
dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE);
$login = ''; // force authentication failure
}
unset($usertmp);
}
unset($usertmp);
}
}
if ($result == 1) {
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
$langs->loadLangs(array('main', 'other'));
@ -265,7 +267,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
$ldap->ldapErrorText = ldap_error($ldap->connection);
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
$langs->loadLangs(array('main', 'other', 'errors'));

View File

@ -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"',
'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
'loadLangs' => array(),
'loadLangs' => array("members"),
'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"',
'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
'loadLangs' => array("products"),
'loadLangs' => array("products", "stocks"),
'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"',
'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
'loadLangs' => array("holiday"),
'loadLangs' => array("hrm", "holiday"),
'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"',
'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
'loadLangs' => array("other"),
'loadLangs' => array("ticket", "knowledgemanagement"),
'submenus' => array(),
);

View File

@ -98,10 +98,10 @@ class CommActionRapport
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
$this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;

View File

@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Get source company
$this->emetteur = $mysoc;

View File

@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Retrieves transmitter
$this->emetteur = $mysoc;

View File

@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION

View File

@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -135,10 +135,10 @@ class pdf_merou extends ModelePdfExpedition
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = round($formatarray['height'] / 2);
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo

View File

@ -135,10 +135,10 @@ class pdf_rouget extends ModelePdfExpedition
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -119,10 +119,10 @@ class pdf_standard extends ModeleExpenseReport
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -155,10 +155,10 @@ class pdf_crabe extends ModelePDFFactures
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$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';
global $langs;
$langs->loadLangs(array('payment', 'paybox'));
$langs->loadLangs(array('payment', 'paybox', 'stripe'));
$servicename = $langs->transnoentities('Online');
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';

View File

@ -182,10 +182,10 @@ class pdf_sponge extends ModelePDFFactures
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -137,10 +137,10 @@ class pdf_soleil extends ModelePDFFicheinter
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION

View File

@ -217,7 +217,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
{
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)) {
$s .= '<option value="-1">'.$langs->trans("ProductOrService").'</option>';
} else {
@ -228,6 +228,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
}
$s .= '</select>';
$s .= ajax_combobox("filter_services_expired");
return $s;
}

View File

@ -1,8 +1,7 @@
<?php
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 SuperAdmin
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* 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");
// Used only if file README.md and README-LL.md not found.
$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'
$this->version = 'development';
// 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->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->langfiles = array("stocktransfer@stocktransfer");
$this->phpmin = array(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->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'...)

View File

@ -2,7 +2,6 @@
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* 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
* 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.
$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'
$this->version = 'development';
// Url to the file with your last numberversion of this module

View File

@ -116,10 +116,10 @@ class pdf_standard extends ModelePDFMovement
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display stock-service code

View File

@ -144,10 +144,10 @@ class pdf_vinci extends ModelePDFMo
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; //Available in several languages

View File

@ -89,10 +89,13 @@ if ($state) {
$requestedpermissionsarray = explode(',', $statewithscopeonly); // Example: 'userinfo_email,userinfo_profile,openid,email,profile,cloud_print'.
$statewithanticsrfonly = preg_replace('/^.*\-/', '', $state);
}
if ($action != 'delete' && empty($requestedpermissionsarray)) {
print 'Error, parameter state is not defined';
exit;
if ($action != 'delete' && (empty($statewithscopeonly) || empty($requestedpermissionsarray))) {
setEventMessages($langs->trans('ScopeUndefined'), null, 'errors');
header('Location: '.$backtourl);
exit();
}
//var_dump($requestedpermissionsarray);exit;

View File

@ -97,10 +97,10 @@ class pdf_standard extends ModelePDFProduct
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages

View File

@ -139,10 +139,10 @@ class pdf_baleine extends ModelePDFProjects
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -175,10 +175,10 @@ class pdf_beluga extends ModelePDFProjects
$this->page_hauteur = $formatarray['height'];
}
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -138,10 +138,10 @@ class pdf_timespent extends ModelePDFProjects
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -145,10 +145,10 @@ class pdf_azur extends ModelePDFPropales
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -148,10 +148,10 @@ class pdf_cyan extends ModelePDFPropales
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -54,10 +54,10 @@ class pdf_paiement
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->tab_top = 30;

View File

@ -57,10 +57,10 @@ class pdf_squille extends ModelePdfReception
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -111,10 +111,10 @@ class pdf_standard extends ModelePDFStock
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display product-service code

View File

@ -131,10 +131,10 @@ class pdf_eagle extends ModelePdfStockTransfer
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo

View File

@ -145,10 +145,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -141,10 +141,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -143,10 +143,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -143,10 +143,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -114,10 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments
$this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height'];
$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_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
$this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages

View File

@ -101,7 +101,7 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
if ($action == 'edit_extras') {
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
} 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);
}

View 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;
}
}

View File

@ -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/DolTimeDataCollector.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/DolQueryCollector.php');
dol_include_once('/debugbar/class/DataCollector/DolibarrCollector.php');
@ -36,6 +37,7 @@ class DolibarrDebugBar extends DebugBar
$this->addCollector(new DolRequestDataCollector());
//$this->addCollector(new DolConfigCollector()); // Disabled for security purpose
$this->addCollector(new DolTimeDataCollector());
$this->addCollector(new PhpCollector());
$this->addCollector(new DolMemoryCollector());
//$this->addCollector(new DolExceptionsCollector());
$this->addCollector(new DolQueryCollector());

View File

@ -973,7 +973,7 @@ class Delivery extends CommonObject
$sqlSourceLine .= ", p.ref, p.label";
$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 .= " 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);
if ($resultSourceLine) {
@ -986,12 +986,12 @@ class Delivery extends CommonObject
// Get lines of sources alread delivered
$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 .= " ".MAIN_DB_PREFIX.$this->linked_object[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']." as c";
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd";
$sql .= " WHERE ld.fk_delivery = l.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_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']);
$sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid";
$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 .= " GROUP BY ld.fk_origin_line";

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More