Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-10-28 11:42:51 +01:00
commit b27cbb5cd3
56 changed files with 419 additions and 704 deletions

View file

@ -37,7 +37,7 @@ cache:
jobs:
fast_finish: true
allow_failures:
- php: '8.3'
- php: '8.4'
include:
- stage: PHP min and max
if: type = push
@ -94,6 +94,9 @@ before_install:
if [ "$TRAVIS_PHP_VERSION" = '8.3' ]; then
sudo apt install unzip apache2 php8.3 php8.3-cli php8.3-curl php8.3-mysql php8.3-pgsql php8.3-gd php8.3-imap php8.3-intl php8.3-ldap php8.3-xml php8.3-mbstring php8.3-xml php8.3-zip libapache2-mod-php8.3
fi
if [ "$TRAVIS_PHP_VERSION" = '8.4' ]; then
sudo apt install unzip apache2 php8.4 php8.4-cli php8.4-curl php8.4-mysql php8.4-pgsql php8.4-gd php8.4-imap php8.4-intl php8.4-ldap php8.4-xml php8.4-mbstring php8.4-xml php8.4-zip libapache2-mod-php8.4
fi
- |
echo Install pgsql if run is for pgsql
@ -164,7 +167,7 @@ install:
squizlabs/php_codesniffer ^3
fi
# phpunit 9 is required for php 8
if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = '8.3' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = '8.3' ] || [ "$TRAVIS_PHP_VERSION" = '8.4' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
sudo composer self-update 2.4.4
composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \
php-parallel-lint/php-parallel-lint ^1.2 \
@ -354,6 +357,13 @@ script:
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --exclude htdocs/includes/webklex --blame .
fi
if [ "$TRAVIS_PHP_VERSION" = "8.4" ]; then
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --exclude htdocs/includes/webklex --blame .
fi
set +e
echo
@ -373,6 +383,9 @@ script:
if [ "$TRAVIS_PHP_VERSION" = "8.3" ]; then
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --severity=1 ${CACHE_OPT} --runtime-set ignore_warnings_on_exit true .;
fi
if [ "$TRAVIS_PHP_VERSION" = "8.4" ]; then
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --severity=1 ${CACHE_OPT} --runtime-set ignore_warnings_on_exit true .;
fi
set +e
echo
@ -391,6 +404,9 @@ script:
if [ "$TRAVIS_PHP_VERSION" = "8.3" ]; then
var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php .
fi
if [ "$TRAVIS_PHP_VERSION" = "8.4" ]; then
var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php .
fi
set +e
echo

View file

@ -562,12 +562,11 @@ a:hover {
<ul class="tools">
<li><a target="_blank" href="index.php?phpinfo=1">Phpinfo</a></li>
<li><a target="_blank" href="server-status">Server-status</a></li>
<li><a target="_blank" href="/dolibarr/support/index.php">{$langues[$langue]['askhelp']}</a></li>
</ul>
<ul id="foot">
<li><a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp project</a> was built from modified sources of <a href="http://www.wampserver.com">WampServer project</a> from Anaska</li>
<li>DoliWamp package was built from modified sources of <a href="http://www.wampserver.com">WampServer project</a> from Anaska</li>
</ul>
</body>
</html>

View file

@ -75,14 +75,16 @@ git commit -a -m "My message" --no-verify
```
If you want to skip certain checks for whatever reason, you can set the SKIP
environment variable:
environment variable into the .git/hooks/pre-commit file:
```bash
SKIP=no-commit-to-branch git commit -a -m "My message"
export SKIP=no-commit-to-branch
```
or
You can also switch output to text only, by setting the PRE_COMMIT_COLOR in .git/hooks/pre-commit file:
export SKIP=no-commit-to-branch # In your .bashrc or session.
```bash
export PRE_COMMIT_COLOR=never
```
There is much more you can do with pre-commit, check out its

View file

@ -666,10 +666,12 @@ if ($mode == 'login') {
print '</td></tr>';
// Hide helpcenter link on login page
/*
print '<tr class="oddeven"><td>' . $langs->trans("DisableLinkToHelpCenter") . '</td><td>';
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0, 0, 0, '', 'login');
print '</td>';
print '</tr>';
*/
// Message on login page
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));

View file

@ -105,7 +105,7 @@ print "<br>\n";
// Load array with all captcha generation modules
$dir = "../core/modules/security/captcha";
$dir = DOL_DOCUMENT_ROOT."/core/modules/security/captcha";
clearstatcache();
$handle = opendir($dir);
$i = 1;
@ -142,23 +142,41 @@ print '<br>';
print $langs->trans("UseCaptchaCode");
if (function_exists("imagecreatefrompng")) {
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA', array(), null, 0, 0, 1);
} else {
if (!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA', array(), null, 0, 0, 1);
} else {
$desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
print $desc;
if (!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
if (isModEnabled('ticket')) {
print '<br>';
print $langs->trans("TicketUseCaptchaCodeHelp");
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET', array(), null, 0, 0, 1);
} else {
if (!getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA_TICKET&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
}
$showavailablecaptcha = 0;
if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
$showavailablecaptcha = 1;
}
if (isModEnabled('ticket') && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
$showavailablecaptcha = 1;
}
$selectedcaptcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard');
if ($showavailablecaptcha) {
print '<br>';
print '<br>';
print '<br>';
@ -171,13 +189,6 @@ if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
print '<td class="right" width="100">'.$langs->trans("Status").'</td>';
print '</tr>';
$arrayofcaptcha = array(
'standard' => array('label' => 'Standard', 'picto' => 'ee')
);
//$arrayofcaptcha['google'] = array('label' => 'Google');
$selectedcaptcha = 'standard';
// Loop on each available captcha
foreach ($arrayhandler as $key => $module) {
print '<tr class="oddeven">';
@ -192,9 +203,22 @@ if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
print $module->getExample().'<br>';
print '</td>';
print '<td class="right" width="100">';
if ($key == $selectedcaptcha) {
print 'On';
if (function_exists("imagecreatefrompng")) {
if ($key != $selectedcaptcha) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=enabledcaptchahandler&token='.newToken().'&handler=standard"><input type="checkbox"></a>';
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=disablecaptchahandler&token='.newToken().'&handler=standard"><input type="checkbox" checked="checked"';
if (count($arrayhandler) <= 1) {
print 'disabled="disabled"';
}
print '></a>';
}
} else {
$desc = $form->textwithpicto('', $langs->transnoentities("EnableGDLibraryDesc"), 1, 'warning');
print $desc;
}
print '</td>';
print '</tr>';
}

View file

@ -146,16 +146,6 @@ print '</div>';
print '</div><div class="fichehalfright">';
print '<div class="divsection wordwrap">';
print $langs->trans("HelpCenter").':';
print '<ul>';
print '<li>';
//print $langs->trans("SeeWikiPage",'http://wiki.dolibarr.org/index.php/List_of_OpenSource_Software_companies_and_freelancers');
print '<a target="_blank" rel="noopener noreferrer external" href="'.DOL_URL_ROOT.'/support/index.php" data-ajax="false">'.$langs->trans("HelpCenter").'</a>';
print '</li>';
print '</ul>';
print '</div>';
print '<div class="divsection wordwrap">';
print $langs->trans("Foundation").':';
@ -176,7 +166,7 @@ print $langs->trans("SocialNetworks").':';
print '<ul>';
print '<li><a href="https://wiki.dolibarr.org/index.php?title=Social_Networksr" target="_blank" rel="noopener noreferrer external">See wiki</a></li>';
print '<li><a href="https://wiki.dolibarr.org/index.php?title=Social_Networks" target="_blank" rel="noopener noreferrer external">See wiki</a></li>';
print '</ul>';
print '</div>';

View file

@ -631,7 +631,7 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswers
print '</td>';
print '</tr>';
print '</table><br>';
print '</table>';
print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition');

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Jose <jose.martinez@pichinov.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
@ -84,9 +85,9 @@ class AssetDepreciationOptions extends CommonObject
'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,),
'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("economic")',),
'accelerated_depreciation_option' => array('type' => 'boolean', 'label' => 'AssetDepreciationOptionAcceleratedDepreciation', 'enabled' => 1, 'position' => 60, 'column_break' => true, 'notnull' => 0, 'default' => '0', 'visible' => 1, 'validate' => 1,),
'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1,),
'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 110, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1,),
'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 110, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
),
),
'accelerated_depreciation' => array(
@ -99,9 +100,9 @@ class AssetDepreciationOptions extends CommonObject
'duration' => array('type' => 'integer', 'label' => 'AssetDepreciationOptionDuration', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'duration_type' => array('type' => 'smallint', 'label' => 'AssetDepreciationOptionDurationType', 'enabled' => 1, 'position' => 40, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'arrayofkeyval' => array(0 => 'AssetDepreciationOptionDurationTypeAnnual', 1 => 'AssetDepreciationOptionDurationTypeMonthly'/*, '2'=>'AssetDepreciationOptionDurationTypeDaily'*/), 'validate' => 1,),
'rate' => array('type' => 'double(24,8)', 'label' => 'AssetDepreciationOptionRate', 'enabled' => 1, 'position' => 50, 'visible' => 3, 'default' => '0', 'isameasure' => 1, 'validate' => 1, 'computed' => '$object->asset_depreciation_options->getRate("accelerated_depreciation")',),
'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 80, 'column_break' => true, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1,),
'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object)&&get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'amount_base_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDepreciationHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 80, 'column_break' => true, 'notnull' => 0, 'required' => 1, 'visible' => 1, 'default' => '$object->reversal_amount_ht > 0 ? $object->reversal_amount_ht : $object->acquisition_value_ht', 'isameasure' => 1, 'validate' => 1,),
'amount_base_deductible_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionAmountBaseDeductibleHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 90, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
'total_amount_last_depreciation_ht' => array('type' => 'price', 'label' => 'AssetDepreciationOptionTotalAmountLastDepreciationHT', 'enabled' => 'isset($object) && get_class($object)=="Asset"', 'only_on_asset' => 1, 'position' => 100, 'noteditable' => 1, 'notnull' => 0, 'visible' => 1, 'default' => '0', 'isameasure' => 1, 'validate' => 1,),
),
),
);

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
/* Copyright (C) 2021 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 José <jose.martinez@pichinov.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
@ -137,7 +138,7 @@ if (empty($reshook)) {
}
$value = GETPOSTISSET($html_name) ? GETPOST($html_name, $check) : $assetdepreciationoptions->$field_key;
} elseif ($field_info['type'] == 'price') {
$value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name)) : ($assetdepreciationoptions->$field_key ? price2num($assetdepreciationoptions->$field_key) : (!empty($field_info['default']) ? $field_info['default'] : 0));
$value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name)) : ($assetdepreciationoptions->$field_key ? price2num($assetdepreciationoptions->$field_key) : (!empty($field_info['default']) ? dol_eval($field_info['default'], 1) : 0));
} elseif ($field_key == 'lang') {
$value = GETPOSTISSET($html_name) ? GETPOST($html_name, 'aZ09') : $assetdepreciationoptions->lang;
} else {

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2017-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
@ -372,7 +372,7 @@ if (($id || $ref) && $action == 'edit') {
print dol_get_fiche_end();
print $form->buttonsSaveCancel("Create");
print $form->buttonsSaveCancel("Update");
print '</form>';
}

View file

@ -1395,8 +1395,8 @@ if (empty($reshook)) {
}
// Local Taxes
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $tva_npr);
$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
// Margin
$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : '');

View file

@ -1331,6 +1331,15 @@ if (empty($reshook)) {
$action = 'editline';
}
$object->loadExpeditions();
if (isset($object->expeditions[GETPOST('lineid', 'int')])) {
if ($qty < $object->expeditions[GETPOST('lineid', 'int')]) {
setEventMessages($langs->trans('ErrorQtyOrderedLessQtyShipped'), null, 'errors');
$error++;
$action = 'editline';
}
}
if (!$error) {
if (!$user->hasRight('margins', 'creer')) {
foreach ($object->lines as &$line) {
@ -3015,7 +3024,7 @@ if ($action == 'create' && $usercancreate) {
}
}
// Edit
if ($object->statut == Commande::STATUS_VALIDATED && $usercancreate) {
if (($object->statut == Commande::STATUS_VALIDATED || ($object->statut == Commande::STATUS_SHIPMENTONPROCESS && getDolGlobalString('EDIT_ORDER_SHIPMENT_ON_PROCESS'))) && $usercancreate) {
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&amp;token='.newToken().'&amp;id='.$object->id, '');
}

View file

@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
@ -39,6 +39,11 @@ class ChargeSociales extends CommonObject
*/
public $element = 'chargesociales';
/**
* @var string Name of table without prefix where object is stored
* @deprecated Use $table_element
* @see $table_element
*/
public $table = 'chargesociales';
/**
@ -65,18 +70,22 @@ class ChargeSociales extends CommonObject
* @var string label
*/
public $label;
/**
* @var int
*/
public $type;
/**
* @var string
*/
public $type_label;
/**
* @var string
*/
public $type_code;
/**
* @var string
*/
@ -86,15 +95,18 @@ class ChargeSociales extends CommonObject
* @var int|string
*/
public $amount;
/**
* @var int<0,1>
*/
public $paye;
/**
* @deprecated Use $period
* @var int|string
*/
public $periode;
/**
* @var int|string
*/
@ -102,7 +114,7 @@ class ChargeSociales extends CommonObject
/**
* @var string
* @deprecated Use label instead
* @deprecated Use $label instead
*/
public $lib;
@ -125,10 +137,12 @@ class ChargeSociales extends CommonObject
* @var int ID
*/
public $mode_reglement_id;
/**
* @var string
*/
public $mode_reglement_code;
/**
* @var string
*/
@ -154,8 +168,14 @@ class ChargeSociales extends CommonObject
*/
public $totalpaid;
/**
* @var int
*/
const STATUS_UNPAID = 0;
/**
* @var int
*/
const STATUS_PAID = 1;

View file

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2017-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2017-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -312,7 +313,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
}
$object->$key = $value;
if ($val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) {
if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors');
}

View file

@ -5236,6 +5236,10 @@ abstract class CommonObject
}
$extrafields->fetch_name_optionals_label($this->table_element_line);
if (method_exists($this, 'loadExpeditions')) {
$this->loadExpeditions();
}
$parameters = array('num' => $num, 'dateSelector' => $dateSelector, 'seller' => $seller, 'buyer' => $buyer, 'selected' => $selected, 'table_element_line' => $this->table_element_line);
$reshook = $hookmanager->executeHooks('printObjectLineTitle', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
@ -5365,6 +5369,13 @@ abstract class CommonObject
// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
// Note: This is deprecated. If you need to overwrite the tpl file, use instead the hook printObjectLine and printObjectSubLine.
$qty_shipped = 0;
if (isset($this->expeditions[$line->id])) {
$qty_shipped = $this->expeditions[$line->id];
}
$disableedit = $qty_shipped >= $line->qty;
$dirtpls = array_merge($conf->modules_parts['tpl'], array($defaulttpldir));
foreach ($dirtpls as $module => $reldir) {
$res = 0;

View file

@ -7,7 +7,7 @@
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2023 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
*
* This program is free software; you can redistribute it and/or modify
@ -244,10 +244,12 @@ class FormMail extends Form
* @var array<string,string>
*/
public $substit = array();
/**
* @var string[]
* @var array<int,array<string,string>>
*/
public $substit_lines = array();
/**
* @var array{}|array{models:string,langsmodels?:string,fileinit?:string[],returnurl:string}
*/

View file

@ -569,16 +569,37 @@ class FormTicket
$doleditor->Create();
print '</td></tr>';
$captcha = '';
if ($public && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
print '<tr><td class="titlefield">';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
print '<tr><td class="titlefield"><label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>';
print '<span class="span-icon-security inline-block">';
print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" />';
print '</span>';
print '<span class="nowrap inline-block">';
print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
print '<a class="inline-block valignmiddle" href="" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>';
print '</span>';
$captcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard');
$classfile = DOL_DOCUMENT_ROOT."/core/modules/security/captcha/modCaptcha".ucfirst($captcha).'.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$captchaobj = null;
if (dol_is_file($classfile)) {
// Charging the numbering class
$classname = "modCaptcha".ucfirst($captcha);
require_once $classfile;
$captchaobj = new $classname($this->db, $conf, $langs, $user);
}
if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) {
// TODO: get this code using a method of captcha
} else {
print '<label for="email"><span class="fieldrequired">'.$langs->trans("SecurityCode").'</span></label></td><td>';
print '<span class="span-icon-security inline-block">';
print '<input id="securitycode" placeholder="'.$langs->trans("SecurityCode").'" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" />';
print '</span>';
print '<span class="nowrap inline-block">';
print '<img class="inline-block valignmiddle" src="'.DOL_URL_ROOT.'/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />';
print '<a class="inline-block valignmiddle" href="" tabindex="4" data-role="button">'.img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"').'</a>';
print '</span>';
}
print '</td></tr>';
}

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -28,10 +28,9 @@
/**
* Prepare array with list of different ecm main dashboard
*
* @param object $object Object related to tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_prepare_dasboard_head($object)
function ecm_prepare_dasboard_head()
{
global $langs, $conf, $user, $form;
@ -73,9 +72,9 @@ function ecm_prepare_dasboard_head($object)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ecm');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm', 'remove');
complete_head_from_modules($conf, $langs, null, $head, $h, 'ecm', 'remove');
return $head;
}
@ -84,9 +83,9 @@ function ecm_prepare_dasboard_head($object)
/**
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @param string $module Module
* @param string $section Section
* @param EcmDirectory $object Object related to tabs
* @param string $module Module
* @param string $section Section
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_prepare_head($object, $module = 'ecm', $section = '')
@ -113,12 +112,12 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '')
/**
* Prepare array with list of tabs
*
* @param Object $object Object related to tabs
* @param EcmFiles $object Object related to tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_file_prepare_head($object)
{
global $langs, $conf, $user;
global $langs;
$h = 0;
$head = array();
@ -149,7 +148,7 @@ function ecm_file_prepare_head($object)
/**
* Prepare array with list of tabs
*
* @param object $object Object related to tabs
* @param EcmDirectory $object Object related to tabs
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
*/
function ecm_prepare_head_fm($object)

View file

@ -271,22 +271,20 @@ if (!function_exists('dol_loginfunction')) {
}
// Security graphical code
$captcha = 0;
$captcha_refresh = '';
if (function_exists("imagecreatefrompng") && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
$captcha = 1;
$captcha_refresh = img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"');
$captcha = '';
if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
$captcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard');
}
// Extra link
$forgetpasslink = 0;
$helpcenterlink = 0;
if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK') || !getDolGlobalString('MAIN_HELPCENTER_DISABLELINK')) {
if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK') || getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE')) {
if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
$forgetpasslink = 1;
}
if (!getDolGlobalString('MAIN_HELPCENTER_DISABLELINK')) {
if (getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE')) {
$helpcenterlink = 1;
}
}

View file

@ -1191,7 +1191,6 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$newmenu->add('/admin/system/modules.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('Modules'), 2);
$newmenu->add('/admin/triggers.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('Triggers'), 2);
$newmenu->add('/admin/system/filecheck.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('FileCheck'), 2);
$newmenu->add('/admin/system/about.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('ExternalResources'), 2);
}
$newmenu->add('/admin/system/browser.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoBrowser'), 1);
$newmenu->add('/admin/system/os.php?mainmenu=home&amp;leftmenu=admintools', $langs->trans('InfoOS'), 1);
@ -1206,6 +1205,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
$newmenu->add("/admin/tools/dolibarr_import.php?mainmenu=home&amp;leftmenu=admintools", $langs->trans("Restore"), 1);
$newmenu->add("/admin/tools/update.php?mainmenu=home&amp;leftmenu=admintools", $langs->trans("MenuUpgrade"), 1);
$newmenu->add("/admin/tools/purge.php?mainmenu=home&amp;leftmenu=admintools", $langs->trans("Purge"), 1);
$newmenu->add('/admin/system/about.php?mainmenu=home&amp;leftmenu=admintools_info', $langs->trans('ExternalResources'), 1);
/* Already into menu Tools
if (isModEnabled('blockedlog')) {

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2022 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2009-2015 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -41,14 +41,13 @@ if ($size > 10000) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
'
@phan-var-force string $captcha_refresh
@phan-var-force string $captcha
@phan-var-force int<0,1> $dol_hide_leftmenu
@phan-var-force int<0,1> $dol_hide_topmenu
@phan-var-force int<0,1> $dol_no_mouse_hover
@phan-var-force int<0,1> $dol_optimize_smallscreen
@phan-var-force int<0,1> $dol_use_jmobile
@phan-var-force string $focus_element
@phan-var-force string $helpcenterlink
@phan-var-force string $login
@phan-var-force string $main_authentication
@phan-var-force string $main_home
@ -58,7 +57,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@phan-var-force string $urllogo
@phan-var-force int<0,1> $forgetpasslink
@phan-var-force int<0,1> $helpcenterlink
';
@ -150,6 +148,7 @@ if (getDolGlobalInt('MAIN_MODULE_OPENIDCONNECT', 0) > 0 && isset($conf->file->ma
top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
$helpcenterlink = getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE');
$colorbackhmenu1 = '60,70,100'; // topmenu
if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
@ -279,7 +278,22 @@ if (!empty($captcha)) {
} else {
$php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
}
// TODO: provide accessible captcha variants?>
$classfile = DOL_DOCUMENT_ROOT."/core/modules/security/captcha/modCaptcha".ucfirst($captcha).'.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$captchaobj = null;
if (dol_is_file($classfile)) {
// Charging the numbering class
$classname = "modCaptcha".ucfirst($captcha);
require_once $classfile;
$captchaobj = new $classname($db, $conf, $langs, $user);
}
if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) {
// TODO: get this code using a method of captcha
} else {
?>
<!-- Captcha -->
<div class="trinputlogin">
<div class="tagtd none valignmiddle tdinputlogin nowrap">
@ -290,11 +304,13 @@ if (!empty($captcha)) {
</span>
<span class="nowrap inline-block">
<img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo $captcha_refresh; ?></a>
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4" data-role="button"><?php echo img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"'); ?></a>
</span>
</div></div>
<?php
</div>
</div>
<?php
}
}
if (!empty($morelogincontent)) {
@ -369,11 +385,7 @@ if ($forgetpasslink || $helpcenterlink) {
}
if ($helpcenterlink) {
$url = DOL_URL_ROOT.'/support/index.php'.$moreparam;
if (getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE')) {
$url = getDolGlobalString('MAIN_HELPCENTER_LINKTOUSE');
}
echo '<a class="alogin" href="'.dol_escape_htmltag($url).'" target="_blank" rel="noopener noreferrer">';
echo '<a class="alogin" href="'.dol_escape_htmltag($helpcenterlink).'" target="_blank" rel="noopener noreferrer">';
echo $langs->trans('NeedHelpCenter');
echo '</a>';
}

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2009-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -17,6 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Page to ask email for password forgotten
if (!defined('NOBROWSERNOTIF')) {
define('NOBROWSERNOTIF', 1);
}
@ -164,7 +166,22 @@ if (!empty($captcha)) {
} else {
$php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
}
// TODO: provide accessible captcha variants?>
$classfile = DOL_DOCUMENT_ROOT."/core/modules/security/captcha/modCaptcha".ucfirst($captcha).'.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$captchaobj = null;
if (dol_is_file($classfile)) {
// Charging the numbering class
$classname = "modCaptcha".ucfirst($captcha);
require_once $classfile;
$captchaobj = new $classname($db, $conf, $langs, $user);
}
if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) {
// TODO: get this code using a method of captcha
} else {
?>
<!-- Captcha -->
<div class="trinputlogin">
<div class="tagtd tdinputlogin nowrap none valignmiddle">
@ -175,11 +192,13 @@ if (!empty($captcha)) {
</span>
<span class="nowrap inline-block">
<img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a>
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4"><?php echo img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"'); ?></a>
</span>
</div></div>
<?php
</div>
</div>
<?php
}
}
if (!empty($morelogincontent)) {

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -196,7 +196,6 @@ if (!empty($disablenofollow)) {
<?php
$captcha = 0;
if (!empty($captcha)) {
// Add a variable param to force not using cache (jmobile)
$php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
@ -205,7 +204,22 @@ if (!empty($captcha)) {
} else {
$php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
}
// TODO: provide accessible captcha variants?>
$classfile = DOL_DOCUMENT_ROOT."/core/modules/security/captcha/modCaptcha".ucfirst($captcha).'.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$captchaobj = null;
if (dol_is_file($classfile)) {
// Charging the numbering class
$classname = "modCaptcha".ucfirst($captcha);
require_once $classfile;
$captchaobj = new $classname($db, $conf, $langs, $user);
}
if (is_object($captchaobj) && method_exists($captchaobj, 'getCaptchaCodeForForm')) {
// TODO: get this code using a method of captcha
} else {
?>
<!-- Captcha -->
<div class="trinputlogin">
<div class="tagtd tdinputlogin nowrap none valignmiddle">
@ -216,11 +230,13 @@ if (!empty($captcha)) {
</span>
<span class="nowrap inline-block">
<img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a>
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4"><?php echo img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"'); ?></a>
</span>
</div></div>
<?php
</div>
</div>
<?php
}
}
if (!empty($morelogincontent)) {

View file

@ -334,7 +334,7 @@ $moreheadjs .= '</script>'."\n";
llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', '', 'mod-ecm page-index');
$head = ecm_prepare_dasboard_head(null);
$head = ecm_prepare_dasboard_head();
print dol_get_fiche_head($head, 'index', '', -1, '');

View file

@ -409,7 +409,7 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) {
}
}
$head = ecm_prepare_dasboard_head(null);
$head = ecm_prepare_dasboard_head();
print dol_get_fiche_head($head, 'index_auto', '', -1, '');

View file

@ -304,7 +304,7 @@ $moreheadjs .= '</script>'."\n";
llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', 0, 0, $morejs, '', '', 'mod-ecm page-index_medias');
$head = ecm_prepare_dasboard_head(null);
$head = ecm_prepare_dasboard_head();
print dol_get_fiche_head($head, 'index_medias', '', -1, '');

View file

@ -55,6 +55,7 @@ DROP TABLE llx_contratdet_log;
ALTER TABLE llx_societe_rib MODIFY COLUMN iban_prefix varchar(60);
ALTER TABLE llx_bom_bom ADD COLUMN last_main_doc varchar(255) AFTER model_pdf;
-- add billable attribute to project task
ALTER TABLE llx_projet_task ADD COLUMN billable smallint DEFAULT 1;

View file

@ -37,6 +37,7 @@ CREATE TABLE llx_bom_bom(
fk_user_valid integer,
import_key varchar(14),
model_pdf varchar(255),
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
status integer NOT NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;

View file

@ -1,5 +1,5 @@
-- ===================================================================
-- Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
-- Copyright (C) 2020 Frédéric France <frederic.france@free.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

View file

@ -1,5 +1,5 @@
-- ========================================================================
-- Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
-- Copyright (C) 2020 Frédéric France <frederic.france@free.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
@ -23,4 +23,3 @@ CREATE TABLE llx_ecm_directories_extrafields
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View file

@ -1,5 +1,5 @@
-- ===================================================================
-- Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
-- Copyright (C) 2020 Frédéric France <frederic.france@free.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

View file

@ -1,5 +1,5 @@
-- ========================================================================
-- Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
-- Copyright (C) 2020 Frédéric France <frederic.france@free.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
@ -23,4 +23,3 @@ CREATE TABLE llx_ecm_files_extrafields
fk_object integer NOT NULL,
import_key varchar(14) -- import key
) ENGINE=innodb;

View file

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software: you can redistribute it and/or modify

View file

@ -343,6 +343,7 @@ ErrorEndHourIsNull=End date field cannot be empty
ErrorStartHourIsNull=Start date field cannot be empty
ErrorTooManyLinesToProcessPleaseUseAMoreSelectiveFilter=Too many lines to process. Please use a more selective filter.
ErrorEmptyValueForQty=Quantity cannot be zero.
ErrorQtyOrderedLessQtyShipped = The quantity ordered cannot be less than the quantity shipped.
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
@ -108,8 +108,8 @@ if (empty($reshook)) {
if (!$cancel) {
$datestart = dol_mktime(12, 0, 0, GETPOSTINT('startmonth'), GETPOSTINT('startday'), GETPOSTINT('startyear'));
$dateend = dol_mktime(12, 0, 0, GETPOSTINT('endmonth'), GETPOSTINT('endday'), GETPOSTINT('endyear'));
$capital = price2num(GETPOST('capital'));
$rate = price2num(GETPOST('rate'));
$capital = (float) price2num(GETPOST('capital'));
$rate = (float) price2num(GETPOST('rate'));
if (!$capital) {
$error++;
@ -138,7 +138,7 @@ if (empty($reshook)) {
$object->capital = $capital;
$object->datestart = $datestart;
$object->dateend = $dateend;
$object->nbterm = GETPOST('nbterm');
$object->nbterm = (float) price2num(GETPOST('nbterm'));
$object->rate = $rate;
$object->note_private = GETPOST('note_private', 'restricthtml');
$object->note_public = GETPOST('note_public', 'restricthtml');
@ -183,7 +183,7 @@ if (empty($reshook)) {
$datestart = dol_mktime(12, 0, 0, GETPOSTINT('startmonth'), GETPOSTINT('startday'), GETPOSTINT('startyear'));
$dateend = dol_mktime(12, 0, 0, GETPOSTINT('endmonth'), GETPOSTINT('endday'), GETPOSTINT('endyear'));
$capital = price2num(GETPOST('capital'));
$capital = (float) price2num(GETPOST('capital'));
if (!$capital) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
@ -192,9 +192,9 @@ if (empty($reshook)) {
$object->datestart = $datestart;
$object->dateend = $dateend;
$object->capital = $capital;
$object->nbterm = GETPOSTINT("nbterm");
$object->rate = price2num(GETPOST("rate", 'alpha'));
$object->insurance_amount = price2num(GETPOSTINT('insurance_amount'));
$object->nbterm = (float) price2num(GETPOSTINT("nbterm"));
$object->rate = (float) price2num(GETPOST("rate", 'alpha'));
$object->insurance_amount = (float) price2num(GETPOSTINT('insurance_amount'));
$accountancy_account_capital = GETPOST('accountancy_account_capital');
$accountancy_account_insurance = GETPOST('accountancy_account_insurance');

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2014-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
@ -35,6 +35,11 @@ class Loan extends CommonObject
*/
public $element = 'loan';
/**
* @var string Name of table without prefix where object is stored
* @deprecated Use $table_element
* @see $table_element
*/
public $table = 'loan';
/**
@ -52,7 +57,14 @@ class Loan extends CommonObject
*/
public $rowid;
/**
* @var int|'' date start
*/
public $datestart;
/**
* @var int|''
*/
public $dateend;
/**
@ -60,17 +72,59 @@ class Loan extends CommonObject
*/
public $label;
/**
* @var float capital
*/
public $capital;
/**
* @var float nb terms
*/
public $nbterm;
/**
* @var float rate
*/
public $rate;
/**
* @var int<0,1> paid
*/
public $paid;
/**
* @var string account_capital
*/
public $account_capital;
/**
* @var string account_insurance
*/
public $account_insurance;
/**
* @var string account_interest
*/
public $account_interest;
/**
* @var string accountancy_account_capital
*/
public $accountancy_account_capital;
/**
* @var string accountancy_account_insurance
*/
public $accountancy_account_insurance;
/**
* @var string accountancy_account_interest
*/
public $accountancy_account_interest;
/**
* @var float insurance amount
*/
public $insurance_amount;
/**
@ -98,8 +152,19 @@ class Loan extends CommonObject
*/
public $totalpaid;
/**
* @var int
*/
const STATUS_UNPAID = 0;
/**
* @var int
*/
const STATUS_PAID = 1;
/**
* @var int
*/
const STATUS_STARTED = 2;
@ -135,11 +200,11 @@ class Loan extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->datestart = $this->db->jdate($obj->datestart);
$this->dateend = $this->db->jdate($obj->dateend);
$this->label = $obj->label;
$this->capital = $obj->capital;
$this->dateend = $this->db->jdate($obj->dateend);
$this->label = $obj->label;
$this->capital = $obj->capital;
$this->nbterm = $obj->nbterm;
$this->rate = $obj->rate;
$this->rate = $obj->rate;
$this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->insurance_amount = $obj->insurance_amount;
@ -147,8 +212,8 @@ class Loan extends CommonObject
$this->fk_bank = $obj->fk_bank;
$this->account_capital = $obj->accountancy_account_capital;
$this->account_insurance = $obj->accountancy_account_insurance;
$this->account_interest = $obj->accountancy_account_interest;
$this->account_insurance = $obj->accountancy_account_insurance;
$this->account_interest = $obj->accountancy_account_interest;
$this->fk_project = $obj->fk_project;
$this->db->free($resql);
@ -601,8 +666,6 @@ class Loan extends CommonObject
*/
public function initAsSpecimen()
{
global $user, $langs, $conf;
$now = dol_now();
// Initialise parameters
@ -610,13 +673,13 @@ class Loan extends CommonObject
$this->fk_bank = 1;
$this->label = 'SPECIMEN';
$this->specimen = 1;
$this->account_capital = 16;
$this->account_insurance = 616;
$this->account_interest = 518;
$this->account_capital = '16';
$this->account_insurance = '616';
$this->account_interest = '518';
$this->datestart = $now;
$this->dateend = $now + (3600 * 24 * 365);
$this->note_public = 'SPECIMEN';
$this->capital = 20000;
$this->capital = 20000.80;
$this->nbterm = 48;
$this->rate = 4.3;

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2015-2018 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -183,7 +183,7 @@ if ($action == 'add_payment' && $permissiontoadd) {
if (!$error && !empty($line)) {
// If payment values are modified, recalculate schedule
if (($line->amount_capital != $pay_amount_capital) || ($line->amount_insurance != $pay_amount_insurance) || ($line->amount_interest != $pay_amount_interest)) {
$arr_term = loanCalcMonthlyPayment(($pay_amount_capital + $pay_amount_interest), $remaindertopay, ($loan->rate / 100), $echance, $loan->nbterm);
$arr_term = loanCalcMonthlyPayment(($pay_amount_capital + $pay_amount_interest), $remaindertopay, ($loan->rate / 100), $echance, (int) $loan->nbterm);
foreach ($arr_term as $k => $v) {
// Update fk_bank for current line
if ($k == $echance) {

View file

@ -2755,14 +2755,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
if ($object->isService()) {
// Duration
require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
$measuringUnits = new CUnits($db);
$durations = [];
$plural = '';
if ($object->duration_value > 1) {
$plural = 's';
}
$result = $measuringUnits->fetchAll('', 'scale', 0, 0, ['t.active' => 1, 't.unit_type' => 'time']);
if ($result !== -1) {
foreach ($measuringUnits->records as $record) {
$durations[$record->short_label] = dol_ucfirst($record->label) . $plural;
}
}
print '<tr><td class="titlefieldmiddle">'.$langs->trans("Duration").'</td><td>';
print $object->duration_value;
if ($object->duration_value > 1) {
$dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
} elseif ($object->duration_value > 0) {
$dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
}
print(!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? "&nbsp;".$langs->trans($dur[$object->duration_unit])."&nbsp;" : '');
print (!empty($object->duration_unit) && isset($durations[$object->duration_unit]) ? "&nbsp;".$langs->trans($durations[$object->duration_unit])."&nbsp;" : '');
// Mandatory period
if ($object->duration_value > 0) {

View file

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015-2017 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015-2017 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
@ -589,7 +589,7 @@ class FormProduct
$result = $measuringUnits->fetchAll(
'',
'',
'scale',
0,
0,
$filter

View file

@ -2843,8 +2843,8 @@ class Product extends CommonObject
$sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,";
}
//For MultiCompany
//PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
// For MultiCompany
// PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
$visibleWarehousesEntities = $conf->entity;
@ -2969,8 +2969,10 @@ class Product extends CommonObject
$this->fk_default_bom = $obj->fk_default_bom;
$this->duration = $obj->duration;
$this->duration_value = $obj->duration ? (int) (substr($obj->duration, 0, dol_strlen($obj->duration) - 1)) : 0;
$this->duration_unit = $obj->duration ? substr($obj->duration, -1) : null;
$matches = [];
preg_match('/(\d+)(\w+)/', $obj->duration, $matches);
$this->duration_value = !empty($matches[1]) ? (int) $matches[1] : 0;
$this->duration_unit = !empty($matches[2]) ? (string) $matches[2] : null;
$this->canvas = $obj->canvas;
$this->net_measure = $obj->net_measure;
$this->net_measure_units = $obj->net_measure_units;

View file

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2007-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2007-2023 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
@ -48,12 +48,19 @@ class Productbatch extends CommonObject
public $fk_product_stock;
/**
* @var string batch number
*/
public $batch = '';
/**
* @var float Quantity
*/
public $qty;
/**
* @var int warehouse ID
*/
public $warehouseid;
/**
@ -61,8 +68,12 @@ class Productbatch extends CommonObject
*/
public $fk_product;
// Properties of the lot
public $lotid; // ID in table of the details of properties of each lots
/**
*
* @var int Properties of the lot
* ID in table of the details of properties of each lots
*/
public $lotid;
/**
* @var int|string

View file

@ -506,6 +506,7 @@ if (!$ret) {
$socstatic = fetchObjectByElement($element_id, $element, $element_ref);
if (is_object($socstatic)) {
'@phan-var-force Societe $socstatic';
/** @var Societe $socstatic */
$savobject = $object;
$object = $socstatic;

View file

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
@ -37,7 +37,7 @@ class Client extends Societe
public $next_prev_filter = "te.client in (1,2,3)";
/**
* @var array
* @var array<int,array{id:int,code:string,label:string,picto:string}>
*/
public $cacheprospectstatus = array();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -1,274 +0,0 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/support/inc.php
* \ingroup core
* \brief File that define environment for support pages
*/
// Define DOL_DOCUMENT_ROOT
if (!defined('DOL_DOCUMENT_ROOT')) {
define('DOL_DOCUMENT_ROOT', '..');
}
require_once DOL_DOCUMENT_ROOT.'/core/class/conf.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$conf = new Conf();
// Force $_REQUEST["logtohtml"]
$_REQUEST["logtohtml"] = 1;
// Correction PHP_SELF (ex pour apache via caudium) car PHP_SELF doit valoir URL relative
// et non path absolu.
if (isset($_SERVER["DOCUMENT_URI"]) && $_SERVER["DOCUMENT_URI"]) {
$_SERVER["PHP_SELF"] = $_SERVER["DOCUMENT_URI"];
}
$includeconferror = '';
// Define vars
$conffiletoshowshort = "conf.php";
// Define localization of conf file
$conffile = "../conf/conf.php";
$conffiletoshow = "htdocs/conf/conf.php";
// For debian/redhat like systems
/*
if (!file_exists($conffile)) {
$conffile = "/etc/dolibarr/conf.php";
$conffiletoshow = "/etc/dolibarr/conf.php";
}
*/
// Load conf file if it is already defined
if (!defined('DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > 8) { // Test on filesize is to ensure that conf file is more that an empty template with just <?php in first line
$result = include_once $conffile; // Load conf file
if ($result) {
if (empty($dolibarr_main_db_type)) {
$dolibarr_main_db_type = 'mysql'; // For backward compatibility
}
//Mysql driver support has been removed in favor of mysqli
if ($dolibarr_main_db_type == 'mysql') {
$dolibarr_main_db_type = 'mysqli';
}
if (!isset($dolibarr_main_db_port) && ($dolibarr_main_db_type == 'mysqli')) {
$dolibarr_main_db_port = '3306'; // For backward compatibility
}
// Clean parameters
$dolibarr_main_data_root = isset($dolibarr_main_data_root) ? trim($dolibarr_main_data_root) : '';
$dolibarr_main_url_root = isset($dolibarr_main_url_root) ? trim($dolibarr_main_url_root) : '';
$dolibarr_main_url_root_alt = isset($dolibarr_main_url_root_alt) ? trim($dolibarr_main_url_root_alt) : '';
$dolibarr_main_document_root = isset($dolibarr_main_document_root) ? trim($dolibarr_main_document_root) : '';
$dolibarr_main_document_root_alt = isset($dolibarr_main_document_root_alt) ? trim($dolibarr_main_document_root_alt) : '';
// Remove last / or \ on directories or url value
if (!empty($dolibarr_main_document_root) && !preg_match('/^[\\/]+$/', $dolibarr_main_document_root)) {
$dolibarr_main_document_root = preg_replace('/[\\/]+$/', '', $dolibarr_main_document_root);
}
if (!empty($dolibarr_main_url_root) && !preg_match('/^[\\/]+$/', $dolibarr_main_url_root)) {
$dolibarr_main_url_root = preg_replace('/[\\/]+$/', '', $dolibarr_main_url_root);
}
if (!empty($dolibarr_main_data_root) && !preg_match('/^[\\/]+$/', $dolibarr_main_data_root)) {
$dolibarr_main_data_root = preg_replace('/[\\/]+$/', '', $dolibarr_main_data_root);
}
if (!empty($dolibarr_main_document_root_alt) && !preg_match('/^[\\/]+$/', $dolibarr_main_document_root_alt)) {
$dolibarr_main_document_root_alt = preg_replace('/[\\/]+$/', '', $dolibarr_main_document_root_alt);
}
if (!empty($dolibarr_main_url_root_alt) && !preg_match('/^[\\/]+$/', $dolibarr_main_url_root_alt)) {
$dolibarr_main_url_root_alt = preg_replace('/[\\/]+$/', '', $dolibarr_main_url_root_alt);
}
// Create conf object
if (!empty($dolibarr_main_document_root)) {
$result = loadconf($dolibarr_main_document_root);
}
// Load database driver
if ($result) {
if (!empty($dolibarr_main_document_root) && !empty($dolibarr_main_db_type)) {
$result = include_once $dolibarr_main_document_root."/core/db/".$dolibarr_main_db_type.'.class.php';
if (!$result) {
$includeconferror = 'ErrorBadValueForDolibarrMainDBType';
}
}
} else {
$includeconferror = 'ErrorBadValueForDolibarrMainDocumentRoot';
}
} else {
$includeconferror = 'ErrorBadFormatForConfFile';
}
}
$conf->global->MAIN_LOGTOHTML = 1;
// Define prefix
if (!isset($dolibarr_main_db_prefix) || !$dolibarr_main_db_prefix) {
$dolibarr_main_db_prefix = 'llx_';
}
define('MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : ''));
define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir
define('DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root : ''));
define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root : '')); // URL relative root
$uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http*
$suburi = strstr($uri, '/'); // $suburi contains url without domain
if ($suburi == '/') {
$suburi = ''; // If $suburi is /, it is now ''
}
define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
if (empty($character_set_client)) {
$character_set_client = "UTF-8";
}
$conf->file->character_set_client = strtoupper($character_set_client);
if (empty($dolibarr_main_db_character_set)) {
$dolibarr_main_db_character_set = ($conf->db->type == 'mysqli' ? 'utf8' : ''); // Old installation
}
$conf->db->character_set = $dolibarr_main_db_character_set;
if (empty($dolibarr_main_db_collation)) {
$dolibarr_main_db_collation = ($conf->db->type == 'mysqli' ? 'utf8_unicode_ci' : ''); // Old installation
}
$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
if (empty($dolibarr_main_db_encryption)) {
$dolibarr_main_db_encryption = 0;
}
$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
if (empty($dolibarr_main_db_cryptkey)) {
$dolibarr_main_db_cryptkey = '';
}
$conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
if (empty($conf->db->user)) {
$conf->db->user = '';
}
// Defini object langs
$langs = new Translate('..', $conf);
if (GETPOST('lang', 'aZ09')) {
$langs->setDefaultLang(GETPOST('lang', 'aZ09'));
} else {
$langs->setDefaultLang('auto');
}
/**
* Load conf file (file must exists)
*
* @param string $dolibarr_main_document_root Root directory of Dolibarr bin files
* @return int Return integer <0 if KO, >0 if OK
*/
function loadconf($dolibarr_main_document_root)
{
global $conf;
global $dolibarr_main_db_type;
global $dolibarr_main_db_host;
global $dolibarr_main_db_port;
global $dolibarr_main_db_name;
global $dolibarr_main_db_user;
global $dolibarr_main_db_pass;
global $character_set_client;
$return = 1;
if (!class_exists('Conf')) {
$return = include_once $dolibarr_main_document_root.'/core/class/conf.class.php';
}
if (!$return) {
return -1;
}
$conf = new Conf();
$conf->db->type = trim($dolibarr_main_db_type);
$conf->db->host = trim($dolibarr_main_db_host);
$conf->db->port = trim($dolibarr_main_db_port);
$conf->db->name = trim($dolibarr_main_db_name);
$conf->db->user = trim($dolibarr_main_db_user);
$conf->db->pass = trim($dolibarr_main_db_pass);
if (empty($conf->db->dolibarr_main_db_collation)) {
$conf->db->dolibarr_main_db_collation = 'utf8_unicode_ci';
}
return 1;
}
/**
* Show HTML header
*
* @param string $soutitre Title
* @param string $next Next
* @param string $action Action code
* @return void
*/
function pHeader($soutitre, $next, $action = 'none')
{
global $conf, $langs;
$langs->loadLangs(array("main", "admin"));
// On force contenu dans format sortie
header("Content-type: text/html; charset=".$conf->file->character_set_client);
// Security options
header("X-Content-Type-Options: nosniff");
header("X-Frame-Options: SAMEORIGIN"); // Frames allowed only if on same domain (stop some XSS attacks)
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
print '<head>'."\n";
print '<meta http-equiv="content-type" content="text/html; charset='.$conf->file->character_set_client.'">'."\n";
print '<meta name="robots" content="index,follow">'."\n";
print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
print '<meta name="keywords" content="help, center, dolibarr, doliwamp">'."\n";
print '<meta name="description" content="Dolibarr help center">'."\n";
print '<link rel="stylesheet" type="text/css" href="../install/default.css">'."\n";
print '<title>'.$langs->trans("DolibarrHelpCenter").'</title>'."\n";
print '</head>'."\n";
print '<body class="center">'."\n";
print '<div class="noborder centpercent center valignmiddle inline-block">';
print '<img src="helpcenter.png" alt="logohelpcenter" class="inline-block"><br><br>';
print '<span class="titre inline-block">'.$soutitre.'</span>'."\n";
print '</div><br>';
}
/**
* Print HTML footer
*
* @param integer $nonext No button "Next step"
* @param string $setuplang Language code
* @return void
*/
function pFooter($nonext = 0, $setuplang = '')
{
global $langs;
$langs->load("main");
$langs->load("admin");
print '</body>'."\n";
print '</html>'."\n";
}

View file

@ -1,238 +0,0 @@
<?php
/* Copyright (C) 2008-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* add german links 2020 Udo Tamm <dev@dolibit.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/support/index.php
* \ingroup support
* \brief Provide an Online Help support
*/
// Use its own include to not share the include of Dolibarr
// This is a standalone feature with no information from Dolibarr to show
// and no database access to do.
include_once 'inc.php';
$uri = preg_replace('/^http(s?):\/\//i', '', $dolibarr_main_url_root);
$pos = strstr($uri, '/'); // $pos contient alors url sans nom domaine
if ($pos == '/') {
$pos = ''; // si $pos vaut /, on le met a ''
}
if (!defined('DOL_URL_ROOT')) {
define('DOL_URL_ROOT', $pos); // URL racine relative
}
$langs->loadLangs(array("other", "help"));
/*
* View
*/
pHeader($langs->trans("DolibarrHelpCenter"), $_SERVER["PHP_SELF"]);
print '<br><span class="opacitymedium">'.$langs->trans("HelpCenterDesc1")."<br>\n";
print $langs->trans("HelpCenterDesc2")."</span><br>\n";
print '<br>';
$homeurl = DOL_URL_ROOT.'/';
if (GETPOST('dol_hide_toptmenu')) {
$homeurl .= (strpos($homeurl, '?') === false ? '?' : '&').'dol_hide_toptmenu=1';
}
if (GETPOST('dol_hide_leftmenu')) {
$homeurl .= (strpos($homeurl, '?') === false ? '?' : '&').'dol_hide_leftmenu=1';
}
if (GETPOST('dol_no_mouse_hover')) {
$homeurl .= (strpos($homeurl, '?') === false ? '?' : '&').'dol_no_mouse_hover=1';
}
if (GETPOST('dol_use_jmobile')) {
$homeurl .= (strpos($homeurl, '?') === false ? '?' : '&').'dol_use_jmobile=1';
}
// If a global var $dolibarr_main_url_root exists, install is done and complete, we can show the link to home page
if (!empty($dolibarr_main_url_root)) {
print $langs->trans("ToGoBackToDolibarr", $homeurl);
}
print '<br><br>';
$style1 = 'color: #333344; font-size: 16px; font-weight: bold';
$style2 = 'color: #5D4455; font-weight: bold;';
print "\n";
print '<div style="width: 100%; text-align: center"><div class="inline-block blocksupport">';
print "\n";
// Forum/wiki support
print '<table class="login tablesupport" width="100%" style="margin-top: 20px">';
print '<tr class="title tablesupport-title" valign="top">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="who"><tr><td>'.img_picto('', 'who.png', 'class="valignmiddle paddingright"', 1).'</td><td>';
print '<span style="'.$style1.'">'.$langs->trans("CommunitySupport").'</span>';
print '<span class="small">';
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfSupport").':</span> ';
print '<span style="'.$style2.'">'.$langs->trans("TypeSupportCommunauty").'</span>';
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfHelp").':</span> ';
print $langs->trans("TypeHelpDev");
print '<br><span class="opacitymedium">'.$langs->trans("Efficiency").':</span> ';
print img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1);
print '<br><span class="opacitymedium">'.$langs->trans("Price").':</span> ';
print img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1);
print '</span>';
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '<tr>';
print '<td align="center" valign="middle">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';
$urlwiki = 'https://wiki.dolibarr.org';
if (preg_match('/fr/i', $langs->defaultlang)) {
$urlwiki = 'https://wiki.dolibarr.org/index.php/Accueil';
}
if (preg_match('/es/i', $langs->defaultlang)) {
$urlwiki = 'https://wiki.dolibarr.org/index.php/Portada';
}
if (preg_match('/de/i', $langs->defaultlang)) {
$urlwiki = 'https://wiki.dolibarr.org/index.php/Hauptseite';
}
print '<div class="wordbreak">';
print '<br>'.$langs->trans("ForDocumentationSeeWiki", $urlwiki, $urlwiki);
print '<br>';
$urlforum = 'https://www.dolibarr.org/forum/';
$urlforumlocal = 'https://www.dolibarr.org/forum/';
if (preg_match('/fr/i', $langs->defaultlang)) {
$urlforumlocal = 'https://www.dolibarr.fr/forum/';
}
if (preg_match('/es/i', $langs->defaultlang)) {
$urlforumlocal = 'https://www.dolibarr.es/foro/';
}
if (preg_match('/it/i', $langs->defaultlang)) {
$urlforumlocal = 'http://www.dolibarr.it/forum/';
}
if (preg_match('/gr/i', $langs->defaultlang)) {
$urlforumlocal = 'https://www.dolibarr.gr/forum/';
}
if (preg_match('/de/i', $langs->defaultlang)) {
$urlforumlocal = 'https://www.dolibarr.de/forum/';
}
print '<br>'.$langs->trans("ForAnswersSeeForum", $urlforumlocal, $urlforumlocal).'<br>';
if ($urlforumlocal != $urlforum) {
print '<b><a href="'.$urlforum.'">'.$urlforum.'</a></b>';
}
print '</div>';
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '</table>'."\n";
print "\n";
print '</div><div class="inline-block blocksupport">';
// EMail support
print '<table class="login tablesupport" width="100%" style="margin-top: 20px">';
print '<tr class="title tablesupport-title" valign="top">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="mail"><tr><td>'.img_picto('', 'mail.png', 'class="valignmiddle paddingright"', 1).'</td><td>';
print '<span style="'.$style1.'">'.$langs->trans("EMailSupport").'</span>';
print '<span class="small">';
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfSupport").':</span> ';
print '<span style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</span>';
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfHelp").':</span>';
print $langs->trans("TypeHelpOnly");
print '<br><span class="opacitymedium">'.$langs->trans("Efficiency").':</span>';
print img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1);
print '<br><span class="opacitymedium">'.$langs->trans("Price").':</span> ';
print img_picto_common('', 'star', 'class="valignmiddle"', 1).img_picto_common('', 'star', 'class="valignmiddle"', 1);
print '</span>';
print '</td></tr></table>';
print '</td>';
print '</tr><tr>';
$urlwiki = 'https://partners.dolibarr.org';
print '<td align="center" valign="top">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';
print '<br><span class="opacitymedium">'.$langs->trans("ToSeeListOfAvailableRessources").'</span><br>';
print '<br>';
print '<b><a href="'.$urlwiki.'">'.$langs->trans("ClickHere").'</a></b><br>';
print '<br>';
print '<br><br>';
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '</table>'."\n";
print '</div><div class="inline-block blocksupport">';
// Other support
print '<table class="login tablesupport" width="100%" style="margin-top: 20px">';
print '<tr class="title tablesupport-title">';
print '<td width="100%" align="left" valign="middle">';
print '<table summary="special"><tr><td>'.img_picto('', 'pagemaster.png', 'class="valignmiddle paddingright"', 1).'</td><td>';
print '<span style="'.$style1.'">'.$langs->trans("OtherSupport").'</span>';
print '<span class="small">';
print '<br><span class="opacitymedium">'.$langs->trans("TypeOfSupport").':</span> ';
print '<span style="'.$style2.'">'.$langs->trans("TypeSupportCommercial").'</span>';
print '<br><span class="opacitymedium wordbreak">'.$langs->trans("TypeOfHelp").':</span>';
print $langs->trans("TypeHelpDevForm");
print '<br><span class="opacitymedium">'.$langs->trans("Efficiency").':</span>';
print img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1).img_picto_common('', 'redstar', 'class="valignmiddle"', 1);
print '<br><span class="opacitymedium">'.$langs->trans("Price").':</span> ';
print img_picto_common('', 'star', 'class="valignmiddle"', 1);
print '</span>';
print '</td></tr></table>';
print '</td>';
print '</tr><tr>';
$urlwiki = 'https://partners.dolibarr.org';
print '<td align="center" valign="top">';
print '<table class="nocellnopadd">';
print '<tr><td align="center">';
print '<br><span class="opacitymedium">'.$langs->trans("ToSeeListOfAvailableRessources").'</span><br>';
print '<br>';
print '<b><a href="'.$urlwiki.'">'.$langs->trans("ClickHere").'</a></b><br>';
print '<br>';
print '<br><br>';
print '</td></tr></table>';
print '</td>';
print '</tr>';
print '</table>'."\n";
print "\n";
print '<div style="clear: both"></div>';
print '</div>';
pFooter();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 980 B

View file

@ -234,9 +234,9 @@ if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/log
}
// Security graphical code
if (function_exists("imagecreatefrompng") && !$disabled) {
$captcha = 1;
$captcha_refresh = img_picto($langs->trans("Refresh"), 'refresh', 'id="captcha_refresh_img"');
$captcha = '';
if (!$disabled) {
$captcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard');
}
// Execute hook getPasswordForgottenPageOptions (for table)

View file

@ -685,7 +685,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
* Set password of an user
*
* @param array{login:string,password:string,entity:?int,dolibarrkey:string} $authentication Array of authentication information
* @param array $shortuser Array of login/password info
* @param array{login:string,password:string} $shortuser Array of login/password info
* @return mixed
*/
function setUserPassword($authentication, $shortuser)

View file

@ -101,16 +101,14 @@ parameters:
- '# (Odf) constructor expects #'
- '# Stripe[^ ]+::all\(\) expects #'
- '#expects resource#'
- '# (?:(?:BordereauChequeBlochet::_pagefoot|(?:Order|Product|SupplierOrder)s::_cleanObjectDatas)\(\)|ecm_prepare_dasboard_head|formatObject) expects object#'
- '# (?:(?:BordereauChequeBlochet::_pagefoot|(?:Order|Product|SupplierOrder)s::_cleanObjectDatas)\(\)|formatObject) expects object#'
- '#(?:ftp_(?:c(?:dup|hdir|lose)|delete|get|mkdir|put|rmdir)) expects FTP\\Connection#'
- '#(?:ldap_(?:(?:ad|bin)d|delete|err(?:no|or)|first_entry|get_(?:(?:attribut|entri)es|(?:optio|values_le)n)|mod_(?:add|del|replace)|rename|set_option|unbind)) expects LDAP\\Connection#'
- '#(?:MultiCurrencies::_cleanObjectDatasRate\(\)) expects MultiCurrency#'
- '# (?:pg_(?:affected_rows|f(?:etch_(?:array|object|row)|ree_result)|num_rows)) expects PgSql\\Result#'
- '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#'
- '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'
- '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#'
- '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#'
- '#(?:make_substitutions expects array<string, string>,) string given\.#'
- '#Method (?:(?:(?:(?:AgendaEve|BankAccou)nt|Bom|C(?:ategorie|ont(?:r?act))|Do(?:cument|libarrApiAcces|nation)|ExpenseReport|In(?:tervention|voice))s|KnowledgeManagement|Login|M(?:(?:ultiCurrencie|o)s)|(?:Order|P(?:artnership|ro(?:duct|posal))|Salarie)s|S(?:etup|(?:hipment|t(?:atu|ockMovement)|upplier(?:Invoice|Order|Proposal))s)|T(?:(?:ask|hirdpartie|icket)s)|W(?:arehouses|ebhook|orkstations)|Zapier)::.*) no value type specified in iterable type array#'
- '#Property (?:(?:(?:(?:AgendaEven|Cont(?:r?ac))t|Do(?:libarrApiAcces|nation)|ExpenseReport|In(?:tervention|voice)|Order|Pro(?:duct|posal)|S(?:alarie|(?:hip|tockMove)ment|upplier(?:Invoice|Order|Proposal))|T(?:ask|hirdpartie|icket)|Warehouse)s|Webhook|Zapier)::.*) no value type specified in iterable type array#'
- '#Property RemiseCheque::\$account_id \(int\) does not accept string\.#'