2
0
forked from Wavyzz/dolibarr

Compare commits

..

2 Commits

Author SHA1 Message Date
estebanthi
3c61da3212 API endpoint to mark invoice as paid 2025-10-11 15:11:39 +02:00
estebanthi
ce89584f76 Removed credit notes bug 2025-10-08 22:17:57 +02:00
3238 changed files with 371305 additions and 63788 deletions

View File

@@ -0,0 +1,3 @@
# Add this tag for any changes for more than 1 line
"Pending analysis of PR (maintenance team)":
min: 1

View File

@@ -1,19 +1,6 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
allow:
# Allow production updates only (can do a AND, several entries are doing a OR)
- dependency-type: "production"
#- dependency-type: "direct"
exclude-paths:
- 'dev'
- 'tests/acceptance'
- 'tests/selenium'

View File

@@ -20,10 +20,10 @@ See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workf
The other worklows are:
-----------------------
- ci-stale-issues-safe to autoclose old issues.
- ci-phpstan_baseline to update the phpstan baseline file.
- ci-cache-clean-pr to clean cache when closing a PR.
- ci-test to make CI tests
- stale-issues-safe to autoclose old issues.
- phpstan_baseline to update the phpstan baseline file.
- cache-clean-pr to clean cache when closing a PR.
Some tests workflows are:
------------------------

View File

@@ -16,7 +16,7 @@ jobs:
contents: read
steps:
- name: Check out code
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

View File

@@ -25,15 +25,15 @@ jobs:
# uses: ./.github/workflows/windows-ci.yml
# with:
# gh_event: ${{ github.event_name }}
#gh-travis: # Runs travis script on github runner (not on travis)
# if: false
# # needs: [pre-commit, phan]
# # needs: [windows-ci]
# secrets: inherit
# needs: [pre-commit, phan, phpstan]
# uses: ./.github/workflows/gh-travis.yml
# with:
# gh_event: ${{ github.event_name }}
gh-travis: # Runs travis script on github runner (not on travis)
if: false
# needs: [pre-commit, phan]
# needs: [windows-ci]
secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml
with:
gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one fails, the following action may help

View File

@@ -25,15 +25,15 @@ jobs:
uses: ./.github/workflows/windows-ci.yml
with:
gh_event: ${{ github.event_name }}
# gh-travis: # Runs travis script on github runner (not on travis)
# if: false
# # needs: [pre-commit, phan]
# # needs: [windows-ci]
# secrets: inherit
# needs: [pre-commit, phan, phpstan]
# uses: ./.github/workflows/gh-travis.yml
# with:
# gh_event: ${{ github.event_name }}
gh-travis: # Runs travis script on github runner (not on travis)
if: false
# needs: [pre-commit, phan]
# needs: [windows-ci]
secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml
with:
gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one fails, the following action may help

View File

@@ -1,24 +0,0 @@
# See syntax file on https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: "Check tag branch"
on:
push:
tags:
- "18.*"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify tag is on main
run: |
TAG_COMMIT=$(git rev-list -n 1 $GITHUB_REF)
if ! git branch --contains $TAG_COMMIT | grep -q "18.0"; then
echo "The tag must be on branch 18.0"
exit 1
fi

View File

@@ -27,15 +27,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
# matrix:
# php-version:
# # PHPStan requires PHP >= 7.2.
# #- "7.2"
- "8.2"
# - "8.2"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout travis file
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Run .travis.yml build script
uses: ktomk/run-travis-yml@v1
with:

View File

@@ -30,14 +30,26 @@ jobs:
github.repository == 'Dolibarr/dolibarr'
|| github.event.schedule == false
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none # disable xdebug, pcov
tools: phan
tools: cs2pr,phan
- name: Run Phan analysis
run: |
# shellcheck disable=2086
phan $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=github
phan $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=checkstyle -o _phan.xml
- name: Add results to PR
if: ${{ always() }}
run: |
cs2pr --prepend-filename --prepend-source --notices-as-warnings _phan.xml
- name: Provide phan log as artifact
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: phan-srcrt
# path: ${{ github.workspace }}/phan.log
path: ${{ github.workspace }}/_phan.xml
retention-days: 2

View File

@@ -35,7 +35,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v5
- uses: actions/checkout@v4
# Get PHP and addons
- name: Setup PHP
id: setup-php
@@ -43,7 +43,7 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
coverage: none # disable xdebug, pcov
tools: phpstan:2.1.12, cs2pr
tools: phpstan:2.1.8, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt

View File

@@ -33,13 +33,13 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none # disable xdebug, pcov
tools: phpstan:2.1.12, cs2pr
tools: phpstan:2.1.8, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
env:

View File

@@ -28,7 +28,7 @@ jobs:
# if: false
# Checkout git sources to analyze
- uses: actions/checkout@v5
- uses: actions/checkout@v4
# Try to get the list of modified files into steps.changed-php.outputs.all_changed_files
#- name: Get changed files
@@ -66,7 +66,7 @@ jobs:
run: |-
[ -r requirements.txt ] || [ -r pyproject.toml ] || touch requirements.txt
# Install python and pre-commit tool
- uses: actions/setup-python@v6
- uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.11"

30
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Test github actions
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
push:
env:
ENVGHT: ${{ secrets.GITHUB_TOKEN }}
ENVGHU: ${{ github.token }}
TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }}
TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }}
TEST_VAR_ORGA: ${{ vars.TEST_VAR_ORGA }}
ENVLOCAL: "varenvlocal"
jobs:
testjob:
runs-on: ubuntu-latest
steps:
- name: Log
run: |
echo "Run action by ${{ github.actor }}"
echo "github.token=${{ github.token }}"
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
echo "repo-token: ${{secrets.GITHUB_TOKEN}}"
echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}"
echo "variable repository : ${{vars.TEST_VAR_REPO}}"
echo "variable organization : ${{vars.TEST_VAR_ORGA}}"
echo "ENVLOCAL: ${{env.ENVLOCAL}}"

View File

@@ -35,7 +35,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v5
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:

View File

@@ -522,9 +522,6 @@ script:
php upgrade.php 21.0.0 22.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade21002200.log || cat $TRAVIS_BUILD_DIR/upgrade21002200.log
php upgrade2.php 21.0.0 22.0.0 > $TRAVIS_BUILD_DIR/upgrade21002200-2.log || cat $TRAVIS_BUILD_DIR/upgrade21002200-2.log
php step5.php 21.0.0 22.0.0 > $TRAVIS_BUILD_DIR/upgrade21002200-3.log || cat $TRAVIS_BUILD_DIR/upgrade21002200-3.log
php upgrade.php 22.0.0 23.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade22002300.log || cat $TRAVIS_BUILD_DIR/upgrade22002300.log
php upgrade2.php 22.0.0 23.0.0 > $TRAVIS_BUILD_DIR/upgrade22002300-2.log || cat $TRAVIS_BUILD_DIR/upgrade22002300-2.log
php step5.php 22.0.0 23.0.0 > $TRAVIS_BUILD_DIR/upgrade22002300-3.log || cat $TRAVIS_BUILD_DIR/upgrade22002300-3.log
set +e
echo

View File

@@ -44,6 +44,12 @@ source_file = htdocs/langs/en_US/blockedlog.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:bookmarks]
file_filter = htdocs/langs/<lang>/bookmarks.lang
source_file = htdocs/langs/en_US/bookmarks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:boxes]
file_filter = htdocs/langs/<lang>/boxes.lang
source_file = htdocs/langs/en_US/boxes.lang
@@ -98,6 +104,12 @@ source_file = htdocs/langs/en_US/datapolicy.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:deliveries]
file_filter = htdocs/langs/<lang>/deliveries.lang
source_file = htdocs/langs/en_US/deliveries.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:dict]
file_filter = htdocs/langs/<lang>/dict.lang
source_file = htdocs/langs/en_US/dict.lang
@@ -134,6 +146,12 @@ source_file = htdocs/langs/en_US/exports.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:help]
file_filter = htdocs/langs/<lang>/help.lang
source_file = htdocs/langs/en_US/help.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:holiday]
file_filter = htdocs/langs/<lang>/holiday.lang
source_file = htdocs/langs/en_US/holiday.lang
@@ -266,6 +284,12 @@ source_file = htdocs/langs/en_US/partnership.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:paybox]
file_filter = htdocs/langs/<lang>/paybox.lang
source_file = htdocs/langs/en_US/paybox.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:paypal]
file_filter = htdocs/langs/<lang>/paypal.lang
source_file = htdocs/langs/en_US/paypal.lang
@@ -356,12 +380,6 @@ source_file = htdocs/langs/en_US/stripe.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:subtotals]
file_filter = htdocs/langs/<lang>/subtotals.lang
source_file = htdocs/langs/en_US/subtotals.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[o:dolibarr-association:p:dolibarr:r:supplier_proposal]
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
source_file = htdocs/langs/en_US/supplier_proposal.lang

View File

