Merge branch 'develop' into lounes2001-3

This commit is contained in:
Bahfirilyes 2024-12-30 22:08:25 +01:00 committed by GitHub
commit 1751705f1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3933 changed files with 160395 additions and 70768 deletions

View File

@ -26,3 +26,7 @@ trim_trailing_whitespace = false
indent_style = tab
trim_trailing_whitespace = true
indent_size = 4
[*.yml]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

View File

@ -1,56 +1,90 @@
How to contribute to Dolibarr
=============================
Bug reports and feature requests
--------------------------------
Submit a Bug report or a Feature request
---------------------------------------
<a name="not-a-support-forum"></a>*Note*: **GitHub Issues is not a support forum.** If you have questions about Dolibarr / need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages.
<a name="not-a-support-forum"></a>*Note*: **GitHub Issues is not a support forum.**
If you have questions about Dolibarr or need help on using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages.
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
Default **language here is English**. So please prepare your contributions in English.
Issues to inform about a bug or a development trouble and requests for a new feature, are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
Default **language here is English**. So please prepare your contributions in English (we recommend using an online translation service if you don't speak English).
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if anyone else has already reported your issue.
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
3. Tell us the version you are using! (look at /htdocs/admin/system/dolibarr.php? and check if you are using the latest version)
4. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging information whenever possible).
5. Delete unnecessary submissions.
6. **Check your Message at Preview before sending.**
6. **Check your Message at Preview before submitting.**
<a name="code"></a>Submit code
<a name="code"></a>
Submit code
---------------------
This process describes how a Developer can submit code to the project so it can be analyzed and validated by the PR Maintainer (we call this a Pull Request).
Definition:
- Developer: is the human knowing the development language of the application that wants to change some part of the code by modifying the sources of the project.
- PR Maintainer: is the human knowing the development language and code who checks that the code submitted for approbation is correct to validate it, in other words, the PR Maintainer is the approbator of commits.
- Release Maintainer: is the human that validates that a freeze/beta version is ok to be released officially as a stable version.
### Basic workflow
1. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
2. Clone your fork.
3. Choose a branch(See the [Branches](#branches) section below).
4. Read our developer documentation on the [Dolibarr Wiki](https://wiki.dolibarr.org/index.php?title=Developer_documentation).
5. Commit and push your changes.
6. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
As the Developer:
1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/blob/develop/DCO)
2. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
3. Clone your fork.
4. Choose a branch(See the [Branches](#branches) section below).
5. Read our developer documentation on the [Dolibarr Wiki](https://wiki.dolibarr.org/index.php?title=Developer_documentation).
6. Commit and push your changes.
7. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
As the PR Maintainer:
7. The PR Maintainer will check and decide if he approves or not the commits. During this step, the PR Maintainer can modify your own code to make it valid for approbation or ask you to make the change yourself. For this the PR Maintainer may add commits to a PR. Depending on the tools used (can be done from github directly or from an IDE), such commits may be done directly after validating your PR (for example to complete it).
As the Release Maintainer:
8. A tag will be added to take a snapshot of the code with all the changes approved by PR Maintainers, when ready to do a release.
Note: Project leader(Master Yoda and BDFL) retains all above roles and can directly commit to the project without a PR. Of course anyone can check commit history and comment!
<span id="branches" name="branches"></span>
### Branches
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
If you're fixing a bug, it is preferred that you cook your fix and pull request it against an oldest version affected.
If you're fixing a bug, it is preferred that you make a pull request against the oldest version affected.
We recommend to push it into N - 2 for N the latest version available, if not possible into version N - 1, and finally into develop.
This is just a recommendation, currently, if you push a bug fix on a very old version, it is still merged and propagated into
higher versions.
We recommend to push it into N - 2 where N is the latest version available, if not possible into version N - 1, and finally into develop.
The rule N - 2 is just a tip if you don't know which version to choose to get the best compromise between ease of correction and number of potential beneficiaries of the correction.
If you push a bug fix on a very old version it is still going to be merged and propagated into newer versions(choose wisely because old versions depend on old deprecated/unsupported versions of PHP and external libraries).
The rule N - 2 is just a tip if you don't know which version to choose to get the best the best compromise between ease of correction
and number of potential beneficiaries of the correction.
### General rules
Please don't edit the ChangeLog file. This file is generated from all commit messages during release process by the project manager.
- As the Developer, please don't edit the ChangeLog file. This file is generated from all commit messages during the release process by the Project releaser.
- As the Developer: Do not submit changes into files xx_XX/afile.lang. They are language files and are updated/synced automatically from Transifex. If you need to add a new language file, just add it for the en_US language.
- As the Release Maintainer: The Release Maintainer will decide to make a new release as soon as the planning of the release is reached and the code in the branch to release reach the status of "No more known serious bugs".
### <a name="commits"></a>Commits
<a name="commits"></a>
### Commits
Use clear commit messages with the following structure:
```plaintext
@ -106,9 +140,9 @@ FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. I
or
CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
or
NEW|New|QUAL|Qual|PERF|Perf Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #456)
NEW|New|QUAL|Qual|PERF|Perf Short description (In upper case to appear into ChangeLog, use this if you add a feature not tracked, otherwise use CLOSE #xxx)
or
Short description (when the commit is not introducing feature nor closing a bug)
Short description (when the commit is not introducing a feature nor closing a bug)
Long description (Can span across multiple lines).
</pre>
@ -125,11 +159,11 @@ a process to follow to optimize the chance to have PRs merged efficiently...
* When submitting a pull request, use same rule as [Commits](#commits) for the message. If your pull request only contains 1 commit, GitHub will be smart enough to fill it for you. Otherwise, please be a bit verbose about what you're providing.
* A screenshot will be always required for any PR of change/addition of a GUI behaviour.
* A screenshot will be always required for any PR of change/addition of a GUI behavior.
Also, some code changes need a prior approbation:
* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted.
* if you want to include a new external library (into htdocs/includes directory), please contact the core project manager first (mention @dolibarr-jedi in your issue) to see if such a library can be accepted.
* if you add new tables or fields, you MUST first submit a standalone PR with the data structure changes you plan to add/modify (and only data structure changes). Start development only once this data structure has been accepted.
@ -137,12 +171,12 @@ Once a PR has been submitted, you may need to wait for its integration. It is co
If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of the PR (but it can be analyzed for discussion).
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several months later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag ask you. The majority of open PR are waiting an action of the author of the PR.
If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explains why your PR has not been integrated yet.
In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag asks you. The majority of open PRs are waiting an action of the author of the PR.
Statistics on Dolibarr project shows that 95% of submitted PR are reviewed and tagged. Average answer delay is also one of the best among Open source projects (just few days before having the Answer Tag set). This is one of the most important ratio of answered PR in Open Source world for a major project. Don't expect the core team to reach the 100%.
Statistics on Dolibarr project shows that 95% of submitted PRs are reviewed and tagged. Average answer delay is also one of the best among Open source projects (just few days before having the Answer Tag set). This is one of the most important ratio of answered PRs in Open Source world for a major project. Don't expect the core team to reach 100%.
A so high ratio is very rare on a so popular project and with the increasing popularity of Dolibarr, this ratio will probably decrease in future to a more common level.
@ -157,9 +191,9 @@ All other translations are managed online at [Transifex](https://www.transifex.c
Translations done on transifex are available in the next major release.
Note: Sometimes, the source text (English) is modified. In such a case, the translation is reset. Transifex assume that if the original source
Note: Sometimes, the source text (English) is modified. In such a case, the translation is reset. Transifex assumes that if the original source
has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
to retrieve all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to.
to retrieve all old translations of a source text and restore the translation in one click with no need to retranslate it if there is no need to.
### Resources

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

@ -19,17 +19,17 @@ jobs:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
REPO="${{ github.repository }}"
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
cacheKeysForPR=$(gh actions-cache list -R "$REPO" -B "$BRANCH" | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm
done
echo "Done"
env:

View File

@ -0,0 +1,41 @@
name: "CI-PULL-REQUEST"
on: [pull_request]
jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
secrets: inherit
with:
gh_event: ${{ github.event_name }}
phan:
uses: ./.github/workflows/phan.yml
secrets: inherit
needs: [pre-commit]
with:
gh_event: ${{ github.event_name }}
phpstan:
uses: ./.github/workflows/phpstan.yml
secrets: inherit
needs: [pre-commit]
with:
gh_event: ${{ github.event_name }}
#windows-ci:
# needs: [pre-commit, phan, phpstan]
# secrets: inherit
# 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 }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361)
# To cancel jobs if one fails, the following action may help
# - if: "failure()"
# uses: "andymckay/cancel-action@0.3"

View File

@ -1,6 +1,6 @@
name: "CI"
name: "CI-PUSH"
on: [push, pull_request]
on: [push]
jobs:
pre-commit:
uses: ./.github/workflows/pre-commit.yml
@ -10,16 +10,17 @@ jobs:
phan:
uses: ./.github/workflows/phan.yml
secrets: inherit
needs: [pre-commit]
with:
gh_event: ${{ github.event_name }}
phpstan:
uses: ./.github/workflows/phpstan.yml
secrets: inherit
needs: [pre-commit, phan]
needs: [pre-commit]
with:
gh_event: ${{ github.event_name }}
windows-ci:
needs: [pre-commit, phan]
needs: [pre-commit, phan, phpstan]
secrets: inherit
uses: ./.github/workflows/windows-ci.yml
with:
@ -29,12 +30,12 @@ jobs:
# 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 failes, the following action may help
# To cancel jobs if one fails, the following action may help
# - if: "failure()"
# uses: "andymckay/cancel-action@0.3"

View File

@ -4,10 +4,8 @@ name: "Exakat analysis"
on:
# execute once a month, the 1st
schedule:
- cron: "0 20 1 * *"
- cron: "0 20 1 * *"
workflow_dispatch:
branches:
- develop
permissions:
contents: read
@ -19,6 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: develop
- name: Exakat
uses: docker://exakat/exakat-ga
with:

View File

@ -3,13 +3,13 @@
name: Travis
# Controls when the workflow will run
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:

View File

@ -1,15 +1,12 @@
---
on:
# pull_request:
# push:
# schedule:
# # execute once a day, the 1st
# - cron: 10 9 * * *
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:
@ -17,8 +14,7 @@ concurrency:
cancel-in-progress: true
env:
gh_event: ${{ inputs.gh_event || github.event_name }}
PHAN_CONFIG: >
${{ 'dev/tools/phan/config.php' }}
PHAN_CONFIG: dev/tools/phan/config.php
PHAN_BASELINE: dev/tools/phan/baseline.txt
PHAN_MIN_PHP: 7.0
PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }}
@ -43,7 +39,8 @@ jobs:
tools: cs2pr,phan
- name: Run Phan analysis
run: |
phan $PHAN_QUICK -k $PHAN_CONFIG -B $PHAN_BASELINE --analyze-twice --minimum-target-php-version $PHAN_MIN_PHP --output-mode=checkstyle -o _phan.xml
# shellcheck disable=2086
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: |

View File

@ -3,18 +3,17 @@
name: PHPStan
# Controls when the workflow will run
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
}}
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
gh_event: ${{ inputs.gh_event || github.event_name }}
@ -37,14 +36,14 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# Get PHP and addons
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpstan, cs2pr
coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
@ -86,3 +85,9 @@ jobs:
name: phpstan-srcrt
path: ${{ github.workspace }}/_stan.xml
retention-days: 2
# Run PHPStan generate baseline
# - name: Run PHPStan generate baseline
# id: phpstan-baseline
# if: ${{ success() }}
# run: |
# phpstan -vv analyse --memory-limit 7G -a build/phpstan/bootstrap_action.php --generate-baseline build/phpstan/phpstan-baseline.neon

80
.github/workflows/phpstan_baseline.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: 'PHPStan baseline'
on:
# Every day we want to refresh the baseline
schedule:
- cron: '0 12 * * *'
# We want to be able to manually refresh the baseline too
workflow_dispatch:
workflow_call:
inputs:
gh_event:
required: true
type: string
# Run PHPStan analyse on pull requests
# pull_request:
permissions: {} # none
env:
PHP_VERSION: '8.2'
GH_TOKEN: ${{ github.token }}
gh_event: ${{ inputs.gh_event || github.event_name }}
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
jobs:
phpstan:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
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.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt
env:
fail-fast: true
# Restore old cache
- name: Restore phpstan cache
id: cache
uses: actions/cache/restore@v4
with:
path: ./.github/tmp
key: phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-${{
github.run_id }}
restore-keys: |
phpstan-cache-${{ env.PHP_VERSION }}-${{ env.CACHE_KEY_PART }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.head_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-${{ github.base_ref }}-
phpstan-cache-${{ env.PHP_VERSION }}-
- uses: ruudk/phpstan-baseline-refresh-create-pr-action@main
with:
github_token: ${{ env.GH_TOKEN }}
phpstan_path: phpstan
configuration_path: phpstan.neon.dist
phpstan_additional_arguments: --memory-limit 7G -a build/phpstan/bootstrap_action.php
baseline_path: build/phpstan/phpstan-baseline.neon
commit_name: Dolibot
commit_email: dolibarr-bot@users.noreply.github.com
commit_message: PHPStan > Update baseline
target_branch: develop
# pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
pr_create: 1
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |
This PR is automatically created to cleanup our baseline.
Since the last refresh of the baseline we have fixed {0} ignored errors.
Keep it up all! :muscle:
There are only {1} ignored errors left :sweat_smile:

21
.github/workflows/pr-18-autolabel.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
name: "Set label for v18"
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
changed-lines-count-labeler:
runs-on: ubuntu-latest
name: An action for automatically labelling pull requests based on the changed lines count
steps:
- name: Set a label
uses: vkirilichev/changed-lines-count-labeler@v0.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/changed-lines-count-labeler.yml
continue-on-error: true

55
.github/workflows/pr-18.yaml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Set reviewer for v18
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "18.0"
push:
branches:
- "18.0"
jobs:
pr18:
runs-on: ubuntu-latest
#env:
# GH_TOKEN: ${{ github.token }}
# GH_TOKENS: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install GitHub CLI
run: |
sudo apt update
sudo apt install gh -y
- name: Assign reviewer
env:
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: |
# shellcheck disable=2086
echo "Run action by ${{ github.actor }}"
# shellcheck disable=2086
echo "github.token=${{ github.token }}"
# shellcheck disable=2086
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
# shellcheck disable=2086
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
# shellcheck disable=2086
echo Get the pr_number
# shellcheck disable=2086
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
# shellcheck disable=2086
echo "pr_number=$pr_number"
# shellcheck disable=2086
echo Authenticate login gh
# shellcheck disable=2086
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
# shellcheck disable=2086
gh auth setup-git
# shellcheck disable=2086
gh pr edit $pr_number --add-reviewer "$REVIEWER"
continue-on-error: true

View File

@ -1,13 +1,13 @@
---
name: pre-commit
on:
# pull_request:
# push:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:
@ -32,7 +32,7 @@ jobs:
# This is faster for a big repo.
- name: Get all changed php files (if PR)
id: changed-php
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
if: env.gh_event == 'pull_request'
with:
files: |
@ -67,12 +67,12 @@ jobs:
run: |
set -o pipefail
pre-commit gc
pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
pre-commit run --show-diff-on-failure --color=always --all-files | tee "${RAW_LOG}"
# The next uses git, which is slow for a bit repo.
# - name: Get all changed php files (if PR)
# id: changed-php
# uses: tj-actions/changed-files@v44
# uses: tj-actions/changed-files@v45
# if: env.gh_event == 'pull_request'
# with:
# files: |
@ -105,7 +105,8 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
run: |
set -o pipefail
pre-commit run php-cs --files ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG}
# shellcheck disable=2086
pre-commit run php-cs --files ${ALL_CHANGED_FILES} | tee -a "${RAW_LOG}"
- name: Run some pre-commit hooks on all files on push to "main" branches
if: |
@ -117,8 +118,8 @@ jobs:
run: |
set -o pipefail
ln -sf ~/.cache .cache # Absolute path in .pre-commit-config.yaml
pre-commit run --hook-stage manual -a php-cs-with-cache | tee -a ${RAW_LOG}
pre-commit run --hook-stage manual -a sqlfluff-lint | tee -a ${RAW_LOG}
pre-commit run --hook-stage manual -a php-cs-with-cache | tee -a "${RAW_LOG}"
pre-commit run --hook-stage manual -a sqlfluff-lint | tee -a "${RAW_LOG}"
ls -l ~/.cache/pre-commit/
- name: Convert Raw Log to Annotations

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

@ -0,0 +1,38 @@
name: Test github actions
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
branches:
- "18.0"
env:
ENVGHT: ${{ secrets.GITHUB_TOKEN }}
ENVGHU: ${{ github.token }}
VARAAA: ${{ vars.AAA }}
SECBBB: ${{ secrets.BBB }}
VARREPORGCCC: ${{ vars.CCC }}
ENVFIX: "abc"
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 "variable org: ${{vars.AAA}}"
echo "env prg: ${{env.AAA}}"
echo "env prg: ${{env.VARAAA}}"
echo "secret org: ${{secrets.BBB}}"
echo "variable repository of orga: ${{vars.CCC}}"
echo "ENVGHT: ${{env.ENVGHT}}"
echo "ENVGHU: ${{env.ENVGHU}}"
echo "VARAAA: ${{vars.AAA}}"
echo "ENVAAA: ${{env.VARAAA}}"
echo "VARREPORGCCC: ${{env.VARREPORGCCC}}"
echo "ENVFIX: ${{env.ENVFIX}}"

View File

@ -2,13 +2,13 @@
name: Win CI
# yamllint disable-line rule:truthy
on:
# push:
# pull_request:
# workflow called by the parent workflow ci.yml
workflow_call:
inputs:
gh_event:
required: true
type: string
# can run job manually
workflow_dispatch:
concurrency:
@ -57,11 +57,11 @@ jobs:
id: cache
uses: actions/cache/restore@v4
env:
HASH: ${{ hashFiles('htdocs/install/**') }}
HASH: ${{ hashFiles('htdocs/install/**', 'htdocs/filefunc.inc.php') }}
KEY_ROOT: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}
with:
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
enableCrossOsArchive: true
enableCrossOsArchive: true
path: |
./db_init.sql
./db_init.sql.md5
@ -72,7 +72,7 @@ jobs:
${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ github.head_ref }}-
${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ github.base_ref }}-
${{ env.KEY_ROOT }}-${{ env.HASH }}-
${{ env.KEY_ROOT }}-
# ${{ env.KEY_ROOT }}-
- name: Setup MariaDB
uses: frederic34/setup-mariadb@v1
@ -116,6 +116,7 @@ jobs:
# Note this is bash (MSYS) on Windows
shell: bash
run: |
# shellcheck disable=SC2129
ECHO "#[group]Directory contents to verify cache files, ..."
ls -l
ECHO "#[endgroup]"
@ -130,10 +131,12 @@ jobs:
ls -l
ECHO "#[endgroup]"
# Export some tool paths to reuse the from CMD shell.
echo "TAIL=$(cygpath -w "$(which tail)")" >> "$GITHUB_ENV"
echo "GREP=$(cygpath -w "$(which grep)")" >> "$GITHUB_ENV"
echo "TEE=$(cygpath -w "$(which tee)")" >> "$GITHUB_ENV"
echo "BASEDIR=$(realpath .)" >> "$GITHUB_ENV"
{
echo "TAIL=$(cygpath -w "$(which tail)")"
echo "GREP=$(cygpath -w "$(which grep)")"
echo "TEE=$(cygpath -w "$(which tee)")"
echo "BASEDIR=$(realpath .)"
} >> "$GITHUB_ENV"
- name: Run PHPUnit tests
# continue-on-error: true
@ -186,7 +189,7 @@ jobs:
if: ${{ ! cancelled() }}
with:
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
enableCrossOsArchive: true
enableCrossOsArchive: true
key: ${{ steps.cache.outputs.cache-primary-key }}
path: |
./db_init.sql

4
.gitignore vendored
View File

@ -41,6 +41,7 @@ htdocs/includes/php-parallel-lint/
htdocs/includes/sebastian/
htdocs/includes/squizlabs/
htdocs/includes/webmozart/
htdocs/install/install.forced.php
htdocs/.well-known/apple-developer-merchantid-domain-association
/factory/
/output/
@ -89,3 +90,6 @@ phpstan_custom.neon
/.php-cs-fixer.cache
/.php_cs.cache
/.cache
# ignore .htaccess files
.htaccess

View File

@ -5,7 +5,7 @@ Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <eldy@users.source
Laurent Destailleur <eldy@destailleur.fr> eldy <eldy@destailleur.fr>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ldestailleur@teclib.com>
Laurent Destailleur <eldy@destailleur.fr> eldy10 <eldy10@master8.(none)>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ephpcsdy@destailleur.fr>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <eldy@destailleur.fr>
Regis Houssin <regis.houssin@inodbox.com> Regis Houssin <regis@dolibarr.fr>
Regis Houssin <regis.houssin@inodbox.com> Régis Houssin <regishoussin@device5.home>
Juanjo Menent <jmenent@2byte.es> simnandez <jmenent@2byte.es>
@ -94,4 +94,4 @@ Anthony Berton <anthony.berton@bb2a.fr> Berton Anthony <anthony.berton@bb2a.fr>
Anthony Berton <anthony.berton@bb2a.fr> BB2A-Anthony <anthony.berton@bb2a.fr>
Anthony Berton <anthony.berton@bb2a.fr> Anthony Berton <bertonanthony@gmail.com>
Anthony Berton <anthony.berton@bb2a.fr> Berton Anthony <bertonanthony@gmail.com>
Anthony Berton <anthony.berton@bb2a.fr> BB2A-Anthony <bertonanthony@gmail.com>
Anthony Berton <anthony.berton@bb2a.fr> BB2A-Anthony <bertonanthony@gmail.com>

View File

@ -1,9 +1,9 @@
---
exclude: (?x)^( htdocs/includes/ckeditor/.*|(\.[^/]*/.*))$
exclude: (?x)^( htdocs/includes/ckeditor/.*|(\.(?!github/workflows)[^/]*/.*))$
repos:
# Several miscellaneous checks and fix (on yaml files, end of files fix)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
# This hook tests the name of the branch and return an error if the name is
# 'develop' or an official version 'x.y'
@ -18,7 +18,7 @@ repos:
# git commit -a -m "My message" --no-verify
# (Recommendation: run git commit -a .. once, then with `--no-verify`)
- id: no-commit-to-branch
args: [--branch, develop, --pattern, \d+.0]
args: [--branch, develop, --pattern, \d+.0$]
# This checks that xml files are correct
- id: check-xml
exclude: |
@ -43,7 +43,7 @@ repos:
- id: end-of-file-fixer
# Check that there are no completely merged file conflicts
- id: check-merge-conflict
stages: [pre-commit, pre-rebase, pre-commit, pre-merge-commit]
stages: [pre-rebase, pre-commit, pre-merge-commit]
# Check that files with shebangs have the executable bit set (in git)
- id: check-executables-have-shebangs
# Check that shell files are executables
@ -58,12 +58,18 @@ repos:
# Check that there are no files that have are the same when uppercased (conflict on windows)
- id: check-case-conflict
# Beautify shell scripts
# Gitleaks is a SAST tool for detecting and preventing hardcoded secrets like passwords, api keys, and tokens in git repos
- repo: https://github.com/gitleaks/gitleaks.git
rev: v8.16.1
hooks:
- id: gitleaks
# Check github actions
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
hooks:
- id: actionlint
# Beautify shell scripts
- repo: https://github.com/lovesegfault/beautysh.git
rev: v6.2.1
@ -183,7 +189,7 @@ repos:
# Check format of yaml files
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
args:
@ -193,7 +199,7 @@ repos:
# Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/)
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
# Due to a current limitation of configuration files,
@ -210,7 +216,7 @@ repos:
- -x
- dev/tools/codespell/codespell-lines-ignore.txt
exclude_types: [image]
exclude: (?x)^(.phan/stubs/.*)$
exclude: (?x)^(.phan/stubs/.*|phpstan\.neon.*)$
additional_dependencies: [tomli]
- alias: codespell-lang-en_US
# Only for translations with specialised exceptions
@ -236,30 +242,31 @@ repos:
# Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [-W, "100"]
# Check sql file syntax
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.0.4
rev: 3.1.0
hooks:
- id: sqlfluff-lint
stages: [pre-commit, manual] # manual needed for ci
exclude: (?x)^
(htdocs/includes/.*
|htdocs/install/doctemplates/websites/.*_template
(dev/initdemo/mysqldump_.*\.sql
|htdocs/core/menus/init_menu_auguria\.sql
|htdocs/install/doctemplates/websites/website_template-.*\.sql
|(htdocs/install/mysql/data/(llx_20_c_departements\.sql
|llx_accounting_account_.*\.sql)
|(htdocs/install/mysql/migration/3\.[256]\.0-.*\.sql)
)
|htdocs/includes/.*
|htdocs/install/doctemplates/websites/.*_template
|htdocs/install/doctemplates/websites/website_template.*\.sql
|htdocs/install/mysql/data/llx_20_c_departements\.sql
|htdocs/install/mysql/data/llx_accounting_account_.*\.sql
|htdocs/install/mysql/migration/3\..*\.sql
|htdocs/install/mysql/migration/(1[0-5]|[456789])\.0\.0-.*\.sql
|htdocs/install/mysql/migration/3\.([0134789])\.0-.*\.sql
|htdocs/install/mysql/migration/repair\.sql
|htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal\.sql
|htdocs/install/mysql/tables/llx_categorie(_(account|actioncomm|contact|fournisseur|knowledgemanagement-knowledgemanagement|member|product|project|societe|ticket-ticket|user|warehouse|website_page-website)?\.key\.sql)
|htdocs/install/mysql/tables/llx_categorie.*\.key\.sql
|htdocs/install/mysql/tables/llx_rights_def\.key\.sql
|htdocs/install/pgsql/functions/functions(-(don|loan|mailing|opensurvey|partnership|recruitment|website))?\.sql
|htdocs/install/pgsql/functions/functions.*\.sql
|htdocs/modulebuilder/template/sql/.*\.sql
)$

View File

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

View File

@ -47,7 +47,7 @@ Sabre 4.6.0 BSD Yes
Swift Mailer 5.4.2-DEV MIT License Yes Comprehensive mailing tools for PHP
Symfony/var-dumper ??? MIT License Yes Library to make var dump (used by DebugBar)
Stripe 10.7.0 MIT Licence Yes Library for Stripe module
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
TCPDF 6.7.5 LGPL-3+ Yes PDF generation
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
bacon, dasprid, swiss-qr-bill, kmukku, symfony/validator

485
ChangeLog
View File

@ -2,8 +2,281 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 20.0.1 compared to 20.0.0 *****
***** ChangeLog for 21.0.0 compared to 20.0 *****
For users:
----------
NEW: NEW Module - help to setup OpenID Connect (#30317)
NEW: Add hidden option CONTRACT_HIDE_MYCOMPANY_SIGNATURE_SECTION_PDF
NEW: Add a tab on recurring invoice card to see the list of invoices generated from this recurring invoice (customer and supplier invoices) (#31463)
NEW: #28871 signed_status to commande (#30359)
NEW: #30269 linked project in column of last record tables (#30344)
NEW: Accountancy - Add general account on thirdparty
NEW: Accountancy - Add partial reconcile on subledger (#30027)
NEW: Accountancy - Option to select the label of operation (#31200)
NEW: Accountancy - Allow grouping taxes with primary line price (#26732)
NEW: Activate PHPUnit with tests on permission on $action ==...
NEW: Add advice for max size on list for better performance
NEW: Add an advanced permission to validate knowledge (#30855)
NEW: Add a test mode into the setup of AI module to test the AI prompts.
NEW: Add a tool to decrypt data encrypted in database.
NEW: Add auto generate document when reception is created (#30688)
NEW: Add badge for generate invoice client tab (#31559)
NEW: Add caldav on fichinter (#30582)
NEW: Add column agenda_id to implement the link between files and event
NEW: Add column "comment" in list of payment
NEW: Add constant to hide version (#30865)
NEW: Add country in search of project
NEW: add duration extrafields (#31595)
NEW: Add export for thirdparty bank accounts (#30807)
NEW: Add export profile to export MO and lines of consumption/production
NEW: Add option to store the text content of uploaded files into database (with conversion with pdftotext)
NEW: Add Filter Assistance for Filling Filters Field (#31646)
NEW: add last stock movement and product nature to StocksWithBatch export (#30578)
NEW: Add member title to the labels (#31710)
NEW: Add mode Customer price + level price (#31091)
NEW: add option to add external billing contact on the supplier_proposal pdf (#30298)
NEW: Add option to clone its default BOM when cloning a product (#30088)
NEW: Add option to enable PDF frame rounded corners
NEW: Add option to round weight and volume on shipment PDF
NEW: add pdf regeneration to mass action for shipments (#29970)
NEW: Add picto on list of notification email templates
NEW: add recurring supplier invoice on supplier tab #30945 #30949
NEW: Add sort by ref warehouse/product or ref product/warehouse on inventory product list (#31639)
NEW: Add some improvement for ODT Contracts (#31715)
NEW: Add terms of sale on documents (#24846)
NEW: Add thirdparty state in substitution array (#31549)
NEW: Add tooltip on closing accounting setup
NEW: add trigger for linking and unlinking invoices (#30182)
NEW: Add Unit price on supplier order stat product (#31055)
NEW: add warehouseId parameters in select_produit to limit result to existing product in select (#30477)
NEW: allow link feature to task (#30235)
NEW: Authorize modification of a partially shipped order (#31423)
NEW: autogenerate project reference in API (#30638)
NEW: automatically change status on answering a ticket (#30556)
NEW: Browser notifications use now jnotify (fix browser compatibility)
NEW: can add extrafields with dol_move (#30574)
NEW: Can change the type of a social contribution if no payment
NEW: can delete a category translation (#31396)
NEW: Can link an object to another using the ref. Close #31001
NEW: Can set a class on the tr lines of form setup lines
NEW: Can set border radius of list and tables
NEW: Can set date of transmission in 1 click when validating SEPA
NEW: Can set parameters with setup type yesno.
NEW: Can set the contact type for the autoassigned user that creates a project (#30444)
NEW: Can show raw value of oauth token
NEW: Can use a specific profile to send email for password forgotten
NEW: option to care grandchild (#31314)
NEW: Look and feel - checkbox to choose thirdparty nature (#30192)
NEW: Color line total and sub total (#26172)
NEW: Constant to hide user login times (#29815)
NEW: Const ASSET_ROUND_INTEGER_NUMBER_UPWARDS for ASSET Module. Compatibility to migrate from other accounting solutions. (#31615)
NEW: Content of tab "attached files" is more compact.
NEW: Contract signed status update (#30779)
NEW: Create thirdparty notification by action code (#30541)
NEW: Customer price and level price together
NEW: default configuration for event reminder (#31407)
NEW: determine multi-currency price on object line create tpl (#28021)
NEW: Display for socialnetworks admin
NEW: display mark rates in objectLineCreate (#30872)
NEW: due date in accounting bookkeeping list and card (#30061)
NEW: enhance the OAUTH2 token manager. Can refresh a token from page.
NEW: EPC QR CODE - Use bank owner account name instead of company (#31735)
NEW: fichinter list disable details option (#30884)
NEW: filter on invoice dates in product margin tab (#29997) and thirdparty margin tab (#29998)
NEW: FIX: Display invoice widgets by amount instead of number (#30215)
NEW: Add the Clone of company (#29755)
NEW: function for Preview In CKeditor products
NEW: FY Changed Period handle in Module Asset (#31618)
NEW: hidden option MAIN_TE_PRIVATE_FIRST_AND_LASTNAME_TO_UPPER (#31143)
NEW: Hide completed items in Link to (#31329)
NEW: Iban is saved encrypted
NEW: if a user is associated with the expense report, then that user will get an associated credit line ($tabtp) generated.
NEW: Implementing Billable tasks on projects using new attribute "billable" (#30092)
NEW: Include a protection into check update of module to detect malware
NEW: intervention signed status update (#30629)
NEW: INTRA VAT ID field optionally mandatory and/or invoice mandatory in thirdparty module setup (#31663)
NEW: Invoice - Generate payment information - Structured communication (#31376)
NEW: Invoice line import - fk_product can be a ref (#30795)
NEW: Look and feel v21 - Can have rounded border on tables
NEW: Look and feel v21 - Toolbar for WYSIWYG editor is short on smartphone
NEW: Management of extrafields on customer prices, level prices and default prices (#31313)
NEW: manage several type of dangerous goods for a same parcel (#30238)
NEW: Member - Can upload a file with drag and drop (#30265)
NEW: Move the picto in the first tab label always visible
NEW: ODTSubsitution for date_start_real / Contracts
NEW: Look and feel - Opacity for finished lines (#30219)
NEW: option: assign default roles to "individual" third-party contacts (#30499)
NEW: option to allow freezing qty in BOM service's line (#29990)
NEW: Add a page to list the lines of orderse (#31521)
NEW: pagination in product margin tab
NEW: payment term and mode on creating supplier (#31166) and third-party (#31067)
NEW: PDF Add Customer accountancy code (#31544)
NEW: PDF Add discount total if line discount exists (#31483)
NEW: PDF Add option to print rounded corner frames (#31172)
NEW: PDF Add shipping address in sales orders (#31293)
NEW: PDF Add total discount if line discount exists
NEW: PDF frame rounded corners
NEW: Prelevement - Use structured payment data for Belgium (#31383)
NEW: Preview product list when we choose model email layout Commerce (#30185)
NEW: Can upload a file with drag and drop: Thirdparty (#30263) - Product/Service (#30250) - Project (#30276) - Propale (#30315)
NEW: Public and private note options in thirdparty list (#31062)
NEW: redirect to expedition card if global search has unique result (#30108)
NEW: replenishment if the warehouse is set to the default selected user (#31229)
NEW: retrieve Thirdparty by account (#31283)
NEW: Share msg "not found" for widgets and add a button to add new record when none exists (#31309)
NEW: shipment signed status update (#30928)
NEW: Show detail of each multicurrency amount in popup of price
NEW: show holidays at bottom of activity/permonth.php page (#31550)
NEW: Show tooltip on number of qualified records
NEW: Signature or proposal from the Web portal (#30062)
NEW: Star Field Type for Extra Fields (#31348) and for for Module Builder (#31216)
NEW: Support option PDF_ADD_POSITION on shipment espadon template
NEW: Auto-suspend facture rec when nb gen max is reached (#31623)
NEW: The margin section can now be shown/hidden
NEW: Deal change in fiscal year period adjustments to shortened or extended periods (e.g., fiscal years of 9 or 15 months)
NEW: (ticket, admin): More options entries (#30548)
NEW: Update warehouse product list to add another sorting option (#30971)
NEW: Can set blacklist of words into answer of AI (#30385)
NEW: user list country filter (#30770)
NEW: vat rate with department in dict (#31628) (#31627)
NEW: When we export data of unlaterable log, we add an unalterable line in logs
NEW Add option THEME_STICKY_TOPMENU = 'scrollleftmenu_after_mainpage' (or 'disabled')
NEW value for FICHINTER_DISABLE_DETAILS. If FICHINTER_DISABLE_DETAILS is set to '2' details are disabled only on intervention list.
PERF: Reduce nb of requests into num_public_holiday
PERF: Reduce size for VCF files and virtualcard qrcode
PERF: Reduce time to show the page of unalterable logs with high data
For developers:
---------------
NEW: translation with action triggers API (#30595)
NEW: more complete stock product API call (#30567)
NEW: Projet - Add hook formconfirm (#31408)
NEW: Can choose the zip handler to build ODT.
NEW: Can force ip into log file name using a define('SYSLOG_FILE_ADDIP')
NEW: Can force log file name using a define('SYSLOG_FILE_ADDSUFFIX')
NEW: Can define the text on tooltip on a yesno check.
NEW: Introduce value 'password' for mode of sanitization in GETPOST.
NEW: Add getImageFromHtmlContent() method
NEW: Add gitleaks into pre-commit
NEW: Add hook after the line is processed in the sell journal page (#31439)
NEW: add hook dolibarrDelConst (#30672)
NEW: Add hook getLoginPageExtraContent, getPasswordResetPageExtraContent
NEW: add hook in dolibarr_set_const admin.lib.php (#30605)
NEW: Add hook on sell journal page for overwrite the processed journal data after the SQL request (#31033)
NEW: force_install_noedit : add value 3 to block all technical parameters excepted main_url (#30080)
NEW: Add a new hook on order list (#31315)
NEW: Add ID of the line in the trigger context for addLine(), updateLine() and deleteLine() on contract (#30343)
NEW: Add more log information
NEW: Add pagination data to some api routes (#29895)
NEW: Add test to forbidden NOW() SQL function.
NEW: API call to re-generate a users password. (#30590)
NEW: API close proposal now supports both private and public note (#30659)
NEW: API_LOGINS_ALLOWED_FOR_GET_EXTRAFIELD (#30562)
NEW: API /setup endpoint for getting action triggers (#30538)
NEW: HOOK FORMCONFIRM IN TICKET (#31321)
NEW: hook on expensereport added (#31380)
QUAL line classes for various business object classes have been moved to individual files.
QUAL: #30122 (#30131)
QUAL: AccountancySystem: maintenance work to uniformize and clean up (#31391)
QUAL: All $conf->global->module->enabled are replaced with isModEnabled()
QUAL: bankline category table name (#30419)
QUAL: Clean code
QUAL: conformity PR for data structure of #29964 (#30014)
QUAL: Edition of currency is shared in a common tpl file
QUAL: Ergo btn and fix (#30947)
QUAL: Move function csvClean into functions2.lib.php
QUAL: Move the public css file into the public directory
QUAL: Removed inclusion of the file json.lib.php
QUAL: simplifying readability of sql
QUAL: Standardize name of user cookies
QUAL: Suffix table name to have them created on module install
QUAL: The property ->domiciliation and ->propio on bank accounts has been
QUAL: Update inc.php (#29822)
QUAL: Use archiveOrBackupFile for MAIN_MAIL_DEBUG_LOG_WITH_DATE
QUAL: Use table_element in sql queries (#31355)
QUAL: rename const WORKFLOW_EXPEDITION_CLASSIFY_NEWD_INVOICE to WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE
QUAL: This configuration change in phan will report NEW: array types in phpdoc
WARNING:
--------
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Prepare your module for deprecation of triggers code XXX_INSERT to support also XXX_CREATE.
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
* The json emulator dol_json_encode/decode() is removed. The native json PHP module must be enabled/available (this is the case by default with most PHP installation).
* The deprecated GET parameter "&sall=" has been removed, use now the "&search_all=".
* The experimental and deprecated module WebserviceClient is completely removed (was never released and use deprecated architecture). May be replaced with the stable module Webhook.
* The dynamic properties ->no_button_delete, ->no_button_edit, ->no_button_copy for $object Product that could be set by an external module must no more
be set (not allowed by PHP 8.2). A module can already return an array with key 'no_button_delete', 'no_button_edit', 'no_button_copy' for same purpose.
* The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it.
* The trigger code CATEGORY_LINK and CATEGORY_UNLINK has been replaced with code CATEGORY_MODIFY. You can read ->context['linkto'] or ->context['unlinkoff' to detect if we want to make a link or unlink.
* The property ->domiciliation and ->propio on bank accounts has been deprecated and replaced with property ->address and ->owner_name everywhere.
* If you were using the substitution key __MEMBER_CIVILITY__, you must now use __MEMBER_TITLE__
***** ChangeLog for 20.0.2 compared to 20.0.1 *****
FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28505 Blank page from third party to projects (#31637)
FIX: #30432 make thirdparty code_client and code_compta modifiable via API (#31668)
FIX: #31015
FIX: #31360 delete contact when using pgsql.
FIX: #31365 Bank - Card - Ref haven't max length in edit mode (#31533)
FIX: #31452 Predefined supplier invoice - Language key & link to supplier card (#31514)
FIX: #31538 Addition to EPC-QR values <200b><200b>to correct remittance information (#31557)
FIX: Accountancy - Loan - Error on transfer (#31546)
FIX: a dictionary CANNOT have zero value in entity field (#31625)
FIX: Avoid fatal error when mysqli not available
FIX: Bad balance of td into setup page of shipments
FIX: bad test on permission makes agenda event creation on object not
FIX: can validate shipment without stock movement (#31780)
FIX: Clear of option THEME_ELDY_USEBORDERONTABLE
FIX: column position on PDF of payments
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: convert amount into text when using numberwords
FIX: Corrected typo preventing data from being saved (#31716)
FIX: CSS
FIX: access to media files
FIX: default visibility
FIX: dol_openinpopup for virtual card
FIX: duplicate answers in list when using global search on proposals
FIX: Edit a link
FIX: email templates for expense report not visible
FIX: Error management on cheque deposit.
FIX: error message in xls import when stream zip is not available.
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: Filter on month of the balance of leaves.
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: for #31237 #31524
FIX: Get number of bank deposit wa not using the date.
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: open redirection
FIX: pagebreak when option PDF_ADD_POSITION is set
FIX: PHP-warning-multiprice-in-liste-product-if-level-is-not-defined-on-product (#31507)
FIX: Picto menu not visible
FIX: Salary - Payment card - Missing date (#31512)
FIX: Search on batch code
FIX: select variant by attribute. (#31759)
FIX: show preview pdf list expensereport (#31694)
FIX: Show twice the technical ID
FIX: space used by linked elements in PDF notes (#31459)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: Support for PDF_ADD_POSITION was not complete
FIX: the autofix corrupted vat value must be triggered only if we are
FIX: the autofix must also fix the multicurrency value.
FIX: this constant break the dictionary admin without Multicompany (#31638)
FIX: uniformize and check delete contact action (#31384)
FIX: Vat code is lost when updating lines in POS
FIX: uniformize and check delete contact action (#31384)
FIX: Vat code is lost when updating lines in POS
FIX: When PDF_ADD_POSITION is on, the number was doing pagebreak before
***** ChangeLog for 20.0.1 compared to 20.0.0 *****
FIX: #30960 show and search extrafields (#31026)
FIX: #31076 Bad position of hooks
FIX: #31152
@ -52,7 +325,6 @@ FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong price for BOM with workstation (#31142)
FIX: determine multi-currency price on object line create tpl (#28021)
***** ChangeLog for 20.0.0 compared to 19.0 *****
For users:
@ -190,7 +462,7 @@ NEW: Module Website: Can link/unlink translation between web pages
NEW: Move dir of cache for widgets
NEW: multiselect with checkbox in categories/tags search for thirdparty list (#28335)
NEW: new consts to redirect from massaction createbills (#29436)
NEW: new global string to preselect yes for one bill per thirparty in orderlist massaction (#29359)
NEW: new global string to preselect yes for one bill per third party in orderlist massaction (#29359)
NEW: notification action triggers for cancelling orders and invoices
NEW: now button when editing an event
NEW: online signature of shipments (#29559)
@ -306,7 +578,6 @@ QUAL: professional identifiers - remove TODO by adding profid.lib.php
QUAL: Properties ->date_update and ->date_modification were merged
QUAL: removed duplicate language file
QUAL: Remove the external js library jstimezonedetect
QUAL: Remove use of customurl filter. Must use the USF syntax.
QUAL: Rename all input fields "tel" into "phone"
QUAL: Rename column fk_origin_line on shipment lines into fk_elementdet to match a generic use. (#28989)
QUAL: replace $conf->global with getDolGlobalString()
@ -327,6 +598,7 @@ The following changes may create regressions for some external modules, but were
See https://wiki.dolibarr.org/index.php?title=Universal_Search_Filter_Syntax
* The parameter $filter of methods fetchAll() does not accept array of SQL commands but must be a string of an Universal Search Filter syntax.
See https://wiki.dolibarr.org/index.php?title=Universal_Search_Filter_Syntax
* The use of 'customurl' into $filter has been removed. Must use the USF syntax.
* Some API HTTP return code were moved from 401 to 403 to better follow REST specification.
* More class properties (with old name in french) are now deprecated in favor of the property name in english.
* dolibarrtriggers class VERSION_XXX constants have been deprecated. Please use array dictionary VERSIONS['XXX'].
@ -345,10 +617,63 @@ The following changes may create regressions for some external modules, but were
* Removed trigger BILLREC_CREATEBILL. This trigger was not a CRUD event. If you used it, you can already use the trigger BILL_CREATE and
test that ($object->fac_rec > 0) to know if creation trigger is from a recurring invoice or not. Also this old trigger was never enabled
into table llx_c_action_trigger.
* Renamings in expedition line table and class, fk_origin_line is now fk_elementdet in table and class.
* Renaming into expedition line table and class: fk_origin_line is now fk_elementdet in table and class.
* The signature of method fetch() of class CompanyBankAccount has been modified to match the signature of method Account->fetch()
***** ChangeLog for 19.0.4 compared to 19.0.3 *****
FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28505 Blank page from thirdparty to projects (#31637)
FIX: #30757
FIX: #30762
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
FIX: #30772 Accountancy document export - The project filter on expenses report don't work (#30824)
FIX: #30836
FIX: #30960 show and search extrafields (#31026)
FIX: Add same security test when uploading files from API than from GUI (#31114)
FIX: ajaxik URL in ExpenseReport to load coef calculation (#30918)
FIX: attached file on first page load (#30694)
FIX: autoselect the fiscal period by default
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
FIX: avoid odt errors (#31126)
FIX: avoid pgsql error (#30678)
FIX: avoid the return "AND (())" (#30829)
FIX: Backport fix fatal error on price with some truncating setup
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
FIX: can validate shipment without stock movement (#31780)
FIX: column position on PDF of payments
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: Debug extrafields for bank lines
FIX: email templates for expense report not visible
FIX: Error message overwrote when a error occurs during update of product multilangs (#30841)
FIX: error return missing in mo creation when qty to consume is <= 0 (#31134)
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: Fatal error on create loan schedule (#30656)
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: fixed search filter for projects resetting when set to empty (#30902)
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: Invoice unpaid widget - SQL error on group by with constant MAIN_COMPANY_PERENTITY_SHARED (#30866)
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: late order search option (v18+) (#30692)
FIX: late propal search option (v18+) (#30687)
FIX: missing fk_parent_line parameter (#30806)
FIX: mysql error during dump for enable sandbox M999999 (#31116)
FIX: PHP-warning-multiprice-in-liste-product-if-level-is-not-defined-on-product (#31507)
FIX: Protection to avoid an extrafield to be mandatory if computed
FIX: purge files cron: php warnings when rest module enabled (#30919)
FIX: removed unreachable code (#31141)
FIX: show preview pdf list expensereport (#31694)
FIX: Substitution error in ticket emails in the subject (#30778)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
FIX: Vat code is lost when updating lines in POS
FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong default PDF model when creating the second situation invoice (#30843)
FIX: wrong subprice if price base type is TTC (#30887)
***** ChangeLog for 19.0.3 compared to 19.0.2 *****
FIX: #29403 HRM - Unable to delete a skill in a job Profile (#29779)
FIX: #29439 incomplete API return (#29796)
@ -908,6 +1233,138 @@ The following changes may create regressions for some external modules, but were
* The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases.
***** ChangeLog for 18.0.6 compared to 18.0.5 *****
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
FIX: 16.0 - the e-mail templates configured in the notification module are not used if the recipient is a fixed e-mail address (#29407)
FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)
FIX: 17.0: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
FIX: 17.0: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
FIX: #24265 regression cannot see all product on takepos (#28753)
FIX: #25853 Thirdparty Massaction (#25868)
FIX: #28205
FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252)
FIX: #28369
FIX: #28518 (#28520)
FIX: #28978 FIX: #28976
FIX: #29029 Impossible to delete an order line
FIX: #29114 Missing contact term in intervention
FIX: #29114 Translate contact term in intervention
FIX: #29439 incomplete API return (#29796)
FIX: #29496 filtering a record should not hide its child not filtered
FIX: #30010 Use conf TICKET_MESSAGE_MAIL_INTRO instead of translation key (#30081)
FIX: #30274 Add the include before executing dolibarr_set_const (#30320)
FIX: #30467
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
FIX: Accountancy export with file or not
FIX: Accountancy - Generate entries of expense report with localtax (#30411)
FIX: Accountancy - Not trunc id_import
FIX: accounting FEC import (Issue #28306) (#29414)
FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523)
FIX: Add same security test when uploading files from API than from GUI (#31114)
FIX: Amount of localtaxes in foreign currency was wrong on screen and PDF
FIX: an error in a complex else condition
FIX: ASSET: annual depreciation starting year (Again ;-)) #26084 (#30040)
FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270)
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
FIX: avoid php warnings (#29247)
FIX: avoid to delete "lock" and "unlock" files
FIX: avoid Unknown column 'pfp.ref_fourn' (#28145)
FIX: background color for enabled modules (#29378)
FIX: Backport fix fatal error on price with some truncating setup
FIX: Backport page inventory.php from v18 to fix pagination bugs causing data loss (#29688)
FIX: back to page on error in contact card (#29627)
FIX: Bad calculation of $nbtotalofrecord (#30183)
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
FIX: can validate shipment without stock movement (#31780)
FIX: Condition on newDateLimReglement
FIX: Conflict with autoload (#30399)
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
FIX: contact/address title is always "New Contact/Address" even if the contact/address already exists (#29581)
FIX: Display the date according to user language on substitutions (#29510)
FIX: Display the real_PMP on inventory when its value is equal to 0 (#22291)
FIX: Don't display column when it's out of date (#28271)
FIX: email templates for expense report not visible
FIX: Error mesg show untranslated extrafield name (#30227)
FIX: Error message overwrote when a error occurs during update of product multilangs (#30841)
FIX: Error When cloning fourn price no default value for tva_tx (#28368)
FIX: executeHooks $object default value (#29647)
FIX: expedition PDF models using units labels (#30358)
FIX: Extrafield following between rec invoice and classic invoice (#31445)
FIX: fatal error on loading pictures in attached documents of an event (#30553)
FIX: fatal error Unsupported operand types when recording load payment
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfer is allowed (#26217)
FIX: Fix save directory for invoice ODT and multientities
FIX: group by qty in product margin tab (#29853)
FIX: Hierarchy Employee view do not filter on employee = 1 (#29496)
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
FIX: incorrect page numbering in PDF #29458 (#29476)
FIX: inventoryDeletePermission id define twice
FIX: issue on action set condition in particular when you set a deposi… (#31518)
FIX: issue to get the right files exported in Quadratrus export.php (#30004)
FIX: lang output for sales representative on PDF (#30469)
FIX: late order search option (#30692) and propal (#30687)
FIX: lettering (auto) for invoice deposit with company discount (#29633)
FIX: made invalid code shape error more user friendly (#29498)
FIX: Merge of thirdparties must also move uploaded files
FIX: missing entity parameter for ajax_constantonoff
FIX: missing hide "new" button where "product" or "service" module are disable
FIX: mo cloning (#29686)
FIX: modification date from label in accounting bookkeeping list (#30038)
FIX: Move the trigger for delete order line before the SQL request
FIX: multiple problems with multicompany
FIX: mysql error during dump for enable sandbox M999999 (#31116)
FIX: notification: error 500 in fixed emails due to a bad copy/paste (#29580)
FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216)
FIX: Not qualified lines for reception (#29473)
FIX: not redirect when error occurs on updating card (#29388)
FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211)
FIX: on change ref for bank account attachment are lost (#30529)
FIX: Option MAIN_DOC_USE_TIMING can be a string with date format
FIX: orders to bill menu (#30179)
FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156)
FIX: PDF Fatal error : Backport fix from #23972
FIX: PDF Translations Extrafields
FIX: permission on payment file of a tax
FIX: php8: Fatal when empty $tmpvat is an empty string (no silent conversion to '0' when used in arithmetic operations) (#29451)
FIX: PHP 8 warning on output of successful cronjob (#29922)
FIX: PHP exception on getSpecialCode (#29646)
FIX: php warning global conf (#29478)
FIX: pos: invoice date incorrectly set because of timezome mismatches (reverts #36e91da) (#30184)
FIX: public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942)
FIX: purge files cron: php warnings when rest module enabled (#30919)
FIX: PUT /thirdparties/{id} and PUT /contacts/{id} should throw exception if update returns < 0 (#29596)
FIX: Regression #29340
FIX: Repair the replenishment list (#29336)
FIX: REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)
FIX: round capital societe (#29211)
FIX: search and add extrafields to tasks when conf disabled (#29542)
FIX: show preview pdf list expensereport (#31694)
FIX: sometimes a string type instead integer is return, why ?
FIX: Special code is now transmitted by args only in order supplier (#28546) (#28619)
FIX: SQL syntax error in DDLUpdateField
FIX: subscription must be editable when accounting isn't reconciled (#28469)
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
FIX: Supplier Order search on date valid (#30448)
FIX: supplier price duplicate entry on update supplier product ref (#29290)
FIX: syntax error
FIX: TakePOS | Add product / Delete line of existing invoice
FIX: Ticket new message notification sent twice
FIX: transfer in accountancy for expense reports.
FIX: Unsigned propal having signing date (#29825)
FIX: Update asset.class.php
FIX: update date_echeance of supplier invoices when we update invoice date in the past (#29886)
FIX: use $conf->browser->os instead
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
FIX: User List - Function is show in wrong column when module HRM enabled (#30186)
fix: when invoice is created by WORKFLOW_ORDER_AUTOCREATE_INVOICE on ORDER_NEW, the invoice must have the default bank account of the thirdparty is it's empty on order (#29462)
FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong currency shown in TakePOS payment page
FIX: wrong shortcut key for macintosh
FIX: wrong sql request with product category filter
FIX: wrong stock permission number
***** ChangeLog for 18.0.5 compared to 18.0.4 *****
FIX: 17.0: deprecated field should only be a fallback
FIX: 17.0 - php8 warnings: test for $field existence before checking if it is null or empty
@ -1264,7 +1721,7 @@ NEW: No overwrite of optionals during put() contact
NEW: Notifications: add Customer Order delivered (ORDER_NEW) in module Notification
NEW: Notifications: for Sign or Refused Propal from Online Page
NEW: Now we can edit amount on VAT and salaries clone action
NEW: only get opened contact from liste_contact function, to not have access to closed contact as mail receiver
NEW: only get open contact from liste_contact function, to not have access to closed contact as mail receiver
NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
NEW: Option to manage deposit slips for more payment modes (not only
NEW: Option to show column for field and line selection on the left
@ -1747,7 +2204,7 @@ NEW: Add link to create an element from the category page
NEW: add margin infos to takepos invoice lines
NEW: Add max size send for "backup and link to mail" option
NEW: Add method httponly_accessforbidden()
NEW: Add more advices into the Setup security page
NEW: Add more advice into the Setup security page
NEW: Add new global variable for keeping the previous signature information on proposal (case of reopening a proposal)
NEW: Add objectLink on shipment
NEW: Add option --force on CLI cron_run_jobs.php
@ -3165,8 +3622,8 @@ NEW: add option in Workflow module to set a shipment as closed
for Admins
NEW: Add a security center page with all information and advices related to the security of your instance
NEW: Add a performance center page with all information and advices related to the performance of your instance
NEW: Add a security center page with all information and advice related to the security of your instance
NEW: Add a performance center page with all information and advice related to the performance of your instance
Modules
NEW: Module Recruitment is now stable
@ -3328,7 +3785,7 @@ FIX: fix checkbox displayed according to module project setup parameters - work
FIX: inconsistency in margin recording with option "Force to sale price"
FIX: invoice PDF generation after payment
FIX: mask selector fournisseur if module not activate
FIX: merge thirparty also work for bank URL entry
FIX: merge third party also works for bank URL entry
FIX: Missing extrafields into export of agenda record
FIX: missing parameter in select for POP
FIX: missing return edit if update error
@ -7184,7 +7641,7 @@ NEW: Add index and constraints keys on supplier proposal detail table
NEW: Add phpunit to check the engine is defined into sql create files.
NEW: Add project and Hook to Loan
NEW: Add REST API to push a file.
NEW: Allow extrafields list select to be dependands on other standard list and not only other extrafields list
NEW: Allow extrafields list select to be dependent on other standard list and not only other extrafields list
NEW: Architecture to manage search criteria persistence (using save_lastsearch_values=1 on exit links and restore_lastsearch_values=1 in entry links)
NEW: data files are now also parsed by phpunit for sql syntax
NEW: Hook to allow inserting custom product head #6001
@ -8208,7 +8665,7 @@ NEW: The clicktodial module is now able to provide link "tel:" on phone numbers.
NEW: The conditional IF into ODT templates works also on not defined var so we can show data only if defined. Close #3819
NEW: The free text in PDF footers can now be a HTML content. So the WYSIWYG editor is on by default to edit it into module setup.
NEW: The thirdparties tabs, the contacts tabs and the members tabs are now presented using a new "top banner", saving space and using a same way to show address, status and navigation arrows.
NEW: Thumbs for statistics on main page are fully clicable (not only link inside the thumb)
NEW: Thumbs for statistics on main page are fully clickable (not only link inside the thumb)
NEW: Translate extrafield's labels.
NEW: Use new select2 component for juridical status, country and state selection.
NEW: When creating order, proposal or invoice from thirdparty card, the project is asked during creation. A link to create project if it does not exists is also available.
@ -8807,7 +9264,7 @@ NEW: [ task #851 ] Add a new field: Commercial name
NEW: [ task #977 ] New option to manage product unit Migrated code from GPCSolutions/dolibarr:3.2-units branch and adapted for 3.8 with some improvements
NEW: The line where mouse is over can be highlight with option THEME_ELDY_USE_HOVER (on by default)
NEW: The notification module accept keyword __SUPERVISOR__ to send notification to supervisor of user.
NEW: Thumbs for statistics on main page are fully clicable (not only link inside the thumb)
NEW: Thumbs for statistics on main page are fully clickable (not only link inside the thumb)
NEW: Title of page project contains project ref and label
NEW: update skeleton and class builder
NEW: Use new select2 component for juridical status, country and state selection.
@ -9958,7 +10415,7 @@ For users:
prices, radio).
- New: [ task #798 ] Add range limit date on product/services as it is done on order
and invoice.
- New: [ task #814 ] Add extrafield feature for projects ands tasks.
- New: [ task #814 ] Add extrafield feature for projects and tasks.
- New: [ task #770 ] Add ODT document generation for Projects module.
- New: [ task #741 ] Add intervention box.
- New: [ task #826 ] Optional increase stock when deleting an invoice already validated.

View File

@ -1,6 +1,7 @@
# DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg)
![Docker hub pulls](https://img.shields.io/docker/pulls/dolibarr/dolibarr.svg)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/)
[![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521)
@ -10,13 +11,15 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENCE
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
## INSTALLER DOLIBARR
### Configuration simple
### Installation simple
Si vous avez peu de compétences techniques et que vous souhaitez installer Dolibarr ERP/CRM en quelques clics, vous pouvez utiliser l'une des versions pré-packagées avec les prérequis:
@ -26,7 +29,7 @@ Si vous avez peu de compétences techniques et que vous souhaitez installer Doli
Les packages peuvent être téléchargés à partir de [site web officiel](https://www.dolibarr.org/).
### Configuration avancée
### Installation recommandée/avancée
Vous pouvez aussi utiliser un serveur Web et une base de données prise en charge (MariaDB, MySQL ou PostgreSQL) pour installer la version standard.
@ -54,6 +57,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg
- Suivez les instructions de l'installateur
## METTRE A JOUR DOLIBARR
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
@ -70,10 +74,12 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
Note: *Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
## CE QUI EST NOUVEAU
Voir le fichier [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog).
## CE QUE DOLIBARR PEUT FAIRE
### Modules principaux (tous optionnels)
@ -143,6 +149,7 @@ Voir le fichier [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/Ch
Dolibarr peut aussi être étendu à volonté avec l'ajout de modules/applications externes développées par des développeurs tiers, disponible sur [DoliStore](https://www.dolistore.com).
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
@ -152,22 +159,26 @@ Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
- Dolibarr n'embarque pas de Webmail intégré nativement.
- Dolibarr ne fait pas le café (pas encore).
## DOCUMENTATION
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
## CONTRIBUER
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
[![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](https://github.com/Dolibarr/dolibarr/graphs/contributors)
## CREDITS
Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs.
Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
## ACTUALITES ET RESEAUX SOCIAUX
Suivez le projet Dolibarr sur les réseaux francophones

View File

@ -1,11 +1,12 @@
# DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg)
![Docker hub pulls](https://img.shields.io/docker/pulls/dolibarr/dolibarr.svg)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square)](https://php.net/)
[![GitHub release](https://img.shields.io/github/v/release/Dolibarr/dolibarr)](https://github.com/Dolibarr/dolibarr)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5521/badge)](https://bestpractices.coreinfrastructure.org/projects/5521)
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activities (contacts, suppliers, invoices, orders, stocks, agenda…).
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activities (contacts, quotes, invoices, orders, stocks, agenda, human resources, ecm, manufacturing…).
It's an Open-Source Software suite (written in PHP with JavaScript enhancements) designed for small, medium or large companies, foundations and freelancers.
@ -17,6 +18,7 @@ Dolibarr has a large community ready to help you, free forums and [preferred par
![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENSE
Dolibarr is released under the terms of the GNU General Public License as published by the Free Software Foundation; either Version 3 of the License, or (at your option) any later version (GPL-3+).
@ -25,24 +27,25 @@ See the [COPYING](https://github.com/Dolibarr/dolibarr/blob/develop/COPYING) fil
Other licenses apply for some included dependencies. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) for a full list.
## INSTALLING
### Simple setup
There is a lot of different solutions to install Dolibarr.
### Using packages
If you have low technical skills and you're looking to install Dolibarr ERP/CRM with just a few clicks, you can use one of the packaged versions:
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp))
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
- DoliRpm for Red Hat, Fedora, OpenSuse, Mandriva or Mageia
- The Docker image (see next chapter)
Releases can be downloaded from [official website](https://www.dolibarr.org/).
### Recommended setup
### Using the generic step by step setup (recommended for IT users)
You can use any web server supporting PHP (Apache, Nginx, ...) and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version.
#### Generic install steps
You can use any web server supporting PHP (Apache, Nginx, ...) and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version:
- Verify that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
@ -70,10 +73,15 @@ You can use any web server supporting PHP (Apache, Nginx, ...) and a supported d
- Follow the installer instructions
### SaaS/Cloud Setup
### Using Docker images
Dolibarr is also available as a [Docker image](https://hub.docker.com/r/dolibarr/dolibarr). Installation instructions are available [here](https://github.com/Dolibarr/dolibarr-docker).
### Using ready to use SaaS/Cloud offers
If you lack the time to install it yourself, consider exploring commercial 'ready-to-use' Cloud offerings (refer to https://saas.dolibarr.org). Keep in mind that this third option comes with associated costs.
## UPGRADING
Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
@ -86,10 +94,12 @@ Follow these step-by-step instructions to seamlessly upgrade Dolibarr to the lat
- At your next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
 If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
## WHAT'S NEW
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
## FEATURES
### Main application/modules (all optional)
@ -211,6 +221,7 @@ See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequ
Dolibarr can be extended with a lot of other external applications or modules from third-party developers available at the [DoliStore](https://www.dolistore.com).
## WHAT DOLIBARR CAN'T DO YET
These are features that Dolibarr does **not** yet fully support:
@ -220,10 +231,12 @@ These are features that Dolibarr does **not** yet fully support:
- Native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
- Dolibarr can't do coffee (yet)
## DOCUMENTATION
Administrator, user, developer and translator's documentation are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
## CONTRIBUTING
This project exists thanks to all the people who contribute.
@ -233,12 +246,14 @@ A View on Contributors:
[![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](https://github.com/Dolibarr/dolibarr/graphs/contributors)
## CREDITS
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
## NEWS AND SOCIAL NETWORKS
Follow Dolibarr project on:
@ -250,6 +265,7 @@ Follow Dolibarr project on:
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)
### Sponsors
## Sponsors
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]

View File

@ -1,6 +1,6 @@
# Security Policy
This file contains some policies about the security reports on Dolibarr ERP CRM project, one of the most popular Open Source ERP and CRM in the world.
This file contains some policies about the security reports on Dolibarr ERP CRM project, a popular Open Source ERP and CRM used by millions of users.
## Supported Versions for security reports
@ -12,8 +12,9 @@ Security report are valid only on current stable version (see https://dolibarr.o
To report a vulnerability, for a private report, you can:
- Send your report on Vulnerability Disclosure Program (VDP) [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
- Send your report on Vulnerability Disclosure Program (VDP): Link will be updated soon (recommended for everybody)
<!--
- Send your report on Vulnerability Disclosure Program (VDP) [https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US](https://app.yogosha.com/cvd/dolibarr/10VxeNx6Ui3rSEhAgX63US) (recommended for everybody)
- Or if you have permissions, use GitHub security advisory at [https://github.com/Dolibarr/dolibarr/security/advisories/new](https://github.com/Dolibarr/dolibarr/security/advisories/new)
-->
- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.

View File

@ -2,7 +2,7 @@
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/tuxgasy/dolibarr
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:

View File

@ -1,6 +1,23 @@
# How to use it ?
# 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 this current repository by running
sudo docker-compose build
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
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 ihttps://hub.docker.com/r/dolibarr/dolibarr

View File

@ -1,25 +1,15 @@
# This docker-compose.yml file is used to build and test quickly
# a specific version of Dolibarr
#
# Before build, define the variable DOLI_VERSION as following:
# $ export DOLI_VERSION=4.0.4
# And then, you can run :
# $ docker-compose up
#
# More information about Docker-compose : https://docs.docker.com/compose/
version: "3"
services:
mariadb:
container_name: dolibarr-mariadb-dev
mariadb-prod:
container_name: dolibarr-mariadb-prod
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PWD
MYSQL_DATABASE: "dolibarr-prod"
web:
container_name: dolibarr-web-dev
container_name: dolibarr-web-prod
build: .
volumes:
@ -27,12 +17,12 @@ services:
- ../../documents:/var/www/html/documents
depends_on:
- mariadb
- mariadb-prod
environment:
WWW_USER_ID: 1000
WWW_GROUP_ID: 1000
HOST_USER_ID: $HOST_USER_ID
HOST_GROUP_ID: $HOST_GROUP_ID
DOLI_ROOT_PASSWORD: $MYSQL_ROOT_PWD
DOLI_DATABASE: "dolibarr-prod"
DOLI_DB_SERVER: "mariadb"
DOLI_DB_SERVER: "mariadb-prod"
ports:
- "8080:80"

View File

@ -2,18 +2,26 @@
# Script used by the Dockerfile.
# See README.md to know how to create a Dolibarr env with docker
if [ "${PHP_INI_DIR}" == "" ]; then
echo
echo This script must not be run directly. It is used by the Dockerfile
echo See README.md
echo
exit
fi
usermod -u "${HOST_USER_ID}" www-data
groupmod -g "${HOST_USER_ID}" www-data
groupmod -g "${HOST_GROUP_ID}" www-data
chgrp -hR www-data /var/www/html
chmod g+rwx /var/www/html/conf
if [ ! -d /var/documents ]; then
echo "[docker-run] => create volume directory /var/documents ..."
mkdir -p /var/documents
if [ ! -d /var/www/documents ]; then
echo "[docker-run] => create volume directory /var/www/documents ..."
mkdir -p /var/www/documents
fi
echo "[docker-run] => Set Permission to www-data for /var/documents"
chown -R www-data:www-data /var/documents
echo "[docker-run] => Set Permission to www-data for /var/www/documents"
chown -R www-data:www-data /var/www/documents
echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'"
cat <<EOF > "${PHP_INI_DIR}/conf.d/dolibarr-php.ini"

View File

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

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -199,7 +200,7 @@ fputs($fp, ' </dir>'."\n");
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
asort($checksumconcat); // Sort list of checksum
//var_dump($checksumconcat);
fputs($fp, '<dolibarr_htdocs_dir_checksum>'."\n");
fputs($fp, md5(join(',', $checksumconcat))."\n");
fputs($fp, '</dolibarr_htdocs_dir_checksum>'."\n");

View File

@ -4,7 +4,7 @@
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
# \author (c)2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
#
# This is list of constant you can set to have generated packages moved into a specific dir:
# This is list of constant you can set to have generated packages moved into a specific dir:
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
#DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'
#DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules'
@ -129,7 +129,7 @@ if (! $TEMP || ! -d $TEMP) {
print "$PROG.$Extension aborted.\n";
sleep 2;
exit 2;
}
}
$BUILDROOT="$TEMP/buildroot";
@ -172,7 +172,7 @@ $newbuild = $BUILD;
$newbuild =~ s/(dev|alpha)/1/gi; # dev
$newbuild =~ s/beta(.?)/2/gi; # beta (we want beta1, beta2, betax to be same package name)
$newbuild =~ s/rc(.?)/3/gi; # rc (we want rc1, rc2, rcx to be same package name)
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc.
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc.
# now newbuild is 0-1 or 0-4 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
$build = $newbuild;
$build =~ s/-.*$//g;
@ -190,8 +190,8 @@ for (0..@ARGV-1) {
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
$PREFIX=$1;
$FILENAMESNAPSHOT.="-".$PREFIX;
$PREFIX=$1;
$FILENAMESNAPSHOT.="-".$PREFIX;
}
}
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined
@ -210,7 +210,7 @@ print "Target directory (DESTI) : $DESTI\n";
# Choose package targets
#-----------------------
if ($target) {
if ($target eq "ALL") {
if ($target eq "ALL") {
foreach my $key (@LISTETARGET) {
if ($key ne 'SNAPSHOT' && $key ne 'SF' && $key ne 'ASSO') { $CHOOSEDTARGET{$key}=1; }
}
@ -236,10 +236,10 @@ else {
printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".$REQUIREMENTPUBLISH{"ASSO"});
$cpt=99;
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"});
# Ask which target to build
print "Choose one target number or several separated with space (0 - ".$cpt."): ";
$NUM_SCRIPT=<STDIN>;
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
{
@ -286,11 +286,11 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
print "Error: You asked creation of several rpms. Because all rpm have same name, you must defined an environment variable DESTI to tell packager where it can create subdirs for each generated package.\n";
exit;
}
$atleastonerpm=1;
}
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
$atleastonerpm=1;
}
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
{
# Test
# Test
print "Test requirement for target $target: Search '$req'... ";
$newreq=$req; $newparam='';
if ($newreq eq 'zip') { $newparam.='-h'; }
@ -299,12 +299,12 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
print "Test command ".$cmd."... ";
$ret=`$cmd`;
$coderetour=$?; $coderetour2=$coderetour>>8;
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
# Not found error, we try in PROGPATH
$ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
$coderetour=$?; $coderetour2=$coderetour>>8;
$REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
}
}
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
# Not found error
@ -333,7 +333,7 @@ $nbofpublishneedchangelog=0;
foreach my $target (sort keys %CHOOSEDTARGET) {
if ($target eq '-CHKSUM') { $nbofpublishneedchangelog++; }
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
{
$nboftargetneedbuildroot++;
}
@ -397,10 +397,10 @@ if ($nboftargetok) {
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
print "Clean $SOURCE/htdocs/includes/autoload.php\n";
$ret=`rm -f $SOURCE/htdocs/includes/autoload.php`;
$ret=`git ls-files . --exclude-standard --others`;
if ($ret)
{
@ -409,7 +409,7 @@ if ($nboftargetok) {
print "Canceled.\n";
exit;
}
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
print $ret."\n";
@ -427,13 +427,13 @@ if ($nboftargetok) {
print "Go to directory $SOURCE\n";
$olddir=getcwd();
chdir("$SOURCE");
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /(already exists|existe déjà)/)
{
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
$QUESTIONOVERWRITETAG=<STDIN>;
$QUESTIONOVERWRITETAG=<STDIN>;
chomp($QUESTIONOVERWRITETAG);
if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
{
@ -452,7 +452,7 @@ if ($nboftargetok) {
}
chdir("$olddir");
}
# Update buildroot if required
#-----------------------------
if ($nboftargetneedbuildroot)
@ -462,7 +462,7 @@ if ($nboftargetok) {
print "Delete directory $BUILDROOT\n";
$ret=`rm -fr "$BUILDROOT"`;
mkdir "$BUILDROOT";
mkdir "$BUILDROOT/$PROJECT";
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
@ -474,7 +474,7 @@ if ($nboftargetok) {
print "Clean $BUILDROOT\n";
$ret=`rm -f $BUILDROOT/$PROJECT/.buildpath`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.cache`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.codeclimate.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.externalToolBuilders`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.git*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.project`;
@ -484,11 +484,14 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/.stickler.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.travis.yml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.tx`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.pre-commit-config.yaml`;
$ret=`rm -fr $BUILDROOT/$PROJECT/.phan`;
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
$ret=`rm -fr $BUILDROOT/$PROJECT/phpstan.neon.dist`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
@ -504,6 +507,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/doxygen/doxygen_warnings.log`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/phpstan/phpstan`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/cache.manifest`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
@ -557,20 +561,20 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`;
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
# Security to avoid to package data files
# Security to avoid to package data files
print "Remove documents dir\n";
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
# Removed known external modules to avoid any error when packaging from env where external modules are tested
# Removed known external modules to avoid any error when packaging from env where external modules are tested
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/abricot*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
@ -596,15 +600,15 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/common/fontawesome-5/svgs`;
# Removed other test files
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
# Removed files installed by the awful composer
# Removed files installed by the awful composer
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
@ -639,7 +643,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/bin`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/bin`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/*/bin`;
@ -649,14 +653,14 @@ if ($nboftargetok) {
# Build package for each target
#------------------------------
foreach my $target (sort keys %CHOOSEDTARGET)
foreach my $target (sort keys %CHOOSEDTARGET)
{
if ($CHOOSEDTARGET{$target} < 0) { next; }
if ($target eq '-CHKSUM') { next; }
print "\nBuild package for target $target\n";
if ($target eq 'SNAPSHOT')
if ($target eq 'SNAPSHOT')
{
$NEWDESTI=$DESTI;
@ -680,13 +684,13 @@ if ($nboftargetok) {
next;
}
if ($target eq 'TGZ')
if ($target eq 'TGZ')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/standard');
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
}
print "Remove target $FILENAMETGZ.tgz...\n";
@ -700,7 +704,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`;
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ";
print "$cmd\n";
@ -712,14 +716,14 @@ if ($nboftargetok) {
next;
}
if ($target eq 'XZ')
if ($target eq 'XZ')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/standard');
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
}
}
print "Remove target $FILENAMEXZ.xz...\n";
unlink("$NEWDESTI/$FILENAMEXZ.xz");
@ -732,7 +736,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`;
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n";
print "Go to directory $BUILDROOT\n";
@ -748,15 +752,15 @@ if ($nboftargetok) {
$ret=`mv "$BUILDROOT/$FILENAMEXZ.xz" "$NEWDESTI/$FILENAMEXZ.xz"`;
next;
}
if ($target eq 'ZIP')
if ($target eq 'ZIP')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/standard');
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
}
}
print "Remove target $FILENAMEZIP.zip...\n";
unlink("$NEWDESTI/$FILENAMEZIP.zip");
@ -779,14 +783,14 @@ if ($nboftargetok) {
print $cmd."\n";
$ret= `$cmd`;
chdir("$olddir");
# Move to final dir
print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n";
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`;
next;
}
if ($target =~ /RPM/) # Linux only
if ($target =~ /RPM/) # Linux only
{
$NEWDESTI=$DESTI;
$subdir="package_rpm_generic";
@ -797,7 +801,7 @@ if ($nboftargetok) {
{
mkdir($DESTI.'/'.$subdir);
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
}
}
if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
@ -810,7 +814,7 @@ if ($nboftargetok) {
print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n";
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
$ret=`$cmd`;
@ -836,7 +840,7 @@ if ($nboftargetok) {
if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; }
if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; }
if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; }
use Date::Language;
$lang=Date::Language->new('English');
$datestring = $lang->time2str("%a %b %e %Y", time);
@ -854,7 +858,7 @@ if ($nboftargetok) {
}
close SPECFROM;
close SPECTO;
print "Copy patch file to $RPMDIR/SOURCES\n";
$ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`;
$ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`;
@ -876,14 +880,14 @@ if ($nboftargetok) {
next;
}
if ($target eq 'DEB')
if ($target eq 'DEB')
{
$NEWDESTI=$DESTI;
if ($NEWDESTI =~ /stable/)
{
mkdir($DESTI.'/package_debian-ubuntu');
if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; }
}
}
$olddir=getcwd();
@ -964,13 +968,13 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/select2/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`;
# Removed files we don't need (already removed)
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
# Rename upstream changelog to match debian rules
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
# Prepare source package (init debian dir)
print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n";
$ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`;
@ -1008,7 +1012,7 @@ if ($nboftargetok) {
$ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`;
$ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
# Set owners and permissions
#print "Set owners on files/dir\n";
#$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
@ -1039,8 +1043,8 @@ if ($nboftargetok) {
$ret=`$cmd`;
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
$ret=`$cmd`;
print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
$cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
$ret=`$cmd`;
@ -1048,14 +1052,14 @@ if ($nboftargetok) {
print "Go into directory $BUILDROOT\n";
chdir("$BUILDROOT");
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
print $cmd."\n";
$ret=`$cmd`;
# Creation of source package
# Creation of source package
print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
#$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
@ -1074,12 +1078,12 @@ if ($nboftargetok) {
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
next;
}
if ($target eq 'EXEDOLIWAMP')
{
$NEWDESTI=$DESTI;
@ -1087,22 +1091,22 @@ if ($nboftargetok) {
{
mkdir($DESTI.'/package_windows');
if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; }
}
}
print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n";
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
if ($OS eq 'windows') {
print "Check that ISCC.exe is in your PATH.\n";
} else {
print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n";
}
$SOURCEBACK=$SOURCE;
$SOURCEBACK =~ s/\//\\/g;
print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
#$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
open(IN, '<' . $SOURCE."/build/exe/doliwamp/doliwamp.iss") or die $!;
open(OUT, '>' . "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss") or die $!;
@ -1115,7 +1119,7 @@ if ($nboftargetok) {
close(OUT);
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n";
if ($OS eq 'windows') {
$cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
} else {
@ -1129,26 +1133,26 @@ if ($nboftargetok) {
print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
use File::Copy;
#$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
$ret=move("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe", "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n";
#$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
$ret=unlink("$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss");
next;
}
}
# Publish package for each target
#--------------------------------
foreach my $target (sort keys %CHOOSEDPUBLISH)
foreach my $target (sort keys %CHOOSEDPUBLISH)
{
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
print "\nList of files to publish (BUILD=$BUILD)\n";
%filestoscansf=(
"$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'none', # none means it won't be published on SF
@ -1206,26 +1210,26 @@ if ($nboftargetok) {
print "\n";
}
if ($target eq 'SF' || $target eq 'ASSO')
if ($target eq 'SF' || $target eq 'ASSO')
{
print "\n";
if ($target eq 'SF') { $PUBLISH = $PUBLISHSTABLE; }
if ($target eq 'ASSO' && $BUILD =~ /[a-z]/i) { $PUBLISH = $PUBLISHBETARC.'/lastbuild'; }
if ($target eq 'ASSO' && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $PUBLISHBETARC.'/stable'; }
$NEWPUBLISH=$PUBLISH;
print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
# Ask which target to build
$NUM_SCRIPT=<STDIN>;
$NUM_SCRIPT=<STDIN>;
chomp($NUM_SCRIPT);
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
$ret=`mkdir -p "/tmp/emptydir/"`;
%filestoscan=%filestoscansf;
foreach my $file (sort keys %filestoscan)
{
$found=0;
@ -1235,30 +1239,30 @@ if ($nboftargetok) {
if ($target eq 'SF') {
if ($filestoscan{$file} eq 'none') {
next;
}
}
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
}
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
$destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}";
}
}
elsif ($target eq 'ASSO' and $NEWPUBLISH !~ /stable/) {
$destFolder="$NEWPUBLISH";
}
}
else # No more used
{
$dirnameonly=$file;
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
$filenameonly=$file;
$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;
$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;
$destFolder="$NEWPUBLISH/$dirnameonly";
}
print "\n";
print "Publish file ".$file." to ".$destFolder."\n";
# mkdir
# mkdir
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
#$ssh->login("$user","$pass");
#$ssh->login("$user","$pass");
#use String::ShellQuote qw( shell_quote );
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
@ -1267,20 +1271,20 @@ if ($nboftargetok) {
#$sftp->mkdir($destFolder)
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
#print "$command\n";
#print "$command\n";
#my $ret=`$command 2>&1`;
$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
print "$command\n";
print "$command\n";
my $ret=`$command 2>&1`;
$command="rsync -s -e 'ssh' \"$file\" \"".$destFolder."\"";
print "$command\n";
print "$command\n";
my $ret2=`$command 2>&1`;
print "$ret2\n";
}
}
}
}
}
print "\n----- Summary -----\n";

View File

@ -1,4 +1,19 @@
<?php
/* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things.
//define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
@ -16,5 +31,15 @@ if (!defined("NOHTTPSREDIRECT")) {
define("NOHTTPSREDIRECT", '1');
}
global $conf, $db, $langs, $user;
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Societe $mysoc
* @var Translate $langs
* @var User $user
*/
global $conf, $db, $hookmanager, $langs, $mysoc, $user;
include_once __DIR__ . '/../../htdocs/main.inc.php';

View File

@ -1,4 +1,19 @@
<?php
/* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Load the main.inc.php file to have functions env defined
if (!defined("NOLOGIN")) {
@ -12,11 +27,23 @@ if (!defined("NOHTTPSREDIRECT")) {
}
// Defined some constants and load Dolibarr env to reduce PHPStan bootstrap that fails to load a lot of things.
$dolibarr_main_document_root = __DIR__ . '/../../htdocs';
define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
define('DOL_URL_ROOT', '/');
define('DOL_MAIN_URL_ROOT', '/');
define('MAIN_DB_PREFIX', 'llx_');
global $conf, $db, $langs, $user;
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Societe $mysoc
* @var Translate $langs
* @var User $user
*/
global $conf, $db, $hookmanager, $langs, $mysoc, $user;
global $dolibarr_main_document_root;
// include_once DOL_DOCUMENT_ROOT . '/../../htdocs/main.inc.php';

File diff suppressed because it is too large Load Diff

View File

@ -113,24 +113,9 @@ PHP TCPDF:
to
* @public
* Replace in tcpdf.php:
if (isset($this->imagekeys)) {
foreach($this->imagekeys as $file) {
unlink($file);
}
}
with
if (isset($this->imagekeys)) {
foreach($this->imagekeys as $file) {
// DOL CHANGE If we keep this, source image files are physically destroyed
// unlink($file);
}
}
* Replace in tcpdf.php:
$preserve = array(
'file_id',
'internal_encoding',
'state',
'bufferlen',
'buffer',
@ -138,7 +123,6 @@ with
with
$preserve = array(
'file_id',
'internal_encoding',
'state',
'bufferlen',
'buffer',
@ -147,16 +131,16 @@ with
'imagekeys',
* Replace in tcpdf.php:
if (!@TCPDF_STATIC::file_exists($file)) {
if (!@this->fileExists($file)) {
return false;
}
with
if (!@TCPDF_STATIC::file_exists($file)) {
if (!@this->fileExists($file)) {
// DOL CHANGE If we keep this, the image is not visible on pages after the first one.
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
//var_dump($file.' '.(!@this->fileExists($file)));
//return false;
$tfile = str_replace(' ', '%20', $file);
if (@TCPDF_STATIC::file_exists($tfile)) {
if (@this->fileExists($tfile)) {
$file = $tfile;
}
}
@ -191,7 +175,7 @@ with
}
elseif (strpos($filename, '://') === false)
* To avoid to have QRcode changed because generated with a random mask, replace:
* In tecnickcom/tcpdf/include/barcodes/qrcode.php To avoid to have QRcode changed because generated with a random mask, replace:
define('QR_FIND_FROM_RANDOM', 2);
with
define('QR_FIND_FROM_RANDOM', false);
@ -215,19 +199,6 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
- protected $default_monospaced_font = 'courier';
+ protected $default_monospaced_font = 'freemono';
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
of the function, replace:
$roman = '';
with:
$roman = '';
if ($number >= 4000) {
// do not represent numbers above 4000 in Roman numerals
return strval($number);
}
* Add this at begin of tcpdf_autoconfig.php
// @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver
@ -384,7 +355,9 @@ PHP PARSEDOWN
PHP OAUTH
---------
Add into Class Google of file OAuth2/Service/Google:
Restore old OAuth2/Service/Google.php file and OAuth2/Service/Microsoft.php and OAuth2/Service/Microsoft2.php
Or add into Class Google of file OAuth2/Service/Google:
// LDR CHANGE Add approval_prompt to force the prompt if value is set to 'force' so it force return of a "refresh token" in addition to "standard token"
public $approvalPrompt='auto';
@ -398,6 +371,17 @@ Add into Class Google of file OAuth2/Service/Google:
}
Modify function
public function getAuthorizationEndpoint()
{
// LDR CHANGE Add approval_prompt to force the prompt if value is set to 'force' so it force return of a "refresh token" in addition to "standard token"
//return new Uri('https://accounts.google.com/o/oauth2/auth?access_type='.$this->accessType);
$url = 'https://accounts.google.com/o/oauth2/auth?'.($this->approvalPrompt?'approval_prompt='.$this->approvalPrompt.'&':'').'access_type='.$this->accessType;
return new Uri($url);
}
JS JSGANTT:
-----------

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -55,7 +56,7 @@ if (!$result > 0) {
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();
print "***** ".$script_file." (".$version.") *****\n";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,7 +54,7 @@ if (!$result > 0) {
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();
print "***** ".$script_file." (".$version.") *****\n";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,7 +54,7 @@ if (!$result > 0) {
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();
print "***** ".$script_file." (".$version.") *****\n";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,7 +54,7 @@ if (!$result > 0) {
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();
print "***** ".$script_file." (".$version.") *****\n";

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -53,7 +54,7 @@ if (!$result > 0) {
dol_print_error(null, $user->error);
exit;
}
$user->getrights();
$user->loadRights();
print "***** ".$script_file." (".$version.") *****\n";

View File

@ -4,7 +4,7 @@
"description": "An app for connecting Dolibarr to the Zapier platform.",
"repository": "Dolibarr/dolibarr",
"homepage": "https://www.dolibarr.org/",
"author": "Frédéric France <frederic.france@netlogic.fr>",
"author": "Frédéric France <frederic.france@free.fr>",
"license": "BSD-3-Clause",
"main": "index.js",
"scripts": {

View File

@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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
@ -104,7 +105,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
$socids = array();

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -110,7 +111,7 @@ if ($ret <= 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
$societesid = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe where client in (1, 3)";

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -58,7 +59,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -106,7 +107,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
$socids = array();

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -61,7 +62,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product"; $productsid = array();

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* 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
@ -83,7 +84,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
// Ask confirmation
if (! $confirmed) {

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* 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
@ -83,7 +84,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
// Ask confirmation
if (! $confirmed) {

View File

@ -84,7 +84,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit;
}
$user->getrights();
$user->loadRights();
// Ask confirmation
if (! $confirmed) {

View File

@ -2,6 +2,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* 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
* the Free Software Foundation; either version 3 of the License, or
@ -225,13 +226,12 @@ if (!empty($argv[4])) {
$user=new User($db);
}
//var_dump($user->db->database_name);
$ret=$user->fetch('', 'admin');
if (! $ret > 0) {
print 'An admin user with login "admin" must exists to use this script.'."\n";
exit;
}
//$user->getrights();
//$user->loadRights();
print "Purge all data for this database:\n";

View File

@ -10,7 +10,7 @@ Init demo
The script `initdemo.sh` will erase the current database with data from `dev/initdemo/mysqldump_dolibarr_x.y.z.sql` and copy files from `documents_demo` to the official document directory.
You many to execute `chmod 700 initdemo.sh`
You may need to execute `chmod 700 initdemo.sh`
then run `./initdemo.sh` to launch the Graphical User Interface.
After loading the demo files, the admin login may be one of the following:

View File

@ -51,6 +51,13 @@ then
fi
# ----------------------------- check if dialog available
command -v dialog >/dev/null 2>&1 || {
echo "Error: command dialog not found. On Linux, you can install it with: apt install dialog"
exit
}
# ----------------------------- if no params on command line
if [ "$passwd" = "" ]
then
@ -179,17 +186,19 @@ fi
if [ "$passwd" != "" ]
then
export passwd="-p$passwd"
export passwdshown="-p*****"
fi
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
#echo "drop old table"
echo "drop table"
echo "drop table if exists llx_accounting_account;" | mysql "-P$port" "-u$admin" "$passwd" "$base"
echo "mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'"
echo "mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
mysql "-P$port" "-u$admin" "$passwd" "$base" < "$mydir/$dumpfile"
export res=$?
if [ $res -ne 0 ]; then
echo "Error to load database dump with mysql -P$port -u$admin -p***** $base < '$mydir/$dumpfile'"
echo "Error to load database dump with: mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
exit
fi

View File

@ -1150,7 +1150,7 @@ CREATE TABLE `llx_c_field_list` (
LOCK TABLES `llx_c_field_list` WRITE;
/*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */;
INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8);
INSERT INTO `llx_c_field_list` VALUES (1,'2011-02-06 11:18:30','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2011-02-06 11:18:30','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2011-02-06 11:18:30','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'isModEnabled("barcode")',3),(4,'2011-02-06 11:18:30','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2011-02-06 11:18:30','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2011-02-06 11:18:30','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2011-02-06 11:18:30','product_default',1,'p.stock','stock','Stock','right',0,0,'isModEnabled("stock")',7),(8,'2011-02-06 11:18:30','product_default',1,'p.envente','status','Status','right',1,0,'1',8);
/*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */;
UNLOCK TABLES;

View File

@ -1,16 +1,16 @@
JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE
Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109
Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109
Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109
Banque Banque 17295 20170109 5121CRA CR AGRICOLE Report 20170109 ORPA adsl par 12 0,00 96,00 20170109
Banque Banque 17302 20170105 401ORVI ORANGE VEBRON INTERNET Report 20170105 ORVI adsl veb 12 26,00 0,00 20170109
Banque Banque 17302 20170105 5121CRA CR AGRICOLE Report 20170105 ORVI adsl veb 12 0,00 26,00 20170109
Fournisseurs Fournisseurs 17305 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
Fournisseurs Fournisseurs 17305 20170119 622200 Courtages s/ ventes A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
Banque Banque 17306 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
Banque Banque 17306 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
Banque Banque 17307 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170131
Banque Banque 17307 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170131
Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109
Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109
Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109
Banque Banque 17295 20170109 5121CRA CR AGRICOLE Report 20170109 ORPA adsl par 12 0,00 96,00 20170109
Banque Banque 17302 20170105 401ORVI ORANGE VEBRON INTERNET Report 20170105 ORVI adsl veb 12 26,00 0,00 20170109
Banque Banque 17302 20170105 5121CRA CR AGRICOLE Report 20170105 ORVI adsl veb 12 0,00 26,00 20170109
Fournisseurs Fournisseurs 17305 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
Fournisseurs Fournisseurs 17305 20170119 622200 Courtages s/ ventes A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
Banque Banque 17306 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
Banque Banque 17306 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
Banque Banque 17307 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170131
Banque Banque 17307 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170131

View File

@ -0,0 +1,2 @@
OFX is an old Financial format:
See https://stackoverflow.com/questions/15735330/how-to-parse-a-ofx-version-1-0-2-file-in-php

View File

@ -11,6 +11,7 @@ List of QR Code format we found on some invoices
------------------------------------------
https://en.wikipedia.org/wiki/EPC_QR_code#Generators
Experimental support can be enabled in Dolibarr by setting INVOICE_ADD_EPC_QR_CODE = 1
* For ZATCA QR Code format (Saudi Arabia). Used when INVOICE_ADD_ZATCA_QR_CODE is set
@ -19,11 +20,14 @@ https://www.pwc.com/m1/en/services/tax/me-tax-legal-news/2021/saudi-arabia-guide
https://www.tecklenborgh.com/post/ksa-zatca-publishes-guide-on-how-to-develop-a-fatoora-compliant-qr-code
Method to encode/decode ZATCA string is available in test/phpunit/BarcodeTest.php
Method to encode/decode ZATCA string is available in test/phpunit/BarcodeTest.php
* FOR QR-Bill in switzerland - Facture-QR
-----------------------------------------
Syntax of QR Code - See file ig-qr-bill-v2.2-fr.pdf (more doc on https://www.swiss-qr-invoice.org/downloads/)
Syntax of complementary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
* FOR QR-Bill in switzerland - Facture-QR or QR-Facture
-------------------------------------------------------
- Syntax of QR Code - See file ig-qr-bill-v2.2-fr.pdf (more doc on https://www.swiss-qr-invoice.org/downloads/)
- Syntax of complementary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
To test/validate: https://www.swiss-qr-invoice.org/validator/
Experimental support to show the QR code can be enabled in dolibarr by setting INVOICE_ADD_SWISS_QR_CODE = 1.
If setting value to "bottom", the complete top banner can be added at bottom of invoice PDF. Note: an external PHP library may be requested at first PDF generation.

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,11 @@ https://en.wikipedia.org/wiki/Single_Euro_Payments_Area
https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html
https://www.europeanpaymentscouncil.eu/about-sepa
Spec for credit transfer:
Spec for credit transfer:
https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
To validate a SEPA file:
xmllint --schema pain.001.001.03.xsd T200801.xml --noout
To test a SEPA file:
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa
To test a SEPA file:
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa

View File

@ -1 +0,0 @@
See specification at http://www.ofx.net

View File

@ -10,8 +10,11 @@ PHP_OPT="-d error_reporting=32767"
DB=${DB:=mariadb}
DB_ROOT=${DB_ROOT:=root}
DB_PASS=${DB_PASS:=}
DB_PASSROOT=${DB_PASSROOT:=}
DB_USER=${DB_USER:=travis}
DB_PASS=${DB_PASS:=password}
DB_CACHE_FILE="${TRAVIS_BUILD_DIR}/db_init.sql"
DB_PREFIX="llx21_"
TRAVIS_DOC_ROOT_PHP="${TRAVIS_DOC_ROOT_PHP:=$TRAVIS_BUILD_DIR/htdocs}"
TRAVIS_DATA_ROOT_PHP="${TRAVIS_DATA_ROOT_PHP:=$TRAVIS_BUILD_DIR/documents}"
@ -25,20 +28,24 @@ if [[ "$(uname -a)" =~ "MINGW"* ]] || [[ "$(uname -a)" =~ "CYGWIN"* ]] ; then
else
SUDO="sudo"
fi
CONF_FILE=${CONF_FILE:=${TRAVIS_BUILD_DIR}/htdocs/conf/conf.php}
function save_db_cache() (
set -x
rm "${DB_CACHE_FILE}".md5 2>/dev/null
echo "Saving DB to cache file '${DB_CACHE_FILE}'"
${SUDO} "${MYSQLDUMP}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT travis \
eval ${SUDO} "${MYSQLDUMP}" ${USERPASS_OPT} -h 127.0.0.1 travis \
--hex-blob --lock-tables=false --skip-add-locks \
| sed -e 's/DEFINER=[^ ]* / /' > ${DB_CACHE_FILE}
echo "${sum}" > "${DB_CACHE_FILE}".md5
set +x
)
if [ "${DB_USER}" = travis ] && [ -r "${CONF_FILE}" ] ; then
# Cleanup configuration file in ci
mv "${CONF_FILE}" "${CONF_FILE}.$(date +"%Y%m%d%H%M%S").bak"
fi
if [ -r "${CONF_FILE}" ] ; then
echo "'${CONF_FILE} exists, not overwriting!"
@ -56,8 +63,8 @@ else
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo '$'dolibarr_main_db_type=\'mysqli\'';'
echo '$'dolibarr_main_db_port=3306';'
echo '$'dolibarr_main_db_user=\'travis\'';'
echo '$'dolibarr_main_db_pass=\'password\'';'
echo '$'"dolibarr_main_db_user='${DB_USER}'"';'
echo '$'"dolibarr_main_db_pass='${DB_PASS}'"';'
fi
if [ "$DB" = 'postgresql' ]; then
echo '$'dolibarr_main_db_type=\'pgsql\'';'
@ -65,12 +72,20 @@ else
echo '$'dolibarr_main_db_user=\'postgres\'';'
echo '$'dolibarr_main_db_pass=\'postgres\'';'
fi
if [ "${DB_PREFIX}" != '' ]; then
echo '$'"dolibarr_main_db_prefix='${DB_PREFIX}'"';'
fi
echo '$'dolibarr_main_authentication=\'dolibarr\'';'
echo '$'force_install_createuser=true';'
echo '$'"dolibarr_main_db_collation='utf8_unicode_ci'"';'
} > "$CONF_FILE"
cat $CONF_FILE
echo
fi
# From here on, the DB_PREFIX can not be empty, set default value if empty
DB_PREFIX="${DB_PREFIX:=llx_}"
load_cache=0
echo "Setting up database '$DB'"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
@ -81,62 +96,63 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
${SUDO} mysqld_safe --skip-grant-tables --socket=/tmp/aaa &
sleep 3
${SUDO} ps fauxww
if [ "${DB_PASS}" = "" ] ; then
PASS_OPT="-password="
PASS_OPT=""
if [ "${DB_PASSROOT}" = "" ] ; then
ROOTPASS_OPT="-u ${DB_ROOT}"
else
PASS_OPT="'-password=${DB_PASS}'"
ROOTPASS_OPT="-u ${DB_ROOT} --password='${DB_PASSROOT}'"
fi
USERPASS_OPT="-u ${DB_USER} --password=\"${DB_PASS}\""
echo "MySQL set root password"
if [ 1 = 1 ] ; then
CMDS=( \
""
"FLUSH PRIVILEGES; DROP DATABASE travis; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';"
"CREATE USER 'root'@'localhost' IDENTIFIED BY '$DB_PASS';"
"CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY '$DB_PASS';"
"CREATE USER 'travis'@'localhost' IDENTIFIED BY 'password';"
"CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
"GRANT ALL PRIVILEGES ON travis.* TO root@localhost;"
"GRANT ALL PRIVILEGES ON travis.* TO root@127.0.0.1;"
"GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;"
"GRANT ALL PRIVILEGES ON travis.* TO travis@localhost;"
"CREATE USER '${DB_ROOT}'@'localhost' IDENTIFIED BY '${DB_PASSROOT}';"
"CREATE USER '${DB_ROOT}'@'127.0.0.1' IDENTIFIED BY '${DB_PASSROOT}';"
"CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASS}';"
"CREATE USER '${DB_USER}'@'127.0.0.1' IDENTIFIED BY '${DB_PASS}';"
"GRANT ALL PRIVILEGES ON travis.* TO ${DB_ROOT}@localhost;"
"GRANT ALL PRIVILEGES ON travis.* TO ${DB_ROOT}@127.0.0.1;"
"GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@127.0.0.1;"
"GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@localhost;"
"FLUSH PRIVILEGES;"
)
# Local, not changing root
for CMD in "${CMDS[@]}" ; do
${SUDO} "${MYSQL}" -u "$DB_ROOT" ${PASS_OPT} -h 127.0.0.1 -e "$CMD"
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e "$CMD"
done
else
DB_ROOT='root'
DB_PASS='password'
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 -e "FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8'; ALTER USER 'root'@'localhost' IDENTIFIED BY '$DB_PASS'; CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY '$DB_PASS'; CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON travis.* TO root@127.0.0.1; GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1; FLUSH PRIVILEGES;"
DB_PASSROOT='password'
ROOTPASS_OPT="-u ${DB_ROOT} '--password=${DB_PASSROOT}'"
${SUDO} "${MYSQL}" -u "${ROOTPASS_OPT}" -h 127.0.0.1 -e "FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8'; ALTER USER '${DB_ROOT}'@'localhost' IDENTIFIED BY '${DB_PASSROOT}'; CREATE USER '${DB_ROOT}'@'127.0.0.1' IDENTIFIED BY '${DB_PASSROOT}'; CREATE USER '${DB_USER}'@'127.0.0.1' IDENTIFIED BY '${DB_PASS}'; GRANT ALL PRIVILEGES ON travis.* TO '${DB_ROOT}@127.0.0.1; GRANT ALL PRIVILEGES ON travis.* TO '${DB_USER}'@127.0.0.1; FLUSH PRIVILEGES;"
fi
echo "MySQL grant"
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1; FLUSH PRIVILEGES;'
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON travis.* TO travis@localhost; FLUSH PRIVILEGES;'
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e "FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@127.0.0.1; FLUSH PRIVILEGES;"
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e "FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@localhost; FLUSH PRIVILEGES;"
echo "MySQL list current users"
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'use mysql; select * from user;'
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e 'use mysql; select * from user;'
echo "List pid file"
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e "show variables like '%pid%';"
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e "show variables like '%pid%';"
#sudo kill `cat /var/lib/mysqld/mysqld.pid`
#sudo systemctl start mariadb
echo "MySQL grant"
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e "GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@127.0.0.1;"
echo "MySQL flush"
${SUDO} "${MYSQL}" -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -e 'FLUSH PRIVILEGES;'
${SUDO} "${MYSQL}" ${ROOTPASS_OPT} -h 127.0.0.1 -e 'FLUSH PRIVILEGES;'
sum=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | LC_ALL=C sort | md5sum)
cnt=$(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f -exec md5sum {} + | wc)
echo "OLDSUM $sum COUNT:$cnt"
# Compute md5 based on install file contents, and on db prefix
# filefunc.inc.php holds the version, so include it"
# shellcheck disable=2046
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | LC_ALL=C sort | md5sum)
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum)
# shellcheck disable=2046
cnt=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc)
echo "NEWSUM $sum COUNT:$cnt"
echo "MD5SUM $sum COUNT:$cnt"
load_cache=0
if [ -r "$DB_CACHE_FILE".md5 ] && [ -r "$DB_CACHE_FILE" ] && [ -x "$(which "${MYSQLDUMP}")" ] ; then
cache_sum="$(<"$DB_CACHE_FILE".md5)"
@ -145,10 +161,10 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
if [ "$load_cache" = "1" ] ; then
echo "MySQL load cached sql"
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < ${DB_CACHE_FILE} | tee $TRAVIS_BUILD_DIR/db_from_cacheinit.log
eval ${SUDO} "${MYSQL}" --force ${USERPASS_OPT} -h 127.0.0.1 -D travis < ${DB_CACHE_FILE} | tee $TRAVIS_BUILD_DIR/db_from_cacheinit.log
else
echo "MySQL load initial sql"
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < ${TRAVIS_BUILD_DIR}/dev/initdemo/mysqldump_dolibarr_3.5.0.sql | tee $TRAVIS_BUILD_DIR/initial_350.log
sed 's/\([ `]\)llx_/\1'"${DB_PREFIX}/g" < "${TRAVIS_BUILD_DIR}/dev/initdemo/mysqldump_dolibarr_3.5.0.sql" | eval ${SUDO} "${MYSQL}" --force ${USERPASS_OPT} -h 127.0.0.1 -D travis | tee $TRAVIS_BUILD_DIR/initial_350.log
fi
elif [ "$DB" = 'postgresql' ]; then
echo Install pgsql if run is for pgsql
@ -191,20 +207,52 @@ set +e
fi
echo '$'force_install_dbserver=\'127.0.0.1\'';'
echo '$'force_install_database=\'travis\'';'
echo '$'force_install_databaselogin=\'travis\'';'
echo '$'force_install_databasepass=\'\'';'
echo '$'force_install_prefix=\'llx_\'';'
echo '$'"force_install_databaselogin='${DB_USER}'"';'
echo '$'"force_install_databasepass='${DB_PASS}'"';'
if [ "${DB_PREFIX}" != '' ] ; then
echo '$'"force_install_prefix='${DB_PREFIX}'"';'
fi
#echo '$'"force_install_dolibarrlogin='admin'"';'
#echo '$'force_install_createuser=true';'
} > "$INSTALL_FORCED_FILE"
if [ "$load_cache" != "1" ] ; then
(
cd "${TRAVIS_BUILD_DIR}/htdocs/install" || exit 1
# Get the target version from the filefunc.inc.php file
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9.]*\\).*/\\1/p" ../filefunc.inc.php) ; echo $target_version
# Default in case that failed
target_version=${target_version:=20.0.0}
# Sequence of versions for upgrade process (to be completed)
VERSIONS=("3.5.0" "3.6.0" "3.7.0" "3.8.0" "3.9.0")
VERSIONS+=("4.0.0")
VERSIONS+=("5.0.0" "6.0.0" "7.0.0" "8.0.0" "9.0.0")
VERSIONS+=("10.0.0" "11.0.0" "12.0.0" "13.0.0" "14.0.0")
VERSIONS+=("15.0.0" "16.0.0" "18.0.0" "19.0.0" "20.0.0")
# Append versions up to the current dolibarr version
last_version=${VERSIONS[-1]}
target_major=${target_version%%.*}
last_major=${last_version%%.*}
# Add versions up to target_version
while (( last_major < target_major )); do
((last_major++))
VERSIONS+=("${last_major}.0.0")
done
# Add target_version if it's not already in the list
last_version=${VERSIONS[-1]}
if [[ "${last_version}" != "${target_version}" ]]; then
VERSIONS+=("$target_version")
fi
last_version=${VERSIONS[-1]} # Keep last_version up-to-date
# Proceed with the upgrade process
pVer=${VERSIONS[0]}
for v in "${VERSIONS[@]:1}" ; do
LOGNAME="${TRAVIS_BUILD_DIR}/upgrade${pVer//./}${v//./}"
@ -214,8 +262,16 @@ if [ "$load_cache" != "1" ] ; then
pVer="$v"
done
${SUDO} "${MYSQL}" --force -u "$DB_ROOT" -h 127.0.0.1 $PASS_OPT -D travis < "${TRAVIS_BUILD_DIR}/htdocs/install/mysql/migration/repair.sql"
sed "s/ llx_/ ${DB_PREFIX}/g" <"${TRAVIS_BUILD_DIR}/htdocs/install/mysql/migration/repair.sql" | eval ${SUDO} "${MYSQL}" --force ${USERPASS_OPT} -h 127.0.0.1 -D travis
# Apply repair options:
# Excluded options: force_utf8_on_tables force_utf8mb4_on_tables rebuild_sequences ; do
PHP_REPAIR_OPT=""
for opt in force_disable_of_modules_not_found restore_thirdparties_logos restore_user_pictures rebuild_product_thumbs clean_linked_elements clean_menus clean_orphelin_dir clean_product_stock_batch clean_perm_table repair_link_d set_empty_time_spent_amount force_collation_from_conf_on_tables ; do
PHP_REPAIR_OPT="$PHP_REPAIR_OPT\$_POST['$opt'] = '1';"
done
LOGNAME="${TRAVIS_BUILD_DIR}/repair${pVer//./}${v//./}"
"${PHP}" $PHP_OPT -r "$PHP_REPAIR_OPT; include 'repair.php';" > ${LOGNAME}.log
{
"${PHP}" $PHP_OPT upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_ProductBatch,MAIN_MODULE_SupplierProposal,MAIN_MODULE_STRIPE,MAIN_MODULE_ExpenseReport

View File

@ -25,9 +25,12 @@ the project: `pre-commit-config.yaml`.
1. Install pre-commit tool.\
If you do not have python installed, install [python](https://www.python.org) first.\
If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\\
`sudo apt install python3`
If you do not have [`pip`](https://pypi.org/project/pip), install that as well.\
`sudo apt install pip`
Then you can install pre-commit tool:
Then you can install pre-commit tool:\
`python3 -m pip install pre-commit`
2. In your local git clone of the project, run `pre-commit install` to add the hooks
@ -72,14 +75,16 @@ git commit -a -m "My message" --no-verify
```
If you want to skip certain checks for whatever reason, you can set the SKIP
environment variable:
environment variable into the .git/hooks/pre-commit file:
```bash
SKIP=no-commit-to-branch git commit -a -m "My message"
export SKIP=no-commit-to-branch
```
or
You can also switch output to text only, by setting the PRE_COMMIT_COLOR in .git/hooks/pre-commit file:
export SKIP=no-commit-to-branch # In your .bashrc or session.
```bash
export PRE_COMMIT_COLOR=never
```
There is much more you can do with pre-commit, check out its
@ -91,4 +96,6 @@ CI also runs pre-commit to help maintain code quality.
Note:
Code for precommits are saved into:
.cache/pre-commit/repoyXXXXX/py_env-python3/lib/pythonX.Y/site-packages/pre_commit_hooks/no_commit_to_branch.py
.cache/pre-commit/repo.../pre_commit_hooks/php-....sh
and
.cache/pre-commit/repo.../py_env-python3/lib/python.../site-packages/pre_commit_hooks/no_commit_to_branch.py

View File

@ -98,7 +98,7 @@ while ($i < $argc) {
}
// PHPSTAN setup
$PHPSTANLEVEL = 4;
$PHPSTANLEVEL = 9;
// PHAN setup. Configuration is required, otherwise phan is disabled.
$PHAN_CONFIG = "{$path}phan/config_extended.php";
@ -149,7 +149,7 @@ $phpstanversion = $output_arrtd[0];
$output_arrtd = array();
if ($dirphpstan != 'disabled') {
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github';
$commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 8G --error-format=github -c ~/preview.dolibarr.org/dolibarr/dev/tools/phpstan/phpstan_v1_apstats.neon';
print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n";
$resexectd = 0;
exec($commandcheck, $output_arrtd, $resexectd);
@ -745,7 +745,7 @@ $html .= '<div class="boxallwidth">'."\n";
$html .= <<<END
<center><br>Thumbs of most active contributors<br>
<br>
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://camo.githubusercontent.com/a641a400eef38e00a93b572dcfc30d13ceaaeefbca951d09ed9189142d20cf62/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f646f6c69626172722f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365" alt="Dolibarr" data-canonical-src="https://opencollective.com/dolibarr/contributors.svg?width=890&amp;button=false" style="max-width: 100%;"></a>
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" alt="Dolibarr" data-canonical-src="https://opencollective.com/dolibarr/contributors.svg?width=890&amp;button=false" style="max-width: 100%;"></a>
</center>
<br>
END;
@ -883,7 +883,7 @@ $html .= '<h2><span class="fas fa-code pictofixedwidth"></span>'.$title_security
$html .= '<div class="boxallwidth">'."\n";
$html .= '<div class="div-table-responsive">'."\n";
$html .= '<table class="list_technical_debt centpercent">'."\n";
$html .= '<tr class="trgroup"><td>Commit ID</td><td>Date</td><td style="white-space: nowrap">Reported on<br>Yogosha</td><td style="white-space: nowrap">Reported on<br>GIT</td><td style="white-space: nowrap">Reported on<br>CVE</td><td>Title</td><td>Branch of fix</td></tr>'."\n";
$html .= '<tr class="trgroup"><td>Commit ID</td><td>Date</td><td style="white-space: nowrap">Reported on<br>Yogosha</td><td style="white-space: nowrap">Reported on<br>GIT</td><td style="white-space: nowrap"><a href="https://www.cve.org/CVERecord/SearchResults?query=dolibarr">Reported on<br>CVE</a></td><td>Title</td><td>Branch of fix</td></tr>'."\n";
foreach ($arrayofalerts as $key => $alert) {
$cve = '';
$yogosha = empty($alert['issueidyogosha']) ? '' : $alert['issueidyogosha'];

View File

@ -8,6 +8,7 @@ aplhanothtml->alphanohtml
aploha->alpha
aplohanothtml->alphanohtml
aplphanothtml->alphanohtml
centpecent->centpercent
choosed->chosen
cumuled->cumulative
dokument->document
@ -18,12 +19,32 @@ dollibarr->dolibarr
extrafeild->extrafield
thoose->those
# fiche->card
nempty->an empty, empty, not empty,
maringbottomonly->marginbottomonly
maxwidthonsmartpone->maxwidthonsmartphone
maxwidthonspartphone->maxwidthonsmartphone
minwith100->minwidth100
minwith200->minwidth200
mot de passe->password
multicurreny->multicurrency
nempty->an empty, empty, not empty,
nocellnopadding->nocellnopadd
nodrap->nodrag, nodrop,
not de passe->password
nothtml->nohtml
notoptoleftroright->notoptoleftnoright
nowraponalls->nowraponall
oddevene->oddeven
oddseven->oddeven
opacitymediuem->opacitymedium
pictofiwedwidth->pictofixedwidth
pictofixedwith->pictofixedwidth
shippin->shipping
tableau de bord->state board
tagret->target
thridparty->thirdparty
tdoverflowmax100aaa->tdoverflowmax100
tdoverlowmax200->tdoverflowmax200
thirparty->thirdparty, third party,
thridparty->thirdparty, third party,
with100->width100
with75->width75
wysiwig->wysiwyg

View File

@ -15,6 +15,8 @@ noe
udo
tim
ConfirmActionXxx
# Inside email
ba
blacklist
@ -71,7 +73,6 @@ unvalidate
# Some french strings
somme
caracteres
cas
sur
Datas
@ -84,3 +85,12 @@ fonction
espace
methode
datee
# Translation keys
addin
amountin
alltime
# other
blacklists
confirmactionxxx

View File

@ -1,197 +1,94 @@
|| !empty($dates) && empty($datee) && $loanSchedule->datep >= $dates && $loanSchedule->datep <= dol_now()
|| empty($dates) && !empty($datee) && $loanSchedule->datep <= $datee
$objMod->dictionaries = $objMod->{"dictionnaries"}; // For backward compatibility
if (($loanSchedule->datep >= $dates && $loanSchedule->datep <= $datee) // dates filter is defined
$datee = $langs->trans("Unknown");
$datee = dol_print_date($objectligne->date_end, 'day', false, $outputlangs, true);
$txt .= $outputlangs->transnoentities("DateStartPlannedShort")." : <strong>".$datei."</strong> - ".$outputlangs->transnoentities("DateEndPlanned")." : <strong>".$datee.'</strong>';
if (empty($objMod->dictionaries) && !empty($objMod->{"dictionnaries"})) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;id_entrepot='.$entrepotstatic->id.'&amp;action=transfert&amp;pdluoid='.$pdluo->id.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&id_entrepot='.$entrepotstatic->id.'&action=transfert&pdluoid='.$pdluo->id.'&token='.newToken().'">';
$object->date_ech = $object->periode;
$object->periode = $object->date_ech;
$reponsesadd = str_split($obj->reponses);
$sql .= " SET reponses = '".$db->escape($reponsesadd)."'";
$sql .= " SET reponses = '0".$db->escape($obj->reponses)."'";
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0);
// $object->periode = dol_get_last_day(year of $object->date_ech - 1m, month or $object->date_ech -1m)
//$pice = '<i class="fas fa-briefcase inline-block"></i>';
//$typea = ($objp->typea == 'birth') ? $picb : $pice;
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
$date = $overview[0]->udate;
$dateb = $this->db->jdate($data[$j]->datea);
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
$dateemail = dol_stringtotime((string) $overview[0]->udate, 'gmt');
$link->datea = $this->db->jdate($obj->datea);
$object->periode = $newdateperiod;
$out .= dol_print_date($file->datea, 'dayhour');
$pice = '<i class="fas fa-briefcase inline-block"></i>';
$taskstatic->date_end = $this->db->jdate($objp->datee);
$tmp = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee);
$tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); // $element is a task. $elementuser may be empty
$typea = ($data[$j]->typea == 'birth') ? $picb : $pice;
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
GETPOSTINT("mouvement"),
dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." from=".$overview[0]->from." to=".$overview[0]->to." subject=".$overview[0]->subject);
if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) {
jQuery("#mouvement option").removeAttr("selected").change();
jQuery("#mouvement option[value=0]").attr("selected","selected").trigger("change");
jQuery("#mouvement option[value=1]").attr("selected","selected").trigger("change");
jQuery("#mouvement").trigger("change");
print '<td colspan="'.(6 + count($TWeek)).'">';
$TFirstDay = getFirstDayOfEachWeek($TWeek, date('Y', $firstdaytoshow));
$TFirstDay[reset($TWeek)] = 1;
$action = 'transfert';
$addform .= '<input type="hidden" name="dateerfc" value="'.dol_print_date($datee, 'dayhourrfc').'">';
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$date_liv = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$newfiletmp = preg_replace('/\.od(s|t)/i', '', $newfile);
$newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile);
$object->period = dol_time_plus_duree($object->periode, 1, 'm');
$object->periode = dol_time_plus_duree($object->periode, 1, 'm');
$project_static->date_end = $this->db->jdate($obj->datee);
$projectstatic->date_end = $db->jdate($objp->datee);
$ret = projectLinesPerMonth($inc, $firstdaytoshow, $fuser, $lines[$i]->id, ($parent == 0 ? $lineswithoutlevel0 : $lines), $level, $projectsrole, $tasksrole, $mine, $restricteditformytask, $isavailable, $oldprojectforbreak, $TWeek);
$taskstatic->datee = $lines[$i]->date_end; // deprecated
$this->category->childs[] = $this->_cleanObjectDatas($cat);
$this->date_approbation = $this->db->jdate($obj->datea);
$this->date_approval = $this->db->jdate($obj->datea);
$this->date_approve = $this->db->jdate($obj->datea);
$this->datea = $this->db->jdate($obj->datea);
$this->datee = $this->db->jdate($obj->datee);
$this->periode = $this->db->jdate($obj->period);
$tmp = array('id_users' => $obj->id_users, 'nom' => $obj->name, 'reponses' => $obj->reponses);
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, 1); // Disable hook for the moment
//si les reponses ne concerne pas la colonne effacée, on concatenate
GETPOST("mouvement", 'alpha'),
GETPOSTINT("mouvement"),
foreach ($TWeek as $weekIndex => $weekNb) {
if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) {
if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr("disabled");
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
$action = 'transfert';
$date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
$date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
$date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear);
$datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12);
$datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$ensemblereponses = $obj->reponses;
$field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field
$newcrit = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '', $tmpcrit);
$object->datee = $datee;
$object->periode = $dateperiod;
$return .= '<br><span class="opacitymedium">'.$langs->trans("Payement").'</span> : <span class="info-box-label">'.$this->type_payment.'</span>';
$sortfield = "datea";
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
$sql .= " '".$db->escape($conf->currency)."' as currency, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->escape($obj->datee)."'" : "null");
$sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)";
$sql .= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter, 1, false)).")";
$sql .= " AND date_creation BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'";
$sql .= " AND er.datee >= '".$this->db->idate($date)."'";
$sql .= " ORDER BY pt.datee ASC, pt.dateo ASC";
$sql .= " t.datec, t.dateo, t.datee, t.tms,";
$sql .= " t.dateo, t.datee, t.planned_workload, t.rang,";
$sql .= ", datee = ".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null');
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, date_format(u.dateemployment, '%d') as daya, 'employment' as typea, u.email, u.statut as status";
$sql = "SELECT pt.rowid, pt.ref, pt.fk_projet, pt.fk_task_parent, pt.datec, pt.dateo, pt.datee, pt.datev, pt.label, pt.description, pt.duration_effective, pt.planned_workload, pt.progress";
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, date_format(u.birth, '%d') as daya, 'birth' as typea, u.email, u.statut as status";
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, date_creation)';
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)';
$sql = 'SELECT s.reponses';
$sql2 .= " SET reponses = '".$db->escape($newcar)."'";
$taskstatic->datee = $db->jdate($obj->date_end);
$this->category->childs = array();
$this->datea = dol_now();
$tmpcrit = preg_replace('/^.*(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '\1', $tmpcrit); // the condition after the name of the field
'datee' => $date_end,
// mise a jour des reponses utilisateurs dans la base
if (!empty($arrayfields['t.datee']['checked'])) {
if ($user->hasRight('stock', 'mouvement', 'lire')) {
if (empty($reyear) || empty($remonth) || empty($reday)) {
jQuery("#mouvement").change(function() {
preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg);
print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1);
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>';
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->periode), 'day').'</td>';
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
print dol_print_date($object->periode, "day");
$TWeek[$week_number] = $week_number;
print '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->period), 'day').'</td>';
"sme",
$action = 'transfert';
$cle_rib = strtolower(checkES($rib, $CCC));
$date_com = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOSTINT('remonth') ? dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')) : -1);
$datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
$datesubscription = dol_mktime(0, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0);
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field) ? $project_field : 'fk_projet');
$ensemblereponses = $obj->reponses;
$head[$h][1] = $langs->trans("Referers");
$head[$tab][1] = $langs->trans("Referers");
$out .= "<b>".$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."<br>\n";
$reday = GETPOSTINT('reday');
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount";
$sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount';
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datea)."'";
$sql .= " datee=".($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null').",";
$sql .= " f.date_approval as datea,";
$sql .= " f.date_approve as datea,";
$sql .= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,";
$sql .= " t.datee as date_end,";
$sql .= " t.dateo as date_start, t.datee as date_end";
$sql .= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,";
$sql .= " tms, dateo as date_start, datee as date_end, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,";
$sql .= ", '".$this->db->idate($this->periode)."'";
$sql .= ", '".$this->db->idate($this->period)."'";
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key";
$sql .= ", datea = '".$this->db->idate(dol_now())."'";
$sql .= ", datee";
$sql .= ", periode='".$this->db->idate($this->periode)."'";
$sql = "INSERT INTO ".$this->db->prefix()."links (entity, datea, url, label, objecttype, objectid)";
$sql .= ", periode = '".$this->db->idate($this->period ? $this->period : $this->periode)."'";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, fk_user, date_creation)";
$sql = "SELECT SUM(duree) as total_duration, min(date) as dateo, max(date) as datee ";
$sql = "SELECT id_users, nom as name, id_sondage, reponses";
$sql = "SELECT id_users, nom as name, reponses";
$sql = "SELECT p.rowid, p.fk_statut as status, p.fk_opp_status, p.datee as datee";
$sql = "SELECT rowid, entity, datea, url, label, objecttype, objectid FROM ".$this->db->prefix()."links";
$sql = 'SELECT c.rowid, date_creation as datec, tms as datem, date_valid as date_validation, date_approve as datea, date_approve2 as datea2,';
$test = "<IMG SRC=\"jav&#x0D;ascript:alert('XSS');\">"; // Same
$test = '/javas:cript/google.com';
$this->periode = $this->date_creation + 3600 * 24 * 30;
$title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers');
$title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers');
$title = $langs->transnoentities("Balance")." - ".$langs->transnoentities("AllTime");
'datee' => $datee
'datee' =>array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>1, 'position'=>35),
'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
,'datee'=>array('type'=>'date')
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
echo dol_print_date($rule->datee, 'day');
foreach ($TWeek as $weekNb) {
if (!empty($arrayfields['cs.periode']['checked'])) {
if (!empty($arrayfields['p.datee']['checked'])) {
if ($datee > 0) {
if ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) {
if ($user->hasRight('stock', 'mouvement', 'creer')) {
if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) {
if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) {
if (empty($datee)) {
if (empty($reyear) || empty($remonth) || empty($reday)) {
if (empty($this->datea)) {
if (in_array('01', $TWeek) && in_array('52', $TWeek) && $weekNb == '01') {
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', 0, 0, 0, '', 1, 0);
print $object->datee ? dol_print_date($object->datee, 'daytext') : '&nbsp;';
print '<input type="hidden" name="action" value="addin">';
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
print '<tr><td>'.$langs->trans("Datee").'</td>';
print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "t.datee", '', $param, '', $sortfield, $sortorder, 'center ');
* @param string $datee End date (ex 23:59:59)
* @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing.
$TWeek = array();
$date = $obj->periode;
$datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
$datee = dol_stringtotime($dateerfc);
* @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing.
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
@ -201,61 +98,34 @@
$head[$h][1] = $langs->trans('Referers');
$inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $tmpval);
$inj += preg_match('/on(dblclick|drop|durationchange|emptied|end|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)[a-z]*\s*=/i', $val);
$morewherefilterarray[] = " t.datee <= '".$db->idate($search_date_end_end)."'";
$morewherefilterarray[] = " t.datee >= '".$db->idate($search_date_end_start)."'";
$opensurveysondage->mail_admin = $_SESSION['adresse'];
$pdf->SetXY($savx, $savy);
$projectstatic->datee = $db->jdate($obj->projectdatee);
$reday = GETPOST('reday');
$savy = $pdf->getY();
$somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " AND cs.periode <= '".$db->idate($search_date_limit_end)."'";
$sql .= " AND cs.periode >= '".$db->idate($search_date_limit_start)."'";
$sql .= " AND p.datee <= '".$db->idate($search_date_end_end)."'";
$sql .= " AND p.datee >= '".$db->idate($search_date_end_start)."'";
$sql .= " AND t.datee <= '".$db->idate($search_datelimit_end)."'";
$sql .= " AND t.datee >= '".$db->idate($search_datelimit_start)."'";
$sql .= " GROUP BY p.ref, p.title, p.rowid, p.fk_statut, p.fk_opp_status, p.public, p.dateo, p.datee, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee";
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_statut, p.datee, p.fk_opp_status, p.public, p.fk_user_creat,";
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " ORDER BY t.dateo DESC, t.rowid DESC, t.datee DESC";
$sql .= " SET reponses = '".$db->escape($nouveauchoix)."'";
$sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,";
$sql .= " t.datec, t.dateo, t.datee, t.tms,";
$sql .= " t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo as date_start, t.datee as date_end, SUM(tasktime.element_duration) as timespent";
$sql = "SELECT p.ref, p.title, p.rowid as projectid, p.fk_statut as status, p.fk_opp_status as opp_status, p.public, p.dateo as projdate_start, p.datee as projdate_end,";
$sql.= " ".MAIN_DB_PREFIX."notify_def as nd,";
$sql.= " AND nd.fk_action = ad.rowid";
$sql.= " WHERE u.rowid = nd.fk_user";
$sql.= " nd.rowid, ad.code, ad.label";
$sql2 .= " p.dateo, p.datee,";
$sql2 .= " s.logo, s.email, s.entity, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_percent, p.opp_amount, p.dateo, p.datee";
$title = $langs->trans('Batch')." ".$shortlabel." - ".$langs->trans('Referers');
$totalforvisibletasks = projectLinesPerMonth($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restrictviewformytask, $isavailable, 0, $TWeek);
$value = preg_replace('/([a-z\.]+)\s*([!<>=]+|in|notin|like|notlike)\s*/', '\1:\2:', $value); // Clean string 'x < 10' into 'x:<:10' so we can then explode on space to get all AND tests to do
'cs.periode' => array('label' => "PeriodEndDate", 'checked' => 1, 'position' => 50),
't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>101),
't.datee'=>array('label'=>"Deadline", 'checked'=>1, 'position'=>5),
// Ligne de la periode d'analyse du rapport
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
//$datee=$now
//$dates=dol_time_plus_duree($datee, -1, 'y');
<strong>TaskItem(<em>pID, pName, pStart, pEnd, pColor, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGantt</em>)</strong></p>
foreach ($TWeek as $weekNb) {
foreach ($TWeek as $week_number) {
if (!empty($arrayfields['t.datee']['checked'])) {
if ($action == "transfert") {
if ($object->id > 0 && $action == 'addin') {
if (GETPOST('reday')) {
if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) {
print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
print '<td class="left" width="25%">'.$langs->trans("Referers").'</td>';
print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacitymedium">('.$langs->trans("AllTime").')</span></td>';
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
print '<tr><td>'.$langs->trans("Period")."</td><td>".dol_print_date($charge->periode, 'day')."</td></tr>\n";
print ajax_combobox("mouvement");
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname,cs.periode", "", $param, 'class="left"', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['cs.amount']['label'], $_SERVER["PHP_SELF"], "cs.amount,cs.periode", '', $param, 'class="right"', $sortfield, $sortorder);
@ -266,58 +136,20 @@
print_liste_field_titre($arrayfields['cs.libelle']['label'], $_SERVER["PHP_SELF"], "cs.libelle,cs.periode", '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['cs.paye']['label'], $_SERVER["PHP_SELF"], "cs.paye,cs.periode", '', $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['cs.periode']['label'], $_SERVER["PHP_SELF"], "cs.periode", '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($arrayfields['p.datee']['label'], $_SERVER["PHP_SELF"], "p.datee", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($arrayfields['t.datee']['label'], $_SERVER["PHP_SELF"], "t.datee", "", $param, '', $sortfield, $sortorder, 'center ');
public $childs = array();
public $datea;
public $datee;
public $periode;
public function getSumOfAmount($fuser = '', $dates = '', $datee = '')
return $TWeek;
unset($_SESSION["adresse"]);
- creat,unitl,alltime,datas,referers
- informations,medias,uptodate,reenable,crypted,developpers
- ned
* @param array $TWeek array of week numbers
* @param string[] $TWeek array of week numbers
* @param string[] $TWeek array of week numbers (week 1 must be '01')
* @param array $TWeek Array of week numbers
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
* Copyright (C) 2019 Tim Otte <otte@meuser.it>
* Copyright (C) 2020 Thibault FOUCART <suport@ptibogxiv.net>
* Copyright (C) 2020-2021 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2022 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2022 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2022-2023 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2023 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2024 Noé Cendrier <noe.cendrier@altairis.fr>
* add german links 2020 Udo Tamm <dev@dolibit.de>
$TFirstDays = getFirstDayOfEachWeek($TWeek, $year);
$TFirstDays[reset($TWeek)] = '01'; //first day of month
$TLastDays = getLastDayOfEachWeek($TWeek, $year);
$TLastDays[end($TWeek)] = date("t", strtotime($year.'-'.$month.'-'.$day)); //last day of month
$TWeek = getWeekNumbersOfMonth($month, $year);
$datee = dol_mktime(23, 59, 59, GETPOST('dateemonth'), GETPOST('dateeday'), GETPOST('dateeyear'));
$moresql = dolSqlDateFilter('t.datee', $search_dtendday, $search_dtendmonth, $search_dtendyear, 1);
$parameters = array('id' => $id, 'taskid' => $taskid, 'projectid' => $projectid, 'TWeek' => $TWeek, 'TFirstDays' => $TFirstDays, 'TLastDays' => $TLastDays);
* Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
$permissiontoadd = $user->hasRight('stock', 'mouvement', 'creer');
$permissiontodelete = $user->hasRight('stock', 'mouvement', 'creer'); // There is no deletion permission for stock movement as we should never delete
$permissiontoread = $user->hasRight('stock', 'mouvement', 'lire');
$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_modification, p.budget_amount,";
$sql .= " t.datec as date_creation, t.dateo as date_start, t.datee as date_end, t.tms as date_modification,";
$sql .= dolSqlDateFilter('p.datee', $search_eday, $search_emonth, $search_eyear);
$sql = "SELECT ".$distinct." p.rowid as projectid, p.ref as projectref, p.title as projecttitle, p.fk_statut as projectstatus, p.datee as projectdatee, p.fk_opp_status, p.public, p.fk_user_creat as projectusercreate, p.usage_bill_time,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode as period, cs.fk_account,";
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total, cs.paye,";
$sql = "SELECT id_users, nom as name, id_sondage, reponses";
$sql = "SELECT p.rowid, p.ref, p.title, p.dateo as date_start, p.datee as date_end, p.fk_statut as status, p.tms as datem";
$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea";
$sql = 'SELECT nom as name, reponses';
$title = $langs->trans("Referers", $object->name);
$usercancreate = $user->hasRight('stock', 'mouvement', 'creer');
@ -326,33 +158,19 @@ $usercandelete = $user->hasRight('stock', 'mouvement', 'creer');
$usercandelete = (($user->hasRight('stock', 'mouvement', 'supprimer')));
$usercanread = $user->hasRight('stock', 'mouvement', 'lire');
$usercanread = (($user->hasRight('stock', 'mouvement', 'lire')));
* The hook contaxt commcard has been renamed thirdpartycomm
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
$usercanupdatestock = $user->hasRight('stock', 'mouvement', 'creer');
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
- Fix: [ bug #485 ] Configurated amount for public auto-subscription form is not taken into account
- New: Add proposals into referer page of thirdparty.
AmountIn
NEW: ModuleBuilder: Checkin comments begin and end before each actions
Vous pouvez voir la progression du ticket en cliquant sur le lien
for /F "tokens=2 delims=," %%i in ('tasklist /FI "IMAGENAME eq php.exe" /FO CSV /NH') do (
foreach ($TWeek as $week_number) {
function checkES($IentOfi, $InumCta)
function getFirstDayOfEachWeek($TWeek, $year)
function getLastDayOfEachWeek($TWeek, $year)
function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array())
if (!$user->hasRight('stock', 'mouvement', 'lire')) {
if (!empty($arrayfields['cs.periode']['checked'])) {
if (!empty($arrayfields['p.datee']['checked'])) {
if (!empty($arrayfields['t.datee']['checked'])) {
if ($action == "transfert") {
if (empty($datee) && !empty($dateerfc)) { // deprecated
print $langs->trans("Developpers").':';
print '<input type="hidden" id="numberOfFirstLine" name="numberOfFirstLine" value="'.(reset($TWeek)).'"/>'."\n";
print '<td class="right">'.$langs->trans("NbOfMembers").' <span class="opacitymedium">('.$langs->trans("AllTime").')</span></td>';
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "cs.periode", "", $param, '', $sortfield, $sortorder, 'center ');
select#date_startday, select#date_startmonth, select#date_endday, select#date_endmonth, select#reday, select#remonth
select#date_startday, select#date_startmonth, select#date_endday, select#date_endmonth, select#reday, select#remonth,
print '<td class="center"><a href="'.DOL_URL_ROOT.'/product/stock/product.php?dwid='.$object->id.'&id='.$objp->rowid.'&action=transfert&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$id).'">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&id_entrepot='.$entrepotstatic->id.'&action=transfert&pdluoid='.$pdluo->id.'&token='.newToken().'">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';

View File

@ -157,7 +157,7 @@ foreach my $file (keys %filelist) {
print OUT "\\c ". $1;
next;
}
if ($create_sql ne "") { # we are inside create table statement so lets process datatypes
if ($create_sql ne "") { # we are inside create table statement so let's process datatypes
if (/\);/i) { # end of create table sequence
$create_sql =~ s/,$//g; # strip last , inside create table

View File

@ -3,6 +3,7 @@
/*
* Copyright (C) 2005-2011 James Grant <james@lightbox.org> Lightbox Technologies Inc.
* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -419,7 +420,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
// in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string'), but could also be (number, E'string'); so we can't search for the previous '
// ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character
// at a time, and that's just stupid, so lets just hope this doesn't appear anywhere in the actual data
// at a time, and that's just stupid, so let's just hope this doesn't appear anywhere in the actual data
$after = str_replace(" (E'", " ('", $after);
$after = str_replace(", E'", ", '", $after);
@ -439,7 +440,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
// in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string')
// ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character
// at a time, and that's just stupid, so lets just hope this doesn't appear anywhere in the actual data
// at a time, and that's just stupid, so let's just hope this doesn't appear anywhere in the actual data
$after = str_replace(" (E'", " ('", $after);
$after = str_replace(", E'", ", '", $after);
@ -457,7 +458,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
// in after, we need to watch out for escape format strings, ie (E'escaped \r in a string'), and ('bla',E'escaped \r in a string')
// ugh i guess its possible these strings could exist IN the data as well, but the only way to solve that is to process these lines one character
// at a time, and that's just stupid, so lets just hope this doesn't appear anywhere in the actual data
// at a time, and that's just stupid, so let's just hope this doesn't appear anywhere in the actual data
// after the first line, we only need to check for it in the middle, not at the beginning of an insert (because the beginning will be on the first line)
// $after=str_replace(" (E'","' ('",$after);
@ -497,7 +498,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$reg2 = array();
if (preg_match('/ALTER TABLE ([^\s]+)/', $pkey, $reg2)) {
if (empty($arrayofprimaryalreadyintabledef[$reg2[1]])) {
// looks like we have a single line PRIMARY KEY definition, lets go ahead and add it
// looks like we have a single line PRIMARY KEY definition, let's go ahead and add it
$output .= str_replace("\n", "", $pkey);
// the postgres and mysql syntax for this is (at least, in the example im looking at)
// identical, so we can just add it as is.

View File

@ -42,6 +42,32 @@ const PREFIXES = [
'php' => ['/* ', ' * ', ' */', '<?php'],
];
/**
* Expand tabs in string to spaces.
*
* @param $str String in which to expand the tabs to spaces
* @param $tabWidth Width to use for a tabstop
*
* @return string Expanded string value.
*/
function expandTabs($str, $tabWidth)
{
$expanded = '';
$col = 0;
$len = mb_strlen($str);
for ($i = 0; $i < $len; $i++) {
if ($str[$i] == "\t") {
$expanded .= str_repeat(' ', $tabWidth - ($col % $tabWidth));
$col += $tabWidth - ($col % $tabWidth);
} else {
$expanded .= $str[$i];
$col++;
}
}
return $expanded;
}
/**
* Update or add copyright notice in a file
*
@ -70,18 +96,45 @@ function updateCopyrightNotice($filename, $fileType, $name, $email)
$n = 50;
$lines = implode('', array_slice(file($filename), 0, $n));
// Define the regex pattern for matching copyright notices
$pattern = "~(?:{$r_prefix0}|{$r_prefix1})Copyright \(C\)\s+(?:(?:\d{4}-)?(?<year>\d{4}))\s+{$r_name}\s*\<{$r_email}>~";
// Based on the tendency to limit the length of the spacing between the name
// and email to the smallest one, determine the biggest offset from the start
// of a name to the start of the email, and use that for the current name/email
// offset if it is sufficient.
// Pattern to match any copyright already present
$allpattern = "~(?:{$r_prefix0}|{$r_prefix1})Copyright \(C\)\s+(?:(?:\d{4}-)?(?:\d{4}))\s+(\S.*)<\S+>~";
// Set minimum offset based of width of new name
$nameStartToMailStartOffset = 4 * (int) ((mb_strlen($r_name) + 4) / 4);
if (preg_match_all($allpattern, $lines, $allmatches)) {
foreach ($allmatches[1] as $nameAndSpaces) {
//print $nameAndSpaces."\n";
$nameAndSpaces = expandTabs($nameAndSpaces, 4);
$currentOffset = mb_strlen($nameAndSpaces);
$currentOffset = 4 * (int) ((3 + $currentOffset) / 4);
//print "Other offset $nameAndSpaces: $currentOffset\n";
if ($currentOffset > $nameStartToMailStartOffset) {
$nameStartToMailStartOffset = $currentOffset;
}
}
}
// Pattern to match the line matching the current developer
$pattern = "~(?:{$r_prefix0}|{$r_prefix1})Copyright \(C\)\s+(?:(?:(?<start>\d{4})-)?(?<last>\d{4}))\s+{$r_name}\s*\<{$r_email}>~";
// Check if the lines match the pattern
$matches = array();
if (preg_match($pattern, $lines, $matches)) {
$existingYear = $matches['year'];
$existingYear = $matches['last'];
if (array_key_exists('start', $matches)) {
$startYear = $matches['start'];
} else {
$startYear = $existingYear;
}
// Check if the existing year is different from the current year
if ($existingYear !== date('Y')) {
// Update the year range to include or be up to the current year
$updatedNotice = preg_replace('/(\d{4})(-\d{4})?\s+/', $existingYear . '-' . date('Y') . "\t", $matches[0]);
// Extend the year range to the current year
$updatedNotice = preg_replace('/(?:\d{4}-)?\d{4}\s+/', $startYear . '-' . date('Y') . "\t", $matches[0]);
// Replace the old notice with the updated one in the file
file_put_contents($filename, preg_replace($pattern, $updatedNotice, file_get_contents($filename)));
@ -90,7 +143,8 @@ function updateCopyrightNotice($filename, $fileType, $name, $email)
// If the existing year is the same, no need to update
} else {
// Adjust tabs for proper alignment
$emailTabs = str_repeat("\t", (int) (max(0, (31 - mb_strlen($name)) / 4)));
// print "Offset:".$nameStartToMailStartOffset."\n";
$emailTabs = str_repeat("\t", (int) (max(0, ($nameStartToMailStartOffset + 4 - mb_strlen($name)) / 4)));
// No match found, add a new line to the header
$newNotice = "Copyright (C) " . date('Y') . "\t\t" . $name . $emailTabs . "<" . $email . ">";
@ -114,6 +168,7 @@ function updateCopyrightNotice($filename, $fileType, $name, $email)
// Write the updated content back to the file
file_put_contents($filename, $fileContent);
// print $fileContent;
return true; // Change detected
}

View File

@ -1,25 +1,64 @@
#!/bin/bash
#
# Count number of commits per user and per versions (using date for version detection)
#
# shellcheck disable=1113,2002,2006,2086,2164,2219
# Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "19.0" "develop")
let "counter = 0"
#
# Count number of commits per user and per version (using date for version detection)
#
#
#
echo "Copy script into /tmp/github_commits_byversion.sh"
cp $0 /tmp/github_commits_perversion.sh
cp "$0" /tmp/github_commits_perversion.sh
echo "Delete /tmp/git"
rm -fr /tmp/git
echo "Create and go into /tmp/git"
mkdir /tmp/git
cd /tmp/git
git clone https://github.com/Dolibarr/dolibarr.git
TEMP_DIR=/tmp/git
DOL_GIT="$TEMP_DIR/dolibarr"
if ! git rev-parse ; then
echo "Delete $TEMP_DIR"
rm -fr "$TEMP_DIR"
echo "Create '$TEMP_DIR' and cd to it"
mkdir "$TEMP_DIR"
cd "$TEMP_DIR" || exit
git clone https://github.com/Dolibarr/dolibarr.git
cd "${DOL_GIT}" || exit
else
if [ -r "${DOL_GIT}" ] ; then
git worktree remove "${DOL_GIT}"
rm -rf "${DOL_GIT}" >& /dev/null
fi
git worktree add --force "${DOL_GIT}" develop
cd "$DOL_GIT" || exit
git pull
fi
cd /tmp/git/dolibarr
# Determine release to check
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "19.0" "20.0")
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9]*\\.[0-9]*\\).*/\\1/p" htdocs/filefunc.inc.php)
# Default target version in case getting it from filefunc.inc failed
target_version=${target_version:=20.0}
# Setup loop to append required versions
target_major=${target_version%%.*}
last_major=${Releases%%.*}
# Add versions up to target_version
while (( last_major < target_major )); do
((last_major++))
tag="${last_major}.0"
if git rev-parse --verify "origin/$tag" >&/dev/null ; then
Releases+=("$tag")
fi
done
# Always end with develop
Releases+=("develop")
# Now proceed with generating the report for branches in ${Releases[@]}
firstline=1
((counter = 0))
for i in "${Releases[@]}"
do
if [ $firstline -eq 1 ]; then
@ -31,21 +70,28 @@ do
echo "=== Version $i (counter $counter):"
echo "Get common commit ID between origin/${Releases[counter]} and origin/${Releases[counter+1]}"
echo "git merge-base origin/${Releases[counter]} origin/${Releases[counter+1]}"
commitidcommon=`git merge-base origin/${Releases[counter]} origin/${Releases[counter+1]}`
commitidcommon=$(git merge-base "origin/${Releases[counter]}" "origin/${Releases[counter+1]}")
echo "Found commitid=$commitidcommon"
echo "Checkout into version $i"
git checkout $i
echo "Checkout version $i"
git checkout --ignore-other-worktrees "$i"
#git shortlog -s -n --after=YYYY-MM-DD --before=YYYY-MM-DD | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion.txt
git shortlog -s -n $commitidcommon.. | iconv -f UTF-8 -t ASCII//TRANSLIT | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion.txt
git shortlog --encoding=utf-8 -s -n "$commitidcommon.." | iconv -f UTF-8 -t ASCII//TRANSLIT | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion.txt
#cat /tmp/github_commits_perversion.txt
echo "Total for version $i:"
echo -n "- Nb of commits: "
git log $commitidcommon.. --pretty=oneline | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion2.txt
cat /tmp/github_commits_perversion2.txt | wc -l
git log "$commitidcommon.." --pretty=oneline | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion2.txt
wc -l < /tmp/github_commits_perversion2.txt
echo -n "- Nb of different authors: "
awk ' { print $2 } ' < /tmp/github_commits_perversion.txt | sort -u | wc -l
echo "======================="
echo
let "counter +=1"
((counter++))
done
# Clean up git directory if it is a worktree
if [ "$(git rev-parse --git-dir)" != "$(git rev-parse --git-common-dir)" ] ; then
cd "$TEMP_DIR" || exit
git -C "$DOL_GIT" worktree remove "$DOL_GIT"
fi
exit

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,8 @@ return [
'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgumentNullableInternal'], // false positive
'internal' => ['PhanUndeclaredConstant'],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
'directory_suppressions' => [
'htdocs/admin/tools' => ['PhanPluginUnknownArrayPropertyType', 'PhanTypeArraySuspiciousNull', 'PhanPluginUnknownArrayMethodParamType', 'PhanTypeSuspiciousEcho']
]
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases)
];

View File

@ -11,6 +11,7 @@ $sanitizeRegex
array(
// Documented:
'none',
'password',
'array',
'int',
'intcomma',
@ -22,24 +23,16 @@ $sanitizeRegex
'aZ09',
'aZ09arobase',
'aZ09comma',
'email',
'san_alpha',
'restricthtml',
'nohtml',
'custom',
// Not documented:
'email',
'restricthtmlallowclass',
'restricthtmlallowunvalid',
'restricthtmlnolink',
//'ascii',
//'categ_id',
//'chaine',
//'html',
//'boolean',
//'double',
//'float',
//'string',
'restricthtmlallowlinkscript'
)
).')*$/';
@ -137,7 +130,7 @@ $VALID_MODULE_MAPPING = array(
'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives)
'notification' => 'Notification',
'numberwords' => null, // Not provided by default, no module tests
'oauth' => 'Oauth',
'oauth' => 'OAuth',
'openstreetmap' => null, // External module?
'opensurvey' => 'OpenSurvey',
'order' => 'Commande',
@ -230,6 +223,7 @@ return [
'simplify_ast' => true,
'analyzed_file_extensions' => ['php','inc'],
'globals_type_map' => [
'_Avery_Labels' => '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:float,custom_x:float,custom_y:float}>',
'action' => 'string',
'actioncode' => 'string',
'badgeStatus0' => 'string',
@ -265,18 +259,21 @@ return [
'filtert' => 'int',
'forceall' => 'int<0,1>',
'form' => '\Form',
'formcompany' => '\FormCompany',
'hookmanager' => '\HookManager',
'inputalsopricewithtax' => 'int<0,1>',
'langs' => '\Translate',
'leftmenu' => 'string',
'linkedObjectBlock' => '\CommonObject[]', // See htdocs/core/class/html.form.class.php
'mainmenu' => 'string',
'menumanager' => '\MenuManager',
'mysoc' => '\Societe',
'mysoc' => '?\Societe',
'nblines' => '\int',
'obj' => '\CommonObject', // Deprecated
'object_rights' => 'int|stdClass',
'objectoffield' => '\CommonObject',
'objsoc' => '\Societe',
'senderissupplier' => 'int<0,2>',
'shmkeys' => 'array<string,int>', // memory.lib
'shmoffset' => 'int', // memory.lib
'user' => '\User',
'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type
'websitepage' => '\WebSitePage',
@ -325,13 +322,16 @@ return [
//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
'exclude_file_regex' => '@^(' // @phpstan-ignore-line
.'dummy' // @phpstan-ignore-line
// mymodule seen in cti, but not in git.
.'|htdocs/custom/.*' // Ignore all custom modules @phpstan-ignore-line
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
.'|htdocs/admin/tools/ui/.*' // @phpstan-ignore-line
//.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
// Included as stub (better analysis)
.'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line
// Included as stub (old version + incompatible typing hints)
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
// Included as stub (did not seem properly analysed by phan without it)
// Included as stub (did not seem properly analyzed by phan without it)
.'|htdocs/includes/stripe/.*' // @phpstan-ignore-line
.'|htdocs/conf/conf.php' // @phpstan-ignore-line
// .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line
@ -354,9 +354,9 @@ return [
'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
'/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"],
'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"],
'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"], // '', 0, 1 match bool and int values
'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"],
'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}',"InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"],
'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"],
'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"],
],
@ -392,7 +392,7 @@ return [
'UnknownElementTypePlugin',
'WhitespacePlugin',
//'RemoveDebugStatementPlugin', // Reports echo, print, ...
//'SimplifyExpressionPlugin',
'SimplifyExpressionPlugin',
//'StrictComparisonPlugin', // Expects ===
'SuspiciousParamOrderPlugin',
'UnsafeCodePlugin',
@ -421,13 +421,14 @@ return [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginUnknownArrayPropertyType', // this option costs more time to be supported than it solves time
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time
// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
'PhanTypeArraySuspiciousNullable', // About 440 occurrences
// 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty',
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
// 'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginWhitespaceTab', // Dolibarr used tabs
'PhanPluginWhitespaceTab', // Dolibarr uses tabs
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
'PhanPluginShortArray', // Dolibarr uses array()
'PhanPluginShortArrayList', // Dolibarr uses array()
@ -439,7 +440,7 @@ return [
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
'PhanPluginDuplicateAdjacentStatement',
@ -449,10 +450,11 @@ return [
'PhanPluginRedundantAssignment', // Not essential, useless
'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
'PhanPluginUnknownArrayMethodParamType', // Too many troubles to manage. Is enabled into config_extended only.
'PhanPluginUnknownArrayMethodReturnType', // Too many troubles to manage. Is enabled into config_extended only.
'PhanUndeclaredGlobalVariable', // Too many false positives on .tpl.php files. Is enabled into config_extended only.
'PhanPluginUnknownObjectMethodCall', // False positive for some class. Is enabled into config_extended only.
// 'PhanPluginUnknownArrayMethodParamType', // Too many troubles to manage. Is enabled in config_extended only.
// 'PhanPluginUnknownArrayMethodReturnType', // Too many troubles to manage. Is enabled in config_extended only.
// 'PhanUndeclaredGlobalVariable', // Helps identify variables that are not set/defined - add '@phan-var-force TYPE $varname' in tpl or includes to help type the variable
// 'PhanPluginUnknownObjectMethodCall', // False positive for some class. Is enabled in config_extended only.
'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
],
// You can put relative paths to internal stubs in this config option.
// Phan will continue using its detailed type annotations,

View File

@ -66,11 +66,12 @@ $config['suppress_issue_types'] = [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginUnknownArrayPropertyType', // this option costs more time to be supported than it solves time
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time
// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
'PhanTypeArraySuspiciousNullable', // About 400 cases
// 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty',
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginWhitespaceTab', // Dolibarr used tabs
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
@ -93,6 +94,10 @@ $config['suppress_issue_types'] = [
'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
'PhanPluginRedundantAssignment', // Not essential, useless
'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
'PhanPluginUnknownArrayMethodParamType', // this option costs more time to be supported than it solves time
'PhanPluginUnknownArrayMethodReturnType', // this option costs more time to be supported than it solves time
'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
];
return $config;

View File

@ -21,7 +21,8 @@ require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php';
$config['exclude_file_regex'] = '@^(' // @phpstan-ignore-line
.'dummy' // @phpstan-ignore-line
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
.'|htdocs/admin/tools/ui/.*' // @phpstan-ignore-line
//.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
// Included as stub (old version + incompatible typing hints)
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
// Included as stub (did not seem properly analysed by phan without it)
@ -33,7 +34,6 @@ $config['exclude_file_regex'] = '@^(' // @phpstan-ignore-line
// $config['plugins'][] = __DIR__.'/plugins/ParamMatchRegexPlugin.php';
$config['plugins'][] = 'DeprecateAliasPlugin';
$config['plugins'][] = 'DeprecateAliasPlugin';
// $config['plugins'][] = __DIR__.'/plugins/GetPostFixerPlugin.php';
// $config['plugins'][] = 'PHPDocToRealTypesPlugin';

View File

@ -135,8 +135,16 @@ class ParamMatchVisitor extends PluginAwarePostAnalysisVisitor
{
$class_name = $node->children['class']->children['name'] ?? null;
if (!\is_string($class_name)) {
throw new NodeException($expr, 'does not have class');
// May happen for $this->className::$name(...$arguments); (variable class name)
$location = $this->context->getFile().":".$node->lineno;
print "$location: Node does not have fixed string class_name - node type ".(is_object($class_name) ? get_class_name($class_name) : gettype($class_name)).PHP_EOL;
return;
// throw new NodeException($node, 'does not have class');
}
// } else {
// $location = $this->context->getFile().":".$node->lineno;
// print "$location: Static call - node type ".get_class($node).PHP_EOL;
//}
try {
$class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name);
} catch (FQSENException $_) {

View File

@ -0,0 +1,115 @@
<?php
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*/
namespace {
/**
* Use an OVH account to send SMS with Dolibarr
*/
class OvhSms extends \CommonObject
{
public $db;
//!< To store db handler
public $error;
//!< To return error code (or message)
public $errors = array();
//!< To return several error codes (or messages)
public $element = 'ovhsms';
//!< Id that identify managed object
public $id;
public $account;
public $socid;
public $contact_id;
public $member_id;
public $fk_project;
public $nostop;
public $expe;
public $dest;
public $message;
public $validity;
public $class;
public $deferred;
public $priority;
public $soap;
// Old API
public $conn;
// New API
public $endpoint;
/**
* Constructor
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
}
/**
* Logout
*
* @return void
*/
public function logout()
{
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Send SMS
*
* @return int <=0 if error, >0 if OK
*/
public function SmsSend()
{
}
/**
* Show HTML select box to select account
*
* @return void
*/
public function printListAccount()
{
}
/**
* Return list of SMSAccounts
*
* @return array
*/
public function getSmsListAccount()
{
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Return Credit
*
* @return array
*/
public function CreditLeft()
{
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Return History
*
* @return array
*/
public function SmsHistory()
{
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps,PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Return list of possible SMS senders
*
* @return array|int <0 if KO, array with list of available senders if OK
*/
public function SmsSenderList()
{
}
/**
* Call soapDebug method to output traces
*
* @return void
*/
public function soapDebug()
{
}
}
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*/
// phpcs:disable PEAR.Commenting,Generic.NamingConventions,PEAR.NamingConventions,Squiz.Scope.MethodScope.Missing
@ -3162,7 +3163,7 @@ namespace Luracast\Restler {
505 => 'HTTP Version Not Supported',
);
/**
* @param string $httpStatusCode http status code
* @param int $httpStatusCode http status code
* @param string|null $errorMessage error message
* @param array $details any extra detail about the exception
* @param Exception $previous previous exception if any

View File

@ -0,0 +1,98 @@
parameters:
tmpDir: ./.github/tmp
parallel:
# Commented some of the settings, reminding the defaults:
# should adapt better to target machines
# jobSize: 8 # default is 20
processTimeout: 600.0
# maximumNumberOfProcesses: 20 # default is 32
# minimumNumberOfJobsPerProcess: 2 # default is 2
# buffer: 134217728 # 128 MB # Not documented
customRulesetUsed: true
level: 9
fileExtensions:
- php
paths:
- htdocs
- scripts
excludePaths:
analyseAndScan:
- htdocs/custom/*
- htdocs/documents/*
- htdocs/install/doctemplates/*
- htdocs/langs/*
- htdocs/modulebuilder/template/test/*
- htdocs/support/*
analyse:
- htdocs/includes/*
- htdocs/core/class/lessc.class.php
checkAlwaysTrueCheckTypeFunctionCall: false
checkAlwaysTrueInstanceof: false
checkAlwaysTrueStrictComparison: false
checkClassCaseSensitivity: true
checkFunctionArgumentTypes: true
checkFunctionNameCase: true
checkArgumentsPassedByReference: true
checkMaybeUndefinedVariables: true
checkNullables: false
checkThisOnly: true
checkUnionTypes: false
checkExplicitMixedMissingReturn: true
reportMaybes: false
reportMaybesInMethodSignatures: false
reportStaticMethodSignatures: false
polluteScopeWithLoopInitialAssignments: true
polluteScopeWithAlwaysIterableForeach: true
reportMagicMethods: false
reportMagicProperties: false
treatPhpDocTypesAsCertain: false
ignoreErrors:
- '#.*phan-var#'
- '#is always#'
internalErrorsCountLimit: 50
cache:
nodesByFileCountMax: 512
nodesByStringCountMax: 512
reportUnmatchedIgnoredErrors: false
universalObjectCratesClasses:
- stdClass
- SimpleXMLElement
earlyTerminatingMethodCalls: []
dynamicConstantNames:
- ICONV_IMPL
- PHP_VERSION
- PHP_MAJOR_VERSION
- PHP_MINOR_VERSION
- PHP_RELEASE_VERSION
- PHP_VERSION_ID
- PHP_EXTRA_VERSION
- PHP_ZTS
- PHP_DEBUG
- PHP_MAXPATHLEN
- PHP_OS
- PHP_OS_FAMILY
- PHP_SAPI
- PHP_EOL
- PHP_INT_MAX
- PHP_INT_MIN
- PHP_INT_SIZE
- PHP_FLOAT_DIG
- PHP_FLOAT_EPSILON
- PHP_FLOAT_MIN
- PHP_FLOAT_MAX
- DEFAULT_INCLUDE_PATH
- PEAR_INSTALL_DIR
- PEAR_EXTENSION_DIR
- PHP_EXTENSION_DIR
- PHP_PREFIX
- PHP_BINDIR
- PHP_BINARY
- PHP_MANDIR
- PHP_LIBDIR
- PHP_DATADIR
- PHP_SYSCONFDIR
- PHP_LOCALSTATEDIR
- PHP_CONFIG_FILE_PATH
- PHP_CONFIG_FILE_SCAN_DIR
- PHP_SHLIB_SUFFIX
- PHP_FD_SETSIZE

View File

@ -48,6 +48,7 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/../../../scripts/',
__DIR__ . '/../../../test/phpunit/',
]);
$rectorConfig->skip([
'**/includes/**',
'**/custom/**',
@ -55,6 +56,7 @@ return static function (RectorConfig $rectorConfig): void {
'**/rector/**', // Disable this line to test the "test.php" file.
__DIR__ . '/../../../htdocs/custom/',
__DIR__ . '/../../../htdocs/install/doctemplates/*'
//'test.php',
]);
$rectorConfig->parallel(240);
@ -70,9 +72,9 @@ return static function (RectorConfig $rectorConfig): void {
//$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
//Not yet ready: $rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class);
@ -82,11 +84,16 @@ return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::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);
// Add all predefined rules to migrate to up to php 71.
// Warning this break tab spacing of arrays on several lines
/*$rectorConfig->sets([
LevelSetList::UP_TO_PHP_70
]);*/
LevelSetList::UP_TO_PHP_70
]);*/
// Add predefined rules for a given version only
//$rectorConfig->import(SetList::PHP_70);
//$rectorConfig->import(SetList::PHP_71);

View File

@ -64,8 +64,8 @@ class GlobalToFunction extends AbstractRector
[new CodeSample(
'$conf->global->CONSTANT',
'getDolGlobalInt(\'CONSTANT\')'
)]
);
)]
);
}
/**
@ -133,7 +133,7 @@ class GlobalToFunction extends AbstractRector
$node->dim = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
);
}
return $node;
}
@ -208,7 +208,7 @@ class GlobalToFunction extends AbstractRector
$leftConcat = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
);
$rightConcat = $node->right;
}
if ($this->isGlobalVar($node->right)) {
@ -219,7 +219,7 @@ class GlobalToFunction extends AbstractRector
$rightConcat = new FuncCall(
new Name('getDolGlobalString'),
[new Arg($constName)]
);
);
$leftConcat = $node->left;
}
if (!isset($leftConcat, $rightConcat)) {
@ -238,6 +238,7 @@ class GlobalToFunction extends AbstractRector
$node = $nodes->getFirstExpr();
}
// Now process all comparison like:
// $conf->global->... Operator Value
@ -264,11 +265,14 @@ class GlobalToFunction extends AbstractRector
$typeofcomparison = 'NotIdentical';
//var_dump($node->left);
}
if (empty($typeofcomparison)) {
return;
}
if (!$this->isGlobalVar($node->left)) {
$isconfglobal = $this->isGlobalVar($node->left);
if (!$isconfglobal) {
// The left side is not conf->global->xxx, so we leave
return;
}
@ -282,7 +286,8 @@ class GlobalToFunction extends AbstractRector
$funcName = 'getDolGlobalString';
break;
default:
return;
$funcName = 'getDolGlobalString';
break;
}
$constName = $this->getConstName($node->left);
@ -295,9 +300,9 @@ class GlobalToFunction extends AbstractRector
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'NotEqual') {
return new NotEqual(
@ -313,36 +318,36 @@ class GlobalToFunction extends AbstractRector
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'GreaterOrEqual') {
return new GreaterOrEqual(
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'Smaller') {
return new Smaller(
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'SmallerOrEqual') {
return new SmallerOrEqual(
new FuncCall(
new Name($funcName),
[new Arg($constName)]
),
),
$node->right
);
);
}
if ($typeofcomparison == 'NotIdentical') {
return new NotIdentical(
@ -382,7 +387,7 @@ class GlobalToFunction extends AbstractRector
}
return \true;
}
);
);
}
/**

View File

@ -1204,6 +1204,7 @@ Feature
FeatureIsSupportedInInOutModeOnly
Features
FichinterNoContractLinked
FichintersCategoriesArea
FieldNeedSource
FieldTarget
FieldTitle

View File

@ -143,7 +143,7 @@ BAN
BI
BOMs
Back
Bad value for email, email lwas not verified by Google
Bad value for email, email was not verified by Google
Bad value for returned userinfo[aud]
Bad value for returned userinfo[exp]. Token expired.
Bad value for returned userinfo[iss]
@ -164,7 +164,6 @@ BlockLogNeedElement
BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote
BlockedLogAuthorityUrl
BlockedLogSetup
BookCalArea
BookCalSystem
Bookings
BoxTitleLast
@ -302,8 +301,6 @@ ECMAreaDesc2
ECMDocsByProducts
ECMSectionAutoDesc
ECMSectionManualDesc
EMail
EMails
EcmFiles
EditAdherent
EditAdherentAddress
@ -445,6 +442,7 @@ Free
FreeLegalTextOnReceptions
FrequencyPer_
FromPublicEmail
FullPathOrig
Function_getNextValue_InModuleNotWorking
Gantt
GeneratePDF
@ -525,7 +523,6 @@ MemberAllowchangeOfType
MemberTypeCard
MembersListOfTiers
MenuAddedSuccesfuly
Message
MigrationBankTransfertsToUpdate
MigrationContractsEmptyCreationDatesUpdateSuccess
Millisecond
@ -583,7 +580,6 @@ NewProperty
NoActiveEstablishmentDefined
NoAddMember
NoAuthorityURLDefined
NoBankAccountFound
NoCurrencyRateSelected
NoEntriesToShow
NoEstablishmentFound
@ -696,7 +692,6 @@ Production
ProfId
Profile
Programs
Progression
ProjectNbProject
ProjectNbTask
Property %s not found in the class. The class was probably not generated by modulebuilder.
@ -791,7 +786,6 @@ ShowEmailcollectorFilter
ShowEvaluation
ShowEvaluationdet
ShowFichinter
ShowInterventionModel
ShowInventory
ShowJob
ShowKnowledgeRecord
@ -808,7 +802,6 @@ ShowRecruitmentCandidature
ShowRecruitmentJobPosition
ShowSearchFields
ShowSkill
ShowSkillRank
ShowSkilldet
ShowStockTransfer
ShowStockTransferLine
@ -821,8 +814,6 @@ SignatureOK
Siren
Situation
SizeUnit
SkillCreated
SkillRank
SmsTestSubstitutionReplacedByGenericValues
SomeShipmentExists
SourceType
@ -1012,7 +1003,6 @@ VideoGeneration
#####################################################################
#####################################################################
AddService
AnHelpMessage
Analytic
AnalyticLabel
BankId
@ -1044,6 +1034,7 @@ FailedToLogin
First
GroupCreate
GroupUpdate
HelpMessage
INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION
INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION
INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID
@ -1081,6 +1072,10 @@ MYMODULE_MYPARAM6
MYMODULE_MYPARAM7
MYMODULE_MYPARAM8
MYMODULE_MYPARAM9
MYMODULE_MYPARAM10
MYMODULE_MYPARAM11
MYMODULE_MYPARAM12
MYMODULE_MYPARAM13
ManufacturingOrders
MemberCreate
MemberTypeCreate
@ -1121,8 +1116,6 @@ TicketMessageMailSignatureText
TicketSetupPage
Tiers
Timeline
TotalDiscount
TotalHTBeforeDiscount
Transfer
TryAnotherConnectionMode
UndefinedKey

View File

@ -3,6 +3,7 @@
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -31,6 +32,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
// Load translation files required by the page
$langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries'));
@ -62,18 +71,20 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->hasRight('accounting', 'chartofaccount')) {
if (!$permissiontoadd) {
accessforbidden();
}
// now $permissiontoadd or $user->hasRight('accounting', 'chartofaccount') are always equal to 1
// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
if (empty($page) || $page == -1) {
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
// If $page is not defined, or '' or -1 or if we click on clear filters
$page = 0;
} // If $page is not defined, or '' or -1
}
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@ -103,7 +114,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$accounting = new AccountingAccount($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('accountancyadminaccount'));
@ -152,7 +163,7 @@ if (empty($reshook)) {
|| (GETPOSTINT('chartofaccounts') > 0 && GETPOSTINT('chartofaccounts') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified
$error = 0;
if ($chartofaccounts > 0 && $permissiontoadd) {
if ($chartofaccounts > 0 /* && $permissiontoadd */) {
$country_code = '';
// Get language code for this $chartofaccounts
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
@ -199,7 +210,7 @@ if (empty($reshook)) {
}
}
if ($action == 'disable' && $permissiontoadd) {
if ($action == 'disable' /* && $permissiontoadd */) {
if ($accounting->fetch($id)) {
$mode = GETPOSTINT('mode');
$result = $accounting->accountDeactivate($id, $mode);
@ -209,7 +220,7 @@ if (empty($reshook)) {
}
$action = 'update';
} elseif ($action == 'enable' && $permissiontoadd) {
} elseif ($action == 'enable' /* && $permissiontoadd */) {
if ($accounting->fetch($id)) {
$mode = GETPOSTINT('mode');
$result = $accounting->accountActivate($id, $mode);
@ -230,7 +241,7 @@ $formaccounting = new FormAccounting($db);
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $langs->trans("ListAccounts"), $help_url);
llxHeader('', $langs->trans("ListAccounts"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_account');
if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1);
@ -340,7 +351,8 @@ if ($resql) {
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
// if null contextpage is forced to 'accountingaccountlist' so never empty
if (/* !empty($contextpage) && */$contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
@ -388,9 +400,9 @@ if ($resql) {
// List of mass actions available
$arrayofmassactions = array();
if ($user->hasRight('accounting', 'chartofaccount')) {
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
}
// if ($permissiontoadd) { // test is always true
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
// }
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
$arrayofmassactions = array();
}
@ -461,20 +473,21 @@ if ($resql) {
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
$moreforfilter = '';
if ($moreforfilter) {
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
}
$accountstatic = new AccountingAccount($db);
$accountparent = new AccountingAccount($db);
$totalarray = array();
$totalarray['nbfield'] = 0;
$moreforfilter = '';
// if ($moreforfilter) {
// print '<div class="liste_titre liste_titre_bydiv centpercent">';
// print $moreforfilter;
// print '</div>';
// }
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
// print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<table class="tagtable liste">'."\n";
// Fields title search
// --------------------------------------------------------------------
@ -613,7 +626,7 @@ if ($resql) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center nowraponall">';
if ($user->hasRight('accounting', 'chartofaccount')) {
// if ($permissiontoadd) { // test is always true
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
@ -622,14 +635,14 @@ if ($resql) {
print img_delete();
print '</a>';
print '&nbsp;';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
// }
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;
@ -769,7 +782,7 @@ if ($resql) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center nowraponall">';
if ($user->hasRight('accounting', 'chartofaccount')) {
// if ($permissiontoadd) { // test is always true
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit();
print '</a>';
@ -778,14 +791,14 @@ if ($resql) {
print img_delete();
print '</a>';
print '&nbsp;';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
// }
print '</td>'."\n";
if (!$i) {
$totalarray['nbfield']++;

View File

@ -46,6 +46,14 @@ if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
}
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
// Load translation files required by the page
$langs->loadLangs(array('accountancy', 'admin', 'companies', 'compta', 'errors', 'holiday', 'hrm', 'resource'));
@ -68,10 +76,11 @@ $active = 1;
$sortfield = GETPOST("sortfield", 'aZ09comma');
$sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
if (empty($page) || $page == -1) {
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
// If $page is not defined, or '' or -1 or if we click on clear filters
$page = 0;
} // If $page is not defined, or '' or -1
}
$offset = $listlimit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@ -88,7 +97,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) {
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('admin'));
// This page is a generic page to edit dictionaries
@ -340,7 +349,7 @@ $formadmin = new FormAdmin($db);
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $langs->trans("Pcg_version"), $help_url);
llxHeader('', $langs->trans("Pcg_version"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_accountmodel');
$titre = $langs->trans($tablib[$id]);
$linkback = '';
@ -492,7 +501,7 @@ if ($resql) {
// 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), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
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>';
}
@ -657,7 +666,7 @@ $db->close();
* Show fields in insert/edit mode
*
* @param string[] $fieldlist Array of fields
* @param stdClass $obj If we show a particular record, obj is filled with record fields
* @param ?stdClass $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we don't want it to be rendered
* @return void

View File

@ -31,6 +31,14 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
$error = 0;
// Load translation files required by the page
@ -206,7 +214,7 @@ $title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card');
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_card');
// Create mode

View File

@ -3,6 +3,7 @@
* Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,6 +31,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
$error = 0;
// Load translation files required by the page
@ -117,7 +126,7 @@ $formaccounting = new FormAccounting($db);
$title= $langs->trans('AccountingCategory');
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_categories');
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$titlepicto = 'setup';
@ -164,7 +173,7 @@ if (!empty($cat_id)) {
}
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
print img_picto($langs->trans("AccountingAccount"), 'accounting_account', 'class="pictofixedwith"');
print img_picto($langs->trans("AccountingAccount"), 'accounting_account', 'class="pictofixedwidth"');
print $form->multiselectarray('cpt_bk', $arraykeyvalue, GETPOST('cpt_bk', 'array'), 0, 0, '', 0, "80%", '', '', $langs->transnoentitiesnoconv("AddAccountFromBookKeepingWithNoCategories"));
print '<input type="submit" class="button button-add small" id="" class="action-delete" value="'.$langs->trans("Add").'"> ';
}

View File

@ -35,6 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
// Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "accountancy", "hrm"));
@ -72,7 +80,7 @@ $pagenext = $page + 1;
$search_country_id = GETPOST('search_country_id', 'int');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('admin'));
// This page is a generic page to edit dictionaries
@ -408,7 +416,7 @@ $formadmin = new FormAdmin($db);
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $langs->trans('DictionaryAccountancyCategory'), $help_url);
llxHeader('', $langs->trans('DictionaryAccountancyCategory'), $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_categories_list');
$titre = $langs->trans($tablib[$id]);
$linkback = '';
@ -617,7 +625,7 @@ if ($resql) {
// There is several pages
if ($num > $listlimit) {
print '<tr class="none"><td class="right" colspan="'.(2 + count($fieldlist)).'">';
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
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>';
}
@ -635,7 +643,7 @@ if ($resql) {
}
// Title line with search boxes
print '<tr class="liste_titre liste_titre_add liste_titre_filter">';
print '<tr class="liste_titre liste_titre_filter">';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@ -900,7 +908,7 @@ if ($resql) {
// Active
print '<td class="center" class="nowrap">';
if ($canbedisabled) {
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
print '<a class="reposition" href="'.$url.'action='.urlencode($acts[$obj->active]).'&token='.newToken().'">'.$actl[$obj->active].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
@ -947,22 +955,15 @@ $db->close();
* Show fields in insert/edit mode
*
* @param string[] $fieldlist Array of fields
* @param stdClass $obj If we show a particular record, obj is filled with record fields
* @param ?stdClass $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we don't want it to be rendered
* @return void
*/
function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $context = '')
{
global $conf, $langs, $db;
global $form, $mysoc;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'country') {
print '<td>';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2019-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -29,6 +30,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
*/
// Load translation files required by the page
$langs->loadLangs(array("compta", "admin", "accountancy"));
@ -106,7 +115,7 @@ $title = $langs->trans('Closure');
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $title, $help_url);
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_closure');
$linkback = '';
print load_fiche_titre($langs->trans('MenuClosureAccounts'), $linkback, 'title_accountancy');
@ -121,6 +130,11 @@ print '<input type="hidden" name="action" value="update">';
// Define main accounts for closure
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Parameter").'</th>';
print '<th>';
print '</th></tr>';
foreach ($list_account_main as $key) {
print '<tr class="oddeven value">';
// Param
@ -148,16 +162,20 @@ print '</td></tr>';
// Accounting groups used for the balance sheet account
print '<tr class="oddeven">';
print '<td class="fieldrequired">'.$langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT").'</td>';
print '<td class="fieldrequired">';
print $form->textwithpicto($langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT"), $langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNTHelp"));
print '</td>';
print '<td>';
print '<input type="text" size="100" id="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT" name="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT" value="' . dol_escape_htmltag(getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT')). '">';
print '<input type="text" class="quatrevingtpercent" id="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT" name="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT" value="' . dol_escape_htmltag(getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_BALANCE_SHEET_ACCOUNT')). '">';
print '</td></tr>';
// Accounting groups used for the income statement
print '<tr class="oddeven">';
print '<td class="fieldrequired">'.$langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT").'</td>';
print '<td class="fieldrequired">';
print $form->textwithpicto($langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT"), $langs->trans("ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENTHelp"));
print '</td>';
print '<td>';
print '<input type="text" size="100" id="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT" name="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT" value="' . dol_escape_htmltag(getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT')). '">';
print '<input type="text" class="quatrevingtpercent" id="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT" name="ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT" value="' . dol_escape_htmltag(getDolGlobalString('ACCOUNTING_CLOSURE_ACCOUNTING_GROUPS_USED_FOR_INCOME_STATEMENT')). '">';
print '</td></tr>';
print "</table>\n";

View File

@ -35,6 +35,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
* @var HookManager $hookmanager
* @var Societe $mysoc
* @var Translate $langs
* @var User $user
*/
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "trips", "loan"));
@ -123,8 +132,9 @@ if (isModEnabled('societe')) {
* Actions
*/
$error = 0;
if ($action == 'update') {
$error = 0;
// Process $list_account_main
foreach ($list_account_main as $constname) {
$constvalue = GETPOST($constname, 'alpha');
@ -205,7 +215,7 @@ $formaccounting = new FormAccounting($db);
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
llxHeader('', $langs->trans('MenuDefaultAccounts'), $help_url);
llxHeader('', $langs->trans('MenuDefaultAccounts'), $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_defaultaccounts');
$linkback = '';
print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy');
@ -314,7 +324,7 @@ if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_D
print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>';
if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
@ -341,7 +351,7 @@ if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_D
print '<td>' . img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnSupplierDeposit") . '</td>';
if (getDolGlobalInt('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">';

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