@@ -53,7 +53,7 @@ TCPDI 1.1.0 LGPL-3+ / Apache 2.0 Yes
bacon, dasprid, swiss-qr-bill, kmukku, symfony/validator
JS libraries:
Ace 1.43.12 BSD Yes JS library to get code syntaxique coloration in a textarea (Must take src dir into https://github.com/ajaxorg/ace-builds/).
Ace 1.4.14 BSD Yes JS library to get code syntaxique coloration in a textarea.
ChartJS 3.7.1 MIT License Yes JS library for graph
CKEditor 4.22.1 LGPL-2.1+ Yes Editor WYSIWYG
jQuery 3.6.4 MIT License Yes JS library

View File

@@ -2,35 +2,6 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 23.0.0 compared to 22.0 *****
For users:
----------
For developers:
---------------
* Introducing the TRIGGER_PREFIX property to force developers to use unique triggerkey per business object, limit also code to business CRUD events and identity when it is not.
WARNING:
--------
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The deprecated column egroupware_id has been dropped.
* The property $sumpayed (duplicated of $totalpaid), $sumdeposit (duplicate of $totaldeposits) and $sumcreditnote (duplicate of $totalcreditnotes) has
been removed (there are replaced with the property that was a duplication of (same for $sumpayed_multicurrency, $sumdeposit_multicurrency, $sumcreditnote_multicurrency).
* Parameters $maxlen and $notooltip of Contract have been inverted to follow the standard. It was breaking the common use of getNomUrl() but if you were using the parameter
maxlen (rare) by using the old signature, result may be a tooltip that is no more visible on ref printed by you module.
* Removed array $MAP_ID_TO_CODE that was a duplicate of array "array_flip($categ->MAP_ID)"
* The signature of the Sale order ->cancel() method and shipment ->cancel() has been modified to introduce the $user param like for other methods that modify a status.
* Adding new document templates must be done by adding files into the mymodule/core/modules/xxx/doc directory. Adding files into custom directory with the
same path than the core path without using a mymodule directory is now forbidden.
* The directory theme/common/octicons has been removed
* The library timepicker.js has been removed. Was not used by Dolibarr.
* Because of new TRIGGER_PREFIX property triggers SUPPLIER_PRODUCT_BUYPRICE_XXX are renamed to PRODUCT_BUYPRICE_XXX.
***** ChangeLog for 22.0.2 compared to 22.0.1 *****
@@ -43,8 +14,8 @@ FIX: #35407 After updating to version 22, local taxes were no longer applied (#3
FIX: #35425 (#35426)
FIX: accountancy general ledger: bad handling of hook return (#34029)
FIX: Add security test for show terminal selection if no terminal selected when invoice.php is call (#34717)
FIX: allow to create First Situation Invoice (#35228)
FIX: api orders : forward database error on failure (backport commit d9e81cb) (#35478)
FIX: allow to create First Sutuation Invoice (#35228)
FIX: api orders : forward database error on failure (backpot commit d9e81cb) (#35478)
FIX: Can't edit tags of a user.
FIX: can't reset intracomm transport mode
FIX: can't save setup of odt template for stock
@@ -60,7 +31,7 @@ FIX: Generation of member cards (file not found and substitution broken)
FIX: invoice not set to closed when we add a credit note to close it
FIX: missing check constant PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS (#33277)
FIX: missing entity filter (#35461)
FIX: missing quick edit for extrafields (backport commit 4fc66c6) (#35160)
FIX: missing quick edit for extrafields (baclport commit 4fc66c6) (#35160)
FIX: Missing sentence part (#35144)
FIX: Remove perms to access commerce tab when the only active permission is fournisseur:lire (#35467)
FIX: Restore decimal quantity for stock correction/transfer
@@ -92,8 +63,6 @@ FIX: Missing a column on group permissions
FIX: several minor troubles with modulebuilder
FIX: Test on mandatory product or thirdparty barcode
FIX: trigger mailmanspip when un/linking categories
FIX: Security when using Advanced Target page of emailing (feature hidden in v21, default in v22+). Possible
SQL injection by users with permission to make and send mass emailing.
***** ChangeLog for 22.0.0 compared to 21.0 *****
@@ -212,7 +181,7 @@ NEW: Add note public and private on order export
NEW: Finish dev for API_ENABLE_COUNT_CALLS (count of API use is visible on user API key field)
For developers:
---------------
----------
NEW: Add an API endpoint to get properties of a single line of an order (#34045)
NEW: add const to not include default CSS in top_htmlhead with DISABLE_CSS_DEFAULT_THEME
NEW: add const to not include default lib_head.js in top_htmlhead with DISABLE_LIB_HEAD_JS
@@ -239,6 +208,7 @@ NEW: expense report API deny
WARNING:
--------
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The use of GETPOST function is not allowed inside extrafields conditions or any strings that contains dynamic code evaluated with dol_eval().
* The deprecated variable $trigger_name (duplicate of variable $triggersendname) has been removed. You must use $triggersendname everywhere now.
@@ -287,6 +257,7 @@ FIX: trigger mailmanspip when un/linking categories
SEC: Remove functions accepting callable params - Reported by phdwg1410 - CVE-2024-40137
***** ChangeLog for 21.0.2 compared to 21.0.1 *****
FIX: 21.0: $height and $width can be ints, but also 'auto' (#34636)

View File

@@ -1,9 +1,9 @@
# How to use or run Dolibarr with Docker (for a development environment) ?
The docker-compose.yml file is a sample of a config file to use to build and run Dolibarr in the
current workspace with Docker. This docker image is intended for **development usage**.
For a production usage you should consider official packages on https://hub.docker.com/r/dolibarr/dolibarr.
# How to use it ?
The docker-compose.yml file is a sample of a config file to use to build and run
Dolibarr in the current workspace with Docker. This docker image is intended for
**development usage**. For production usage you should consider other
contributor reference like https://hub.docker.com/r/dolibarr/dolibarr.
Before build/run, define the variable HOST_USER_ID as following:
@@ -22,13 +22,18 @@ or
docker compose -f docker-compose.yml -f postgres.yml up
This will run the following Docker containers : Dolibarr, MariaDB, MailDev.
In the case of PostgreSQL, only Dolibarr, MailDev and the PostgreSQL database will be running.
This will run 4 containers Docker : Dolibarr, MariaDB, PhpMyAdmin and MailDev.
In the case of PostgreSQL, only Dolibarr, MailDev and the PostgreSQL database
will be running.
The URL to go to the installed Dolibarr is :
The URL to go to the Dolibarr is :
http://0.0.0.0
The URL to go to PhpMyAdmin is (login/password is root/root) :
http://0.0.0.0:8080
In Dolibarr configuration Email let PHP mail function, To see all mail send by
Dolibarr go to maildev
@@ -37,7 +42,6 @@ Dolibarr go to maildev
Setup the database connection during the installation process, please use
mariadb or postgres (name of the database container) as database host.
## Setup your custom modules
You can setup your own modules from your development folder by using volume
@@ -57,4 +61,8 @@ will automatically be synced with your development environment.
Then, you can start by extending one of the commands above, for instance for
mariadb:
docker compose -f docker-compose.yml -f postgres.yml -f yourmodule.yml up
docker compose \
-f docker-compose.yml \
-f postgres.yml \
-f yourmodule.yml \
up

View File

@@ -1,21 +1,18 @@
# How to use or run Dolibarr with Docker ?
# How to use run Dolibarr with docker ?
## For a fast run of a demo of the local version, you can build the docker image from the source repository by running
## For a fast run of a demo of the local version, you can build the docker image from this current repository by running
git clone https://github.com/Dolibarr/dolibarr.git dolibarr
cd dolibarr/docker
sudo docker-compose build
sudo docker-compose build
sudo -s
sudo -s
export HOST_USER_ID=$(id -u)
export HOST_GROUP_ID=$(id -g)
export MYSQL_ROOT_PWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo)
docker-compose up -d
export HOST_USER_ID=$(id -u)
export HOST_GROUP_ID=$(id -g)
export MYSQL_ROOT_PWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo)
docker-compose up -d
Warning: There is no persistency of data. This process is for dev purpose only.
@@ -23,6 +20,4 @@ Warning: There is no persistency of data. This process is for dev purpose only.
## For a more robust or a production usage
If you want to execute an official Docker package, you can find it and read the doc on
*https://hub.docker.com/r/dolibarr/dolibarr*
If you want to execute an official Docker package, you can find it and read the doc on ihttps://hub.docker.com/r/dolibarr/dolibarr

View File

@@ -3,8 +3,11 @@
DoliWamp is a special all in one package installer for Windows (Dolibarr+Mysql+Apache+PHP).
It's a dedicated Dolibarr version for Windows newbies with no technical knowledge. This package will install or upgrade Dolibarr but also all prerequisites like the web server, and the database in one auto-install process.
If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr, or want to use Dolibarr with a different technical layer (PostgreSQL instead of MariaDB for exemple), you should not use this auto-installer assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (the .zip file).
This directory contains files used by *makepack-dolibarr.pl* script to build the all-in-on .EXE package DoliWamp, ready
to be distributed (for Windows).
The build of .exe files need to have some windows executable files already installed (Apache, MariaDb). The package to install to get this files are defined into the file *doliwamp.iss* (searhc line starting with "; Value OK:")
If you have technical knowledge in web administration and plan to share your server instance (Apache, Mysql or PHP) with other projects than Dolibarr or want to use Dolibarr other components (PostgreSQL), you should not use this assistant and make a manual installation of Dolibarr on your existing server by downloading the standard package (.tgz or .zip file).
This directory contains files used by *makepack-dolibarr.pl* script to build DoliWamp, the all-in-one .EXE package of Dolibarr, ready to be distributed on Windows (See file ../../makepack-howto.md)
The build of .exe files need to have some windows executable files already installed (Apache, MariaDb). The package to install to get this files are defined into the file *doliwamp.iss* (search line starting with "; Value OK:")
!!! See file ../../makepack-howto.md

View File

@@ -50,13 +50,6 @@ $includeconstants = array();
$buildzip = 0;
if (empty($argv[1])) {
print '***** '.$script_file.' *****'."\n";
print "Generate the file filelist-x.y.z[-mybuild].xml with signature of files. ";
print "This includes the 3 sections:\n";
print "- dolibarr_htdocs_dir\n";
print "- dolibarr_scripts_dir\n";
print "- dolibarr_unalterable_files (only files inside the scope of the unalterable module)\n";
print "\n";
print "Usage: ".$script_file." release=auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit(1);
@@ -85,7 +78,7 @@ while ($i < $argc) {
$tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str()
if (count($tmp) != 3) {
print "Error: Bad parameter includeconstant=".$result['includeconstant'] ."\n";
exit(1);
exit -1;
}
$includeconstants[$tmp[0]][$tmp[1]] = $tmp[2];
}
@@ -104,7 +97,7 @@ $savrelease = $release;
$tmpver = explode('-', $release, 2);
if ($tmpver[0] == 'auto') {
$release = DOL_VERSION;
if (!empty($tmpver[1]) && $tmpver[0] == 'auto') {
if ($tmpver[1] && $tmpver[0] == 'auto') {
$release .= '-'.$tmpver[1];
}
}
@@ -133,10 +126,10 @@ if (empty($includecustom)) {
}
}
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
print "Release : ".$release."\n";
print "Include custom dir in signature : ".(empty($includecustom) ? 'no' : 'yes')."\n";
print "Include constants in signature : ".(empty($includeconstants) ? 'none' : '');
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
print "Release : ".$release."\n";
print "Include custom in signature : ".$includecustom."\n";
print "Include constants in signature : ";
foreach ($includeconstants as $countrycode => $tmp) {
foreach ($tmp as $constname => $constvalue) {
print $constname.'='.$constvalue." ";
@@ -162,12 +155,9 @@ $gitcommit = 'seetag';
$branchname = preg_replace('/^(\d+\.\d+)\..*$/', '\1', $release); // Keep only x.y into x.y.z
$fileforgit = dirname(dirname(dirname(__FILE__))).'/.git/refs/heads/'.$branchname;
print "Try to get last commit ID from file ".$fileforgit."\n";
$fileforgitcontent = '';
if (file_exists($fileforgit)) {
$fileforgitcontent = file_get_contents($fileforgit);
}
$fileforgitcontent = file_get_contents($fileforgit);
if (empty($fileforgitcontent)) {
print "Failed to get the last commit ID. Are you on the branch for the release (branch name ".$branchname.") ?\n";
print "Failed to get the last commit ID. Are you on the branch for the release (branch name '.$branchname.') ?\n";
}
$gitcommit = trim($fileforgitcontent);
@@ -190,7 +180,7 @@ fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
// Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
$regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|escpos-php\/example|escpos-php\/test|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
$dir = '';
@@ -349,54 +339,6 @@ if ($needtoclose) {
fputs($fp, ' </dir>'."\n");
$needtoclose = 0;
}
// Add the interfaces.class.php file
$file = dirname(__FILE__).'/../../htdocs/core/class/interfaces.class.php';
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
if ($newdir != $dir) {
if ($needtoclose) {
fputs($fp, ' </dir>'."\n");
$needtoclose = 0;
}
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
$dir = $newdir;
//$needtoclose = 1; // close will be done in next filethat is in same dir
}
if (filetype($file) == "file") {
$md5 = md5_file($file);
$checksumconcat[] = $md5;
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
}
if ($needtoclose) {
fputs($fp, ' </dir>'."\n");
$needtoclose = 0;
}
// Add the commontrigger.class.php file
$file = dirname(__FILE__).'/../../htdocs/core/class/commontrigger.class.php';
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
if ($newdir != $dir) {
if ($needtoclose) {
fputs($fp, ' </dir>'."\n");
$needtoclose = 0;
}
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
$dir = $newdir;
$needtoclose = 1;
}
$needtoclose = 1; // This is the last file
if (filetype($file) == "file") {
$md5 = md5_file($file);
$checksumconcat[] = $md5;
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
}
if ($needtoclose) {
fputs($fp, ' </dir>'."\n");
$needtoclose = 0;
}
fputs($fp, '</dolibarr_unalterable_files>'."\n");
asort($checksumconcat); // Sort list of checksum

View File

@@ -446,15 +446,6 @@ if ($nboftargetok) {
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/dev/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/dev/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
my $retcode=$?;
if ($retcode!=0)
{
print "Error running generate_filelist_xml.php please check\n";
print $ret;
print "Canceled.\n";
exit;
}
print $ret."\n";
# Copy to final dir
$NEWDESTI=$DESTI;

View File

@@ -24,9 +24,10 @@ Prerequisites to build autoexe DoliWamp package from Linux (solution seems broke
- Add path to ISCC.exe into the PATH windows var (You can do this by launching wine cmd, then regedit and add entry int `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH`)
- To manually build the .exe from Windows (Note: running from makepack-dolibarr.pl script is however recommended):
- To manually build the .exe from Windows :
Open the file dev/build/exe/doliwamp.iss and click on button "Compile".
Note: running from makepack-dolibarr.pl script is however recommended
open file dev/build/exe/doliwamp.iss and click on button "Compile".
The .exe file will be build into directory build.
@@ -57,8 +58,7 @@ Prerequisites to build autoexe DoliWamp package from Windows:
This section describes steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step.
- Check that all files on local working repository are committed.
- Check all files are committed.
- Update version/info in ChangeLog, for this you can:
To generate a changelog of a **major new version** x.y.0 (from a repo on branch develop), you can do
@@ -92,7 +92,7 @@ git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //
- Run `makepack-dolibarr.pl` to check the generation of all packages. No need to publish them.
- Post a news message on dolibarr.org about the freeze by cloning a past news + relay the news url on social networks. Include the content of the previously generated ChangeLog file into the news.
- Post a news message on dolibarr.org about the freeze by cloning a past news + relay the news url on social networks
- Create a branch x.y (but only when version seems stable enough).
@@ -108,7 +108,7 @@ We suppose the branch x.y has already been created during the beta (see previous
- Check there is no pending open security issue: List can be found here: https://github.com/Dolibarr/dolibarr/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Priority%20-%20Critical%20or%20Security%22
- Check that all files on local working repository are committed.
- Check all files are committed.
- Update version/info in ChangeLog, for this:

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
"npm": ">=5.6.0"
},
"dependencies": {
"zapier-platform-core": "17.5.0"
"zapier-platform-core": "15.0.1"
},
"devDependencies": {
"mocha": "^5.2.0",

View File

@@ -26,7 +26,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__).'/';
$path=dirname(__FILE__).'/';
// Test si mode batch
$sapi_type = php_sapi_name();
@@ -41,26 +41,12 @@ require __DIR__. '/../../htdocs/master.inc.php';
require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
// Global variables
$version = DOL_VERSION;
/*
* Main
* Parameters
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".implode(',', $argv));
if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(1);
}
define('GEN_NUMBER_FACTURE', ((int) $argv[1]) ?? 1);
define('GEN_NUMBER_FACTURE', $argv[1] ?? 1);
$year = 2016;
$dates = array(mktime(12, 0, 0, 1, 3, $year),
mktime(12, 0, 0, 1, 9, $year),
@@ -114,7 +100,7 @@ $dates = array(mktime(12, 0, 0, 1, 3, $year),
mktime(12, 0, 0, 12, 13, $year),
);
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;

View File

@@ -27,7 +27,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__).'/';
$path=dirname(__FILE__).'/';
// Test si mode batch
$sapi_type = php_sapi_name();
@@ -47,28 +47,12 @@ include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
// Global variables
$version = DOL_VERSION;
/*
* Main
* Parameter
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".implode(',', $argv));
if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(1);
}
define('GEN_NUMBER_COMMANDE', ((int) $argv[1]) ?? 10);
define('GEN_NUMBER_COMMANDE', $argv[1] ?? 10);
$year = 2016;
$dates = array(mktime(12, 0, 0, 1, 3, $year),
mktime(12, 0, 0, 1, 9, $year),
@@ -122,7 +106,7 @@ $dates = array(mktime(12, 0, 0, 1, 3, $year),
mktime(12, 0, 0, 12, 13, $year),
);
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if ($ret <= 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;

View File

@@ -27,7 +27,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__).'/';
$path=dirname(__FILE__).'/';
// Test si mode batch
$sapi_type = php_sapi_name();
@@ -46,28 +46,15 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
// Global variables
$version = DOL_VERSION;
/*
* Main
* Parameters
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".implode(',', $argv));
define('GEN_NUMBER_PRODUIT', $argv[1] ?? 100);
if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(1);
}
define('GEN_NUMBER_PRODUIT', ((int) $argv[1]) ?? 100);
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
@@ -119,22 +106,15 @@ if ($resql) {
print "Generates ".GEN_NUMBER_PRODUIT." products\n";
for ($s = 0; $s < GEN_NUMBER_PRODUIT; $s++) {
print "Product ".$s;
$produit = new Product($db);
$produit->type = mt_rand(0, 1);
$produit->status = mt_rand(0, 1);
$produit->status_buy = mt_rand(0, 1);
$produit->finished = mt_rand(0, 1);
$produit->stockable_product = mt_rand(0, 1);
$produit->status = 1;
$produit->ref = ($produit->type ? 'S' : 'P').time().$s;
$produit->label = 'Label '.time().$s;
$produit->description = 'This is a long description of '.$produit->ref;
$produit->description = 'Description '.time().$s;
$produit->price = mt_rand(1, 999.99);
$produit->tva_tx = "20.0";
$ret = $produit->create($user);
$ret=$produit->create($user);
if ($ret < 0) {
print "Error $ret - ".$produit->error."\n";
} else {

View File

@@ -27,7 +27,7 @@
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__).'/';
$path=dirname(__FILE__).'/';
// Test si mode batch
$sapi_type = php_sapi_name();
@@ -44,27 +44,11 @@ require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php";
require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
// Global variables
$version = DOL_VERSION;
/*
* Main
* Parameters
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".implode(',', $argv));
if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(1);
}
define('GEN_NUMBER_PROPAL', ((int) $argv[1]) ?? 10);
define('GEN_NUMBER_PROPAL', $argv[1] ?? 10);
$year = 2016;
$dates = array(mktime(12, 0, 0, 1, 3, $year),
mktime(12, 0, 0, 1, 9, $year),
@@ -118,7 +102,7 @@ $dates = array(mktime(12, 0, 0, 1, 3, $year),
mktime(12, 0, 0, 12, 13, $year),
);
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;

View File

@@ -49,29 +49,15 @@ include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$listoftown = array("Auray","Baden","Vannes","Pirouville","Haguenau","Souffelweiersheim","Illkirch-Graffenstaden","Lauterbourg","Picauville","Sainte-Mère Eglise","Le Bono");
$listoflastname = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Dorothee","Saby","Brigitte","Karine","Jose-Anne","Celine","Virginie");
// Global variables
$version = DOL_VERSION;
/*
* Main
* Parameter
*/
@set_time_limit(0);
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
dol_syslog($script_file." launched with arg ".implode(',', $argv));
if (empty($argv[1])) {
print "Usage: $script_file nbofrecord\n";
print "Usage: $script_file 100\n";
print "\n";
exit(1);
}
define('GEN_NUMBER_SOCIETE', ((int) $argv[1]) ?? 10);
define('GEN_NUMBER_SOCIETE', $argv[1] ?? 10);
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;

View File

@@ -41,15 +41,15 @@ require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$delimiter = ',';
$enclosure = '"';
$linelength = 10000;
$escape = '/';
$delimiter=',';
$enclosure='"';
$linelength=10000;
$escape='/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$version=DOL_VERSION;
$confirmed=1;
$error=0;
/*
@@ -71,15 +71,15 @@ if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) |
print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [defaultlang] [startlinenb] [endlinenb]\n";
print "Usage: $script_file test myfilepath.csv fr_FR 2 1002\n";
print "\n";
exit(1);
exit(-1);
}
if (! file_exists($filepath)) {
print "Error: File ".$filepath." not found.\n";
print "\n";
exit(1);
exit(-1);
}
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;

View File

@@ -41,15 +41,15 @@ require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$delimiter = ',';
$enclosure = '"';
$linelength = 10000;
$escape = '/';
$delimiter=',';
$enclosure='"';
$linelength=10000;
$escape='/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$version=DOL_VERSION;
$confirmed=1;
$error=0;
/*
@@ -71,15 +71,15 @@ if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) |
print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n";
print "Usage: $script_file test myfilepath.csv 2 1002\n";
print "\n";
exit(1);
exit(-1);
}
if (! file_exists($filepath)) {
print "Error: File ".$filepath." not found.\n";
print "\n";
exit(1);
exit(-1);
}
$ret = $user->fetch('', 'admin');
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;

View File

@@ -41,15 +41,15 @@ require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$delimiter = ',';
$enclosure = '"';
$linelength = 10000;
$escape = '/';
$delimiter=',';
$enclosure='"';
$linelength=10000;
$escape='/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$version=DOL_VERSION;
$confirmed=1;
$error=0;
/*
@@ -71,12 +71,12 @@ if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) |
print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n";
print "Usage: $script_file test myfilepath.csv 2 1002\n";
print "\n";
exit(1);
exit(-1);
}
if (! file_exists($filepath)) {
print "Error: File ".$filepath." not found.\n";
print "\n";
exit(1);
exit(-1);
}
$ret=$user->fetch('', 'admin');

View File

@@ -32,7 +32,7 @@ $path=__DIR__.'/';
// Test si mode batch
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit(1);
exit(-1);
}
// Recupere root dolibarr
@@ -187,13 +187,13 @@ if (empty($mode) || ! in_array($mode, array('test','confirm'))) {
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option can be ".implode(',', array_keys($sqls))."\n";
exit(1);
exit(-1);
}
if (empty($option)) {
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option must be defined with a value in list ".implode(',', array_keys($sqls))."\n";
exit(1);
exit(-1);
}
if ($option != 'all') {
$listofoptions=explode(',', $option);
@@ -202,7 +202,7 @@ if ($option != 'all') {
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "option '".$cursoroption."' must be in list ".implode(',', array_keys($sqls))."\n";
exit(1);
exit(-1);
}
}
}
@@ -211,7 +211,7 @@ if (empty($date) || (! preg_match('/\d\d\d\d\-\d\d\-\d\d$/', $date) && $date !=
print "Usage: $script_file (test|confirm) (all|option) (all|YYYY-MM-DD) [dbtype dbhost dbuser dbpassword dbname dbport]\n";
print "\n";
print "date can be 'all' or 'YYYY-MM-DD' to delete record before YYYY-MM-DD\n";
exit(1);
exit(-1);
}
if ($date == 'all') {

View File

@@ -65051,7 +65051,7 @@ INSERT INTO `llx_const` VALUES
(11890,'MAIN_AGENDA_ACTIONAUTO_USER_CREATE',1,'1','chaine',0,'','2023-03-01 16:57:33'),
(11891,'MAIN_AGENDA_ACTIONAUTO_USER_MODIFY',1,'1','chaine',0,'','2023-03-01 16:57:33'),
(11892,'MAIN_AGENDA_ACTIONAUTO_USER_DELETE',1,'1','chaine',0,'','2023-03-01 16:57:33'),
(11893,'MAIN_AGENDA_ACTIONAUTO_USER_NEW_PASSWORD',1,'1','chaine',0,'','2023-03-01 16:57:33'),
(11893,'MAIN_AGENDA_ACTIONAUTO_USER_NEW_PASSWORD',1,'dolcrypt:AES-256-CTR:9eebc9ac2c57a4ec:ww==','chaine',0,'','2023-03-01 16:57:33'),
(11894,'MAIN_AGENDA_ACTIONAUTO_USER_ENABLEDISABLE',1,'1','chaine',0,'','2023-03-01 16:57:33'),
(11895,'MAIN_AGENDA_ACTIONAUTO_BOM_VALIDATE',1,'1','chaine',0,'','2023-03-01 16:57:33'),
(11896,'MAIN_AGENDA_ACTIONAUTO_BOM_UNVALIDATE',1,'1','chaine',0,'','2023-03-01 16:57:33'),
@@ -65205,6 +65205,7 @@ INSERT INTO `llx_const` VALUES
(14411,'MARKETPLACE_BUYER_ORDER_CONFIRMATION_TEMPLATE',1,'-1','chaine',0,'','2025-02-05 14:08:06'),
(14412,'MARKETPLACE_SELLERS_ORDER_CONFIRMATION_TEMPLATE',1,'-1','chaine',0,'','2025-02-05 14:08:06'),
(14413,'MARKETPLACE_MINIMUM_PAYOUT_AMOUNT',1,'50','chaine',0,'','2025-02-05 14:08:06'),
(14417,'MARKETPLACE_SECRET_KEY',1,'dolcrypt:AES-256-CTR:a113efb19906f2be:q6ZG+E22cA==','chaine',0,'','2025-02-05 14:09:55'),
(14459,'MARKETPLACE_PAYMENT_IN_FRAME',1,'1','chaine',0,'','2025-02-05 14:33:21'),
(14491,'HELLOASSO_BANK_ACCOUNT_FOR_PAYMENTS',1,'6','chaine',0,'','2025-02-06 12:52:19'),
(14521,'MAIN_MAIL_SENDMODE_PASSWORDRESET',1,'default','chaine',0,'','2025-02-12 18:07:29'),
@@ -65250,7 +65251,7 @@ INSERT INTO `llx_const` VALUES
(15001,'PROPALE_VALIDITY_DURATION',1,'15','chaine',0,'','2025-03-03 02:52:32'),
(15002,'PROPOSAL_FREE_TEXT',1,'Ceci est <a href=\"https://www.dolibarr.org\">un lien</a>','chaine',0,'','2025-03-03 02:52:32'),
(15004,'PDF_SECURITY_ENCRYPTION',1,'0','chaine',1,'','2025-03-03 02:53:28'),
(15007,'MARKETPLACE_PUBLIC_API_KEY',1,'demokey','chaine',0,'','2025-03-03 16:22:48'),
(15007,'MARKETPLACE_PUBLIC_API_KEY',1,'dolcrypt:AES-256-CTR:d515f8d303aad816:+32sG1DvuxkMOYlMzFOY6Y1VhKf5r+dvMfz2e+6EjHU=','chaine',0,'','2025-03-03 16:22:48'),
(15011,'MAIN_ENABLE_COMMUNITY_REPO',1,'1','chaine',1,'','2025-03-03 16:54:48'),
(15020,'MAIN_ENABLE_DOLISTORE',1,'0','chaine',1,'','2025-03-04 22:03:12'),
(15161,'MAIN_MODULE_OPENIDCONNECT',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\",\"lastactivationversion\":\"dolibarr\"}','2025-03-06 15:18:21'),
@@ -65303,7 +65304,7 @@ INSERT INTO `llx_const` VALUES
(15630,'MULTICURRENCY_APP_ID',1,'knJn9aj77LqcGtHp9m6rRWB5iD1yhfRO','chaine',0,'','2025-03-21 12:43:49'),
(15726,'EMAILING_USE_ADVANCED_SELECTOR',1,'1','chaine',0,'','2025-03-25 11:08:47'),
(15731,'CONTRACT_ALLOW_ONLINESIGN',1,'0','chaine',0,'','2025-03-25 12:47:09'),
(15746,'MULTICURRENCY_APP_KEY',1,'demokey','chaine',0,'','2025-03-25 15:03:23'),
(15746,'MULTICURRENCY_APP_KEY',1,'dolcrypt:AES-256-CTR:a972ff0c9e92c932:dqOrWexGkIENOk0Fen4hKMCN+jxY2ou0EDwmV1pk2uQ=','chaine',0,'','2025-03-25 15:03:23'),
(15747,'MULTICURRENCY_APP_ENDPOINT',1,'https://api.apilayer.com/currency_data/live?base=__MULTICURRENCY_APP_SOURCE__','chaine',0,'','2025-03-25 15:03:23'),
(15752,'MAIN_AGENDA_ACTIONAUTO_COMPANY_RIB_CREATE',1,'1','chaine',0,NULL,'2025-03-25 19:50:16'),
(15753,'MAIN_AGENDA_ACTIONAUTO_COMPANY_RIB_MODIFY',1,'1','chaine',0,NULL,'2025-03-25 19:50:16'),
@@ -65446,12 +65447,12 @@ INSERT INTO `llx_const` VALUES
(17506,'ACCOUNTING_PRODUCT_MODE',1,'ACCOUNTANCY_SELL','chaine',0,'','2025-04-03 18:15:02'),
(17586,'FACTURE_ADDON',1,'mod_facture_mars','chaine',0,'','2025-04-05 14:25:19'),
(17777,'AI_API_SERVICE',1,'mistral','chaine',0,'','2025-04-07 23:24:36'),
(17778,'AI_API_CHATGPT_KEY',1,'demokey','chaine',0,'','2025-04-07 23:24:36'),
(17778,'AI_API_CHATGPT_KEY',1,'dolcrypt:AES-256-CTR:9613a045bab6c491:GZp61Q3TMSMF/iTVCl/0QXXkGcMsTJetGBR5Zy6nLac=','chaine',0,'','2025-04-07 23:24:36'),
(17779,'AI_API_CHATGPT_URL',1,'https://api.openai.com/v1/','chaine',0,'','2025-04-07 23:24:36'),
(17780,'AI_API_GROQ_URL',1,'https://api.groq.com/openai/','chaine',0,'','2025-04-07 23:24:36'),
(17781,'AI_API_MISTRAL_KEY',1,'demokey','chaine',0,'','2025-04-07 23:24:36'),
(17781,'AI_API_MISTRAL_KEY',1,'dolcrypt:AES-256-CTR:1abe518475f89cfa:LNtWUSvYyIf8LQ/JEtpuu2ZrorjJMUxRFZG4VmmEn7o=','chaine',0,'','2025-04-07 23:24:36'),
(17782,'AI_API_MISTRAL_URL',1,'https://api.mistral.ai/v1/','chaine',0,'','2025-04-07 23:24:36'),
(17783,'AI_API_CUSTOM_KEY',1,'demokey','chaine',0,'','2025-04-07 23:24:36'),
(17783,'AI_API_CUSTOM_KEY',1,'dolcrypt:AES-256-CTR:9733d785d0113ed2:+KXzk7ILKPq99LL2g9dpxGlprEWAScO26jEeFnpJBxQ=','chaine',0,'','2025-04-07 23:24:36'),
(17784,'AI_API_CUSTOM_URL',1,'https://mydomainofapi.com/v1','chaine',0,'','2025-04-07 23:24:36'),
(17788,'SOCIETE_RIB_ALLOW_ONLINESIGN',1,'1','chaine',0,'','2025-04-08 08:59:48'),
(17803,'SOCIETE_ENABLE_PUBLIC',1,'1','chaine',1,'','2025-04-08 10:55:06'),
@@ -65505,7 +65506,7 @@ INSERT INTO `llx_const` VALUES
(18204,'MAIN_INFO_SOCIETE_OBJECT',1,'A company demo to show how Dolibarr ERP CRM is wonderfull','chaine',0,'','2025-04-16 19:50:19'),
(18205,'SOCIETE_FISCAL_MONTH_START',1,'4','chaine',0,'','2025-04-16 19:50:19'),
(18206,'FACTURE_TVAOPTION',1,'1','chaine',0,'','2025-04-16 19:50:19'),
(18234,'MAIN_MODULE_DOLISTORE_API_KEY',1,'dolistorepublicapi','chaine',1,'','2025-04-17 10:04:08'),
(18234,'MAIN_MODULE_DOLISTORE_API_KEY',1,'dolcrypt:AES-256-CTR:d4169f5ecebe9852:mSXcyJujXRYwvP1DmsaFgevA','chaine',1,'','2025-04-17 10:04:08'),
(18241,'PROJET_VISIBILITY',1,'0','chaine',0,'','2025-04-18 11:17:47'),
(18242,'PROJECT_ENABLE_PUBLIC',1,'1','chaine',0,'','2025-04-18 11:17:47'),
(18243,'PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD',1,'-1','chaine',0,'','2025-04-18 11:17:47'),
@@ -65516,7 +65517,7 @@ INSERT INTO `llx_const` VALUES
(18256,'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT',1,'34','chaine',0,'','2025-04-18 11:21:49'),
(18257,'SERVICE_BOOTH_LOCATION',1,'0','chaine',0,'','2025-04-18 11:21:49'),
(18258,'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION',1,'0','chaine',0,'','2025-04-18 11:21:49'),
(18260,'EVENTORGANIZATION_SECUREKEY',1,'demokey','chaine',0,'','2025-04-18 13:46:59'),
(18260,'EVENTORGANIZATION_SECUREKEY',1,'dolcrypt:AES-256-CTR:83f6e644d47eaf29:GIDq0w==','chaine',0,'','2025-04-18 13:46:59'),
(18271,'MAIN_ENABLE_OVERWRITE_TRANSLATION',1,'1','chaine',0,'','2025-04-21 12:59:49'),
(18273,'RESOURCE_USED_IN_EVENT_CHECK',1,'1','chaine',0,'','2025-04-22 17:20:40'),
(18275,'MAIN_MENU_STANDARD',1,'eldy_menu.php','chaine',0,'','2025-04-24 12:08:27'),
@@ -65555,6 +65556,8 @@ INSERT INTO `llx_const` VALUES
(18588,'TAWKTO_WIDGET_ID',1,'123','chaine',0,'','2025-05-12 08:36:50'),
(18678,'SELLYOURSAAS_ALLOW_SELECTION_OF_SERVICE',1,'1','chaine',0,'','2025-05-26 12:57:33'),
(18719,'SELLYOURSAAS_ALLOW_RESELLER_PROGRAM',1,'1','chaine',0,'','2025-05-26 13:41:52'),
(18722,'STRIPE_TEST_PUBLISHABLE_KEY',1,'dolcrypt:AES-256-CTR:d484ce93b5b8497d:T5UVYovfd4RjjYBmTt7Xipdly/dt5R7A/7TwBytAV6E=','chaine',0,'','2025-05-26 15:26:42'),
(18723,'STRIPE_TEST_SECRET_KEY',1,'dolcrypt:AES-256-CTR:eebc90c2ac9810a9:87fh2hsZr7l+dExy/ngsDP25FaoEkRfHkjdqKGulFBU=','chaine',0,'','2025-05-26 15:26:42'),
(18724,'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS',1,'4','chaine',0,'','2025-05-26 15:26:42'),
(18725,'STRIPE_USER_ACCOUNT_FOR_ACTIONS',1,'0','chaine',0,'','2025-05-26 15:26:42'),
(18726,'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS',1,'0','chaine',0,'','2025-05-26 15:26:42'),
@@ -65821,12 +65824,12 @@ LOCK TABLES `llx_contrat_extrafields` WRITE;
/*!40000 ALTER TABLE `llx_contrat_extrafields` DISABLE KEYS */;
INSERT INTO `llx_contrat_extrafields` VALUES
(1,'2023-01-19 12:39:56',2,NULL,NULL,NULL,'done',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(5,'2025-01-03 14:13:54',8,NULL,'DOLICLOUD','testldr1-ABC','processing','127.0.0.1','2025-01-03 15:13:54',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-18 15:13:54',NULL,NULL,NULL,NULL,NULL,'testldr1d.with1.home.lan','osuo724k4hqa','demokey','0','testldr1d.with1.home.lan','dbntq7Wk89Mt','3306','dbuZe76P3B70','demokey',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(6,'2025-01-03 14:17:40',9,NULL,'DOLICLOUD','testldr1-ABC','processing','127.0.0.1','2025-01-03 15:17:40',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-18 15:17:40',NULL,NULL,NULL,NULL,NULL,'testldre.with1.home.lan','osuky642i38n','demokey','0','testldre.with1.home.lan','dbnd3X892MlO','3306','dbuCbWmMi7O8','demokey',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(7,'2025-03-25 23:57:06',7,NULL,'DOLICLOUD','testldr1b-ABC','undeployed','127.0.0.1','2025-01-03 15:08:56',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-23 15:08:56','2025-01-03 15:26:46','127.0.0.1',NULL,NULL,NULL,'testldr1c.with1.home.lan','osu6viclw5if','demokey','0','testldr1c.with1.home.lan','dbnrC5ydd7GC','3306','dbub5pLDMaTw','demokey',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(8,'2025-01-03 14:26:46',5,NULL,'DOLICLOUD','testldr1-ABC','undeployed','127.0.0.1','2025-01-03 14:59:56',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-18 14:59:56','2025-01-03 15:26:46','127.0.0.1',NULL,NULL,NULL,'testldr1.with1.home.lan','osu07jp64r9z','demokey','0','testldr1.with1.home.lan','dbnL4N55fzF6','3306','dbuH73bA3QfX','demokey',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(9,'2025-03-25 21:53:24',6,NULL,'DOLICLOUD','testldr1-ABC','undeployed','127.0.0.1','2025-01-03 15:05:10',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2026-01-19 15:05:10','2025-01-03 15:27:11','127.0.0.1',NULL,NULL,NULL,'testldr1b.with1.home.lan','osu7xkedfm24','demokey','0','testldr1b.with1.home.lan','dbnVmeQT2M8i','3306','dbuK7VsLk5c8','demokey',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(10,'2025-01-28 16:39:40',10,NULL,'DOLICLOUD','Azerty01','processing','127.0.0.1','2025-01-28 17:39:40',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-02-12 17:39:40',NULL,NULL,NULL,NULL,NULL,'aaa.with1.home.lan','osuy6m0f5xtl','demokey','0','aaa.with1.home.lan','dbnSE8YB6jGm','3306','dbu8MhF1Dwcl','demokey',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(5,'2025-01-03 14:13:54',8,NULL,'DOLICLOUD','testldr1-ABC','processing','127.0.0.1','2025-01-03 15:13:54',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-18 15:13:54',NULL,NULL,NULL,NULL,NULL,'testldr1d.with1.home.lan','osuo724k4hqa','dolcrypt:AES-256-CTR:ce01e4a8ade3c2ee:Rn1kmDfhbw0Eb8zpBI8=','0','testldr1d.with1.home.lan','dbntq7Wk89Mt','3306','dbuZe76P3B70','dolcrypt:AES-256-CTR:e0775c31971de7f3:YsE0Bi6lWG63zd537qc=',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(6,'2025-01-03 14:17:40',9,NULL,'DOLICLOUD','testldr1-ABC','processing','127.0.0.1','2025-01-03 15:17:40',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-18 15:17:40',NULL,NULL,NULL,NULL,NULL,'testldre.with1.home.lan','osuky642i38n','dolcrypt:AES-256-CTR:402192d99e39c190:5DrzVbVS5kac7ZQUchU=','0','testldre.with1.home.lan','dbnd3X892MlO','3306','dbuCbWmMi7O8','dolcrypt:AES-256-CTR:b22360d10ff565a0:DXpgecqzOn7X/3PQCo0=',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(7,'2025-03-25 23:57:06',7,NULL,'DOLICLOUD','testldr1b-ABC','undeployed','127.0.0.1','2025-01-03 15:08:56',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-23 15:08:56','2025-01-03 15:26:46','127.0.0.1',NULL,NULL,NULL,'testldr1c.with1.home.lan','osu6viclw5if','dolcrypt:AES-256-CTR:281a87e3e9c5fccb:O/N7kTAeXiZaHqlEupE=','0','testldr1c.with1.home.lan','dbnrC5ydd7GC','3306','dbub5pLDMaTw','dolcrypt:AES-256-CTR:2e4a79eda1bf538a:PS7p579ZNsDQAycuq8o=',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(8,'2025-01-03 14:26:46',5,NULL,'DOLICLOUD','testldr1-ABC','undeployed','127.0.0.1','2025-01-03 14:59:56',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-01-18 14:59:56','2025-01-03 15:26:46','127.0.0.1',NULL,NULL,NULL,'testldr1.with1.home.lan','osu07jp64r9z','dolcrypt:AES-256-CTR:d94d86baf2f8483b:Op7TNgxhUwrSgbilZDo=','0','testldr1.with1.home.lan','dbnL4N55fzF6','3306','dbuH73bA3QfX','dolcrypt:AES-256-CTR:535b648bbae2f12a:VEc+yVQFXPbxOqhIItQ=',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(9,'2025-03-25 21:53:24',6,NULL,'DOLICLOUD','testldr1-ABC','undeployed','127.0.0.1','2025-01-03 15:05:10',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2026-01-19 15:05:10','2025-01-03 15:27:11','127.0.0.1',NULL,NULL,NULL,'testldr1b.with1.home.lan','osu7xkedfm24','dolcrypt:AES-256-CTR:fa3d910f3fbfdad2:o+C4Ksn2W5veGS5R5Ag=','0','testldr1b.with1.home.lan','dbnVmeQT2M8i','3306','dbuK7VsLk5c8','dolcrypt:AES-256-CTR:ccb4d385381f4b4b:lDR/2Y6QjlNt3onLr3U=',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(10,'2025-01-28 16:39:40',10,NULL,'DOLICLOUD','Azerty01','processing','127.0.0.1','2025-01-28 17:39:40',NULL,'127.0.0.1',NULL,NULL,NULL,'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 - fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',NULL,'2025-02-12 17:39:40',NULL,NULL,NULL,NULL,NULL,'aaa.with1.home.lan','osuy6m0f5xtl','dolcrypt:AES-256-CTR:54fed010c0ce1d1c:8eXkLuQl7gNbC9RZEPM=','0','aaa.with1.home.lan','dbnSE8YB6jGm','3306','dbu8MhF1Dwcl','dolcrypt:AES-256-CTR:44f9f66acc719394:Bi7LNv+Vf6cf2ySF2aw=',NULL,NULL,NULL,'Europe/Paris',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(13,'2025-06-26 17:54:04',14,NULL,NULL,NULL,'0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0',NULL,NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `llx_contrat_extrafields` ENABLE KEYS */;
UNLOCK TABLES;
@@ -78959,10 +78962,10 @@ INSERT INTO `llx_societe_rib` VALUES
(2,1,'ban',10,'2023-02-06 14:28:24','2025-04-08 08:59:57','NLTechno','aaaa','','','','','LIABLT2XXXX',NULL,'FR76 1223 9000 0740 4608 0100 091',NULL,'','','',1,NULL,NULL,NULL,'sepamandate','societe/10/Mandat SEPA 10-NLTechno-UMR-CU1212-0005-2-1675704504.pdf','UMR-CU1212-0005-2-1675704504',NULL,'FRST',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'',1,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL),
(3,1,'ban',33,'2023-02-21 21:33:04','2023-02-22 00:33:04','aaainlux','aaa','','','','','aaa',NULL,'aaa',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'UMR-2302212133-3-CU2212-00026',NULL,'FRST',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'',1,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL),
(4,1,'card',33,'2023-02-21 22:26:00','2023-02-22 01:26:00','aa','',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,'aa',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,'',1,2032,'FR',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(5,1,'ban',1,'2023-03-08 06:41:28','2025-06-26 22:04:48','Indian SAS RIB','dfgdfgfd','','','','','LIABLT2XXXX',NULL,'val1',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'RUM-2303080641-5-CU1212-0007',NULL,'FRST',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'',1,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL),
(6,1,'ban',39,'2025-01-03 16:11:35','2025-01-03 15:11:37','test','test','','','','','LIABLT2XXXX',NULL,'val2',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'8ANKF3PEOTZ53TR4','2025-01-03','RCUR',NULL,NULL,'sepa_debit',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'pm_1QdCXECxfvxGwHdwPnN4agJk',0,'mandate_1QdCXECxfvxGwHdwIdo2yLTd',NULL,'cus_test@sk_test_xxx',NULL,NULL,NULL,'StripeTest',NULL),
(7,1,'ban',39,'2025-01-03 16:21:39','2025-01-03 15:21:56','Bank Testldr1','test2','','','','','',NULL,'val3',NULL,'','','',0,NULL,NULL,NULL,NULL,NULL,'SDB8CASXISKK0R7L','2025-01-03','FRST',NULL,NULL,'sepa_debit',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'pm_1QdChDCxfvxGwHdw57zEzGtC',1,'mandate_1QdChDCxfvxGwHdwvIt0244D',NULL,'cus_test@sk_test_xxx',NULL,NULL,NULL,'StripeTest',NULL),
(9,1,'ban',62,'2025-06-26 21:41:42','2025-06-26 21:41:42','Banque ddd','Banque ddd','','','','','aaa',NULL,'val4',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'RUM-2506262141-9-CU2506-0003',NULL,'FRST',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'',1,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL);
(5,1,'ban',1,'2023-03-08 06:41:28','2025-06-26 22:04:48','Indian SAS RIB','dfgdfgfd','','','','','LIABLT2XXXX',NULL,'dolcrypt:AES-256-CTR:6c5e3bcfba8c0873:sGWo/KYhvG8bw/oDC1uxal95cpvQLuKdzDGk86DYpdV2',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'RUM-2303080641-5-CU1212-0007',NULL,'FRST',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'',1,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL),
(6,1,'ban',39,'2025-01-03 16:11:35','2025-01-03 15:11:37','test','test','','','','','LIABLT2XXXX',NULL,'dolcrypt:AES-256-CTR:d0fbb5f8f1882d9f:QruV8ONPL6fQK4ew6aDzI4VSdBU=',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'8ANKF3PEOTZ53TR4','2025-01-03','RCUR',NULL,NULL,'sepa_debit',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'pm_1QdCXECxfvxGwHdwPnN4agJk',0,'mandate_1QdCXECxfvxGwHdwIdo2yLTd',NULL,'cus_test@sk_test_xxx',NULL,NULL,NULL,'StripeTest',NULL),
(7,1,'ban',39,'2025-01-03 16:21:39','2025-01-03 15:21:56','Bank Testldr1','test2','','','','','',NULL,'dolcrypt:AES-256-CTR:2143648571f74d32:ohNxpDnLCHNMP97+7XVn5i7zLNc=',NULL,'','','',0,NULL,NULL,NULL,NULL,NULL,'SDB8CASXISKK0R7L','2025-01-03','FRST',NULL,NULL,'sepa_debit',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'pm_1QdChDCxfvxGwHdw57zEzGtC',1,'mandate_1QdChDCxfvxGwHdwvIt0244D',NULL,'cus_test@sk_test_xxx',NULL,NULL,NULL,'StripeTest',NULL),
(9,1,'ban',62,'2025-06-26 21:41:42','2025-06-26 21:41:42','Banque ddd','Banque ddd','','','','','aaa',NULL,'dolcrypt:AES-256-CTR:ef6a60cae760f8d1:Q8YW',NULL,'','','',1,NULL,NULL,NULL,NULL,NULL,'RUM-2506262141-9-CU2506-0003',NULL,'FRST',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,'',1,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `llx_societe_rib` ENABLE KEYS */;
UNLOCK TABLES;
@@ -79915,13 +79918,13 @@ CREATE TABLE `llx_user` (
LOCK TABLES `llx_user` WRITE;
/*!40000 ALTER TABLE `llx_user` DISABLE KEYS */;
INSERT INTO `llx_user` VALUES
(1,'2012-07-08 13:20:11','2025-03-13 09:13:00',NULL,NULL,'aeinstein',0,'','',NULL,1,NULL,NULL,'$2y$10$lIvMb5RJjxqmd6OxnZLqvuLZGOXj3gxIQhZQUqcY8fQTyh0cTtUpa',NULL,'demokey','Einstein','Albert','','123456789','','','','aeinstein@example.com','','[]','',0,NULL,NULL,NULL,'','2017-10-05 08:32:44','2017-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,'',0,NULL,NULL,NULL,44.00000000,'man','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL),
(1,'2012-07-08 13:20:11','2025-03-13 09:13:00',NULL,NULL,'aeinstein',0,'','',NULL,1,NULL,NULL,'$2y$10$lIvMb5RJjxqmd6OxnZLqvuLZGOXj3gxIQhZQUqcY8fQTyh0cTtUpa',NULL,'dolcrypt:AES-256-CTR:10fbb3f05469219f:vCpWlcfDIoN6yOj2yGQ1WsOCfB8i2cjEKOAhNzPwf/A=','Einstein','Albert','','123456789','','','','aeinstein@example.com','','[]','',0,NULL,NULL,NULL,'','2017-10-05 08:32:44','2017-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,'',0,NULL,NULL,NULL,44.00000000,'man','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL),
(2,'2012-07-08 13:54:48','2025-05-05 12:08:56',NULL,NULL,'demo',1,'','',NULL,1,NULL,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Doe','David','Trainee','09123123','','','','daviddoe@example.com','','[]','',0,NULL,NULL,NULL,'','2018-07-30 23:10:54','2018-07-30 23:04:17',NULL,'',1,'person9.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,'',0,NULL,NULL,NULL,35.00000000,'man','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL),
(3,'2012-07-11 16:18:59','2025-05-05 14:48:17',NULL,NULL,'pcurie',1,'','',NULL,1,NULL,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Curie','Pierre','','','','','','pcurie@example.com','','[]','',0,NULL,NULL,2,'','2014-12-21 17:38:55',NULL,NULL,'',1,'dolicloud_avent_saas.png',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,'',0,NULL,NULL,NULL,39.00000000,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL),
(4,'2015-01-23 17:52:27','2025-05-05 14:48:18',NULL,NULL,'bbookkeeper',1,'','',NULL,1,NULL,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Bookkeeper','Bob','Bookkeeper','','','','','bbookkeeper@example.com','','{\"skype\":\"skypebbookkeeper\"}','',0,17,6,NULL,'','2015-02-25 10:18:41','2015-01-23 17:53:20',NULL,'',1,'person8.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,'',0,NULL,NULL,NULL,16.00000000,'man','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL),
(10,'2017-10-03 11:47:41','2023-03-15 15:07:13',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Curie','Marie','','','','','','mcurie@example.com','','[]','',0,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,NULL,0,NULL,NULL,NULL,44.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(11,'2017-10-05 09:07:52','2023-03-15 15:07:13',NULL,NULL,'zzeceo',1,NULL,'',NULL,1,0,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Zeceo','Zack','President - CEO','','','','','zzeceo@example.com','','{\"facebook\":\"\",\"skype\":\"\",\"twitter\":\"\",\"linkedin\":\"\",\"instagram\":\"\",\"snapchat\":\"\",\"googleplus\":\"\",\"youtube\":\"\",\"whatsapp\":\"\",\"tumblr\":\"\",\"vero\":\"\",\"viadeo\":\"\",\"slack\":\"\",\"xing\":\"\",\"meetup\":\"\",\"pinterest\":\"\",\"flickr\":\"\",\"500px\":\"\",\"giphy\":\"\",\"gifycat\":\"\",\"dailymotion\":\"\",\"vimeo\":\"\",\"periscope\":\"\",\"twitch\":\"\",\"discord\":\"\",\"wikipedia\":\"\",\"reddit\":\"\",\"quora\":\"\",\"tripadvisor\":\"\",\"mastodon\":\"\",\"diaspora\":\"\",\"viber\":\"\",\"github\":\"\"}','',0,NULL,NULL,NULL,'','2017-10-05 22:48:08','2017-10-05 21:18:46',NULL,'',1,'person4.jpeg',NULL,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,NULL,0,NULL,NULL,NULL,39.00000000,NULL,'','2019-06-10 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(12,'2017-10-05 09:09:46','2025-03-27 23:27:43',NULL,12,'admin',0,'','',NULL,1,NULL,NULL,'$2y$10$MiDs0GVn0ksYbOHw8XgAf.oEihYvLI0ZYd0PSVq7/6ret6gifWSh6',NULL,'demokey','Adminson','Alice','Admin Technical','','','','','laurent@destailleur.fr','','[]','Alice - 123',1,NULL,NULL,NULL,'kmlk','2025-07-10 13:00:34','2025-07-09 16:26:18',NULL,'',1,NULL,NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,'',0,2700.00000000,NULL,NULL,39.00000000,'woman','',NULL,NULL,'generic_user_odt','1985-09-15',NULL,NULL,NULL,NULL,NULL,'127.0.0.1','127.0.0.1','2025-03-27 23:27:43',NULL,NULL,'',NULL,'2025-03-27 23:27:38',NULL),
(12,'2017-10-05 09:09:46','2025-03-27 23:27:43',NULL,12,'admin',0,'','',NULL,1,NULL,NULL,'$2y$10$MiDs0GVn0ksYbOHw8XgAf.oEihYvLI0ZYd0PSVq7/6ret6gifWSh6',NULL,'dolcrypt:AES-256-CTR:10fbb3f05469219f:5nJ/t5SbepR61dTsy2pTYfGEZS5j+bj3Ds0FN0OVM5M=','Adminson','Alice','Admin Technical','','','','','laurent@destailleur.fr','','[]','Alice - 123',1,NULL,NULL,NULL,'kmlk','2025-07-10 13:00:34','2025-07-09 16:26:18',NULL,'',1,NULL,NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,'',0,2700.00000000,NULL,NULL,39.00000000,'woman','',NULL,NULL,'generic_user_odt','1985-09-15',NULL,NULL,NULL,NULL,NULL,'127.0.0.1','127.0.0.1','2025-03-27 23:27:43',NULL,NULL,'',NULL,'2025-03-27 23:27:38',NULL),
(13,'2017-10-05 21:29:35','2025-04-15 13:30:44',NULL,NULL,'ccommercy',1,'','',NULL,1,NULL,NULL,'$2y$10$KTaKE0NyYyJSCogsxtwR.eADst17XYMrOWlsFfVLR60IbjANIVLHK',NULL,NULL,'Commercy','Coraly','Commercial leader','','','','','ccommercy@example.com','','{\"facebook\":\"\",\"skype\":\"\",\"twitter\":\"\",\"linkedin\":\"\",\"instagram\":\"\",\"snapchat\":\"\",\"googleplus\":\"\",\"youtube\":\"\",\"whatsapp\":\"\",\"tumblr\":\"\",\"vero\":\"\",\"viadeo\":\"\",\"slack\":\"\",\"xing\":\"\",\"meetup\":\"\",\"pinterest\":\"\",\"flickr\":\"\",\"500px\":\"\",\"giphy\":\"\",\"gifycat\":\"\",\"dailymotion\":\"\",\"vimeo\":\"\",\"periscope\":\"\",\"twitch\":\"\",\"discord\":\"\",\"wikipedia\":\"\",\"reddit\":\"\",\"quora\":\"\",\"tripadvisor\":\"\",\"mastodon\":\"\",\"diaspora\":\"\",\"viber\":\"\",\"github\":\"\"}','',0,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person7.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,'',0,1890.00000000,NULL,NULL,25.00000000,'woman','','2018-09-11 00:00:00',NULL,NULL,'1998-12-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'',NULL,NULL,NULL),
(14,'2017-10-05 21:33:33','2023-03-15 15:07:36',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Scientol','Sam','Scientist leader','','','','','sscientol@example.com','','[]','',0,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person3.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,NULL,0,3500.00000000,NULL,NULL,39.00000000,NULL,NULL,'2018-07-03 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(16,'2017-10-05 22:47:52','2025-01-30 14:37:22',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'$2y$10$Hgawd0DFS2bgBiM6rJuAZ.ff250vlm111HVWBJQvRzRq5hNijLxam',NULL,NULL,'Charle1','Commerson','Sale representative','','','','','ccommerson@example.com','','[]','',0,NULL,NULL,NULL,'','2017-10-05 23:46:24','2017-10-05 23:37:31',NULL,'',0,'person1.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,NULL,0,2900.00000000,NULL,NULL,39.00000000,NULL,NULL,'2019-09-01 00:00:00',NULL,NULL,'1976-02-05',NULL,NULL,NULL,NULL,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@@ -80117,7 +80120,7 @@ INSERT INTO `llx_user_param` VALUES
(12,1,'MAIN_BOXES_11','1'),
(12,1,'MAIN_BOXES_2','1'),
(12,1,'MAIN_BOXES_27','1'),
(12,1,'MAIN_LANG_DEFAULT','auto'),
(12,1,'MAIN_LANG_DEFAULT','fr_FR'),
(12,1,'MAIN_SELECTEDFIELDS_/dolibarr_4.0/htdocs/adherents/list.php','d.zip,d.ref,d.lastname,d.firstname,d.company,d.login,d.morphy,t.libelle,d.email,d.datefin,d.statut,'),
(12,1,'MAIN_SELECTEDFIELDS_accountancycustomerlist','l.rowid,f.ref,f.datef,p.ref,l.total_ht,l.tva_tx,s.nom,co.label,s.tva_intra,aa.data_suggest,aa.account_number,'),
(12,1,'MAIN_SELECTEDFIELDS_accountancysupplierlines','l.rowid,f.ref,f.datef,p.ref,l.description,l.total_ht,l.tva_tx,s.nom,co.label,s.tva_intra,aa.account_number,'),

View File

@@ -84,7 +84,7 @@ if (empty($sourceserver) || empty($server) || empty($login) || empty($sourcefile
print "Usage: $script_file login@server:/src/file.(sql|gz|bz2) passssh databaseserver databasename loginbase passbase\n";
print "Return code: 0 if success, <>0 if error\n";
print "Warning, this script may take a long time.\n";
exit(1);
exit(-1);
}
@@ -106,7 +106,7 @@ $connection = ssh2_connect($server, 22);
if ($connection) {
if (!@ssh2_auth_password($connection, $login, $password)) {
dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR);
exit(5);
exit(-5);
} else {
//$stream = ssh2_exec($connection, '/usr/bin/php -i');
/*
@@ -143,7 +143,7 @@ if ($connection) {
}
} else {
print 'Failed to connect to ssh2 to '.$server;
exit(6);
exit(-6);
}

View File

@@ -72,7 +72,7 @@ print "Update dates to current year for database name = ".$db->database_name."\n
if (empty($confirm)) {
print "Usage: $script_file confirm\n";
print "Return code: 0 if success, <>0 if error\n";
exit(1);
exit(-1);
}

View File

@@ -2,33 +2,33 @@
#php_admin_value sendmail_path "/usr/sbin/sendmail -t -i"
#php_admin_value mail.force_extra_parameters "-f postmaster@mydomain.com"
#php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com"
php_admin_value open_basedir /tmp/:/home/.../htdocs:/home/.../dolibarr_documents:
# Add this to use a custom apparmor profile when using apache php handler
<IfModule mod_apparmor.c>
AADefaultHatName sellyoursaas-instances
</IfModule>
# The URLs of the web site
ServerName myvirtualalias
ServerAlias myvirtualalias
UseCanonicalName On
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 20
AddDefaultCharset UTF-8
# Detect if we are using DoliDroid
#SetEnvIf User-Agent DoliDroid dolidroid
# The directory and permissions for the web site
DocumentRoot "/home/.../htdocs"
<Directory /home/.../htdocs/>
@@ -36,19 +36,24 @@
Options -Indexes -MultiViews +FollowSymLinks -ExecCGI
Require all granted
# To restrict access by a HTTP basic auth
# To restrict access by a HTTP basic auth
#AuthType Basic
#AuthName "Authenticate to backoffice"
#AuthUserFile /etc/apache2/.htpasswd
#require valid-user
</Directory>
# Leaving /public, /dav and /.well_known directory accessible to everyone
# Leaving /public and /api, /dav, .well_known but also wrappers for document, viewimage and public json/img accessible to everyone
<Directory /home/admin/wwwroot/dolibarr/htdocs/public/>
AuthType None
Satisfy any
Require all granted
</Directory>
<Directory /home/admin/wwwroot/dolibarr/htdocs/api/>
AuthType None
Satisfy any
Require all granted
</Directory>
<Directory /home/admin/wwwroot/dolibarr/htdocs/dav/>
AuthType None
Satisfy any
@@ -59,14 +64,6 @@
Satisfy any
Require all granted
</Directory>
# You may also want to allow access to everyone to wrappers for api, document, viewimage, manifest and public json/img
# but if you can avoid it, it is better.
<Files /home/admin/wwwroot/dolibarr/htdocs/api/index.php>
AuthType None
Satisfy any
Require all granted
</Files>
<Files ~ "(document\.php|viewimage\.php|\.js\.php|\.json\.php|\.js|\.css\.php|\.css|\.gif|\.png|\.svg|\.woff2|favicon\.ico)$">
AuthType None
Satisfy any
@@ -74,11 +71,11 @@
</Files>
# Log directives
# Log directives
ErrorLog /var/log/apache2/myvirtualalias_error_log
TransferLog /var/log/apache2/myvirtualalias_access_log
# Compress is done on resources of type php pages, text file export, css and javascript
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
AddType text/javascript .jgz
@@ -95,21 +92,21 @@
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
# To enable the SSL if the certificate file exists
<IfFile "/etc/letsencrypt/live/www.mydomain.com/cert.pem">
SSLEngine On
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/letsencrypt/live/www.mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.mydomain.com/chain.pem
#RewriteEngine on
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
</IfFile>
</VirtualHost>

View File

@@ -28,15 +28,8 @@
<rule ref="Internal.NoCodeFound" />
<!-- Rules from Generic Standard -->
<!--
<rule ref="PSR12.Files.OpenTag">
<properties>
<property name="ignoreIndent" value="true"/>
</properties>
</rule>
<exclude name="PSR12.WhiteSpace.ScopeIndent"/>
-->
<!-- We want to allow empty statement: It allows to put some code comments into the else for examples -->
<rule ref="Generic.CodeAnalysis.EmptyStatement">

View File

@@ -1,5 +0,0 @@
To enable a default git commit template:
git config --local commit.template gitmessage
To enable the git hook pre-commit, to make CI validation at commit:
See the file pre-commit/README.md

View File

@@ -1,12 +0,0 @@
#!/bin/sh
# Hook to force a prefix on commits
commit_msg_file=$1
first_line=$(head -n1 "$commit_msg_file")
if echo "$first_line" | grep -Eqi '^(QUAL|SEC|PERF|FIX|CLOSE|NEW|Clean code|Debug[CSS)'; then
exit 0
else
echo "The commit message must start with QUAL, SEC, PERF, FIX, CLOSE, NEW, Clean code, Debug, CSS ..."
exit 1
fi

View File

@@ -12,10 +12,10 @@ HERE="$(cd "$(dirname "$0")" && pwd)"
ARGS+=(--hook-dir "$HERE" -- "$@")
if [ -x "$INSTALL_PYTHON" ]; then
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}" 1>&2
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}" 1>&2
elif command -v pre-commit > /dev/null; then
exec pre-commit "${ARGS[@]}" 1>&2
exec pre-commit "${ARGS[@]}" 1>&2
else
echo 'pre-commit not found. Did you forget to activate your virtualenv?' 1>&2
exit 1
echo 'pre-commit not found. Did you forget to activate your virtualenv?' 1>&2
exit 1
fi

View File

@@ -1,12 +0,0 @@
# Example of logrotate file to put into /etc/logrotate.d to make the rotation of
# the dolibarr log files.
/home/admin/wwwroot/dolibarr_documents/*.log {
su admin www-data
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 660 admin www-data
}

View File

@@ -124,28 +124,28 @@ $urlgit = 'https://github.com/Dolibarr/dolibarr/blob/develop/';
$output_arrproj = array();
$output_arrdep = array();
if ($dirscc != 'disabled') {
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc . --exclude-dir=htdocs/custom,htdocs/includes,htdocs/public/includes,htdocs/theme/common/fontawesome-5,htdocs/public/theme/common/fontawesome-5';
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc . --exclude-dir=htdocs/includes,htdocs/custom,htdocs/theme/common/fontawesome-5,htdocs/theme/common/octicons';
print 'Execute SCC to count lines of code in project: '.$commandcheck."\n";
$resexecproj = 0;
exec($commandcheck, $output_arrproj, $resexecproj);
// Count lines of code of dependencies
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc htdocs/includes htdocs/public/includes htdocs/theme/common/fontawesome-5 htdocs/public/theme/common/fontawesome-5';
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc htdocs/includes htdocs/theme/common/fontawesome-5 htdocs/theme/common/octicons';
print 'Execute SCC to count lines of code in dependencies: '.$commandcheck."\n";
$resexecdep = 0;
exec($commandcheck, $output_arrdep, $resexecdep);
}
// Get technical debt with PHPStan
$output_arrver = array();
$output_arrtd = array();
if ($dirphpstan != 'disabled') {
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --version';
print 'Execute PHPStan to get the version: '.$commandcheck."\n";
$resexecver = 0;
exec($commandcheck, $output_arrver, $resexecver);
$resexectd = 0;
exec($commandcheck, $output_arrtd, $resexectd);
}
$phpstanversion = $output_arrver[0];
$phpstanversion = $output_arrtd[0];
$output_arrtd = array();
if ($dirphpstan != 'disabled') {
@@ -156,15 +156,6 @@ if ($dirphpstan != 'disabled') {
}
// Get technical debt with Phan
$output_arrverphan = array();
if ($dirphpstan != 'disabled') {
$commandcheck = ($dir_phan ? $dir_phan.DIRECTORY_SEPARATOR : '') .'phan --version';
print 'Execute Phan to get the version: '.$commandcheck."\n";
$resexecverphan = 0;
exec($commandcheck, $output_arrverphan, $resexecverphan);
}
$phpphanversion = $output_arrverphan[0];
$output_phan_json = array();
$res_exec_phan = 0;
if ($dir_phan != 'disabled') {
@@ -254,20 +245,19 @@ foreach (array('proj', 'dep') as $source) {
}
// Get stats on nb of commits
/*
$nbofmonth = 2;
$delay = (3600 * 24 * 30 * $nbofmonth);
// Get stats on nb of commits
$commandcheck = "git log --all --shortstat --no-renames --no-merges --use-mailmap --pretty=".escapeshellarg('format:%cI;%H;%aN;%aE;%ce;%s')." --since=".dol_print_date(dol_now() - $delay, '%Y-%m-%d'); // --since= --until=...
print 'Execute git log to get list of commits: '.$commandcheck."\n";
$output_arrglpu = array();
$resexecglpu = 0;
//exec($commandcheck, $output_arrglpu, $resexecglpu);
*/
// Get git information for security alerts
$nbofmonth = 6;
$nbofmonth = 3;
$delay = (3600 * 24 * 30 * $nbofmonth);
$arrayofalerts = array();
@@ -276,14 +266,14 @@ print 'Execute git log to get commits related to security: '.$commandcheck."\n";
$output_arrglpu = array();
$resexecglpu = 0;
exec($commandcheck, $output_arrglpu, $resexecglpu);
foreach ($output_arrglpu as $valgitlog) { // The most recent lines are first.
foreach ($output_arrglpu as $val) {
// Parse the line to split interesting data
$tmpval = cleanVal2($valgitlog);
$tmpval = cleanVal2($val);
if (preg_match('/(#yogosha|CVE[\s\-]*\d|Sec:|Sec\s|Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..."
if (preg_match('/(#yogosha|CVE|Sec:|Sec\s|Sec$)/i', $tmpval['title'])) { // Recommended git comment: "Sec: Fix #..."
$alreadyfound = '';
$alreadyfoundcommitid = '';
foreach ($arrayofalerts as $val) { // Loop on already found alerts
foreach ($arrayofalerts as $val) {
if ($val['issueidyogosha'] && $val['issueidyogosha'] == $tmpval['issueidyogosha']) { // Already in list
$alreadyfound = 'yogosha';
$alreadyfoundcommitid = $val['commitid'];
@@ -299,9 +289,7 @@ foreach ($output_arrglpu as $valgitlog) { // The most recent lines are first.
$alreadyfoundcommitid = $val['commitid'];
break;
}
if ($val['title'] && $tmpval['title'] &&
(strpos($val['title'], $tmpval['title']) === 0 || strpos($val['title'], $tmpval['title']) > 0
|| strpos($tmpval['title'], $val['title']) === 0 || strpos($tmpval['title'], $val['title']) > 0)) { // Already in list
if ($val['title'] && $val['title'] == $tmpval['title']) { // Already in list
$alreadyfound = 'title';
$alreadyfoundcommitid = $val['commitid'];
break;
@@ -349,22 +337,70 @@ foreach ($output_arrglpu as $valgitlog) { // The most recent lines are first.
/*var_dump($tmpval['commitid'].' '.$alreadyfoundcommitid);
var_dump($arrayofalerts[$alreadyfoundcommitid]['branch']);
var_dump($tmpval);*/
$arrayofalerts[$alreadyfoundcommitid]['commitidbis'][] = $tmpval['commitid']; // Concat the new commitid to the list of commitidbis array of the already found case.
if (empty($arrayofalerts[$alreadyfoundcommitid]['issueid']) && !empty($tmpval['issueid'])) { // If not Github was defined, we set it.
$arrayofalerts[$alreadyfoundcommitid]['issueid'] = $tmpval['issueid'];
}
if ($arrayofalerts[$alreadyfoundcommitid]['title'] != $tmpval['title']) { // Concat label of the new line to the already found one (if it differs)
$arrayofalerts[$alreadyfoundcommitid]['title'] .= ', '.preg_replace('/\.$/', '', $tmpval['title']);
}
$arrayofalerts[$alreadyfoundcommitid]['branch'] = array_merge($arrayofalerts[$alreadyfoundcommitid]['branch'], $tmpval['branch']);
$arrayofalerts[$alreadyfoundcommitid]['commitidbis'][] = $tmpval['commitid'];
}
}
}
/*
//$urlgit = 'https://api.github.com/search/issues?q=is:pr+repo:Dolibarr/dolibarr+created:>'.dol_print_date(dol_now() - $delay, "%Y-%m");
$urlgit = 'https://api.github.com/search/commits?q=repo:Dolibarr/dolibarr+yogosha+created:>'.dol_print_date(dol_now() - $delay, "%Y-%m");
// Count lines of code of application
$newurl = $urlgit.'+CVE';
$result = getURLContent($newurl);
print 'Execute GET on github for '.$newurl."\n";
if ($result && $result['http_code'] == 200) {
$arrayofalerts1 = json_decode($result['content']);
foreach ($arrayofalerts1->items as $val) {
$tmpval = cleanVal($val);
if (preg_match('/CVE/i', $tmpval['title'])) {
$arrayofalerts[$tmpval['number']] = $tmpval;
}
}
} else {
print 'Error: failed to get github response';
exit(-1);
}
$newurl = $urlgit.'+yogosha';
$result = getURLContent($newurl);
print 'Execute GET on github for '.$newurl."\n";
if ($result && $result['http_code'] == 200) {
$arrayofalerts2 = json_decode($result['content']);
foreach ($arrayofalerts2->items as $val) {
$tmpval = cleanVal($val);
if (preg_match('/yogosha:/i', $tmpval['title'])) {
$arrayofalerts[$tmpval['number']] = $tmpval;
}
}
} else {
print 'Error: failed to get github response';
exit(-1);
}
$newurl = $urlgit.'+Sec:';
$result = getURLContent($newurl);
print 'Execute GET on github for '.$newurl."\n";
if ($result && $result['http_code'] == 200) {
$arrayofalerts3 = json_decode($result['content']);
foreach ($arrayofalerts3->items as $val) {
$tmpval = cleanVal($val);
if (preg_match('/Sec:/i', $tmpval['title'])) {
$arrayofalerts[$tmpval['number']] = $tmpval;
}
}
} else {
print 'Error: failed to get github response';
exit(-1);
}
*/
$timeend = time();
@@ -688,6 +724,12 @@ $html .= <<<END
END;
$html .= '<!-- ';
foreach ($output_arrglpu as $line) {
$html .= $line."\n";
}
$html .= ' -->';
$html .= '</div>';
$html .= '</section>'."\n";
@@ -835,7 +877,7 @@ if (count($output_phan_json) != 0) {
$title_security_short = "Last security issues";
$title_security = ($project ? "[".$project."] " : "").$title_security_short;
$html .= '<section class="chapter" id="securityalerts">'."\n";
$html .= '<section class="chapter" id="linesofcode">'."\n";
$html .= '<h2><span class="fas fa-code pictofixedwidth"></span>'.$title_security_short.' <span class="opacitymedium">(last '.($nbofmonth != 1 ? $nbofmonth.' months' : 'month').')</span></h2>'."\n";
$html .= '<div class="boxallwidth">'."\n";
@@ -911,7 +953,7 @@ foreach ($arrayofalerts as $key => $alert) {
}
$html .= '</td>';
// Title - Description
// Description
$html .= '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($alert['title']).'">'.dol_escape_htmltag($alert['title']).'</td>';
// Branches
@@ -932,7 +974,7 @@ $html .= '</div>';
$html .= '</div>';
$html .= '<br>';
$html .= 'Note:Search is done in git repository on regex string "#yogosha|CVE[\s\-]*\d|Sec:|Sec\s" (not case sensitive)<br>';
$html .= 'Note:Search is done in git repository on regexstring #yogosha|CVE|Sec:|Sec\s<br>';
$html .= 'You can use this URL for RSS notifications: <a href="/'.$outputfilerss.'">'.$outputfilerss.'</a><br><br>';
$html .= '</section>';
@@ -1040,7 +1082,7 @@ if ($dir_phan != 'disabled') {
]});
';
$html .= '<section class="chapter" id="technicaldebtphan">'."\n";
$html .= '<h2><span class="fas fa-book-dead pictofixedwidth"></span>Technical debt <span class="opacitymedium">('.$phpphanversion.' -> '.$phan_nblines.' warnings)</span></h2>'."\n";
$html .= '<h2><span class="fas fa-book-dead pictofixedwidth"></span>Technical debt <span class="opacitymedium">(PHAN '.$phan_nblines.' warnings)</span></h2>'."\n";
$html .= '<div class="boxallwidth">'."\n";
$html .= '<div class="div-table-responsive">'."\n";
@@ -1137,7 +1179,7 @@ function cleanVal2($val)
$tmpval['issueid'] = '';
$tmpval['issueidyogosha'] = '';
$tmpval['issueidcve'] = '';
$tmpval['title'] = array_key_exists(5, $tmp) ? preg_replace('/\.$/', '', $tmp[5]) : '';
$tmpval['title'] = array_key_exists(5, $tmp) ? $tmp[5] : '';
$tmpval['created_at'] = array_key_exists(0, $tmp) ? $tmp[0] : '';
$tmpval['updated_at'] = '';
@@ -1146,7 +1188,7 @@ function cleanVal2($val)
$tmpval['issueid'] = $reg[1];
}
if (preg_match('/CVE([0-9\-\s]+)/', $tmpval['title'], $reg)) {
$tmpval['issueidcve'] = preg_replace('/^\-/', '', preg_replace('/\s+/', '-', trim($reg[1])));
$tmpval['issueidcve'] = preg_replace('/^\-/', '', trim($reg[1]));
}
if (preg_match('/#yogosha(\d+)/i', $tmpval['title'], $reg)) {
$tmpval['issueidyogosha'] = $reg[1];

View File

@@ -13,7 +13,7 @@ zar
# Need as part of some PHP keys for some array variables
referer
# Name of contributors
# Name of contributores
noe
udo
tim
@@ -90,7 +90,7 @@ espace
methode
datee
# Some string found because it is part of text that is html entities escaped into files
# Some string found because it is part text that is html entities escaped into files
tre
activ

View File

@@ -9,41 +9,66 @@
*/
return [
// # Issue statistics:
// PhanUndeclaredProperty : 420+ occurrences
// PhanUndeclaredProperty : 440+ occurrences
// PhanTypeMismatchProperty : 100+ occurrences
// PhanTypeMismatchArgument : 70+ occurrences
// PhanUndeclaredGlobalVariable : 70+ occurrences
// PhanTypeMismatchArgumentNullable : 40+ occurrences
// PhanTypeInvalidDimOffset : 15+ occurrences
// PhanUndeclaredGlobalVariable : 90+ occurrences
// PhanTypeMismatchArgument : 85+ occurrences
// PhanTypeMismatchArgumentNullable : 30+ occurrences
// PhanTypeExpectedObjectPropAccess : 20+ occurrences
// PhanTypeInvalidDimOffset : 20+ occurrences
// PhanTypeMismatchDimFetch : 15+ occurrences
// PhanUndeclaredConstant : 15+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 9 occurrences
// PhanUndeclaredMethod : 9 occurrences
// PhanPossiblyUndeclaredGlobalVariable : 6 occurrences
// PhanTypeArraySuspiciousNull : 6 occurrences
// PhanTypeComparisonFromArray : 6 occurrences
// PhanTypeExpectedObjectPropAccess : 5 occurrences
// PhanTypeMismatchArgumentProbablyReal : 5 occurrences
// PhanPluginUndeclaredVariableIsset : 5 occurrences
// PhanParamTooMany : 4 occurrences
// PhanPluginDuplicateArrayKey : 4 occurrences
// PhanParamTooMany : 3 occurrences
// PhanPluginUndeclaredVariableIsset : 3 occurrences
// PhanPluginDuplicateExpressionBinaryOp : 4 occurrences
// PhanTypeMismatchDimAssignment : 2 occurrences
// PhanTypeMismatchReturn : 2 occurrences
// PhanTypeSuspiciousStringExpression : 2 occurrences
// PhanPossiblyUndeclaredVariable : 1 occurrence
// PhanTypeExpectedObjectPropAccessButGotNull : 1 occurrence
// PhanTypeMismatchReturn : 1 occurrence
// PhanTypeMismatchArgumentNullableInternal : 1 occurrence
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/api/class/api_setup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturn'],
'htdocs/asset/class/asset.class.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetdepreciationoptions.class.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/asset/class/assetmodel.class.php' => ['PhanUndeclaredProperty'],
'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/bom/tpl/objectline_create.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/bom/tpl/objectline_edit.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bom/tpl/objectline_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/bookcal/availabilities_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/calendar_card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
'htdocs/collab/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'],
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'],
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/mailing/targetemailing.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/card.php' => ['PhanTypeMismatchProperty'],
'htdocs/comm/propal/list.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/propal/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/class/api_orders.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/customer.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'],
'htdocs/commande/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'],
@@ -51,13 +76,16 @@ return [
'htdocs/compta/bank/various_payment/card.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/bank/various_payment/info.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
'htdocs/compta/clients.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/facture/tpl/linkedobjectblockForRec.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument'],
'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'],
'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'],
@@ -82,7 +110,7 @@ return [
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'],
'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'],
@@ -90,6 +118,7 @@ return [
'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/extrafields.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/class/html.formcompany.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/html.formfile.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/class/html.formmail.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/class/openid.class.php' => ['PhanTypeMismatchArgument'],
@@ -99,12 +128,14 @@ return [
'htdocs/core/lib/company.lib.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/core/lib/files.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/functions2.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/pdf.lib.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/core/lib/pdf.lib.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/core/lib/product.lib.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/lib/project.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/lib/xcal.lib.php' => ['PhanUndeclaredProperty'],
'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
@@ -154,6 +185,7 @@ return [
'htdocs/core/tpl/resource_view.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanUndeclaredProperty'],
'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanUndeclaredProperty'],
'htdocs/datapolicy/class/datapolicycron.class.php' => ['PhanTypeMismatchArgument'],
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'],
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
@@ -169,14 +201,18 @@ return [
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'],
'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'],
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/expensereport/payment/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/expensereport/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanUndeclaredProperty'],
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
'htdocs/fichinter/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/filefunc.inc.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/fourn/class/api_supplier_orders.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/fourn/class/fournisseur.commande.class.php' => ['PhanUndeclaredProperty'],
'htdocs/fourn/commande/card.php' => ['PhanUndeclaredProperty'],
'htdocs/fourn/commande/card.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'],
'htdocs/fourn/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/fourn/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'],
@@ -184,6 +220,7 @@ return [
'htdocs/holiday/card_group.php' => ['PhanTypeMismatchArgument'],
'htdocs/holiday/list.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/hrm/class/evaluation.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/evaluationdet.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/job.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/position.class.php' => ['PhanUndeclaredProperty'],
'htdocs/hrm/class/skill.class.php' => ['PhanUndeclaredProperty'],
@@ -217,6 +254,7 @@ return [
'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'],
'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/list.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/movement_card.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/product/stock/movement_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/product/stock/productlot_card.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanUndeclaredProperty'],
@@ -225,6 +263,7 @@ return [
'htdocs/product/stock/stats/reception.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stocktransfer/class/stocktransferline.class.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/tpl/stockcorrection.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/tpl/stocktransfer.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/projet/card.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/projet/tasks.php' => ['PhanTypeMismatchArgument'],
@@ -233,7 +272,7 @@ return [
'htdocs/public/eventorganization/subscriptionok.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'],
'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'],
@@ -241,7 +280,7 @@ return [
'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'],
'htdocs/reception/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'],
'htdocs/reception/list.php' => ['PhanUndeclaredProperty'],
'htdocs/reception/list.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanUndeclaredProperty'],
@@ -280,7 +319,19 @@ return [
'htdocs/webportal/class/html.formcardwebportal.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_actioncomm.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_category.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_contact.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_invoice.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_order.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'],
'htdocs/webservices/server_payment.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_productorservice.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_project.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_supplier_invoice.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_thirdparty.php' => ['PhanUndeclaredProperty'],
'htdocs/webservices/server_user.php' => ['PhanUndeclaredProperty'],
'htdocs/website/websiteaccount_card.php' => ['PhanUndeclaredProperty'],
'internal' => ['PhanUndeclaredConstant'],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases)

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This is the phan config file used by .github/workflows/phan.yml
*/

View File

@@ -1,93 +1,53 @@
<?php
// These stubs were generated by the phan stub generator.
// @phan-stub-for-extension ftp@7.4.12
namespace {
const FTP_ASCII = 1;
const FTP_TEXT = 1;
const FTP_BINARY = 2;
const FTP_IMAGE = 2;
const FTP_AUTORESUME = -1;
const FTP_TIMEOUT_SEC = 0;
const FTP_AUTOSEEK = 1;
const FTP_USEPASVADDRESS = 2;
const FTP_FAILED = 0;
const FTP_FINISHED = 1;
const FTP_MOREDATA = 2;
function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {}
function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {}
function ftp_login(FTP\Connection $ftp, string $username, #[\SensitiveParameter] string $password): bool {}
function ftp_pwd(FTP\Connection $ftp): string|false {}
function ftp_cdup(FTP\Connection $ftp): bool {}
function ftp_chdir(FTP\Connection $ftp, string $directory): bool {}
function ftp_exec(FTP\Connection $ftp, string $command): bool {}
/**
* @return array<int, string>|null
*/
function ftp_raw(FTP\Connection $ftp, string $command): ?array {}
function ftp_mkdir(FTP\Connection $ftp, string $directory): string|false {}
function ftp_rmdir(FTP\Connection $ftp, string $directory): bool {}
function ftp_chmod(FTP\Connection $ftp, int $permissions, string $filename): int|false {}
/** @param string $response */
function ftp_alloc(FTP\Connection $ftp, int $size, &$response = null): bool {}
/**
* @return array<int, string>|false
*/
function ftp_nlist(FTP\Connection $ftp, string $directory): array|false {}
/**
* @return array<int, string>|false
*/
function ftp_rawlist(FTP\Connection $ftp, string $directory, bool $recursive = false): array|false {}
/**
* @return array<int, array>|false
*/
function ftp_mlsd(FTP\Connection $ftp, string $directory): array|false {}
function ftp_systype(FTP\Connection $ftp): string|false {}
/** @param resource $stream */
function ftp_fget(FTP\Connection $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
/** @param resource $stream */
function ftp_nb_fget(FTP\Connection $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int {}
function ftp_pasv(FTP\Connection $ftp, bool $enable): bool {}
function ftp_get(FTP\Connection $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
function ftp_nb_get(FTP\Connection $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int|false {}
function ftp_nb_continue(FTP\Connection $ftp): int {}
/** @param resource $stream */
function ftp_fput(FTP\Connection $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): bool {}
/** @param resource $stream */
function ftp_nb_fput(FTP\Connection $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): int {}
function ftp_put(FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
function ftp_append(FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY): bool {}
function ftp_nb_put(FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): int|false {}
function ftp_size(FTP\Connection $ftp, string $filename): int {}
function ftp_mdtm(FTP\Connection $ftp, string $filename): int {}
function ftp_rename(FTP\Connection $ftp, string $from, string $to): bool {}
function ftp_delete(FTP\Connection $ftp, string $filename): bool {}
function ftp_site(FTP\Connection $ftp, string $command): bool {}
function ftp_close(FTP\Connection $ftp): bool {}
function ftp_quit(FTP\Connection $ftp): bool {}
/** @param int|bool $value */
function ftp_set_option(FTP\Connection $ftp, int $option, $value): true {}
function ftp_get_option(FTP\Connection $ftp, int $option): int|bool {}
}
namespace FTP {
/**
* @strict-properties
* @not-serializable
*/
final class Connection
{
}
function ftp_alloc($ftp, $size, &$response = null) {}
function ftp_append($ftp, $remote_file, $local_file, $mode = null) {}
function ftp_cdup($ftp) {}
function ftp_chdir($ftp, $directory) {}
function ftp_chmod($ftp, $mode, $filename) {}
function ftp_close($ftp) {}
function ftp_connect($host, $port = null, $timeout = null) {}
function ftp_delete($ftp, $file) {}
function ftp_exec($ftp, $command) {}
function ftp_fget($ftp, $fp, $remote_file, $mode = null, $resumepos = null) {}
function ftp_fput($ftp, $remote_file, $fp, $mode = null, $startpos = null) {}
function ftp_get($ftp, $local_file, $remote_file, $mode = null, $resume_pos = null) {}
function ftp_get_option($ftp, $option) {}
function ftp_login($ftp, $username, $password) {}
function ftp_mdtm($ftp, $filename) {}
function ftp_mkdir($ftp, $directory) {}
function ftp_mlsd($ftp, $directory) {}
function ftp_nb_continue($ftp) {}
function ftp_nb_fget($ftp, $fp, $remote_file, $mode = null, $resumepos = null) {}
function ftp_nb_fput($ftp, $remote_file, $fp, $mode = null, $startpos = null) {}
function ftp_nb_get($ftp, $local_file, $remote_file, $mode = null, $resume_pos = null) {}
function ftp_nb_put($ftp, $remote_file, $local_file, $mode = null, $startpos = null) {}
function ftp_nlist($ftp, $directory) {}
function ftp_pasv($ftp, $pasv) {}
function ftp_put($ftp, $remote_file, $local_file, $mode = null, $startpos = null) {}
function ftp_pwd($ftp) {}
function ftp_quit($ftp) {}
function ftp_raw($ftp, $command) {}
function ftp_rawlist($ftp, $directory, $recursive = null) {}
function ftp_rename($ftp, $src, $dest) {}
function ftp_rmdir($ftp, $directory) {}
function ftp_set_option($ftp, $option, $value) {}
function ftp_site($ftp, $cmd) {}
function ftp_size($ftp, $filename) {}
function ftp_ssl_connect($host, $port = null, $timeout = null) {}
function ftp_systype($ftp) {}
const FTP_ASCII = 1;
const FTP_AUTORESUME = -1;
const FTP_AUTOSEEK = 1;
const FTP_BINARY = 2;
const FTP_FAILED = 0;
const FTP_FINISHED = 1;
const FTP_IMAGE = 2;
const FTP_MOREDATA = 2;
const FTP_TEXT = 1;
const FTP_TIMEOUT_SEC = 0;
const FTP_USEPASVADDRESS = 2;
}

View File

@@ -66,14 +66,8 @@ parameters:
reportMagicMethods: false
reportMagicProperties: false
treatPhpDocTypesAsCertain: false
# if you want to exclude something, generate the baseline to do that, add here give only pattern that does not give the opportunity to introduce new errors
# or pattern to avoid false positive of some bugged or allowed phpstan checks
ignoreErrors:
- '#.*phan-var#'
- '#^Expression "''…" on a separate line does not do anything#'
- '#Empty array passed to foreach#'
- '#Unable to resolve the template type T#'
- '#in empty\(\) always exists and is always falsy#'
- '#is always#'
internalErrorsCountLimit: 50
cache:

View File

@@ -16,15 +16,15 @@ composer install
#### Usage
##### To make changes (remove --dry-run for real run)
##### To make changes (Add --dry-run for test mode only)
```shell
cd dev/tools/rector
./vendor/bin/rector process --debug --dry-run
./vendor/bin/rector process --dry-run
```
##### To make changes on a given directory
```shell
cd dev/tools/rector
./vendor/bin/rector process --debug [--dry-run] [--clear-cache] ../../../htdocs/core/
./vendor/bin/rector process [--dry-run] [--clear-cache] ../../../htdocs/core/
```

View File

@@ -18,7 +18,7 @@
/**
* \file dev/tools/rector/rector.php
* \ingroup core
* \brief Tool to run rector
* \brief Toolt to run rector
*
* cd dev/tools/rector
* ./vendor/bin/rector process [--dry-run] [--clear-cache] ../../../htdocs/core/
@@ -33,22 +33,17 @@ use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(PhpVersion::PHP_71);
$rectorConfig->indent(' ', 4);
//$rectorConfig->indent(' ', 4);
// Traits seems not supported correctly by rector without declaring them as bootstrapFiles
$arrayoftraitfiles = array(
__DIR__ . '/../../../htdocs/core/class/commonincoterm.class.php',
__DIR__ . '/../../../htdocs/core/class/commonpeople.class.php',
__DIR__ . '/../../../htdocs/core/class/commonsignedobject.class.php',
__DIR__ . '/../../../htdocs/core/class/commonsocialnetworks.class.php',
__DIR__ . '/../../../htdocs/core/class/commontrigger.class.php',
__DIR__ . '/../../../htdocs/core/class/doldeprecationhandler.class.php',
__DIR__ . '/../../../htdocs/subtotals/class/commonsubtotal.class.php',
__DIR__ . '/../../../htdocs/core/class/commonsocialnetworks.class.php'
);
$rectorConfig->bootstrapFiles($arrayoftraitfiles);
$rectorConfig->paths([
__DIR__ . '/../../../dev/',
__DIR__ . '/../../../htdocs/',
__DIR__ . '/../../../scripts/',
__DIR__ . '/../../../test/phpunit/',
@@ -59,8 +54,7 @@ return static function (RectorConfig $rectorConfig): void {
'**/custom/**',
'**/vendor/**',
'**/rector/**', // Disable this line to test the "test.php" file.
__DIR__ . '/../../../dev/tools/phan/stubs/*',
__DIR__ . '/../../../htdocs/custom/*',
__DIR__ . '/../../../htdocs/custom/',
__DIR__ . '/../../../htdocs/install/doctemplates/*'
//'test.php',
]);
@@ -88,18 +82,12 @@ return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyUserRightsToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\GlobalToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class);
//$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class);
// This fix <> into != but it breaks other rules, so added at end.
//$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
/*
$rectorConfig->skip([
Rector\BetterPhpDocParser\PhpDocParser\BetterPhpDocParser::class,
Dolibarr\Rector\Renaming\GlobalToFunction::class
]);
*/
// Add all predefined rules to migrate to up to php 71.
// Warning this break tab spacing of arrays on several lines

View File

@@ -63,7 +63,7 @@ class GlobalToFunction extends AbstractRector
'Change $conf->global to getDolGlobal in context (1) conf->global Operator Value or (2) function(conf->global...)',
[new CodeSample(
'$conf->global->CONSTANT',
'getDolGlobalString|Int(\'CONSTANT\')'
'getDolGlobalInt(\'CONSTANT\')'
)]
);
}
@@ -228,36 +228,14 @@ class GlobalToFunction extends AbstractRector
return new Concat($leftConcat, $rightConcat);
}
// If a && b and a or b is conf->global, we replace a or/and b
if ($node instanceof BooleanAnd) {
// Transformation sur le nœud gauche
$changedone = 0;
if ($this->isGlobalVar($node->left)) {
$constName = $this->getConstName($node->left);
if (empty($constName)) {
return;
}
$node->left = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
$changedone++;
}
if ($this->isGlobalVar($node->right)) {
$constName = $this->getConstName($node->right);
if (empty($constName)) {
return;
}
$node->right = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
$changedone++;
$nodes = $this->resolveTwoNodeMatch($node);
if (!isset($nodes)) {
return;
}
if ($changedone) {
return $node;
}
/** @var Equal $node */
$node = $nodes->getFirstExpr();
}
@@ -292,42 +270,9 @@ class GlobalToFunction extends AbstractRector
return;
}
// Now we process a comparison
$isconfglobal = $this->isGlobalVar($node->left);
if (!$isconfglobal) {
$isconfglobal = $this->isGlobalVar($node->right);
if (!$isconfglobal) {
// The left side and right side is not conf->global->xxx, so we leave
return;
}
// Right side is conf->global->xxx, but we can't know if we must use getDolGlobalInt or String,
// so we use getDolGlobalString if comparison is ==
if ($typeofcomparison == 'Equal') {
$constName = $this->getConstName($node->right);
if (empty($constName)) {
return;
}
// Test the type after the comparison conf->global->xxx to know the name of function
$typeleft = $node->left->getType();
switch ($typeleft) {
case 'Scalar_LNumber':
$funcName = 'getDolGlobalInt';
break;
case 'Scalar_String':
$funcName = 'getDolGlobalString';
break;
default: // Can be Expr_FuncCall
$funcName = 'getDolGlobalString';
break;
}
$node->right = new FuncCall(
new Name($funcName),
[new Arg($constName)]
);
return $node;
}
// The left side is not conf->global->xxx, so we leave
return;
}
@@ -415,6 +360,36 @@ class GlobalToFunction extends AbstractRector
}
}
/**
* Get nodes with check empty
*
* @param BooleanAnd $booleanAnd A BooleandAnd
* @return TwoNodeMatch|null
*/
private function resolveTwoNodeMatch(BooleanAnd $booleanAnd): ?TwoNodeMatch
{
return $this->binaryOpManipulator->matchFirstAndSecondConditionNode(
$booleanAnd,
// Function to check if we are in the case $conf->global->... == $value
function (Node $node): bool {
if (!$node instanceof Equal) {
return \false;
}
return $this->isGlobalVar($node->left);
},
// !empty(...) || isset(...)
function (Node $node): bool {
if ($node instanceof BooleanNot && $node->expr instanceof Empty_) {
return $this->isGlobalVar($node->expr->expr);
}
if (!$node instanceof Isset_) {
return $this->isGlobalVar($node);
}
return \true;
}
);
}
/**
* Check if node is a global access with format conf->global->XXX
*

View File

@@ -24,10 +24,6 @@ DATAPOLICY_TIERS_NIPROSPECT_NICLIENT
DATAPOLICY_TIERS_PROSPECT
DATAPOLICY_TIERS_PROSPECT_CLIENT
#
TOKEN_EXPIRE_AT
TOKEN_EXPIRED
# fournisseur
CodePaymentTerm
IdPaymentTerm
@@ -40,15 +36,6 @@ Reservation
CompletePage
PortionOfPage
#
AccountancyGroupCAPIT
AccountancyGroupEXPENSE
AccountancyGroupFINAN
AccountancyGroupIMMO
AccountancyGroupINCOME
AccountancyGroupSTOCK
AccountancyGroupTHIRDPARTY
# Others
ACCOUNTING_ACCOUNT_CUSTOMER
ACCOUNTING_ACCOUNT_CUSTOMER_Desc
@@ -108,14 +95,6 @@ ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT
ACCOUNTING_VAT_PAY_ACCOUNT
ACCOUNTING_VAT_SOLD_ACCOUNT
ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT
AI_API_MODEL_AUDIO
AI_API_MODEL_IMAGE
AI_API_MODEL_TEXT
AI_API_MODEL_TRANSCRIPT
AI_API_MODEL_TRANSLATE
AI_API_MODEL_VIDEO
AGENDA_EVENT_CURRENT_COLOR
AGENDA_EVENT_FUTURE_COLOR
AGENDA_EVENT_PAST_COLOR

View File

@@ -96,6 +96,8 @@ AADE_WEBSERVICE_USER
API
Accept
AccountancyErrorMismatchLetteringCode
AccountingAccount
AccountingCode
AccountingJournalType
ActionAC_
ActionAC_ALL_
@@ -145,12 +147,14 @@ Banque
Barcode
BarcodeDesc
BarcodeStickersMask
BatchInformationNotfound
BillOfMaterialsLine
BlockLogNeedAmountsValue
BlockLogNeedElement
BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote
BlockedLogAuthorityUrl
BlockedLogSetup
BookCalSystem
Bookings
BoxTitleLast
BoxTitleLatest
@@ -198,6 +202,8 @@ ConfirmActionMyObject
ConfirmActionTarget
ConfirmCloneMyObject
ConfirmCloneTask
ConfirmCreateAdherent
ConfirmDeleteAdherent
ConfirmDeleteIndividual
ConfirmDeleteReport
ConfirmDeleteWebsiteAccount
@@ -285,6 +291,7 @@ EmailcollectorFilter
EmailingTargetSelector
Empty
End
EnterAnIP
EnterNameOfDictionnaryToDeleteDesc
Entries
ErrSCAAuthentication
@@ -302,6 +309,7 @@ ErrorBadSocialNetworkValue
ErrorBadStatus
ErrorBadValue
ErrorBadValueForBatch
ErrorBadValueForDate
ErrorCanNotDeleteDir
ErrorCantSplitAUsedDiscount
ErrorChartOfAccountSystemNotSelected
@@ -354,6 +362,7 @@ ErrorTechnicalError
ErrorThirdPartyIdIsMandatory
ErrorTicketIsNotValid
ErrorTitreAlreadyExists
ErrorUpdatingUsersCP
ErrorUserFetch
ErrorValueMustBeInteger
ErrorValueTooHigh
@@ -610,6 +619,7 @@ PaymentCondition
PaymentConditionShort
PaymentDonation
PaymentHigherThanReminderToPaySupplier
PaymentSalary
PaymentSendToStripeTerminal
PaymentType
PaymentTypeShort
@@ -633,7 +643,10 @@ PrintModule
PrintUserConfDesc
PrinterId
PrinterIdEmpty
PrinterLocation
PrinterNameEmpty
PrinterParameterEmpty
Printers
Printing
ProductCodeDesc
ProductFournisseurPrice
@@ -797,6 +810,7 @@ Templates
TestPrinterTemplate
TestTemplateToPrinter
Theme
ThirdpartyHasNoDefaultBanAccount
ThisIsInformationOnDocumentToSign
ThisScreenAllowsYouToSignDocFrom
TicketCategoryShort
@@ -833,6 +847,8 @@ UpdateUser
UpgradeHasBeenUnlocked
Url
Use of API for currency update is disabled by option MULTICURRENCY_DISABLE_SYNC_CURRENCYLAYER
UserRemovedFromGroup
UserSetInGroup
VCard
Vacant
ValidateAndSign
@@ -858,6 +874,7 @@ Widgets
Windows
WorkingBoard
Workload
WrongAmount
XDebug
XmlCorrupted
Y
@@ -1014,6 +1031,10 @@ PDF/A-3b
PartnershipSentByEMail
PdfTitle
ProcessingError
PurchaseOrder
PurchaseOrders
ReceptionSentByEMail
ReceptionValidated
Recruited
Ref. Product
RefNewContract
@@ -1021,6 +1042,7 @@ Stable
Suggested
TicketMessageMailSignatureText
TicketSetupPage
Tiers
Timeline
Transfer
TryAnotherConnectionMode

View File

@@ -1,7 +1,6 @@
#!/bin/bash
#
# Find unused translations pretty fast...
# Go into the root of the git directory, then launch the shell.
#
# Principle:
#
@@ -36,7 +35,7 @@ DYNAMIC_KEYS_FILE=${TMP}/dynamic_keys
MISSING_AND_UNUSED_FILE=${TMP}/missing_and_unused
MISSING_FILE=${TMP}/missing
UNUSED_FILE=${TMP}/unused
EXPECTED_REGEX='(Country..|ExportDataset_.*|Language_.._..|MonthVeryShort\d\d|PaperFormat.*||Permission.*|ProfId\d(..)?|TypeContact_shipping_external_.*|unit.*)'
EXPECTED_REGEX='(Country..|ExportDataset_.*|Language_.._..|MonthVeryShort\d\d|PaperFormat.*||Permission.*|ProfId\d(..)?|unit.*)'
DYNAMIC_KEYS_SRC_FILE=${MYDIR}/dynamic_translation_keys.lst
EXCLUDE_KEYS_SRC_FILE=${MYDIR}/ignore_translation_keys.lst
DUPLICATE_KEYS_SRC_FILE=${MYDIR}/duplicate_translation_keys.lst

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -61,7 +61,7 @@ $search_import_key = GETPOST('search_import_key', 'alpha');
$search_reconcilable = GETPOST("search_reconcilable", 'int');
$search_centralized = GETPOST("search_centralized", 'int');
$search_active = GETPOST("search_active", 'int');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$confirm = GETPOST('confirm', 'alpha');
@@ -98,22 +98,20 @@ if (!$sortorder) {
$sortorder = "ASC";
}
$object = new AccountingAccount($db);
$arrayfields = array(
'aa.account_number' => array('label' => "AccountNumber", 'checked' => '1'),
'aa.label' => array('label' => "Label", 'checked' => '1'),
'aa.labelshort' => array('label' => "ShortLabel", 'checked' => '1'),
'aa.labelshort' => array('label' => "LabelToShow", 'checked' => '1'),
'aa.account_parent' => array('label' => "Accountparent", 'checked' => '1'),
'aa.pcg_type' => array('label' => "Pcgtype", 'checked' => '1', 'help' => 'PcgtypeDesc'),
'categories' => array('label' => "AccountingCategories", 'checked' => '-1', 'help' => 'AccountingCategoriesDesc'),
'aa.reconcilable' => array('label' => "Reconcilable", 'checked' => '1'),
'aa.centralized' => array('label' => "Centralized", 'checked' => '1', 'help' => 'CentralizedAccountHelp'),
'aa.centralized' => array('label' => "Centralized", 'checked' => '1'),
'aa.import_key' => array('label' => "ImportId", 'checked' => '-1', 'help' => ''),
'aa.active' => array('label' => "Activated", 'checked' => '1')
);
if (!getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
unset($arrayfields['categories']);
unset($arrayfields['aa.reconcilable']);
}
@@ -352,7 +350,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
@@ -559,10 +557,12 @@ if ($resql) {
}
// Reconcilable
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print '<td class="liste_titre center">';
print $form->selectyesno('search_reconcilable', $search_reconcilable, 1, false, 1, 1, 'search_status onrightofpage width75');
print '</td>';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print '<td class="liste_titre center">';
print $form->selectyesno('search_reconcilable', $search_reconcilable, 1, false, 1, 1, 'search_status onrightofpage width75');
print '</td>';
}
}
// Centralized
@@ -574,11 +574,10 @@ if ($resql) {
// Active
if (!empty($arrayfields['aa.active']['checked'])) {
print '<td class="liste_titre center parentonrightofpage">';
print '<td class="liste_titre center">';
print $form->selectyesno('search_active', $search_active, 1, false, 1, 1, 'search_status onrightofpage width75');
print '</td>';
}
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch">';
@@ -615,14 +614,12 @@ if ($resql) {
print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
$totalarray['nbfield']++;
}
// Main group
if (!empty($arrayfields['aa.pcg_type']['checked'])) {
print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type,aa.account_number', '', $param, '', $sortfield, $sortorder, 'right ', $arrayfields['aa.pcg_type']['help'].'::-1', 1);
print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type,aa.account_number', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help'], 1);
$totalarray['nbfield']++;
}
// Number of custom groups
if (!empty($arrayfields['categories']['checked'])) {
print_liste_field_titre($arrayfields['categories']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '', $arrayfields['categories']['help'].'::-1', 1);
print_liste_field_titre($arrayfields['categories']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, '', $arrayfields['categories']['help'], 1);
$totalarray['nbfield']++;
}
@@ -632,19 +629,21 @@ if ($resql) {
print $hookmanager->resPrint;
if (!empty($arrayfields['aa.import_key']['checked'])) {
print_liste_field_titre($arrayfields['aa.import_key']['label'], $_SERVER["PHP_SELF"], 'aa.import_key', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.import_key']['help'].'::-1', 1);
print_liste_field_titre($arrayfields['aa.import_key']['label'], $_SERVER["PHP_SELF"], 'aa.import_key', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.import_key']['help'], 1);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['aa.centralized']['checked'])) {
print_liste_field_titre($arrayfields['aa.centralized']['label'], $_SERVER["PHP_SELF"], 'aa.centralized', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.centralized']['help'].'::-1', 1);
print_liste_field_titre($arrayfields['aa.centralized']['label'], $_SERVER["PHP_SELF"], 'aa.centralized', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
if (!empty($arrayfields['aa.active']['checked'])) {
print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
$totalarray['nbfield']++;
}
// Action column
@@ -760,7 +759,7 @@ if ($resql) {
}
// Custom accounts
if (!empty($arrayfields['categories']['checked'])) {
print '<td class="right">';
print "<td>";
// TODO Get all custom groups labels the account is in
print dol_escape_htmltag($obj->fk_accounting_category);
print "</td>\n";
@@ -784,21 +783,23 @@ if ($resql) {
}
}
// Activated or not reconciliation on an accounting account
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print '<td class="center">';
if (empty($obj->reconcilable)) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
// Activated or not reconciliation on an accounting account
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
print '<td class="center">';
if (empty($obj->reconcilable)) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a>';
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
}

View File

@@ -12,7 +12,7 @@
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 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
@@ -92,8 +92,6 @@ $search_country_id = GETPOST('search_country_id', 'int');
if ($user->socid > 0) {
accessforbidden();
}
$permissiontoeditchart = $user->hasRight('accounting', 'chartofaccount');
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}
@@ -144,6 +142,8 @@ $tabrowid[31] = "";
$tabhelp = array();
$tabhelp[31] = array('pcg_version' => $langs->trans("EnterAnyCode"));
$permissiontoeditchart = $user->hasRight('accounting', 'chartofaccount');
/*
* Actions
@@ -199,15 +199,32 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
// Si verif ok et action add, on ajoute la ligne
if ($ok && GETPOST('actionadd', 'alpha')) {
$newid = 0;
if ($tabrowid[$id]) {
// Get free id for insert
$sql = "SELECT MAX(".$db->sanitize($tabrowid[$id]).") as newid FROM ".$db->sanitize($tabname[$id]);
$result = $db->query($sql);
if ($result) {
$obj = $db->fetch_object($result);
$newid = ($obj->newid + 1);
} else {
dol_print_error($db);
}
}
// Add new entry
$sql = "INSERT INTO ".$db->sanitize($tabname[$id])." (";
// List of fields
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
$sql .= $db->sanitize($tabrowid[$id]).",";
}
$sql .= $db->sanitize($tabfieldinsert[$id]);
$sql .= ",active)";
$sql .= " VALUES(";
// List of values
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
$sql .= $newid.",";
}
$i = 0;
foreach ($listfieldinsert as $f => $value) {
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
@@ -243,10 +260,19 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
// Si verif ok et action modify, on modifie la ligne
if ($ok && GETPOST('actionmodify', 'alpha')) {
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
} else {
$rowidcol = "rowid";
}
// Modify entry
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
// Modifie valeur des champs
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
$sql .= $db->sanitize($tabrowid[$id])." = ";
$sql .= "'".$db->escape($rowid)."', ";
}
$i = 0;
foreach ($listfieldmodify as $field) {
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
@@ -265,7 +291,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
}
$i++;
}
$sql .= " WHERE rowid = ".((int) $rowid);
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
dol_syslog("actionmodify", LOG_DEBUG);
//print $sql;
@@ -276,9 +302,14 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
}
}
// delete
if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontoeditchart) {
$sql = "DELETE from ".$db->sanitize($tabname[$id])." WHERE rowid = ".((int) $rowid);
if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontoeditchart) { // @phpstan-ignore-line
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
} else {
$rowidcol = "rowid";
}
$sql = "DELETE from ".$db->sanitize($tabname[$id])." WHERE ".$db->sanitize($rowidcol)." = ".((int) $rowid);
dol_syslog("delete", LOG_DEBUG);
$result = $db->query($sql);
@@ -292,7 +323,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $permissiontoeditchart)
}
// activate
if ($action == 'activate' && $permissiontoeditchart) {
if ($action == 'activate' && $permissiontoeditchart) { // @phpstan-ignore-line
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 1 WHERE rowid = ".((int) $rowid);
$result = $db->query($sql);
if (!$result) {
@@ -301,7 +332,7 @@ if ($action == 'activate' && $permissiontoeditchart) {
}
// disable
if ($action == $acts[1] && $permissiontoeditchart) {
if ($action == $acts[1] && $permissiontoeditchart) { // @phpstan-ignore-line
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET active = 0 WHERE rowid = ".((int) $rowid);
$result = $db->query($sql);
if (!$result) {
@@ -577,19 +608,36 @@ if ($resql) {
}
}
// Can an entry be erased or disabled ?
$iserasable = 1;
$canbedisabled = 1;
$canbemodified = 1; // true by default
$url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
$url .= '&'.$param.'&';
// Active
print '<td class="center nowrap">';
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
if ($canbedisabled) {
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
print "</td>";
// Modify link
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
if ($canbemodified) {
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
} else {
print '<td>&nbsp;</td>';
}
// Delete link
print '<td class="center"><a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>';
if ($iserasable) {
print '<td class="center"><a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>';
} else {
print '<td>&nbsp;</td>';
}
print "</tr>\n";
}
@@ -653,8 +701,16 @@ function fieldListAccountModel($fieldlist, $obj = null, $tabname = '', $context
print '</td>';
}
} elseif ($fieldlist[$field] == 'type_cdr') {
print '<td class="center">';
print $form->selectarray($fieldlist[$field], array(0 => $langs->trans('None'), 1 => $langs->trans('AtEndOfMonth'), 2 => $langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
if ($fieldlist[$field] == 'type_cdr') {
print '<td class="center">';
} else {
print '<td>';
}
if ($fieldlist[$field] == 'type_cdr') {
print $form->selectarray($fieldlist[$field], array(0 => $langs->trans('None'), 1 => $langs->trans('AtEndOfMonth'), 2 => $langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
} else {
print $form->selectyesno($fieldlist[$field], (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''), 1);
}
print '</td>';
} elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
print '<td><input type="text" class="flat" value="'.(!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'" size="10" name="'.$fieldlist[$field].'"></td>';

View File

@@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 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
@@ -77,7 +77,7 @@ if (GETPOST('cancel', 'alpha')) {
exit;
}
if ($action == 'add' /* && $user->hasRight('accounting', 'chartofaccount') // already checked */) {
if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) {
if (!$cancel) {
if (!$account_number) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountNumber")), null, 'errors');
@@ -132,7 +132,7 @@ if ($action == 'add' /* && $user->hasRight('accounting', 'chartofaccount') // al
}
}
}
} elseif ($action == 'edit' /* && $user->hasRight('accounting', 'chartofaccount') // already checked */) {
} elseif ($action == 'edit' && $user->hasRight('accounting', 'chartofaccount')) {
if (!$cancel) {
if (!$account_number) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountNumber")), null, 'errors');
@@ -245,7 +245,7 @@ if ($action == 'create') {
print '<td><input name="label" size="70" value="'.$object->label.'"></td></tr>';
// Label short
print '<tr><td>'.$langs->trans("ShortLabel").'</td>';
print '<tr><td>'.$langs->trans("LabelToShow").'</td>';
print '<td><input name="labelshort" size="70" value="'.$object->labelshort.'"></td></tr>';
// Account parent
@@ -314,15 +314,15 @@ if ($action == 'create') {
// Account number
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("AccountNumber").'</span></td>';
print '<td><input class="minwidth300" name="account_number" value="'.$object->account_number.'"></td></tr>';
print '<td><input name="account_number" size="30" value="'.$object->account_number.'"></td></tr>';
// Label
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td>';
print '<td><input class="minwidth500" name="label" value="'.$object->label.'"></td></tr>';
print '<td><input name="label" size="70" value="'.$object->label.'"></td></tr>';
// Label short
print '<tr><td>'.$langs->trans("ShortLabel").'</td>';
print '<td><input class="minwidth300" name="labelshort" value="'.$object->labelshort.'"></td></tr>';
print '<tr><td>'.$langs->trans("LabelToShow").'</td>';
print '<td><input name="labelshort" size="70" value="'.$object->labelshort.'"></td></tr>';
// Account parent
print '<tr><td>'.$langs->trans("Accountparent").'</td>';
@@ -386,7 +386,7 @@ if ($action == 'create') {
print '<td colspan="2">'.$object->label.'</td></tr>';
// Label to show
print '<tr><td class="titlefield">'.$langs->trans("ShortLabel").'</td>';
print '<tr><td class="titlefield">'.$langs->trans("LabelToShow").'</td>';
print '<td colspan="2">'.$object->labelshort.'</td></tr>';
// Account parent
@@ -419,11 +419,11 @@ if ($action == 'create') {
*/
print '<div class="tabsAction">';
// if ($user->hasRight('accounting', 'chartofaccount')) { // already checked
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=update&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Modify').'</a>';
// } else {
// print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
// }
if ($user->hasRight('accounting', 'chartofaccount')) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=update&token='.newToken().'&id='.$object->id.'">'.$langs->trans('Modify').'</a>';
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
}
// Delete
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');

View File

@@ -131,7 +131,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2014-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -82,7 +82,7 @@ $permissiontoadd = $user->hasRight('accounting', 'fiscalyear', 'write');
if ($user->socid > 0) {
accessforbidden();
}
if (!$permissiontoadd) { // after this test $permissiontoadd is always true
if (!$permissiontoadd) {
accessforbidden();
}
@@ -97,7 +97,7 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // always true */) {
if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontoadd) {
$result = $object->delete($user);
if ($result >= 0) {
header("Location: fiscalyear.php");
@@ -105,7 +105,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // a
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
} elseif ($action == 'add' /* && $permissiontoadd // always true */) {
} elseif ($action == 'add' && $permissiontoadd) {
if (!GETPOST('cancel', 'alpha')) {
$error = 0;
@@ -147,7 +147,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // a
header("Location: ./fiscalyear.php");
exit();
}
} elseif ($action == 'update' /* && $permissiontoadd // always true */) {
} elseif ($action == 'update' && $permissiontoadd) {
// Update record
if (!GETPOST('cancel', 'alpha')) {
$result = $object->fetch($id);
@@ -169,7 +169,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // a
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit();
}
} elseif ($action == 'reopen' /* && $permissiontoadd // always true */ && getDolGlobalString('ACCOUNTING_CAN_REOPEN_CLOSED_PERIOD')) {
} elseif ($action == 'reopen' && $permissiontoadd && getDolGlobalString('ACCOUNTING_CAN_REOPEN_CLOSED_PERIOD')) {
$result = $object->fetch($id);
$object->status = GETPOSTINT('status');

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024-2025 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
@@ -69,7 +69,6 @@ $formSetup = new FormSetup($db);
// Main options
$formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
$formSetup->newItem('ACCOUNTANCY_COMBO_FOR_AUX')->setAsYesNo();
$item = $formSetup->newItem('ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
@@ -180,73 +179,75 @@ if ($action == 'updatemode') {
if ($action == 'update2') {
$error = 0;
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
if ($error) {
setEventMessages($langs->trans("Error"), null, 'errors');
}
// option in section binding
foreach ($list_binding as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
$constvalue = dol_mktime(0, 0, 0, GETPOSTINT($constname.'month'), GETPOSTINT($constname.'day'), GETPOSTINT($constname.'year'));
}
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
// options in section other
if (GETPOSTISSET('ACCOUNTING_LETTERING_NBLETTERS')) {
if (!dolibarr_set_const($db, 'ACCOUNTING_LETTERING_NBLETTERS', GETPOST('ACCOUNTING_LETTERING_NBLETTERS'), 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
// Export options
$modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV');
if (!empty($modelcsv)) {
if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error++;
}
//if ($modelcsv==AccountancyExport::$EXPORT_TYPE_QUADRATUS || $modelcsv==AccountancyExport::$EXPORT_TYPE_CIEL) {
// dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', 'txt', 'chaine', 0, '', $conf->entity);
//}
} else {
$error++;
}
foreach ($main_option as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
foreach ($listparam[$modelcsv] as $key => $value) {
$constante = $key;
if (strpos($constante, 'ACCOUNTING') !== false) {
$constvalue = GETPOST($key, 'alpha');
if (!dolibarr_set_const($db, $constante, $constvalue, 'chaine', 0, '', $conf->entity)) {
if (!$error) {
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
}
if ($error) {
setEventMessages($langs->trans("Error"), null, 'errors');
}
if (!$error) {
// reload
$configuration = $accountancyexport->getTypeConfig();
$listparam = $configuration['param'];
// option in section binding
foreach ($list_binding as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
$constvalue = dol_mktime(0, 0, 0, GETPOSTINT($constname.'month'), GETPOSTINT($constname.'day'), GETPOSTINT($constname.'year'));
}
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
// options in section other
if (GETPOSTISSET('ACCOUNTING_LETTERING_NBLETTERS')) {
if (!dolibarr_set_const($db, 'ACCOUNTING_LETTERING_NBLETTERS', GETPOST('ACCOUNTING_LETTERING_NBLETTERS'), 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
// Export options
$modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV');
if (!empty($modelcsv)) {
if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error++;
}
//if ($modelcsv==AccountancyExport::$EXPORT_TYPE_QUADRATUS || $modelcsv==AccountancyExport::$EXPORT_TYPE_CIEL) {
// dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', 'txt', 'chaine', 0, '', $conf->entity);
//}
} else {
$error++;
}
foreach ($main_option as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
foreach ($listparam[$modelcsv] as $key => $value) {
$constante = $key;
if (strpos($constante, 'ACCOUNTING') !== false) {
$constvalue = GETPOST($key, 'alpha');
if (!dolibarr_set_const($db, $constante, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
}
if (!$error) {
// reload
$configuration = $accountancyexport->getTypeConfig();
$listparam = $configuration['param'];
}
}
if (!$error) {
@@ -459,10 +460,9 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
}
// Show form for main parameters
// Show form main options
print $formSetup->generateOutput(true);
print '<br><br><br>';
@@ -498,7 +498,7 @@ foreach ($list_binding as $key) {
1=>$langs->trans("ThirdPartyName") . ' - ' . $langs->trans("NumPiece"),
2=>$langs->trans("ThirdPartyName")
);
print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage width300');
print $form->selectarray($key, $array, getDolGlobalInt('ACCOUNTING_LABEL_OPERATION_ON_TRANSFER', 0), 0, 0, 0, '', 0, 0, 0, '', 'onrightofpage width200');
} else {
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
}
@@ -579,10 +579,8 @@ print '</div>';
print '<div class="center"><input type="submit" class="button reposition" value="'.dol_escape_htmltag($langs->trans('Save')).'" name="button"></div>';
// Show numbering options
print '<br><br><br>';
print '<br><br>';
// Accountancy Numbering model
$dirmodels = array_merge(array('/'), $conf->modules_parts['models']);
@@ -697,8 +695,7 @@ print '</div>';
// Show advanced options
print '<br><br><br>';
print '<br><br>';
// Advanced params
print '<div class="div-table-responsive-no-min">';
@@ -789,8 +786,7 @@ print '</div>';
print '<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.$langs->trans('Save').'"></div>';
print '<br><br><br>';
print '<br><br>';
// Export options

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 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
@@ -366,9 +366,12 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-adm
$titre = $langs->trans("DictionarySetup");
$linkback = '';
$titre .= ' - '.$langs->trans($tablib[$id]);
$titlepicto = 'title_accountancy';
if ($id) {
$titre .= ' - '.$langs->trans($tablib[$id]);
$titlepicto = 'title_accountancy';
} else {
$titlepicto = '';
}
print load_fiche_titre($titre, $linkback, $titlepicto);
@@ -381,297 +384,309 @@ if ($action == 'delete') {
/*
* Show a dictionary
*/
if ($id) {
// Complete requete recherche valeurs avec critere de tri
$sql = $tabsql[$id];
$sql .= " WHERE a.entity = ".((int) $conf->entity);
// Complete requete recherche valeurs avec critere de tri
$sql = $tabsql[$id];
$sql .= " WHERE a.entity = ".((int) $conf->entity);
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') {
$sortfield = 'country_code';
}
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($listlimit + 1, $offset);
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') {
$sortfield = 'country_code';
}
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($listlimit + 1, $offset);
$fieldlist = explode(',', $tabfield[$id]);
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
// Form to add a new line
if ($tabname[$id]) {
$fieldlist = explode(',', $tabfield[$id]);
// Line for title
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value) {
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$valuetoshow = ucfirst($fieldlist[$field]); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
$class = "left";
if ($fieldlist[$field] == 'code') {
$valuetoshow = $langs->trans("Code");
}
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
$valuetoshow = $langs->trans("Label");
}
if ($fieldlist[$field] == 'nature') {
$valuetoshow = $langs->trans("NatureOfJournal");
}
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
if ($valuetoshow != '') {
print '<td class="'.$class.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {
print $valuetoshow;
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
// Form to add a new line
if ($tabname[$id]) {
$fieldlist = explode(',', $tabfield[$id]);
// Line for title
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value) {
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$valuetoshow = ucfirst($fieldlist[$field]); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
$class = "left";
if ($fieldlist[$field] == 'code') {
$valuetoshow = $langs->trans("Code");
}
print '</td>';
}
}
print '<td>';
print '<input type="hidden" name="id" value="'.$id.'">';
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
// Line to enter new values
print '<tr class="oddeven nodrag nodrop nohover">';
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd', 'alpha')) {
foreach ($fieldlist as $key => $val) {
if (GETPOST($val) != '') {
$obj->$val = GETPOST($val);
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
$valuetoshow = $langs->trans("Label");
}
if ($fieldlist[$field] == 'nature') {
$valuetoshow = $langs->trans("NatureOfJournal");
}
}
}
$tmpaction = 'create';
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
$errors = $hookmanager->errors;
if (empty($reshook)) {
fieldListJournal($fieldlist, $obj, $tabname[$id], 'add');
}
print '<td colspan="4" class="right">';
print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
print '</td>';
print "</tr>";
print '<tr><td colspan="7">&nbsp;</td></tr>'; // Keep &nbsp; to have a line with enough height
}
// List of available record in database
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$param = '&id='.((int) $id);
if ($search_country_id > 0) {
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
}
$paramwithsearch = $param;
$paramwithsearch .= '&sortorder='.$sortorder;
$paramwithsearch .= '&sortfield='.$sortfield;
if (GETPOST('from', 'alpha')) {
$paramwithsearch .= '&from='.GETPOST('from', 'alpha');
}
// There is several pages
if ($num > $listlimit) {
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
print '</td></tr>';
}
// Title line with search boxes
/*print '<tr class="liste_titre_filter liste_titre_add">';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
*/
// Title of lines
print '<tr class="liste_titre liste_titre_add">';
foreach ($fieldlist as $field => $value) {
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$class = "left";
$sortable = 1;
$valuetoshow = '';
/*
$tmparray=getLabelOfField($fieldlist[$field]);
$valuetoshow=$tmp['valuetoshow'];
$align=$tmp['align'];
$sortable=$tmp['sortable'];
*/
$valuetoshow = ucfirst($fieldlist[$field]); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
if ($fieldlist[$field] == 'code') {
$valuetoshow = $langs->trans("Code");
}
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
$valuetoshow = $langs->trans("Label");
}
if ($fieldlist[$field] == 'nature') {
$valuetoshow = $langs->trans("NatureOfJournal");
}
// Affiche nom du champ
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, "", $sortfield, $sortorder, $class.' ');
}
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center ');
print getTitleFieldOfList('');
print getTitleFieldOfList('');
print getTitleFieldOfList('');
print '</tr>';
if ($num) {
// Lines with values
while ($i < $num) {
$obj = $db->fetch_object($resql);
//print_r($obj);
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
$tmpaction = 'edit';
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
$errors = $hookmanager->errors;
// Show fields
if (empty($reshook)) {
fieldListJournal($fieldlist, $obj, $tabname[$id], 'edit');
if ($valuetoshow != '') {
print '<td class="'.$class.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {
print $valuetoshow;
}
print '<td class="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
print '</td>';
} else {
$tmpaction = 'view';
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
}
}
$error = $hookmanager->error;
$errors = $hookmanager->errors;
print '<td>';
print '<input type="hidden" name="id" value="'.$id.'">';
print '</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
if (empty($reshook)) {
$langs->load("accountancy");
foreach ($fieldlist as $field => $value) {
$class = "left";
$tmpvar = $fieldlist[$field];
$valuetoshow = $obj->$tmpvar;
if ($valuetoshow == 'all') {
$valuetoshow = $langs->trans('All');
} elseif ($fieldlist[$field] == 'nature' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
$key = $langs->trans("AccountingJournalType".strtoupper($obj->nature));
$valuetoshow = ($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature)) ? $key : $obj->{$fieldlist[$field]});
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
$valuetoshow = $langs->trans($obj->label);
}
// Line to enter new values
print '<tr class="oddeven nodrag nodrop nohover">';
$class = 'tddict';
// Show value for field
print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.dol_escape_htmltag($valuetoshow).'</td>';
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd', 'alpha')) {
foreach ($fieldlist as $key => $val) {
if (GETPOST($val) != '') {
$obj->$val = GETPOST($val);
}
}
}
$tmpaction = 'create';
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
$errors = $hookmanager->errors;
if (empty($reshook)) {
fieldListJournal($fieldlist, $obj, $tabname[$id], 'add');
}
print '<td colspan="4" class="right">';
print '<input type="submit" class="button button-add" name="actionadd" value="'.$langs->trans("Add").'">';
print '</td>';
print "</tr>";
print '<tr><td colspan="7">&nbsp;</td></tr>'; // Keep &nbsp; to have a line with enough height
}
// List of available record in database
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$param = '&id='.((int) $id);
if ($search_country_id > 0) {
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
}
$paramwithsearch = $param;
if ($sortorder) {
$paramwithsearch .= '&sortorder='.$sortorder;
}
if ($sortfield) {
$paramwithsearch .= '&sortfield='.$sortfield;
}
if (GETPOST('from', 'alpha')) {
$paramwithsearch .= '&from='.GETPOST('from', 'alpha');
}
// There is several pages
if ($num > $listlimit) {
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit ? 1 : 0), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
print '</td></tr>';
}
// Title line with search boxes
/*print '<tr class="liste_titre_filter liste_titre_add">';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
*/
// Title of lines
print '<tr class="liste_titre liste_titre_add">';
foreach ($fieldlist as $field => $value) {
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$showfield = 1; // By default
$class = "left";
$sortable = 1;
$valuetoshow = '';
/*
$tmparray=getLabelOfField($fieldlist[$field]);
$showfield=$tmp['showfield'];
$valuetoshow=$tmp['valuetoshow'];
$align=$tmp['align'];
$sortable=$tmp['sortable'];
*/
$valuetoshow = ucfirst($fieldlist[$field]); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
if ($fieldlist[$field] == 'code') {
$valuetoshow = $langs->trans("Code");
}
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
$valuetoshow = $langs->trans("Label");
}
if ($fieldlist[$field] == 'nature') {
$valuetoshow = $langs->trans("NatureOfJournal");
}
// Affiche nom du champ
if ($showfield) {
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, "", $sortfield, $sortorder, $class.' ');
}
}
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center ');
print getTitleFieldOfList('');
print getTitleFieldOfList('');
print getTitleFieldOfList('');
print '</tr>';
if ($num) {
// Lines with values
while ($i < $num) {
$obj = $db->fetch_object($resql);
//print_r($obj);
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
$tmpaction = 'edit';
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
$errors = $hookmanager->errors;
// Show fields
if (empty($reshook)) {
fieldListJournal($fieldlist, $obj, $tabname[$id], 'edit');
}
}
// Can an entry be erased or disabled ?
$iserasable = 1;
$canbedisabled = 1;
$canbemodified = 1; // true by default
if (isset($obj->code) && $id != 10) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0;
$canbedisabled = 0;
}
}
$canbemodified = $iserasable;
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
$url .= '&'.$param;
$url .= '&';
// Active
print '<td class="nowrap center">';
if ($canbedisabled) {
print '<a href="'.$url.'action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
print "</td>";
// Modify link
if ($canbemodified) {
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
} else {
print '<td>&nbsp;</td>';
}
// Delete link
if ($iserasable) {
print '<td class="center">';
if ($user->admin) {
print '<a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
}
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
print '<td class="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="submit" class="button button-edit" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
print '</td>';
} else {
print '<td>&nbsp;</td>';
$tmpaction = 'view';
$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
$errors = $hookmanager->errors;
if (empty($reshook)) {
$langs->load("accountancy");
foreach ($fieldlist as $field => $value) {
$showfield = 1;
$class = "left";
$tmpvar = $fieldlist[$field];
$valuetoshow = $obj->$tmpvar;
if ($valuetoshow == 'all') {
$valuetoshow = $langs->trans('All');
} elseif ($fieldlist[$field] == 'nature' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
$key = $langs->trans("AccountingJournalType".strtoupper($obj->nature));
$valuetoshow = ($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature)) ? $key : $obj->{$fieldlist[$field]});
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
$valuetoshow = $langs->trans($obj->label);
}
$class = 'tddict';
// Show value for field
if ($showfield) {
print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.dol_escape_htmltag($valuetoshow).'</td>';
}
}
}
// Can an entry be erased or disabled ?
$iserasable = 1;
$canbedisabled = 1;
$canbemodified = 1; // true by default
if (isset($obj->code) && $id != 10) {
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
$iserasable = 0;
$canbedisabled = 0;
}
}
$canbemodified = $iserasable;
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
if ($param) {
$url .= '&'.$param;
}
$url .= '&';
// Active
print '<td class="nowrap center">';
if ($canbedisabled) {
print '<a href="'.$url.'action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
print "</td>";
// Modify link
if ($canbemodified) {
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
} else {
print '<td>&nbsp;</td>';
}
// Delete link
if ($iserasable) {
print '<td class="center">';
if ($user->admin) {
print '<a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
}
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
print '</td>';
} else {
print '<td>&nbsp;</td>';
}
print '<td></td>';
print '</td>';
}
print '<td></td>';
print '</td>';
print "</tr>\n";
$i++;
}
print "</tr>\n";
$i++;
}
} else {
dol_print_error($db);
}
} else {
dol_print_error($db);
print '</table>';
print '</div>';
print '</form>';
}
print '</table>';
print '</div>';
print '</form>';
print '<br>';
// End of page

View File

@@ -199,13 +199,15 @@ if ($action == 'update' && $permissiontobind) {
}
if (!empty($toselect) && $massaction === 'changeaccount') {
//$msg = '<div><span class="accountingprocessing">' . $langs->trans("Processing") . '...</span></div>';
$ok = 0;
$ko = 0;
$msg = '';
$sql = '';
if (!empty($toselect) && in_array($accounting_product_mode, $accounting_product_modes)) { // @phpstan-ignore-line Bug phpstan thinking that empty(array()) is always true
if (!empty($toselect) && in_array($accounting_product_mode, $accounting_product_modes)) {
$accounting = new AccountingAccount($db);
//$msg .= '<div><span class="accountingprocessing">' . count($toselect) . ' ' . $langs->trans("SelectedLines") . '</span></div>';
$arrayofdifferentselectedvalues = array();
$cpt = 0;
@@ -422,7 +424,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -41,16 +41,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("accountancy", "admin", "bills", "compta", "errors", "hrm", "salaries"));
$mesg = '';
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$id = GETPOSTINT('id');
$rowid = GETPOSTINT('rowid');
$massaction = GETPOST('massaction', 'aZ09');
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
$id = GETPOSTINT('id');
$rowid = GETPOSTINT('rowid');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountingsubaccountlist'; // To manage different context of search
$search_subaccount = GETPOST('search_subaccount', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
@@ -299,7 +298,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -55,7 +55,7 @@ $langs->loadLangs(array("accountancy", "compta"));
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist';
$socid = GETPOSTINT('socid');
@@ -764,7 +764,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
dol_print_error($db);
}
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -63,8 +63,8 @@ $massdate = dol_mktime(0, 0, 0, GETPOSTINT('massdatemonth'), GETPOSTINT('massdat
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php'));
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist';
// Search Parameters
$search_mvt_num = GETPOST('search_mvt_num', 'alpha');
@@ -785,7 +785,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
dol_print_error($db);
}
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
@@ -1306,7 +1306,6 @@ while ($i < min($num, $limit)) {
// Document ref
$modulepart = ''; // may be used by include*.tpl.php
if (!empty($arrayfields['t.doc_ref']['checked'])) {
$documentlink = '';
$objectstatic = null;
if ($line->doc_type === 'customer_invoice') {
@@ -1318,7 +1317,7 @@ while ($i < min($num, $limit)) {
//$modulepart = 'facture';
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->invoice->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
} elseif ($line->doc_type === 'supplier_invoice') {

View File

@@ -60,7 +60,7 @@ $socid = GETPOSTINT('socid');
$mode = (GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'customer'); // Only for tab view
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$type = GETPOST('type', 'alpha');
if ($type == 'sub') {
$context_default = 'bookkeepingbysubaccountlist';
@@ -902,7 +902,7 @@ if (empty($reshook)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create'.(!empty($type) ? '&type=sub' : '').'&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
}
if ($contextpage != $_SERVER["PHP_SELF"]) {
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -69,47 +69,47 @@ class AccountancyCategory // extends CommonObject
public $id;
/**
* @var ?string Accountancy code
* @var string Accountancy code
*/
public $code;
/**
* @var ?string Accountancy Category label
* @var string Accountancy Category label
*/
public $label;
/**
* @var ?string Accountancy range account
* @var string Accountancy range account
*/
public $range_account;
/**
* @var ?int Sens of the account: 0: credit - debit, 1: debit - credit
* @var int Sens of the account: 0: credit - debit, 1: debit - credit
*/
public $sens;
/**
* @var ?int Category type of accountancy
* @var int Category type of accountancy
*/
public $category_type;
/**
* @var ?string Formula
* @var string Formula
*/
public $formula;
/**
* @var ?int Position
* @var int Position
*/
public $position;
/**
* @var ?int country id
* @var int country id
*/
public $fk_country;
/**
* @var ?int Is active
* @var int Is active
*/
public $active;
@@ -399,6 +399,7 @@ class AccountancyCategory // extends CommonObject
*/
public function delete($user, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
$sql = "DELETE FROM ".$this->db->prefix().$this->table_element;
@@ -437,7 +438,6 @@ class AccountancyCategory // extends CommonObject
public function display($id)
{
global $conf;
$sql = "SELECT t.rowid, t.account_number, t.label";
$sql .= " FROM ".$this->db->prefix()."accounting_account as t";
$sql .= " WHERE t.fk_accounting_category = ".((int) $id);

View File

@@ -1412,14 +1412,14 @@ class AccountancyExport
$invoice = new Facture($this->db);
$invoice->fetch($line->fk_doc);
$refInvoice = (string) $invoice->ref;
$refInvoice = $invoice->ref;
} elseif ($line->doc_type == 'supplier_invoice') {
// Supplier invoice
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$invoice = new FactureFournisseur($this->db);
$invoice->fetch($line->fk_doc);
$refInvoice = (string) $invoice->ref_supplier;
$refInvoice = $invoice->ref_supplier;
}
$tab = array();
@@ -1632,14 +1632,14 @@ class AccountancyExport
$invoice = new Facture($this->db);
$invoice->fetch($line->fk_doc);
$refInvoice = (string) $invoice->ref;
$refInvoice = $invoice->ref;
} elseif ($line->doc_type == 'supplier_invoice') {
// Supplier invoice
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$invoice = new FactureFournisseur($this->db);
$invoice->fetch($line->fk_doc);
$refInvoice = (string) $invoice->ref_supplier;
$refInvoice = $invoice->ref_supplier;
}
$tab = array();

View File

@@ -1,6 +1,5 @@
<?php
/* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.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,22 +66,22 @@ class AccountancyReport // extends CommonObject
public $id;
/**
* @var ?string Accountancy code
* @var string Accountancy code
*/
public $code;
/**
* @var ?string Accountancy Category label
* @var string Accountancy Category label
*/
public $label;
/**
* @var ?int country id
* @var int country id
*/
public $fk_country;
/**
* @var ?int Is active
* @var int Is active
*/
public $active;
@@ -230,6 +229,7 @@ class AccountancyReport // extends CommonObject
*/
public function update($user = null, $notrigger = 0)
{
global $conf, $langs;
$error = 0;
// Clean parameters

View File

@@ -1,11 +1,11 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2013-2021 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2013-2021 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2018-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
@@ -80,17 +80,17 @@ class AccountingAccount extends CommonObject
public $datec;
/**
* @var ?string pcg version
* @var string pcg version
*/
public $fk_pcg_version;
/**
* @var ?string pcg type
* @var string pcg type
*/
public $pcg_type;
/**
* @var ?string account number
* @var string account number
*/
public $account_number;
@@ -115,12 +115,12 @@ class AccountingAccount extends CommonObject
public $status;
/**
* @var ?string Label of account
* @var string Label of account
*/
public $label;
/**
* @var ?string Label short of account
* @var string Label short of account
*/
public $labelshort;
@@ -358,7 +358,7 @@ class AccountingAccount extends CommonObject
$sql = "UPDATE " . $this->db->prefix() . $this->table_element;
$sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null");
$sql .= " , pcg_type = '" . $this->db->escape($this->pcg_type) . "'";
$sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null");
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
$sql .= " , account_parent = " . (int) $this->account_parent;
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "''");
@@ -436,14 +436,16 @@ class AccountingAccount extends CommonObject
if ($result > 0) {
$this->db->begin();
$sql = "DELETE FROM " . $this->db->prefix() . $this->table_element;
$sql .= " WHERE rowid=" . ((int) $this->id);
if (!$error) {
$sql = "DELETE FROM " . $this->db->prefix() . $this->table_element;
$sql .= " WHERE rowid=" . ((int) $this->id);
dol_syslog(get_class($this) . "::delete sql=" . $sql);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = "Error " . $this->db->lasterror();
dol_syslog(get_class($this) . "::delete sql=" . $sql);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = "Error " . $this->db->lasterror();
}
}
// Commit or rollback
@@ -735,7 +737,7 @@ class AccountingAccount extends CommonObject
* @param FactureLigne|SupplierInvoiceLine $factureDet Facture Det
* @param array<string,int> $accountingAccount Array of Accounting account
* @param string $type Customer / Supplier
* @return array{suggestedaccountingaccountbydefaultfor:''|'eec'|'eecwithoutvatnumber'|'eecwithvat'|'export',suggestedaccountingaccountfor:'deposit'|'eec'|'eecwithoutvatnumber'|'eecwithvat'|'export'|'prodserv'|'thirdparty',suggestedid:?int,code_l:string,code_p:?string,code_t:string}|int<-1,-1> Array of accounting accounts suggested or < 0 if technical error.
* @return array{suggestedaccountingaccountbydefaultfor:string,suggestedaccountingaccountfor:string,suggestedid:?int,code_l:string,code_p:string,code_t:string}|int<-1,-1> Array of accounting accounts suggested or < 0 if technical error.
* 'suggestedaccountingaccountbydefaultfor'=>Will be used for the label to show on tooltip for account by default on any product
* 'suggestedaccountingaccountfor'=>Is the account suggested for this product
*/
@@ -887,10 +889,10 @@ class AccountingAccount extends CommonObject
return -1;
}
$code_l = (string) $accountdeposittoventilated->ref;
$code_l = $accountdeposittoventilated->ref;
$code_p = '';
$code_t = '';
$suggestedid = (int) $accountdeposittoventilated->rowid;
$suggestedid = $accountdeposittoventilated->rowid;
$suggestedaccountingaccountfor = 'deposit';
}
@@ -906,10 +908,10 @@ class AccountingAccount extends CommonObject
} elseif ($type == 'supplier') {
$accountdeposittoventilated->fetch(0, getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 1);
}
$code_l = (string) $accountdeposittoventilated->ref;
$code_l = $accountdeposittoventilated->ref;
$code_p = '';
$code_t = '';
$suggestedid = (int) $accountdeposittoventilated->rowid;
$suggestedid = $accountdeposittoventilated->rowid;
$suggestedaccountingaccountfor = 'deposit';
}
}

View File

@@ -49,6 +49,11 @@ class BookKeeping extends CommonObject
*/
public $table_element = 'accounting_bookkeeping';
/**
* @var int Entity
*/
public $entity;
/**
* @var BookKeepingLine[] Lines
*/
@@ -70,27 +75,27 @@ class BookKeeping extends CommonObject
public $date_lim_reglement;
/**
* @var ?string Doc type
* @var string Doc type
*/
public $doc_type;
/**
* @var ?string Doc ref
* @var string Doc ref
*/
public $doc_ref;
/**
* @var ?int ID
* @var int ID
*/
public $fk_doc;
/**
* @var ?int ID
* @var int ID
*/
public $fk_docdet;
/**
* @var ?string Thirdparty code
* @var string Thirdparty code
*/
public $thirdparty_code;
@@ -105,69 +110,69 @@ class BookKeeping extends CommonObject
public $subledger_label;
/**
* @var ?string doc_type
* @var string doc_type
*/
public $numero_compte;
/**
* @var ?string label compte
* @var string label compte
*/
public $label_compte;
/**
* @var ?string label operation
* @var string label operation
*/
public $label_operation;
/**
* @var ?float FEC:Debit
* @var float FEC:Debit
*/
public $debit;
/**
* @var ?float FEC:Credit
* @var float FEC:Credit
*/
public $credit;
/**
* @var ?float FEC:Amount (Not necessary)
* @var float FEC:Amount (Not necessary)
* @deprecated No more used (we have info into debit/credit and sens)
*/
public $montant;
/**
* @var ?float FEC:Amount (Not necessary)
* @var float FEC:Amount (Not necessary)
* @deprecated No more used (we have info into debit/credit and sens)
*/
public $amount;
/**
* @var ?string FEC:Sens (Not necessary)
* @var string FEC:Sens (Not necessary)
*/
public $sens;
/**
* @var ?int ID
* @var int ID
*/
public $fk_user_author;
/**
* @var ?string key for import
* @var string key for import
*/
public $import_key;
/**
* @var ?string code journal
* @var string code journal
*/
public $code_journal;
/**
* @var ?string label journal
* @var string label journal
*/
public $journal_label;
/**
* @var ?int accounting transaction id
* @var int accounting transaction id
*/
public $piece_num;
@@ -1055,7 +1060,7 @@ class BookKeeping extends CommonObject
$sql .= " AND t.subledger_account IS NOT NULL";
$sql .= " AND t.subledger_account <> ''";
$sortfield = 't.subledger_account'.($sortfield ? ','.$sortfield : '');
$sortorder = 'ASC'.($sortorder ? ','.$sortorder : '');
$sortorder = 'ASC'.($sortfield ? ','.$sortfield : '');
} else {
$sortfield = 't.numero_compte'.($sortfield ? ','.$sortfield : '');
$sortorder = 'ASC'.($sortorder ? ','.$sortorder : '');
@@ -1416,15 +1421,16 @@ class BookKeeping extends CommonObject
$sql .= " AND t.subledger_account <> ''";
$sql .= " GROUP BY t.numero_compte, t.subledger_account, t.subledger_label";
$sortfield = 't.subledger_account'.($sortfield ? ','.$sortfield : '');
$sortorder = 'ASC'.($sortorder ? ','.$sortorder : '');
$sortorder = 'ASC'.($sortfield ? ','.$sortfield : '');
} else {
$sql .= ' GROUP BY t.numero_compte';
$sortfield = 't.numero_compte'.($sortfield ? ','.$sortfield : '');
$sortorder = 'ASC'.($sortorder ? ','.$sortorder : '');
}
$sql .= $this->db->order($sortfield, $sortorder);
if (!empty($sortfield)) {
$sql .= $this->db->order($sortfield, $sortorder);
}
if (!empty($limit)) {
$sql .= $this->db->plimit($limit + 1, $offset);
}
@@ -1822,7 +1828,7 @@ class BookKeeping extends CommonObject
$this->db->begin();
// Call triggers
if (!$notrigger) {
if (! $error && ! $notrigger) {
$result = $this->call_trigger('BOOKKEEPING_DELETE', $user);
if ($result < 0) {
$error++;
@@ -2295,12 +2301,14 @@ class BookKeeping extends CommonObject
}
}
} elseif ($direction == 1) {
$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = 'Error '.$this->db->lasterror();
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
if (!$error) {
$sql = 'DELETE FROM '.$this->db->prefix().$this->table_element.'_tmp WHERE piece_num = '.((int) $piece_num).' AND entity = ' .((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = 'Error '.$this->db->lasterror();
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
}
}
if (!$error) {

View File

@@ -49,7 +49,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("bills", "compta", "accountancy", "productbatch", "products"));
$action = GETPOST('action');
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
$account_parent = GETPOST('account_parent');
@@ -113,7 +112,6 @@ $contextpage = 'accountancycustomerlines';
$hookmanager->initHooks([$contextpage ]);
$formaccounting = new FormAccounting($db);
$object = new stdClass();
$arrayfields = array(
'fd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'),
@@ -131,7 +129,6 @@ $arrayfields = array(
// @phpstan-ignore-next-line
$arrayfields = dol_sort_array($arrayfields, 'position');
/*
* Actions
*/
@@ -358,7 +355,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -55,14 +55,14 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancycustomerlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
$default_account = GETPOSTINT('default_account');
// Select Box
$mesCasesCochees = GETPOST('toselect', 'array:int');
$mesCasesCochees = GETPOST('toselect', 'array');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
@@ -401,7 +401,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -298,7 +298,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -51,13 +51,13 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancyexpensereportlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Select Box
$mesCasesCochees = GETPOST('toselect', 'array:int');
$mesCasesCochees = GETPOST('toselect', 'array');
// Search Getpost
$search_login = GETPOST('search_login', 'alpha');
@@ -330,7 +330,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -196,21 +196,6 @@ if ($only_rappro == 2) {
$sql .= " ORDER BY b.datev";
//print $sql;
// Preload payment account codes by payment type from c_paiement
$accountancy_code_by_payment = array();
$sql2 = "SELECT code, accountancy_code";
$sql2 .= " FROM ".MAIN_DB_PREFIX."c_paiement";
$sql2 .= " WHERE entity IN (".getEntity('c_paiement').")";
$sql2 .= " AND active = 1";
$resql = $db->query($sql2);
if ($resql) {
while ($objp = $db->fetch_object($resql)) {
if (!empty($objp->code) && !empty($objp->accountancy_code)) {
$accountancy_code_by_payment[$objp->code] = $objp->accountancy_code;
}
}
}
$object = new Account($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
@@ -310,11 +295,6 @@ if ($result) {
// Set accountancy code for bank
$compta_bank = $obj->account_number;
// Determining the bank account by payment method
if (!empty($obj->fk_type) && !empty($accountancy_code_by_payment[$obj->fk_type])) {
$compta_bank = $accountancy_code_by_payment[$obj->fk_type];
}
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
$compta_soc = 'NotDefined';
$accountancy_code_general = 'NotDefined';
@@ -382,32 +362,6 @@ if ($result) {
$amounttouse = $obj->amount_main_currency;
}
// in case option FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS is on, payment could be for more than one third-partie
// so we have to find which part of the payment is affected to each third-parties
// (because in this case $obj-amount = the total of the paiement and not the paiement for each third-parties)
if (getDolGlobalString('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS') && ($lineisapurchase == 1 || $lineisasale == 1) ) {
if ($lineisapurchase == 1) {
$sqlamount = "SELECT SUM(pf.amount) as amount";
$sqlamount .= " FROM ".MAIN_DB_PREFIX."paiementfounr_facturefourn AS pf";
$sqlamount .= " INNER JOIN ".MAIN_DB_PREFIX."paiementfourn AS p ON pf.fk_paiementfourn = p.rowid";
$sqlamount .= " RIGHT JOIN ".MAIN_DB_PREFIX."facture AS f ON pf.fk_facturefourn = f.rowid";
$sqlamount .= " WHERE p.fk_bank = ".((int) $obj->rowid);
$sqlamount .= " AND f.fk_soc = ".((int) $obj->socid);
} else {
$sqlamount = "SELECT SUM(pf.amount) as amount";
$sqlamount .= " FROM ".MAIN_DB_PREFIX."paiement_facture AS pf";
$sqlamount .= " INNER JOIN ".MAIN_DB_PREFIX."paiement AS p ON pf.fk_paiement = p.rowid";
$sqlamount .= " RIGHT JOIN ".MAIN_DB_PREFIX."facture AS f ON pf.fk_facture = f.rowid";
$sqlamount .= " WHERE p.fk_bank = ".((int) $obj->rowid);
$sqlamount .= " AND f.fk_soc = ".((int) $obj->socid);
}
$resultamount = $db->query($sqlamount);
if ($resultamount) {
$objamount = $db->fetch_object($resultamount);
if (!empty($objamount->amount)) $amounttouse = $objamount->amount;
}
}
// get_url may return -1 which is not traversable
if (is_array($links) && count($links) > 0) {
// Test if entry is for a social contribution, salary or expense report.
@@ -473,17 +427,10 @@ if ($result) {
$societestatic->email = $tabcompany[$obj->rowid]['email'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
if ($compta_soc) {
// because we are in 2 loop (loop on the line from the sql queries and loop on $links)
// and in case of option FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS is on,
// we will pass here n times for each payment line
// so we have to add $amoutouse only if the line $links[$key] correspond to the payment line we are in used ( socid correspondinf at the payment line $links)
// if FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS is off we add $amounttouse
if (!getDolGlobalString('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS') || $obj->socid == $links[$key]['url_id']){
if (empty($tabtp[$obj->rowid][$compta_soc])) {
$tabtp[$obj->rowid][$compta_soc] = $amounttouse;
} else {
$tabtp[$obj->rowid][$compta_soc] += $amounttouse;
}
if (empty($tabtp[$obj->rowid][$compta_soc])) {
$tabtp[$obj->rowid][$compta_soc] = $amounttouse;
} else {
$tabtp[$obj->rowid][$compta_soc] += $amounttouse;
}
}
} elseif ($links[$key]['type'] == 'user') {
@@ -679,7 +626,7 @@ if ($result) {
}
// If no links were found to know the amount on thirdparty, we try to guess it.
// This may happen on bank entries without the links lines to 'company'.
// This may happens on bank entries without the links lines to 'company'.
if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) { // If we don't find 'company' link because it is an old 'withdraw' record
foreach ($links as $key => $val) {
if ($links[$key]['type'] == 'payment') {

View File

@@ -355,7 +355,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -56,14 +56,14 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancysupplierlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'alpha');
$default_account = GETPOSTINT('default_account');
// Select Box
$mesCasesCochees = GETPOST('toselect', 'array:int');
$mesCasesCochees = GETPOST('toselect', 'array');
// Search Getpost
$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
@@ -409,7 +409,7 @@ $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}

View File

@@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2015-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2022 Lionel Vessiller <lvessiller@open-dsi.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2022 Progiseize <a.bisotti@progiseize.fr>
/* Copyright (C) 2015-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2022 Lionel Vessiller <lvessiller@open-dsi.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2022 Progiseize <a.bisotti@progiseize.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* 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
@@ -33,7 +33,6 @@
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var int $formatexportset
* @var string $type_export
* @var string $filename
@@ -90,38 +89,6 @@ if ((substr($accountancyexport->getFormatCode($formatexportset), 0, 3) == 'fec')
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
}
// --- Hook: allow external modules to override export filename ---
if (is_object($hookmanager)) {
// Dedicated context (non-blocking if other hooks are already initialized)
$hookmanager->initHooks(array('accountancyexportfilename'));
$parameters = array(
'type_export' => $type_export ?? '',
'format' => $format ?? '',
'format_code' => $accountancyexport->getFormatCode($formatexportset),
'code' => $code ?? '',
'prefix' => $prefix ?? '',
'filename' => $filename ?? '',
'period_start' => $startaccountingperiod ?? '',
'period_end' => $endaccountingperiod ?? '',
'siren' => $siren ?? '',
'ndate_in_filename' => $nodateexport ?? 0,
'now_datetime' => $date_export,
// Value by default
'defaultfilename' => $completefilename
);
// Hook called by modules: setExportFilename
$reshook = $hookmanager->executeHooks('setExportFilename', $parameters, $accountancyexport, $action);
if ($reshook > 0) {
if (!empty($hookmanager->resArray['filename'])) {
$completefilename = $hookmanager->resArray['filename'];
} elseif ($hookmanager->resPrint !== '') {
$completefilename = $hookmanager->resPrint;
}
}
}
if (empty($downloadMode)) {
header('Content-Disposition: attachment;filename=' . $completefilename);
}

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Waël Almoman <info@almoman.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
@@ -91,7 +91,11 @@ if ($action == 'set_default') {
$res = true;
} elseif ($action == 'setdoc') {
// Set default model
dolibarr_set_const($db, "MEMBER_ADDON_PDF_ODT", $value, 'chaine', 0, '', $conf->entity);
if (dolibarr_set_const($db, "MEMBER_ADDON_PDF_ODT", $value, 'chaine', 0, '', $conf->entity)) {
// The constant that was read ahead of the new set
// we therefore go through a variable to have a consistent display
$conf->global->MEMBER_ADDON_PDF_ODT = $value;
}
// We activate the model
$ret = delDocumentModel($value, $type);
@@ -238,8 +242,8 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_M
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
@@ -264,7 +268,7 @@ print ' <td>'.$langs->trans("Name").'</td>';
print ' <td>'.$langs->trans("Description").'</td>';
print ' <td>'.$langs->trans("Example").'</td>';
print ' <td class="center" width="80">'.$langs->trans("Status").'</td>';
print ' <td class="center" width="60"></td>';
print ' <td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
$arrayofmodules = array();
@@ -347,14 +351,12 @@ print "<br>";
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
// Defined model definition table
$def = array();
// TODO Replace with $def = getListOfModels($db, $type);
$sql = "SELECT nom as name";
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
$sql .= " WHERE type = '".$db->escape($type)."'";
$sql .= " AND entity = ".((int) $conf->entity);
$sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
if ($resql) {
$i = 0;

View File

@@ -150,8 +150,8 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_M
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_emails');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');

View File

@@ -76,8 +76,8 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_M
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_extrafields');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');

View File

@@ -79,8 +79,8 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_M
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_type_extrafields');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');

View File

@@ -129,8 +129,8 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_M
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_website');
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($title, $linkback, 'title_setup');
$head = member_admin_prepare_head();

View File

@@ -1,8 +1,7 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2024-2025 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
@@ -250,7 +249,7 @@ abstract class ActionsAdherentCardCommon
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login),
array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password));
$this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("CreateDolibarrLogin"), $langs->trans("ConfirmCreateMember"), "confirm_create_user", $formquestion, 'no');
$this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("CreateDolibarrLogin"), $langs->trans("ConfirmCreateAdherent"), "confirm_create_user", $formquestion, 'no');
}
}
@@ -270,8 +269,8 @@ abstract class ActionsAdherentCardCommon
$this->object->fk_soc = GETPOSTINT("fk_soc");
$this->object->socid = GETPOSTINT("fk_soc");
$this->object->lastname = GETPOST("lastname");
$this->object->firstname = GETPOST("firstname");
$this->object->lastname = GETPOST("lastname");
$this->object->firstname = GETPOST("firstname");
$this->object->civility_id = GETPOST("civility_id");
$this->object->address = GETPOST("address");
$this->object->zip = GETPOST("zipcode");

View File

@@ -2,7 +2,6 @@
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2025 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
@@ -113,7 +112,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
} else {
// Confirm delete contact
if ($action == 'delete' && $user->hasRight('adherent', 'supprimer')) {
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("DeleteAdherent"), $langs->trans("ConfirmDeleteMember"), "confirm_delete", '', 0, 1);
$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id, $langs->trans("DeleteAdherent"), $langs->trans("ConfirmDeleteAdherent"), "confirm_delete", '', 0, 1);
}
}
}

View File

@@ -240,7 +240,6 @@ if (empty($reshook)) {
$tmpuser = dol_clone($object, 2);
if (GETPOST('internalorexternal', 'aZ09') == 'internal') {
$tmpuser->fk_soc = 0;
$tmpuser->socid = 0;
}
$result = $nuser->create_from_member($tmpuser, GETPOST('login', 'alphanohtml'));
@@ -273,29 +272,6 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('adherent', 'creer')) {
$member_origin_id = GETPOSTINT('member_origin');
$member_origin = new Adherent($db); // The thirdparty that we will delete
if ($member_origin_id <= 0) {
$langs->load('errors');
setEventMessages($langs->trans('MergeOriginMemberIsMAndatory'), null, 'errors');
} else {
if (!$error && $member_origin->fetch($member_origin_id) < 1) {
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
$error++;
}
if (!$error) {
$result = $object->mergeMembers($member_origin_id);
if ($result < 0) {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans('MemberMergeSuccess'), null, 'mesgs');
}
}
}
}
if ($action == 'update' && !$cancel && $user->hasRight('adherent', 'creer')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -543,18 +519,18 @@ if (empty($reshook)) {
}
}
$object->email = $email;
$object->url = $url;
$object->login = $login;
$object->pass = $pass;
$object->birth = $birthdate;
$object->photo = $photo;
$object->typeid = $typeid;
//$object->note = $comment;
$object->morphy = $morphy;
$object->user_id = $userid;
$object->email = $email;
$object->url = $url;
$object->login = $login;
$object->pass = $pass;
$object->birth = $birthdate;
$object->photo = $photo;
$object->typeid = $typeid;
//$object->note = $comment;
$object->morphy = $morphy;
$object->user_id = $userid;
$object->socid = $socid;
$object->public = $public;
$object->public = $public;
$object->default_lang = $default_lang;
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -618,6 +594,10 @@ if (empty($reshook)) {
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadUrl", $object->url), null, 'errors');
}
$public = 0;
if (isset($public)) {
$public = 1;
}
if (!$error) {
$db->begin();
@@ -1080,93 +1060,41 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
$checkednature = GETPOST("morphy", 'alpha');
$listetype_natures = $adht->morphyByType(1);
$listetype_natures_json = json_encode($listetype_natures);
print '<tr><td class="fieldrequired">'.$langs->trans("MemberNature")."</td><td>\n";
print '<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys["phy"].'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature == "phy" ? ' checked="checked"' : '').'></label></span>';
print '<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys["mor"].'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature == "mor" ? ' checked="checked"' : '').'></label></span>';
// Add JS to manage the background of nature
// Add js to manage the background of nature
if ($conf->use_javascript_ajax) {
print "<script>
var listetype_natures = $listetype_natures_json;
</script>";
print '<script>
jQuery(function($) {
function refreshNatureCss() {
$(".spannature").each(function(index) {
let $span = $("#spannature" + (index + 1));
let checked = $span.find(".checkforselect").is(":checked");
if (checked) {
if (index === 0) {
$span.addClass("member-individual-back").removeClass("nonature-back member-company-back");
} else if (index === 1) {
$span.addClass("member-company-back").removeClass("nonature-back member-individual-back");
jQuery(".spannature").each(function( index ) {
console.log(jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked"));
if (jQuery("#spannature"+(index+1)+" .checkforselect").is(":checked")) {
if (index+1 == 1) {
jQuery("#spannature"+(index+1)).addClass("member-individual-back").removeClass("nonature-back");
}
if (index+1 == 2) {
jQuery("#spannature"+(index+1)).addClass("member-company-back").removeClass("nonature-back");
}
} else {
$span.removeClass("member-individual-back member-company-back")
.addClass("nonature-back");
jQuery("#spannature"+(index+1)).removeClass("member-individual-back").removeClass("member-company-back").addClass("nonature-back");
}
});
}
$(".spannature").on("click", function() {
console.log("Nature clicked");
jQuery(".spannature").click(function(){
console.log("We click on a nature");
refreshNatureCss();
});
$("#typeid").on("change", function() {
let morphy = listetype_natures[$(this).val()];
let $phyInput = $("#phisicalinput");
let $morInput = $("#moralinput");
let $tdLast = $("#tdlastname");
let $tdFirst = $("#tdfirstname");
let $tdCompany = $("#tdcompany");
let $span1 = $("#spannature1");
let $span2 = $("#spannature2");
switch (morphy) {
case "phy":
$phyInput.prop({disabled: false, checked: true});
$morInput.prop({disabled: true, checked: false});
$span1.addClass("member-individual-back").removeClass("nonature-back");
$span2.removeClass("member-company-back").addClass("nonature-back");
$tdLast.addClass("fieldrequired");
$tdFirst.addClass("fieldrequired");
$tdCompany.removeClass("fieldrequired");
break;
case "mor":
$phyInput.prop({disabled: true, checked: false});
$morInput.prop({disabled: false, checked: true});
$span2.addClass("member-company-back").removeClass("nonature-back");
$span1.removeClass("member-individual-back").addClass("nonature-back");
$tdCompany.addClass("fieldrequired");
$tdLast.removeClass("fieldrequired");
$tdFirst.removeClass("fieldrequired");
break;
default:
$phyInput.prop({disabled: false, checked: false});
$morInput.prop({disabled: false, checked: false});
$span1.removeClass("member-individual-back").addClass("nonature-back");
$span2.removeClass("member-company-back").addClass("nonature-back");
}
});
// Initial state
refreshNatureCss();
});
</script>';
</script>';
}
print "</td>\n";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td>'.img_picto('', 'company', 'class="pictofixedwidth"').'<input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $soc->name).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $soc->name).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
@@ -1190,11 +1118,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// EMail
print '<tr><td>'.(getDolGlobalString('ADHERENT_MAIL_REQUIRED') ? '<span class="fieldrequired">' : '').$langs->trans("EMail").(getDolGlobalString('ADHERENT_MAIL_REQUIRED') ? '</span>' : '').'</td>';
print '<td>'.img_picto('', 'object_email', 'class="pictofixedwidth"').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $soc->email).'"></td></tr>';
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $soc->email).'"></td></tr>';
// Website
print '<tr><td>'.$form->editfieldkey('Web', 'member_url', GETPOST('member_url', 'alpha'), $object, 0).'</td>';
print '<td>'.img_picto('', 'globe', 'class="pictofixedwidth"').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(GETPOSTISSET('member_url') ? GETPOST('member_url', 'alpha') : $object->url).'"></td></tr>';
print '<td>'.img_picto('', 'globe').' <input type="text" class="maxwidth500 widthcentpercentminusx" name="member_url" id="member_url" value="'.(GETPOSTISSET('member_url') ? GETPOST('member_url', 'alpha') : $object->url).'"></td></tr>';
// Address
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
@@ -1400,7 +1328,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</td></tr>";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td>'.img_picto('', 'company', 'class="pictofixedwidth"').'<input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET("societe") ? GETPOST("societe", 'alphanohtml', 2) : $object->company).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET("societe") ? GETPOST("societe", 'alphanohtml', 2) : $object->company).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
@@ -1849,21 +1777,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($action == 'add_spip') {
print $form->formconfirm("card.php?rowid=".$id, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
}
// Confirm merge
if ($action == 'merge') {
$formquestion = array(
array(
'name' => 'member_origin',
'label' => $langs->trans('MergeOriginMember'),
'type' => 'other',
'value' => $form->selectMembers('', 'member_origin', '', 0, 1, '', 0, array(), 0, 'SelectMember', 0, 'minwidth200', array(), 1, array($object->id))
)
);
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("MergeMembers"), $langs->trans("ConfirmMergeMembers"), "confirm_merge", $formquestion, 'no', 1, 300);
}
// Confirm removed from spip
if ($action == 'del_spip') {
print $form->formconfirm("card.php?rowid=$id", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
@@ -2174,9 +2087,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
// Merge
print dolGetButtonAction($langs->trans('MergeMembers'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=merge&token='.newToken(), '', $user->hasRight('adherent', 'supprimer'));
// Delete
if ($user->hasRight('adherent', 'supprimer')) {
print '<a class="butActionDelete" href="card.php?rowid='.((int) $object->id).'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";

View File

@@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2024-2025 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
@@ -26,22 +26,22 @@
* \brief Page to output members business cards
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/printsheet/modules_labels.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*
* @var array<string,array{name:string,paper-size:string|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:int,custom_x:float,custom_y:float}> $_Avery_Labels
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php';
/** @var array<string,array{name:string,paper-size:string|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:int,custom_x:float,custom_y:float}> $_Avery_Labels */
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/printsheet/modules_labels.php';
$langs->loadLangs(array("members", "errors"));
// Choice of printing year or current year.

View File

@@ -175,7 +175,7 @@ class Adherent extends CommonObject
public $morphy;
/**
* @var ?int<0,1> Info can be public
* @var int<0,1> Info can be public
*/
public $public;
@@ -283,12 +283,12 @@ class Adherent extends CommonObject
public $last_subscription_date_start;
/**
* @var int|string|null date
* @var int|string date
*/
public $last_subscription_date_end;
/**
* @var null|float|string date, null until set
* @var int|string date
*/
public $last_subscription_amount;
@@ -338,7 +338,7 @@ class Adherent extends CommonObject
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'noteditable' says if field is not editable (1 or 0)
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
* 'default' is a default value for creation (can still be overwritten by the Setup of Default Values if the field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
@@ -659,7 +659,7 @@ class Adherent extends CommonObject
*/
public function create($user, $notrigger = 0)
{
global $langs, $mysoc;
global $conf, $langs, $mysoc;
$error = 0;
@@ -824,7 +824,6 @@ class Adherent extends CommonObject
// $this->note_private = ($this->note_private ? $this->note_private : $this->note_private);
$this->url = $this->url ? clean_url($this->url, 0) : '';
$this->setUpperOrLowerCase();
// Check parameters
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail((string) $this->email)) {
$langs->load("errors");
@@ -902,9 +901,11 @@ class Adherent extends CommonObject
$action = 'update';
// Actions on extra fields
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
}
// Update password
@@ -947,7 +948,7 @@ class Adherent extends CommonObject
if (!$error && $nbrowsaffected) { // If something has change in main data
// Update information on linked user if it is an update
if ($this->user_id > 0 && !$nosyncuser) {
if (!$error && $this->user_id > 0 && !$nosyncuser) {
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
dol_syslog(get_class($this)."::update update linked user");
@@ -999,7 +1000,7 @@ class Adherent extends CommonObject
}
// Update information on linked thirdparty if it is an update
if (!$error && $this->socid > 0 && !$nosyncthirdparty) {
if (!$error && $this->fk_soc > 0 && !$nosyncthirdparty) {
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
dol_syslog(get_class($this)."::update update linked thirdparty");
@@ -1007,7 +1008,7 @@ class Adherent extends CommonObject
// This member is linked with a thirdparty, so we also update thirdparty information
// if this is an update.
$lthirdparty = new Societe($this->db);
$result = $lthirdparty->fetch($this->socid);
$result = $lthirdparty->fetch($this->fk_soc);
if ($result > 0) {
$lthirdparty->address = $this->address;
@@ -1021,7 +1022,7 @@ class Adherent extends CommonObject
//$lthirdparty->phone_mobile=$this->phone_mobile;
$lthirdparty->default_lang = $this->default_lang;
$result = $lthirdparty->update($this->socid, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates
$result = $lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates
if ($result < 0) {
$this->error = $lthirdparty->error;
@@ -1129,7 +1130,7 @@ class Adherent extends CommonObject
$this->db->begin();
if (!$notrigger) {
if (!$error && !$notrigger) {
// Call trigger
$result = $this->call_trigger('MEMBER_DELETE', $user);
if ($result < 0) {
@@ -1201,150 +1202,6 @@ class Adherent extends CommonObject
}
}
/**
* Merge a member with current one, deleting the given company $member_origin_id.
* The member given in parameter will be removed.
* This is called for example by the adherent/card.php file.
* It calls the method replaceMember() of each object with relation with member,
* including hook 'replaceMember' for external modules.
*
* @param int $member_origin_id Member to merge the data from
* @return int -1 if error, >=0 if OK
*/
public function mergeMembers($member_origin_id)
{
global $conf, $langs, $hookmanager, $user, $action;
$error = 0;
$member_origin = new Adherent($this->db); // The member that we will delete
dol_syslog("mergeMembers merge member id=".$member_origin_id." (will be deleted) into the member id=".$this->id);
if ($member_origin->fetch($member_origin_id) < 1) {
$this->error = $langs->trans('ErrorRecordNotFound');
$error++;
}
if (!$error) {
$this->db->begin();
$listofproperties = array(
'ref_ext', 'civility', 'lastname', 'firstname', 'morphy', 'societe', 'socid', 'user_id','address',
'zip', 'town', 'state_id', 'country', 'phone', 'phone_perso', 'phone_mobile', 'email',
'url', 'socialnetworks', 'birth', 'gender', 'photo', 'public', 'datefin', 'default_lang',
'canvas', 'model_pdf', 'import_key'
);
foreach ($listofproperties as $property) {
if (empty($this->$property)) {
$this->$property = $member_origin->$property;
}
}
// Concat some data
$listofproperties = array(
'note_public', 'note_private'
);
foreach ($listofproperties as $property) {
$this->$property = dol_concatdesc($this->$property, $member_origin->$property);
}
// Merge extrafields
if (is_array($member_origin->array_options)) {
foreach ($member_origin->array_options as $key => $val) {
if (empty($this->array_options[$key])) {
$this->array_options[$key] = $val;
}
}
}
// Merge categories
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$static_cat = new Categorie($this->db);
$custcats_ori = $static_cat->containing($member_origin->id, 'member', 'id');
$custcats = $static_cat->containing($this->id, 'member', 'id');
$custcats = array_merge($custcats, $custcats_ori);
$this->setCategories($custcats);
$result = $this->update($user, 1, 1, 1, 1, 'merge');
if ($result < 0) {
$error++;
}
// Merge subscriptions
if (!$error && $member_origin->fetch_subscriptions() < 1) {
$error++;
}
if (!$error) {
foreach ($member_origin->subscriptions as $key => $subscription) {
$subscription->fk_adherent = $this->id;
$result = $subscription->update($user);
if ($result < 0) {
$error++;
break;
}
}
}
// External modules should update their ones too
if (!$error) {
$parameters = array('member_origin' => $member_origin->id, 'member_dest' => $this->id);
$reshook = $hookmanager->executeHooks('replaceMember', $parameters, $this, $action);
if ($reshook < 0) {
$this->setErrorsFromObject($hookmanager);
$error++;
}
}
if (!$error) {
$this->context = array('merge' => 1, 'mergefromid' => $member_origin->id);
// Call trigger
$result = $this->call_trigger('MEMBER_MODIFY', $user);
if ($result < 0) {
$error++;
}
// End call triggers
}
if (!$error) {
// We finally remove the old member
if ($member_origin->delete($user) < 1) {
$this->setErrorsFromObject($member_origin);
$error++;
}
}
if (!$error) {
// Move files from the dir of the third party to delete into the dir of the third party to keep
if (!empty($conf->adherent->multidir_output[$this->entity])) {
$srcdir = $conf->adherent->multidir_output[$this->entity]."/".$member_origin->id;
$destdir = $conf->adherent->multidir_output[$this->entity]."/".$this->id;
if (dol_is_dir($srcdir)) {
$dirlist = dol_dir_list($srcdir, 'files', 1);
foreach ($dirlist as $filetomove) {
$destfile = $destdir.'/'.$filetomove['relativename'];
$result = dol_move($filetomove['fullname'], $destfile, '0', 0, 0, 1);
if (!$result) {
$error++;
}
}
}
}
}
if (!$error) {
$this->db->commit();
return 0;
} else {
$langs->load("errors");
$this->error = $langs->trans('ErrorMembersMerge');
$this->db->rollback();
return -1;
}
}
return -1;
}
/**
* Change password of a user
@@ -1587,23 +1444,23 @@ class Adherent extends CommonObject
*
* @param int $rowid Id of object to load
* @param string $ref To load member from its ref
* @param int $socid To load member from its link to third party
* @param int $fk_soc To load member from its link to third party
* @param string $ref_ext External reference
* @param bool $fetch_optionals To load optionals (extrafields)
* @param bool $fetch_subscriptions To load member subscriptions
* @return int >0 if OK, 0 if not found, <0 if KO
*/
public function fetch($rowid, $ref = '', $socid = 0, $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
public function fetch($rowid, $ref = '', $fk_soc = 0, $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
{
global $langs;
$sql = "SELECT d.rowid, d.ref, d.ref_ext, d.civility as civility_code, d.gender, d.firstname, d.lastname,";
$sql .= " d.societe as company, d.fk_soc as socid, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
$sql .= " d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note_private,";
$sql .= " d.note_public,";
$sql .= " d.email, d.url, d.socialnetworks, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass, d.pass_crypted,";
$sql .= " d.photo, d.fk_adherent_type, d.morphy, d.entity,";
$sql .= " d.datec as datec,";
$sql .= " GREATEST(d.tms, aef.tms) as datem,";
$sql .= " d.tms as datem,";
$sql .= " d.datefin as datefin, d.default_lang,";
$sql .= " d.birth as birthday,";
$sql .= " d.datevalid as datev,";
@@ -1615,19 +1472,18 @@ class Adherent extends CommonObject
$sql .= " t.libelle as type, t.subscription as subscription,";
$sql .= " u.rowid as user_id, u.login as user_login";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as aef ON aef.fk_object = d.rowid';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
$sql .= " WHERE d.fk_adherent_type = t.rowid";
if ($rowid) {
$sql .= " AND d.rowid=".((int) $rowid);
} elseif ($ref || $socid) {
} elseif ($ref || $fk_soc) {
$sql .= " AND d.entity IN (".getEntity('adherent').")";
if ($ref) {
$sql .= " AND d.ref='".$this->db->escape($ref)."'";
} elseif ($socid > 0) {
$sql .= " AND d.fk_soc=".((int) $socid);
} elseif ($fk_soc > 0) {
$sql .= " AND d.fk_soc=".((int) $fk_soc);
}
} elseif ($ref_ext) {
$sql .= " AND d.ref_ext='".$this->db->escape($ref_ext)."'";
@@ -1654,8 +1510,8 @@ class Adherent extends CommonObject
$this->login = $obj->login;
$this->societe = $obj->company;
$this->company = $obj->company;
$this->socid = $obj->socid;
$this->fk_soc = $obj->socid; // For backward compatibility
$this->socid = $obj->fk_soc;
$this->fk_soc = $obj->fk_soc; // For backward compatibility
$this->address = $obj->address;
$this->zip = $obj->zip;
$this->town = $obj->town;
@@ -1776,13 +1632,13 @@ class Adherent extends CommonObject
$this->last_subscription_date = $this->db->jdate($obj->datec);
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
$this->last_subscription_amount = (float) $obj->subscription;
$this->last_subscription_amount = $obj->subscription;
$subscription = new Subscription($this->db);
$subscription->id = $obj->rowid;
$subscription->fk_adherent = $obj->fk_adherent;
$subscription->fk_type = $obj->fk_type;
$subscription->amount = (float) $obj->subscription;
$subscription->amount = $obj->subscription;
$subscription->note = $obj->note_public;
$subscription->note_public = $obj->note_public;
$subscription->fk_bank = $obj->fk_bank;
@@ -1885,8 +1741,6 @@ class Adherent extends CommonObject
$this->last_subscription_date_start = $date;
$this->last_subscription_date_end = $datefin;
$this->last_subscription_amount = $amount;
} else {
$error++;
}
if (!$error) {
@@ -1977,7 +1831,7 @@ class Adherent extends CommonObject
$customer = new Societe($this->db);
if (!$error) {
if (!($this->socid > 0)) { // If not yet linked to a company
if (!($this->fk_soc > 0)) { // If not yet linked to a company
if ($autocreatethirdparty) {
// Create a linked thirdparty to member
$companyalias = '';
@@ -2002,7 +1856,6 @@ class Adherent extends CommonObject
$error++;
} else {
$this->fk_soc = $result;
$this->socid = $result;
}
} else {
$langs->load("errors");
@@ -2013,7 +1866,7 @@ class Adherent extends CommonObject
}
}
if (!$error) {
$result = $customer->fetch($this->socid);
$result = $customer->fetch($this->fk_soc);
if ($result <= 0) {
$this->error = $customer->error;
$this->errors = $customer->errors;
@@ -2034,7 +1887,7 @@ class Adherent extends CommonObject
$this->errors[] = $this->error;
}
}
$invoice->socid = $this->socid;
$invoice->socid = $this->fk_soc;
// set customer's payment bank account on the invoice
if (!empty($customer->fk_account)) {
$invoice->fk_account = $customer->fk_account;
@@ -2057,7 +1910,8 @@ class Adherent extends CommonObject
$result = $invoice->create($user);
if ($result <= 0) {
$this->setErrorsFromObject($invoice);
$this->error = $invoice->error;
$this->errors = $invoice->errors;
$error++;
} else {
$this->invoice = $invoice;
@@ -2079,7 +1933,8 @@ class Adherent extends CommonObject
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
$result = $invoice->addline($label, 0, 1, $vattouse, 0, 0, $idprodsubscription, 0, $datesubscription, '', 0, 0, 0, 'TTC', $amount, 1);
if ($result <= 0) {
$this->setErrorsFromObject($invoice);
$this->error = $invoice->error;
$this->errors = $invoice->errors;
$error++;
}
}
@@ -2088,7 +1943,8 @@ class Adherent extends CommonObject
// Validate invoice
$result = $invoice->validate($user);
if ($result <= 0) {
$this->setErrorsFromObject($invoice);
$this->error = $invoice->error;
$this->errors = $invoice->errors;
$error++;
}
}
@@ -2116,18 +1972,22 @@ class Adherent extends CommonObject
$paiement->ext_payment_id = $ext_payment_id;
$paiement->ext_payment_site = $ext_payment_site;
// Create payment line for invoice
$paiement_id = $paiement->create($user);
if (!($paiement_id > 0)) {
$this->setErrorsFromObject($paiement);
$error++;
if (!$error) {
// Create payment line for invoice
$paiement_id = $paiement->create($user);
if (!($paiement_id > 0)) {
$this->error = $paiement->error;
$this->errors = $paiement->errors;
$error++;
}
}
if (!$error) {
// Add transaction into bank account
$bank_line_id = $paiement->addPaymentToBank($user, 'payment', '(SubscriptionPayment)', $accountid, $emetteur_nom, $emetteur_banque);
if (!($bank_line_id > 0)) {
$this->setErrorsFromObject($paiement);
$this->error = $paiement->error;
$this->errors = $paiement->errors;
$error++;
}
}
@@ -2580,15 +2440,16 @@ class Adherent extends CommonObject
$result .= $linkstart;
if ($withpictoimg) {
$paddafterimage = '';
if (abs($withpictoimg) == 1 || abs($withpictoimg) == 4) {
$morecss .= ' paddingrightonly';
}
// Only picto
if ($withpictoimg > 0) {
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">'.img_object('', 'user', ' '.($notooltip ? '' : $dataparams), 0, 0, $notooltip ? 0 : 1).'</span>';
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : $dataparams), 0, 0, $notooltip ? 0 : 1).'</span>';
} else {
// Picto must be a photo
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'">';
$picto = '<span class="nopadding'.($morecss ? ' userimg'.$morecss : '').'"'.($paddafterimage ? ' '.$paddafterimage : '').'>';
$picto .= Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.(($withpictoimg == -3 || $withpictoimg == -4) ? 'small' : ''), 'mini', 0, 1);
$picto .= '</span>';
}
@@ -2596,7 +2457,7 @@ class Adherent extends CommonObject
}
if (($withpictoimg > -2 && $withpictoimg != 2) || $withpictoimg == -4) {
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$result .= '<span class="nopadding valignmiddle'.((!isset($this->status) || $this->status) ? '' : ' strikefordisabled').
$result .= '<span class="nopadding valignmiddle'.((!isset($this->statut) || $this->statut) ? '' : ' strikefordisabled').
($morecss ? ' usertext'.$morecss : '').'">';
}
if ($mode == 'login') {
@@ -2751,7 +2612,7 @@ class Adherent extends CommonObject
$now = dol_now();
$sql = "SELECT a.rowid, a.datefin, a.statut as status";
$sql = "SELECT a.rowid, a.datefin, a.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
$sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE a.fk_adherent_type = t.rowid";
@@ -2774,12 +2635,12 @@ class Adherent extends CommonObject
$labelShort = '';
if ($mode == 'expired') {
$warning_delay = getWarningDelay('member', 'subscription') / 60 / 60 / 24;
$warning_delay = $conf->adherent->subscription->warning_delay / 60 / 60 / 24;
$label = $langs->trans("MembersWithSubscriptionToReceive");
$labelShort = $langs->trans("MembersWithSubscriptionToReceiveShort");
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&amp;statut='.self::STATUS_VALIDATED.'&amp;filter=outofdate';
} elseif ($mode == 'shift') {
$warning_delay = getWarningDelay('member', 'subscription') / 60 / 60 / 24;
$warning_delay = $conf->adherent->subscription->warning_delay / 60 / 60 / 24;
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&amp;statut='.self::STATUS_DRAFT;
$label = $langs->trans("MembersListToValid");
$labelShort = $langs->trans("ToValidate");
@@ -2798,8 +2659,8 @@ class Adherent extends CommonObject
$response->nbtodo++;
$adherentstatic->datefin = $this->db->jdate($obj->datefin);
$adherentstatic->statut = $obj->status;
$adherentstatic->status = $obj->status;
$adherentstatic->statut = $obj->statut;
$adherentstatic->status = $obj->statut;
if ($adherentstatic->hasDelay()) {
$response->nbtodolate++;
@@ -3109,10 +2970,9 @@ class Adherent extends CommonObject
{
$sql = 'SELECT a.rowid, a.datec as datec,';
$sql .= ' a.datevalid as datev,';
$sql .= ' GREATEST(a.tms, aef.tms) as datem,';
$sql .= ' a.tms as datem,';
$sql .= ' a.fk_user_author, a.fk_user_valid, a.fk_user_mod';
$sql .= ' FROM '.MAIN_DB_PREFIX.'adherent as a';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as aef ON aef.fk_object = a.rowid';
$sql .= ' WHERE a.rowid = '.((int) $id);
dol_syslog(get_class($this)."::info", LOG_DEBUG);
@@ -3152,7 +3012,7 @@ class Adherent extends CommonObject
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
$nb = (int) $obj->nb;
$nb = $obj->nb;
$this->db->free($resql);
return $nb;
@@ -3212,7 +3072,7 @@ class Adherent extends CommonObject
$now = dol_now();
return $this->datefin < ($now - getWarningDelay('member', 'subscription'));
return $this->datefin < ($now - $conf->adherent->subscription->warning_delay);
}
@@ -3357,9 +3217,9 @@ class Adherent extends CommonObject
if ($message) {
$actionmsg = $langs->transnoentities('MailFrom').': '.dol_escape_htmltag($from);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTo').': '.dol_escape_htmltag($sendto));
// if ($sendtocc) {
// $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".dol_escape_htmltag($sendtocc));
// }
if ($sendtocc) {
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc').": ".dol_escape_htmltag($sendtocc));
}
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic').": ".$subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody').":");
$actionmsg = dol_concatdesc($actionmsg, $message);
@@ -3382,7 +3242,7 @@ class Adherent extends CommonObject
$actioncomm->contact_id = 0;
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
// Fields when action is an email (content should be added into note)
// Fields when action is en email (content should be added into note)
$actioncomm->email_msgid = $cmail->msgid;
$actioncomm->email_from = $from;
$actioncomm->email_sender = '';
@@ -3427,31 +3287,10 @@ class Adherent extends CommonObject
} else {
$this->output = 'Found '.($nbok + $nbko).' members to send reminder to.';
$this->output .= ' Send email successfully to '.$nbok.' members';
$listofids = '';
$i = 0;
foreach ($listofmembersok as $idmember) {
if ($i > 100) {
$listofids .= ', ...';
break;
}
if (empty($listofids)) {
$listofids .= ' [';
} else {
$listofids .= ', ';
}
$listofids .= $idmember;
$i++;
}
if ($listofids) {
$listofids .= ']';
}
$this->output .= ($listofids ? ' ids='.$listofids : '');
if ($nbko) {
$this->output .= ' - Canceled for '.$nbko.' member (no email or email sending error)';
if (is_array($listofmembersok)) {
$listofids = '';
$i = 0;
foreach ($listofmembersko as $idmember) {
foreach ($listofmembersok as $idmember) {
if ($i > 100) {
$listofids .= ', ...';
break;
@@ -3467,8 +3306,33 @@ class Adherent extends CommonObject
if ($listofids) {
$listofids .= ']';
}
$this->output .= ($listofids ? ' ids='.$listofids : '');
}
if ($nbko) {
$this->output .= ' - Canceled for '.$nbko.' member (no email or email sending error)';
if (is_array($listofmembersko)) {
$listofids = '';
$i = 0;
foreach ($listofmembersko as $idmember) {
if ($i > 100) {
$listofids .= ', ...';
break;
}
if (empty($listofids)) {
$listofids .= ' [';
} else {
$listofids .= ', ';
}
$listofids .= $idmember;
$i++;
}
if ($listofids) {
$listofids .= ']';
}
$this->output .= ($listofids ? ' ids='.$listofids : '');
}
}
}
return $nbko;
@@ -3488,23 +3352,25 @@ class Adherent extends CommonObject
$return = '<div class="box-flex-item box-flex-grow-zero">';
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infobox-action">';
if (!empty($this->photo)) {
if (property_exists($this, 'photo') || !empty($this->photo)) {
$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photowithmargin photologintooltip', 'small', 0, 1);
} else {
$return .= img_picto('', 'user');
}
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
if ($selected >= 0) {
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
$return .= '<br><span class="info-box-label paddingright">'.$this->getmorphylib('', 2).'</span>';
$return .= '<span class="info-box-label opacitymedium">'.$this->type.'</span>';
$return .= '<br><div class="info-box-status paddingtop">';
$return .= $this->LibStatut($this->status, $this->need_subscription, $this->datefin, 5);
$return .= '</div>';
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status paddingtop">';
$return .= $this->LibStatut($this->status, $this->need_subscription, $this->datefin, 5);
$return .= '</div>';
}
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2019 Thibault Foucart <support@ptibogxiv.net>
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -84,7 +84,7 @@ class AdherentType extends CommonObject
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
* 'noteditable' says if field is not editable (1 or 0)
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
* 'default' is a default value for creation (can still be overwritten by the Setup of Default Values if the field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
* 'index' if we want an index in database.
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
@@ -141,7 +141,7 @@ class AdherentType extends CommonObject
public $morphy;
/**
* @var ?string
* @var string
*/
public $duration;
@@ -156,7 +156,7 @@ class AdherentType extends CommonObject
public $duration_unit;
/**
* @var null|'0'|'1' Subscription required (0 or 1) default '1' in DB, null until value is fetched
* @var int<0,1> Subscription required (0 or 1)
*/
public $subscription;
@@ -180,7 +180,7 @@ class AdherentType extends CommonObject
public $note_public;
/**
* @var null|int<0,1> Can vote, null until fetched
* @var int<0,1> Can vote
*/
public $vote;
@@ -516,9 +516,11 @@ class AdherentType extends CommonObject
}
// Actions on extra fields
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
if (!$error) {
$result = $this->insertExtraFields();
if ($result < 0) {
$error++;
}
}
if (!$error && !$notrigger) {
@@ -707,81 +709,6 @@ class AdherentType extends CommonObject
return $amountbytype;
}
/**
* Return the array of morphy per membership type id
*
* @param int $status Filter on status of type
* @return array<int,string> Array of membership type
*/
public function morphyByType($status = null)
{
$morphybytype = array();
$sql = "SELECT rowid, morphy";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql .= " WHERE entity IN (".getEntity('member_type').")";
if ($status !== null) {
$sql .= " AND statut = ".((int) $status);
}
$resql = $this->db->query($sql);
if ($resql) {
$nump = $this->db->num_rows($resql);
if ($nump) {
$i = 0;
while ($i < $nump) {
$obj = $this->db->fetch_object($resql);
$morphybytype[$obj->rowid] = $obj->morphy;
$i++;
}
}
} else {
print $this->db->error();
}
return $morphybytype;
}
/**
* Return the array of caneditamount per membership type id
*
* @param int $status Filter on status of type
* @return array<int,string> Array of membership type
*/
public function caneditamountByType($status = null)
{
$caneditamountbytype = array();
$sql = "SELECT rowid, caneditamount";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type";
$sql .= " WHERE entity IN (".getEntity('member_type').")";
if ($status !== null) {
$sql .= " AND statut = ".((int) $status);
}
$resql = $this->db->query($sql);
if ($resql) {
$nump = $this->db->num_rows($resql);
if ($nump) {
$i = 0;
while ($i < $nump) {
$obj = $this->db->fetch_object($resql);
$caneditamountbytype[$obj->rowid] = $obj->caneditamount;
$i++;
}
}
} else {
print $this->db->error();
}
return $caneditamountbytype;
}
/**
* Return array of Member objects for member type this->id (or all if this->id not defined)
*
@@ -868,7 +795,7 @@ class AdherentType extends CommonObject
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("MemberType").'</u> '.$this->getLibStatut(4);
$datas['label'] = '<br>'.$langs->trans("Label").': '.$this->label;
if (isset($this->subscription)) {
$datas['subscription'] = '<br>'.$langs->trans("SubscriptionRequired").': '.yn((int) $this->subscription);
$datas['subscription'] = '<br>'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
}
if (isset($this->vote)) {
$datas['vote'] = '<br>'.$langs->trans("VoteAllowed").': '.yn($this->vote);
@@ -876,23 +803,9 @@ class AdherentType extends CommonObject
if (isset($this->duration)) {
$datas['duration'] = '<br>'.$langs->trans("Duration").': '.$this->duration_value;
if ($this->duration_value > 1) {
$dur = array(
"i" => $langs->trans("Minutes"),
"h" => $langs->trans("Hours"),
"d" => $langs->trans("Days"),
"w" => $langs->trans("Weeks"),
"m" => $langs->trans("Months"),
"y" => $langs->trans("Years")
);
$dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
} elseif ($this->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")
);
$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"));
}
$datas['duration'] .= "&nbsp;" . (!empty($this->duration_unit) && isset($dur[$this->duration_unit]) ? $langs->trans($dur[$this->duration_unit]) : '');
}
@@ -913,12 +826,14 @@ class AdherentType extends CommonObject
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
$result = '';
$option = '';
$classfortooltip = 'classfortooltip';
$dataparams = '';
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
@@ -930,15 +845,16 @@ class AdherentType extends CommonObject
}
$url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
// Add param to save lastsearch_values or not
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && isset($_SERVER["PHP_SELF"]) && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
$add_save_lastsearch_values = 1;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && isset($_SERVER["PHP_SELF"]) && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
$add_save_lastsearch_values = 1;
}
if ($add_save_lastsearch_values) {
$url .= '&save_lastsearch_values=1';
}
}
if ($add_save_lastsearch_values) {
$url .= '&save_lastsearch_values=1';
}
$linkstart = '<a href="'.$url.'"';
$linkstart .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
$linkstart .= $dataparams.' class="'.$classfortooltip.'">';
@@ -1083,7 +999,7 @@ class AdherentType extends CommonObject
$this->label = 'MEMBERS TYPE SPECIMEN';
$this->note_public = 'This is a public note';
$this->mail_valid = 'This is welcome email';
$this->subscription = '1';
$this->subscription = 1;
$this->caneditamount = 0;
$this->vote = 0;
@@ -1176,7 +1092,7 @@ class AdherentType extends CommonObject
$return .= img_picto('', $this->picto);
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
//$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
@@ -1185,14 +1101,20 @@ class AdherentType extends CommonObject
} else {
$return .= '<span class="right">&nbsp;</span>';
}
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("VoteAllowed").' : '.yn($this->vote).'</span>';
if (is_null($this->amount) || $this->amount === '') {
$return .= '<br>';
} else {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Amount").'</span>';
$return .= '<span class="amount"> : '.price($this->amount).'</span>';
if (property_exists($this, 'vote')) {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("VoteAllowed").' : '.yn($this->vote).'</span>';
}
if (property_exists($this, 'amount')) {
if (is_null($this->amount) || $this->amount === '') {
$return .= '<br>';
} else {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Amount").'</span>';
$return .= '<span class="amount"> : '.price($this->amount).'</span>';
}
}
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
}
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
* Copyright (C) 2020-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -138,7 +138,7 @@ class Members extends DolibarrApi
throw new RestException(403);
}
$sql = "SELECT rowid, fk_soc as socid, key_account, site, date_creation, tms FROM ".MAIN_DB_PREFIX."societe_account";
$sql = "SELECT rowid, fk_soc, key_account, site, date_creation, tms FROM ".MAIN_DB_PREFIX."societe_account";
$sql .= " WHERE site = '".$this->db->escape($site)."' AND key_account = '".$this->db->escape($key_account)."'";
$sql .= " AND entity IN (".getEntity('adherent').")";
@@ -147,7 +147,7 @@ class Members extends DolibarrApi
if ($result && $this->db->num_rows($result) == 1) {
$obj = $this->db->fetch_object($result);
$thirdparty = new Societe($this->db);
$result = $thirdparty->fetch($obj->socid);
$result = $thirdparty->fetch($obj->fk_soc);
if ($result <= 0) {
throw new RestException(404, 'thirdparty not found');
@@ -661,8 +661,8 @@ class Members extends DolibarrApi
if (!DolibarrApiAccess::$user->hasRight('adherent', 'cotisation', 'creer')) {
throw new RestException(403);
}
if (!is_numeric($start_date) || !is_numeric($end_date) || !is_numeric($amount)) {
throw new RestException(422, 'Malformed data: subscription start or end date, or subscription amount, is not numeric');
if (is_numeric($start_date) || !is_numeric($end_date) || !is_numeric($amount)) {
throw new RestException(422, 'Malformed data');
}
$member = new Adherent($this->db);

View File

@@ -139,8 +139,7 @@ class Subscriptions extends DolibarrApi
if ($result) {
$i = 0;
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
while ($i < $min) {
while ($i < min($limit, $num)) {
$obj = $this->db->fetch_object($result);
$subscription = new Subscription($this->db);
if ($subscription->fetch($obj->rowid)) {

View File

@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 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
@@ -319,7 +319,7 @@ class Subscription extends CommonObject
$result = $member->fetch($this->fk_adherent);
$result = $member->update_end_date($user);
if (!$notrigger) {
if (!$error && !$notrigger) {
$this->context = array('member' => $member);
// Call triggers
$result = $this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user);
@@ -365,13 +365,15 @@ class Subscription extends CommonObject
$this->db->begin();
if (!$notrigger) {
// Call triggers
$result = $this->call_trigger('MEMBER_SUBSCRIPTION_DELETE', $user);
if ($result < 0) {
$error++;
} // Do also here what you must do to rollback action if trigger fail
// End call triggers
if (!$error) {
if (!$notrigger) {
// Call triggers
$result = $this->call_trigger('MEMBER_SUBSCRIPTION_DELETE', $user);
if ($result < 0) {
$error++;
} // Do also here what you must do to rollback action if trigger fail
// End call triggers
}
}
if (!$error) {
@@ -388,10 +390,17 @@ class Subscription extends CommonObject
if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) { // If we found bank account line (this means this->fk_bank defined)
$result = $accountline->delete($user); // Return false if refused because line is reconciled
if ($result <= 0) {
$this->setErrorsFromObject($accountline);
$error++;
if ($result > 0) {
$this->db->commit();
return 1;
} else {
$this->error = $accountline->error;
$this->db->rollback();
return -1;
}
} else {
$this->db->commit();
return 1;
}
} else {
$this->db->commit();
@@ -555,7 +564,7 @@ class Subscription extends CommonObject
if ($selected >= 0) {
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
if (!empty($this->dateh) || !empty($this->datef)) {
if (property_exists($this, 'dateh') || property_exists($this, 'datef')) {
$return .= '<br><span class="info-box-status opacitymedium small">'.dol_print_date($this->dateh, 'day').' - '.dol_print_date($this->datef, 'day').'</span>';
}
@@ -563,14 +572,15 @@ class Subscription extends CommonObject
$return .= '<br><div class="inline-block tdoverflowmax150">'.$arraydata['member']->getNomUrl(-4).'</div>';
}
$return .= '<br><span class="amount inline-block">'.price($this->amount).'</span>';
if (!empty($arraydata['bank'])) {
$return .= ' &nbsp; <span class="info-box-label ">'.$arraydata['bank']->getNomUrl(-1).'</span>';
if (property_exists($this, 'amount')) {
$return .= '<br><span class="amount inline-block">'.price($this->amount).'</span>';
if (!empty($arraydata['bank'])) {
$return .= ' &nbsp; <span class="info-box-label ">'.$arraydata['bank']->getNomUrl(-1).'</span>';
}
}
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';
return $return;
}
}

View File

@@ -57,7 +57,7 @@ $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOSTINT('show_files');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$toselect = GETPOST('toselect', 'array:int');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$optioncss = GETPOST('optioncss', 'aZ');
@@ -415,7 +415,7 @@ $morecss = array();
// Build and execute select
// --------------------------------------------------------------------
$sql = "SELECT";
$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc as socid,";
$sql .= " d.rowid, d.ref, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
$sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
$sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.birth, d.public, d.photo,";
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut as status, d.datec as date_creation, d.tms as date_modification,";
@@ -599,7 +599,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
dol_print_error($db);
}
if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
@@ -1228,7 +1228,7 @@ while ($i < $imaxinloop) {
$memberstatic->gender = $obj->gender;
$memberstatic->status = $obj->status;
$memberstatic->datefin = $datefin;
$memberstatic->socid = $obj->socid;
$memberstatic->socid = $obj->fk_soc;
$memberstatic->photo = $obj->photo;
$memberstatic->email = $obj->email;
$memberstatic->morphy = $obj->morphy;
@@ -1236,7 +1236,7 @@ while ($i < $imaxinloop) {
$memberstatic->note_private = $obj->note_private;
$memberstatic->need_subscription = $obj->subscription;
if (!empty($obj->socid)) {
if (!empty($obj->fk_soc)) {
$memberstatic->fetch_thirdparty();
if ($memberstatic->thirdparty->id > 0) {
$companyname = $memberstatic->thirdparty->name;
@@ -1273,7 +1273,7 @@ while ($i < $imaxinloop) {
} else {
// Show line of result
$j = 0;
print '<tr data-rowid="'.$object->id.'" class="oddeven row-with-select">';
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -1468,7 +1468,7 @@ while ($i < $imaxinloop) {
if ($datefin) {
$s .= dol_print_date($datefin, 'day');
if ($memberstatic->hasDelay()) {
$textlate = ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil(getWarningDelay('member', 'subscription') / 60 / 60 / 24) >= 0 ? '+' : '').ceil(getWarningDelay('member', 'subscription') / 60 / 60 / 24).' '.$langs->trans("days").')';
$textlate = ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')';
$s .= " ".img_warning($langs->trans("SubscriptionLate").$textlate);
}
} else {

View File

@@ -94,11 +94,9 @@ $hookmanager->initHooks(array('membernote'));
// Security check
$result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0);
/*
* Actions
*/
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {

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