2
0
forked from Wavyzz/dolibarr

Merge branch '21.0' into 20.0.33130

This commit is contained in:
Laurent Destailleur
2025-02-19 13:51:26 +01:00
committed by GitHub
4924 changed files with 256873 additions and 94888 deletions

View File

@@ -26,3 +26,7 @@ trim_trailing_whitespace = false
indent_style = tab indent_style = tab
trim_trailing_whitespace = true trim_trailing_whitespace = true
indent_size = 4 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 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). 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. 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. 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) 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). 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. 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 ### Basic workflow
1. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr). As the Developer:
2. Clone your fork.
3. Choose a branch(See the [Branches](#branches) section below). 1. Check you agree with the terms of the [DCO - Developer's Certificate of Origin](https://github.com/Dolibarr/dolibarr/blob/develop/DCO)
4. Read our developer documentation on the [Dolibarr Wiki](https://wiki.dolibarr.org/index.php?title=Developer_documentation). 2. [Fork](https://help.github.com/articles/fork-a-repo) the [GitHub repository](https://github.com/Dolibarr/dolibarr).
5. Commit and push your changes. 3. Clone your fork.
6. [Make a pull request](https://help.github.com/articles/creating-a-pull-request). 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> <span id="branches" name="branches"></span>
### Branches ### Branches
Unless you're fixing a bug, all pull requests should be made against the *develop* branch. 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. 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.
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. 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 ### 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: Use clear commit messages with the following structure:
```plaintext ```plaintext
@@ -106,9 +140,9 @@ FIX|Fix #456 Short description (where #456 is number of bug fix, if it exists. I
or or
CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog) CLOSE|Close #456 Short description (where #456 is number of feature request, if it exists. In upper case to appear into ChangeLog)
or 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 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). Long description (Can span across multiple lines).
</pre> </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. * 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: 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. * 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 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. 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 ask you. The majority of open PR are waiting an action of the author of the PR. 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. 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. 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" 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 ### Resources

View File

@@ -19,17 +19,17 @@ jobs:
- name: Cleanup - name: Cleanup
run: | run: |
gh extension install actions/gh-actions-cache gh extension install actions/gh-actions-cache
REPO=${{ github.repository }} REPO="${{ github.repository }}"
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key" 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 set +e
echo "Deleting caches..." echo "Deleting caches..."
for cacheKey in $cacheKeysForPR for cacheKey in $cacheKeysForPR
do do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm
done done
echo "Done" echo "Done"
env: env:

View File

@@ -16,7 +16,7 @@ jobs:
phpstan: phpstan:
uses: ./.github/workflows/phpstan.yml uses: ./.github/workflows/phpstan.yml
secrets: inherit secrets: inherit
needs: [pre-commit, phan] needs: [pre-commit]
with: with:
gh_event: ${{ github.event_name }} gh_event: ${{ github.event_name }}
#windows-ci: #windows-ci:
@@ -30,11 +30,12 @@ jobs:
# needs: [pre-commit, phan] # needs: [pre-commit, phan]
# needs: [windows-ci] # needs: [windows-ci]
secrets: inherit secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml uses: ./.github/workflows/gh-travis.yml
with: with:
gh_event: ${{ github.event_name }} gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361) # 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()" # - if: "failure()"
# uses: "andymckay/cancel-action@0.3" # uses: "andymckay/cancel-action@0.3"

View File

@@ -16,7 +16,7 @@ jobs:
phpstan: phpstan:
uses: ./.github/workflows/phpstan.yml uses: ./.github/workflows/phpstan.yml
secrets: inherit secrets: inherit
needs: [pre-commit, phan] needs: [pre-commit]
with: with:
gh_event: ${{ github.event_name }} gh_event: ${{ github.event_name }}
windows-ci: windows-ci:
@@ -30,11 +30,12 @@ jobs:
# needs: [pre-commit, phan] # needs: [pre-commit, phan]
# needs: [windows-ci] # needs: [windows-ci]
secrets: inherit secrets: inherit
needs: [pre-commit, phan, phpstan]
uses: ./.github/workflows/gh-travis.yml uses: ./.github/workflows/gh-travis.yml
with: with:
gh_event: ${{ github.event_name }} gh_event: ${{ github.event_name }}
# Note (not tested, from https://github.com/orgs/community/discussions/38361) # 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()" # - if: "failure()"
# uses: "andymckay/cancel-action@0.3" # uses: "andymckay/cancel-action@0.3"

View File

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

View File

@@ -14,8 +14,7 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
env: env:
gh_event: ${{ inputs.gh_event || github.event_name }} gh_event: ${{ inputs.gh_event || github.event_name }}
PHAN_CONFIG: > PHAN_CONFIG: dev/tools/phan/config.php
${{ 'dev/tools/phan/config.php' }}
PHAN_BASELINE: dev/tools/phan/baseline.txt PHAN_BASELINE: dev/tools/phan/baseline.txt
PHAN_MIN_PHP: 7.0 PHAN_MIN_PHP: 7.0
PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }} PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }}
@@ -40,7 +39,8 @@ jobs:
tools: cs2pr,phan tools: cs2pr,phan
- name: Run Phan analysis - name: Run Phan analysis
run: | 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 - name: Add results to PR
if: ${{ always() }} if: ${{ always() }}
run: | run: |

View File

@@ -36,14 +36,14 @@ jobs:
steps: steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# Get PHP and addons # Get PHP and addons
- name: Setup PHP - name: Setup PHP
id: setup-php id: setup-php
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: ${{ matrix.php-version }} php-version: ${{ matrix.php-version }}
tools: phpstan:1, cs2pr coverage: none # disable xdebug, pcov
tools: phpstan:2.0, cs2pr
extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap, extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap,
mysql, pgsql, sqlite3, ldap, xml, mcrypt mysql, pgsql, sqlite3, ldap, xml, mcrypt
@@ -85,3 +85,9 @@ jobs:
name: phpstan-srcrt name: phpstan-srcrt
path: ${{ github.workspace }}/_stan.xml path: ${{ github.workspace }}/_stan.xml
retention-days: 2 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:

View File

@@ -18,7 +18,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
#- name: Install GitHub CLI #- name: Install GitHub CLI
# run: | # run: |
@@ -39,16 +39,26 @@ jobs:
#REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer #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 REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer
run: | run: |
echo "Run action by ${{ github.actor }}" # shellcheck disable=2086
echo "Run action by ${{ github.actor }}"
# shellcheck disable=2086
echo "github.token=${{ github.token }}" echo "github.token=${{ github.token }}"
# shellcheck disable=2086
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
# shellcheck disable=2086
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"
# shellcheck disable=2086
echo Get the pr_number echo Get the pr_number
# shellcheck disable=2086
pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH)
# shellcheck disable=2086
echo "pr_number=$pr_number" echo "pr_number=$pr_number"
# shellcheck disable=2086
echo Authenticate login gh echo Authenticate login gh
# shellcheck disable=2086
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
# shellcheck disable=2086
gh auth setup-git gh auth setup-git
echo Set the reviewer # shellcheck disable=2086
gh pr edit $pr_number --add-reviewer "$REVIEWER" gh pr edit $pr_number --add-reviewer "$REVIEWER"
continue-on-error: true continue-on-error: true

View File

@@ -32,7 +32,7 @@ jobs:
# This is faster for a big repo. # This is faster for a big repo.
- name: Get all changed php files (if PR) - name: Get all changed php files (if PR)
id: changed-php id: changed-php
uses: tj-actions/changed-files@v44 uses: tj-actions/changed-files@v45
if: env.gh_event == 'pull_request' if: env.gh_event == 'pull_request'
with: with:
files: | files: |
@@ -62,8 +62,9 @@ jobs:
- name: Extract PHP version - name: Extract PHP version
id: extract-php-version id: extract-php-version
run: | run: |
# shellcheck disable=SC2016
PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php) PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php)
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV echo "PHP_VERSION=$PHP_VERSION" >> "$GITHUB_ENV"
- name: Setup PHPCS - name: Setup PHPCS
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
@@ -95,12 +96,12 @@ jobs:
run: | run: |
set -o pipefail set -o pipefail
pre-commit gc 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. # The next uses git, which is slow for a bit repo.
# - name: Get all changed php files (if PR) # - name: Get all changed php files (if PR)
# id: changed-php # id: changed-php
# uses: tj-actions/changed-files@v44 # uses: tj-actions/changed-files@v45
# if: env.gh_event == 'pull_request' # if: env.gh_event == 'pull_request'
# with: # with:
# files: | # files: |
@@ -112,7 +113,8 @@ jobs:
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }} ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
run: | run: |
set -o pipefail 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 - name: Run some pre-commit hooks on all files on push to "main" branches
if: | if: |
@@ -124,8 +126,8 @@ jobs:
run: | run: |
set -o pipefail set -o pipefail
ln -sf ~/.cache .cache # Absolute path in .pre-commit-config.yaml 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 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 sqlfluff-lint | tee -a "${RAW_LOG}"
ls -l ~/.cache/pre-commit/ ls -l ~/.cache/pre-commit/
- name: Convert Raw Log to Annotations - name: Convert Raw Log to Annotations

View File

@@ -18,7 +18,7 @@ jobs:
steps: steps:
- name: Log - name: Log
run: | run: |
echo "Run action by ${{ github.actor }}" echo "Run action by ${{ github.actor }}"
echo "github.token=${{ github.token }}" echo "github.token=${{ github.token }}"
echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH"

View File

@@ -61,7 +61,7 @@ jobs:
KEY_ROOT: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }} KEY_ROOT: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}
with: with:
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178 # See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
enableCrossOsArchive: true enableCrossOsArchive: true
path: | path: |
./db_init.sql ./db_init.sql
./db_init.sql.md5 ./db_init.sql.md5
@@ -116,6 +116,7 @@ jobs:
# Note this is bash (MSYS) on Windows # Note this is bash (MSYS) on Windows
shell: bash shell: bash
run: | run: |
# shellcheck disable=SC2129
ECHO "#[group]Directory contents to verify cache files, ..." ECHO "#[group]Directory contents to verify cache files, ..."
ls -l ls -l
ECHO "#[endgroup]" ECHO "#[endgroup]"
@@ -130,10 +131,12 @@ jobs:
ls -l ls -l
ECHO "#[endgroup]" ECHO "#[endgroup]"
# Export some tool paths to reuse the from CMD shell. # 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 "TAIL=$(cygpath -w "$(which tail)")"
echo "TEE=$(cygpath -w "$(which tee)")" >> "$GITHUB_ENV" echo "GREP=$(cygpath -w "$(which grep)")"
echo "BASEDIR=$(realpath .)" >> "$GITHUB_ENV" echo "TEE=$(cygpath -w "$(which tee)")"
echo "BASEDIR=$(realpath .)"
} >> "$GITHUB_ENV"
- name: Run PHPUnit tests - name: Run PHPUnit tests
# continue-on-error: true # continue-on-error: true
@@ -186,7 +189,7 @@ jobs:
if: ${{ ! cancelled() }} if: ${{ ! cancelled() }}
with: with:
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178 # See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
enableCrossOsArchive: true enableCrossOsArchive: true
key: ${{ steps.cache.outputs.cache-primary-key }} key: ${{ steps.cache.outputs.cache-primary-key }}
path: | path: |
./db_init.sql ./db_init.sql

1
.gitignore vendored
View File

@@ -41,6 +41,7 @@ htdocs/includes/php-parallel-lint/
htdocs/includes/sebastian/ htdocs/includes/sebastian/
htdocs/includes/squizlabs/ htdocs/includes/squizlabs/
htdocs/includes/webmozart/ htdocs/includes/webmozart/
htdocs/install/install.forced.php
htdocs/.well-known/apple-developer-merchantid-domain-association htdocs/.well-known/apple-developer-merchantid-domain-association
/factory/ /factory/
/output/ /output/

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> eldy <eldy@destailleur.fr>
Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ldestailleur@teclib.com> Laurent Destailleur <eldy@destailleur.fr> Laurent Destailleur <ldestailleur@teclib.com>
Laurent Destailleur <eldy@destailleur.fr> eldy10 <eldy10@master8.(none)> 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> Regis Houssin <regis@dolibarr.fr>
Regis Houssin <regis.houssin@inodbox.com> Régis Houssin <regishoussin@device5.home> Regis Houssin <regis.houssin@inodbox.com> Régis Houssin <regishoussin@device5.home>
Juanjo Menent <jmenent@2byte.es> simnandez <jmenent@2byte.es> 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> BB2A-Anthony <anthony.berton@bb2a.fr>
Anthony Berton <anthony.berton@bb2a.fr> Anthony Berton <bertonanthony@gmail.com> 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> 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: repos:
# Several miscellaneous checks and fix (on yaml files, end of files fix) # Several miscellaneous checks and fix (on yaml files, end of files fix)
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 rev: v4.6.0
hooks: hooks:
# This hook tests the name of the branch and return an error if the name is # This hook tests the name of the branch and return an error if the name is
# 'develop' or an official version 'x.y' # 'develop' or an official version 'x.y'
@@ -43,7 +43,7 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
# Check that there are no completely merged file conflicts # Check that there are no completely merged file conflicts
- id: check-merge-conflict - 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) # Check that files with shebangs have the executable bit set (in git)
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
# Check that shell files are executables # 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) # Check that there are no files that have are the same when uppercased (conflict on windows)
- id: check-case-conflict - 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 - repo: https://github.com/gitleaks/gitleaks.git
rev: v8.16.1 rev: v8.16.1
hooks: hooks:
- id: gitleaks - id: gitleaks
# Check github actions
- repo: https://github.com/rhysd/actionlint
rev: v1.7.3
hooks:
- id: actionlint
# Beautify shell scripts # Beautify shell scripts
- repo: https://github.com/lovesegfault/beautysh.git - repo: https://github.com/lovesegfault/beautysh.git
rev: v6.2.1 rev: v6.2.1
@@ -185,7 +191,7 @@ repos:
# Check format of yaml files # Check format of yaml files
- repo: https://github.com/adrienverge/yamllint.git - repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0 rev: v1.35.1
hooks: hooks:
- id: yamllint - id: yamllint
args: args:
@@ -195,7 +201,7 @@ repos:
# Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/) # Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/)
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.3.0
hooks: hooks:
- id: codespell - id: codespell
# Due to a current limitation of configuration files, # Due to a current limitation of configuration files,
@@ -212,7 +218,7 @@ repos:
- -x - -x
- dev/tools/codespell/codespell-lines-ignore.txt - dev/tools/codespell/codespell-lines-ignore.txt
exclude_types: [image] exclude_types: [image]
exclude: (?x)^(.phan/stubs/.*)$ exclude: (?x)^(.phan/stubs/.*|phpstan\.neon.*)$
additional_dependencies: [tomli] additional_dependencies: [tomli]
- alias: codespell-lang-en_US - alias: codespell-lang-en_US
# Only for translations with specialised exceptions # Only for translations with specialised exceptions
@@ -238,30 +244,31 @@ repos:
# Check some shell scripts # Check some shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py - repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6 rev: v0.10.0.1
hooks: hooks:
- id: shellcheck - id: shellcheck
args: [-W, "100"] args: [-W, "100"]
# Check sql file syntax
- repo: https://github.com/sqlfluff/sqlfluff - repo: https://github.com/sqlfluff/sqlfluff
rev: 3.0.4 rev: 3.1.0
hooks: hooks:
- id: sqlfluff-lint - id: sqlfluff-lint
stages: [pre-commit, manual] # manual needed for ci stages: [pre-commit, manual] # manual needed for ci
exclude: (?x)^ exclude: (?x)^
(htdocs/includes/.* (dev/initdemo/mysqldump_.*\.sql
|htdocs/install/doctemplates/websites/.*_template
|htdocs/core/menus/init_menu_auguria\.sql |htdocs/core/menus/init_menu_auguria\.sql
|htdocs/install/doctemplates/websites/website_template-.*\.sql |htdocs/includes/.*
|(htdocs/install/mysql/data/(llx_20_c_departements\.sql |htdocs/install/doctemplates/websites/.*_template
|llx_accounting_account_.*\.sql) |htdocs/install/doctemplates/websites/website_template.*\.sql
|(htdocs/install/mysql/migration/3\.[256]\.0-.*\.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/(1[0-5]|[456789])\.0\.0-.*\.sql
|htdocs/install/mysql/migration/3\.([0134789])\.0-.*\.sql
|htdocs/install/mysql/migration/repair\.sql |htdocs/install/mysql/migration/repair\.sql
|htdocs/install/mysql/tables/llx_bookcal_availabilities-bookcal\.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/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: jobs:
fast_finish: true fast_finish: true
allow_failures: allow_failures:
- php: '8.3' - php: '8.4'
include: include:
- stage: PHP min and max - stage: PHP min and max
if: type = push if: type = push
@@ -47,16 +47,16 @@ jobs:
- TRAVIS_PHP_VERSION=7.1 - TRAVIS_PHP_VERSION=7.1
- stage: PHP min and max - stage: PHP min and max
if: type = pull_request OR type = push 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' php: '8.3'
env: env:
- DB=mysql - DB=mysql
- TRAVIS_PHP_VERSION=8.3 - 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: notifications:
email: email:
@@ -94,6 +94,9 @@ before_install:
if [ "$TRAVIS_PHP_VERSION" = '8.3' ]; then 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 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 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 echo Install pgsql if run is for pgsql
@@ -164,7 +167,7 @@ install:
squizlabs/php_codesniffer ^3 squizlabs/php_codesniffer ^3
fi fi
# phpunit 9 is required for php 8 # phpunit 9 is required for php 8
if [ "$TRAVIS_PHP_VERSION" = '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 sudo composer self-update 2.4.4
composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \ composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \
php-parallel-lint/php-parallel-lint ^1.2 \ 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/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 . --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --exclude htdocs/includes/webklex --blame .
fi 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 set +e
echo echo
@@ -373,6 +383,9 @@ script:
if [ "$TRAVIS_PHP_VERSION" = "8.3" ]; then 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 .; 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 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 set +e
echo echo
@@ -391,6 +404,9 @@ script:
if [ "$TRAVIS_PHP_VERSION" = "8.3" ]; then 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 . var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php .
fi 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 set +e
echo 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 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 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 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 set +e
echo 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 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) 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 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 TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
bacon, dasprid, swiss-qr-bill, kmukku, symfony/validator bacon, dasprid, swiss-qr-bill, kmukku, symfony/validator

241
ChangeLog
View File

@@ -2,6 +2,222 @@
English Dolibarr ChangeLog English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 21.0.0 compared to 20.0 *****
For users:
----------
NEW: NEW Module - help to setup OpenID Connect (#30317)
NEW: Module AI moved from experimental to stable
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). It 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 the same purpose.
* The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it (the function has no effect since a long time).
* The trigger code CATEGORY_LINK and CATEGORY_UNLINK have 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.4 compared to 20.0.3 ***** ***** ChangeLog for 20.0.4 compared to 20.0.3 *****
FIX: $this->origin_object can not be instance of CommandeFournisseur if it is already an instanceof CommonObject FIX: $this->origin_object can not be instance of CommandeFournisseur if it is already an instanceof CommonObject
FIX: 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237 FIX: 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237
@@ -169,7 +385,7 @@ FIX: wrong trigger name (MODIFY instead UPDATE)
FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713) 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: 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: #25853 Thirdparty Massaction (#25868)
FIX: #28505 Blank page from thirparty to projects (#31637) FIX: #28505 Blank page from third party to projects (#31637)
FIX: #30432 make thirdparty code_client and code_compta modifiable via API (#31668) FIX: #30432 make thirdparty code_client and code_compta modifiable via API (#31668)
FIX: #31015 FIX: #31015
FIX: #31360 delete contact when using pgsql. FIX: #31360 delete contact when using pgsql.
@@ -273,7 +489,6 @@ FIX: when qty is not an integer, apply price() (#31138)
FIX: Wrong price for BOM with workstation (#31142) FIX: Wrong price for BOM with workstation (#31142)
FIX: determine multi-currency price on object line create tpl (#28021) FIX: determine multi-currency price on object line create tpl (#28021)
***** ChangeLog for 20.0.0 compared to 19.0 ***** ***** ChangeLog for 20.0.0 compared to 19.0 *****
For users: For users:
@@ -411,7 +626,7 @@ NEW: Module Website: Can link/unlink translation between web pages
NEW: Move dir of cache for widgets NEW: Move dir of cache for widgets
NEW: multiselect with checkbox in categories/tags search for thirdparty list (#28335) NEW: multiselect with checkbox in categories/tags search for thirdparty list (#28335)
NEW: new consts to redirect from massaction createbills (#29436) NEW: new consts to redirect from massaction createbills (#29436)
NEW: new global string to preselect yes for one bill per thirdparty 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: notification action triggers for cancelling orders and invoices
NEW: now button when editing an event NEW: now button when editing an event
NEW: online signature of shipments (#29559) NEW: online signature of shipments (#29559)
@@ -527,7 +742,6 @@ QUAL: professional identifiers - remove TODO by adding profid.lib.php
QUAL: Properties ->date_update and ->date_modification were merged QUAL: Properties ->date_update and ->date_modification were merged
QUAL: removed duplicate language file QUAL: removed duplicate language file
QUAL: Remove the external js library jstimezonedetect 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 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: Rename column fk_origin_line on shipment lines into fk_elementdet to match a generic use. (#28989)
QUAL: replace $conf->global with getDolGlobalString() QUAL: replace $conf->global with getDolGlobalString()
@@ -548,6 +762,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 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. * 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 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. * 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. * 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']. * dolibarrtriggers class VERSION_XXX constants have been deprecated. Please use array dictionary VERSIONS['XXX'].
@@ -566,7 +781,7 @@ 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 * 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 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. 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() * The signature of method fetch() of class CompanyBankAccount has been modified to match the signature of method Account->fetch()
@@ -2153,7 +2368,7 @@ NEW: Add link to create an element from the category page
NEW: add margin infos to takepos invoice lines NEW: add margin infos to takepos invoice lines
NEW: Add max size send for "backup and link to mail" option NEW: Add max size send for "backup and link to mail" option
NEW: Add method httponly_accessforbidden() 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 new global variable for keeping the previous signature information on proposal (case of reopening a proposal)
NEW: Add objectLink on shipment NEW: Add objectLink on shipment
NEW: Add option --force on CLI cron_run_jobs.php NEW: Add option --force on CLI cron_run_jobs.php
@@ -3571,8 +3786,8 @@ NEW: add option in Workflow module to set a shipment as closed
for Admins for Admins
NEW: Add a security center page with all information and advices related to the security 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 advices related to the performance of your instance NEW: Add a performance center page with all information and advice related to the performance of your instance
Modules Modules
NEW: Module Recruitment is now stable NEW: Module Recruitment is now stable
@@ -3734,7 +3949,7 @@ FIX: fix checkbox displayed according to module project setup parameters - work
FIX: inconsistency in margin recording with option "Force to sale price" FIX: inconsistency in margin recording with option "Force to sale price"
FIX: invoice PDF generation after payment FIX: invoice PDF generation after payment
FIX: mask selector fournisseur if module not activate FIX: mask selector fournisseur if module not activate
FIX: merge thirdparty 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 extrafields into export of agenda record
FIX: missing parameter in select for POP FIX: missing parameter in select for POP
FIX: missing return edit if update error FIX: missing return edit if update error
@@ -7590,7 +7805,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 phpunit to check the engine is defined into sql create files.
NEW: Add project and Hook to Loan NEW: Add project and Hook to Loan
NEW: Add REST API to push a file. 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: 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: data files are now also parsed by phpunit for sql syntax
NEW: Hook to allow inserting custom product head #6001 NEW: Hook to allow inserting custom product head #6001
@@ -8614,7 +8829,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 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 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: 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: Translate extrafield's labels.
NEW: Use new select2 component for juridical status, country and state selection. 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. 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.
@@ -9213,7 +9428,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: [ 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 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: 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: Title of page project contains project ref and label
NEW: update skeleton and class builder NEW: update skeleton and class builder
NEW: Use new select2 component for juridical status, country and state selection. NEW: Use new select2 component for juridical status, country and state selection.
@@ -10364,7 +10579,7 @@ For users:
prices, radio). prices, radio).
- New: [ task #798 ] Add range limit date on product/services as it is done on order - New: [ task #798 ] Add range limit date on product/services as it is done on order
and invoice. 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 #770 ] Add ODT document generation for Projects module.
- New: [ task #741 ] Add intervention box. - New: [ task #741 ] Add intervention box.
- New: [ task #826 ] Optional increase stock when deleting an invoice already validated. - New: [ task #826 ] Optional increase stock when deleting an invoice already validated.

View File

@@ -1,6 +1,7 @@
# DOLIBARR ERP & CRM # DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![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/) [![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) [![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) [![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) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENCE ## LICENCE
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure. Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
## INSTALLER DOLIBARR ## 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: 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/). 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. 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 - Suivez les instructions de l'installateur
## METTRE A JOUR DOLIBARR ## METTRE A JOUR DOLIBARR
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: 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/* Note: *Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
## CE QUI EST NOUVEAU ## CE QUI EST NOUVEAU
Voir le fichier [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog). Voir le fichier [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog).
## CE QUE DOLIBARR PEUT FAIRE ## CE QUE DOLIBARR PEUT FAIRE
### Modules principaux (tous optionnels) ### 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). 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 ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
Voici un liste de fonctionnalités pas encore gérées par Dolibarr: 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 n'embarque pas de Webmail intégré nativement.
- Dolibarr ne fait pas le café (pas encore). - Dolibarr ne fait pas le café (pas encore).
## DOCUMENTATION ## 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). 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 ## CONTRIBUER
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. 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) [![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](https://github.com/Dolibarr/dolibarr/graphs/contributors)
## CREDITS ## CREDITS
Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs. 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) Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
## ACTUALITES ET RESEAUX SOCIAUX ## ACTUALITES ET RESEAUX SOCIAUX
Suivez le projet Dolibarr sur les réseaux francophones Suivez le projet Dolibarr sur les réseaux francophones

View File

@@ -1,11 +1,12 @@
# DOLIBARR ERP & CRM # DOLIBARR ERP & CRM
![Downloads per day](https://img.shields.io/sourceforge/dw/dolibarr.svg) ![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/) [![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) [![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) [![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. 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) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg)
## LICENSE ## 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+). 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. Other licenses apply for some included dependencies. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) for a full list.
## INSTALLING ## 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: 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)) - [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) - [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
- DoliRpm for Red Hat, Fedora, OpenSuse, Mandriva or Mageia - 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/). 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. 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
- Verify that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases). - 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 - 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. 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 ## 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! 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. - 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*").  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 ## WHAT'S NEW
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
## FEATURES ## FEATURES
### Main application/modules (all optional) ### 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). 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 ## WHAT DOLIBARR CAN'T DO YET
These are features that Dolibarr does **not** yet fully support: 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. - Native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
- Dolibarr can't do coffee (yet) - Dolibarr can't do coffee (yet)
## DOCUMENTATION ## DOCUMENTATION
Administrator, user, developer and translator's documentation are available along with other community resources in the [Wiki](https://wiki.dolibarr.org). Administrator, user, developer and translator's documentation are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
## CONTRIBUTING ## CONTRIBUTING
This project exists thanks to all the people who contribute. 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) [![Dolibarr](https://opencollective.com/dolibarr/contributors.svg?width=890&button=false)](https://github.com/Dolibarr/dolibarr/graphs/contributors)
## CREDITS ## CREDITS
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries. 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. See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
## NEWS AND SOCIAL NETWORKS ## NEWS AND SOCIAL NETWORKS
Follow Dolibarr project on: Follow Dolibarr project on:
@@ -250,6 +265,7 @@ Follow Dolibarr project on:
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM) - [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr) - [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)] 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 # 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 ## 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: 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 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. - 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. 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. 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: 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_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) export MYSQL_ROOT_PWD=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13; echo)
docker-compose up -d 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" version: "3"
services: services:
mariadb: mariadb-prod:
container_name: dolibarr-mariadb-dev container_name: dolibarr-mariadb-prod
image: mariadb:latest image: mariadb:latest
environment: environment:
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PWD MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PWD
MYSQL_DATABASE: "dolibarr-prod" MYSQL_DATABASE: "dolibarr-prod"
web: web:
container_name: dolibarr-web-dev container_name: dolibarr-web-prod
build: . build: .
volumes: volumes:
@@ -27,12 +17,12 @@ services:
- ../../documents:/var/www/html/documents - ../../documents:/var/www/html/documents
depends_on: depends_on:
- mariadb - mariadb-prod
environment: environment:
WWW_USER_ID: 1000 HOST_USER_ID: $HOST_USER_ID
WWW_GROUP_ID: 1000 HOST_GROUP_ID: $HOST_GROUP_ID
DOLI_ROOT_PASSWORD: $MYSQL_ROOT_PWD DOLI_ROOT_PASSWORD: $MYSQL_ROOT_PWD
DOLI_DATABASE: "dolibarr-prod" DOLI_DATABASE: "dolibarr-prod"
DOLI_DB_SERVER: "mariadb" DOLI_DB_SERVER: "mariadb-prod"
ports: ports:
- "8080:80" - "8080:80"

View File

@@ -2,18 +2,26 @@
# Script used by the Dockerfile. # Script used by the Dockerfile.
# See README.md to know how to create a Dolibarr env with docker # 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 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 chgrp -hR www-data /var/www/html
chmod g+rwx /var/www/html/conf chmod g+rwx /var/www/html/conf
if [ ! -d /var/documents ]; then if [ ! -d /var/www/documents ]; then
echo "[docker-run] => create volume directory /var/documents ..." echo "[docker-run] => create volume directory /var/www/documents ..."
mkdir -p /var/documents mkdir -p /var/www/documents
fi fi
echo "[docker-run] => Set Permission to www-data for /var/documents" echo "[docker-run] => Set Permission to www-data for /var/www/documents"
chown -R www-data:www-data /var/documents chown -R www-data:www-data /var/www/documents
echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'" echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'"
cat <<EOF > "${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"> <ul class="tools">
<li><a target="_blank" href="index.php?phpinfo=1">Phpinfo</a></li> <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="server-status">Server-status</a></li>
<li><a target="_blank" href="/dolibarr/support/index.php">{$langues[$langue]['askhelp']}</a></li>
</ul> </ul>
<ul id="foot"> <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> </ul>
</body> </body>
</html> </html>

View File

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

View File

@@ -508,6 +508,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/doxygen/doxygen_warnings.log`; $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/cache.manifest`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;

View File

@@ -45,8 +45,7 @@ Prerequisites to build autoexe DoliWamp package from Windows:
***** Actions to do a BETA ***** ***** Actions to do a BETA *****
This files describe steps made by Dolibarr packaging team to make a This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step.
beta version of Dolibarr, step by step.
- Check all files are committed. - Check all files are committed.
- Update version/info in ChangeLog, for this you can: - Update version/info in ChangeLog, for this you can:
@@ -58,20 +57,17 @@ Recopy the content of the output file into the file ChangeLog.
- Update version number with x.y.z-w in file htdocs/filefunc.inc.php - Update version number with x.y.z-w in file htdocs/filefunc.inc.php
- Commit all changes. - Commit all changes.
- Run makepack-dolibarr.pl to generate all packages. - Run makepack-dolibarr.pl to check the generation of all packages. No need to publish them.
- Create a branch (x.y), if version seems stable enough. - Post a news on dolibarr.org/dolibarr.fr + social networks about the freeze
- Move build files into www.dolibarr.org web site - Create a branch x.y (but only when version seems stable enough).
(/home/dolibarr/wwwroot/files/lastbuild).
- Post a news on dolibarr.org/dolibarr.fr + social networks
***** Actions to do a RELEASE ***** ***** Actions to do a RELEASE *****
This files describe steps made by Dolibarr packaging team to make a This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step.
complete release of Dolibarr, step by step. We suppose the branch x.y has already been created during the beta (see previous step).
- Check all files are committed. - Check all files are committed.
- Update version/info in ChangeLog, for this you can: - Update version/info in ChangeLog, for this you can:
@@ -87,11 +83,7 @@ Recopy the content of the output file into the file ChangeLog.
- Check content of built packages. - Check content of built packages.
- Run makepack-dolibarr.pl again with option to publish files on - Run makepack-dolibarr.pl again with option to publish files on dolibarr foundation server (Dir /home/dolibarr/wwwroot/files/stable on www.dolibarr.org).
dolibarr foundation server (Dir /home/dolibarr/wwwroot/files/stable on www.dolibarr.org). - Run makepack-dolibarr.pl again with option to publish files on sourceforge. This will also add official tag.
- Run makepack-dolibarr.pl again with option to publish files on
sourceforge. This will also add official tag.
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
on server to point to new files (used by some web sites).
- Post a news on dolibarr.org/dolibarr.fr + social networks - Post a news on dolibarr.org/dolibarr.fr + social networks

View File

@@ -1,4 +1,19 @@
<?php <?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. // 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'); //define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
@@ -16,5 +31,15 @@ if (!defined("NOHTTPSREDIRECT")) {
define("NOHTTPSREDIRECT", '1'); 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'; include_once __DIR__ . '/../../htdocs/main.inc.php';

View File

@@ -1,4 +1,19 @@
<?php <?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 // Load the main.inc.php file to have functions env defined
if (!defined("NOLOGIN")) { 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. // 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_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
define('DOL_DATA_ROOT', __DIR__ . '/../../documents'); define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
define('DOL_URL_ROOT', '/'); define('DOL_URL_ROOT', '/');
define('DOL_MAIN_URL_ROOT', '/'); define('DOL_MAIN_URL_ROOT', '/');
define('MAIN_DB_PREFIX', 'llx_'); 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'; // 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 to
* @public * @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: * Replace in tcpdf.php:
$preserve = array( $preserve = array(
'file_id', 'file_id',
'internal_encoding',
'state', 'state',
'bufferlen', 'bufferlen',
'buffer', 'buffer',
@@ -138,7 +123,6 @@ with
with with
$preserve = array( $preserve = array(
'file_id', 'file_id',
'internal_encoding',
'state', 'state',
'bufferlen', 'bufferlen',
'buffer', 'buffer',
@@ -147,16 +131,16 @@ with
'imagekeys', 'imagekeys',
* Replace in tcpdf.php: * Replace in tcpdf.php:
if (!@TCPDF_STATIC::file_exists($file)) { if (!@this->fileExists($file)) {
return false; return false;
} }
with 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. // 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; //return false;
$tfile = str_replace(' ', '%20', $file); $tfile = str_replace(' ', '%20', $file);
if (@TCPDF_STATIC::file_exists($tfile)) { if (@this->fileExists($tfile)) {
$file = $tfile; $file = $tfile;
} }
} }
@@ -191,7 +175,7 @@ with
} }
elseif (strpos($filename, '://') === false) 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); define('QR_FIND_FROM_RANDOM', 2);
with with
define('QR_FIND_FROM_RANDOM', false); 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 = 'courier';
+ protected $default_monospaced_font = 'freemono'; + 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 * Add this at begin of tcpdf_autoconfig.php
// @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver // @CHANGE LDR DOCUMENT_ROOT fix for IIS Webserver
@@ -384,7 +355,9 @@ PHP PARSEDOWN
PHP OAUTH 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" // 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'; 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: JS JSGANTT:
----------- -----------

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,7 +4,7 @@
"description": "An app for connecting Dolibarr to the Zapier platform.", "description": "An app for connecting Dolibarr to the Zapier platform.",
"repository": "Dolibarr/dolibarr", "repository": "Dolibarr/dolibarr",
"homepage": "https://www.dolibarr.org/", "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", "license": "BSD-3-Clause",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -104,7 +105,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit; exit;
} }
$user->getrights(); $user->loadRights();
$socids = array(); $socids = array();

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,6 +2,7 @@
<?php <?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -83,7 +84,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit; exit;
} }
$user->getrights(); $user->loadRights();
// Ask confirmation // Ask confirmation
if (! $confirmed) { if (! $confirmed) {

View File

@@ -2,6 +2,7 @@
<?php <?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -83,7 +84,7 @@ if (! $ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit; exit;
} }
$user->getrights(); $user->loadRights();
// Ask confirmation // Ask confirmation
if (! $confirmed) { 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"; print 'A user with login "admin" and all permissions must be created to use this script.'."\n";
exit; exit;
} }
$user->getrights(); $user->loadRights();
// Ask confirmation // Ask confirmation
if (! $confirmed) { if (! $confirmed) {

View File

@@ -2,6 +2,7 @@
<?php <?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es> * 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
@@ -225,13 +226,12 @@ if (!empty($argv[4])) {
$user=new User($db); $user=new User($db);
} }
//var_dump($user->db->database_name);
$ret=$user->fetch('', 'admin'); $ret=$user->fetch('', 'admin');
if (! $ret > 0) { if (! $ret > 0) {
print 'An admin user with login "admin" must exists to use this script.'."\n"; print 'An admin user with login "admin" must exists to use this script.'."\n";
exit; exit;
} }
//$user->getrights(); //$user->loadRights();
print "Purge all data for this database:\n"; 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. 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. then run `./initdemo.sh` to launch the Graphical User Interface.
After loading the demo files, the admin login may be one of the following: After loading the demo files, the admin login may be one of the following:

View File

@@ -51,6 +51,13 @@ then
fi 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 no params on command line
if [ "$passwd" = "" ] if [ "$passwd" = "" ]
then then
@@ -179,17 +186,19 @@ fi
if [ "$passwd" != "" ] if [ "$passwd" != "" ]
then then
export passwd="-p$passwd" export passwd="-p$passwd"
export passwdshown="-p*****"
fi fi
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" #echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile #mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
#echo "drop old table" #echo "drop old table"
echo "drop table"
echo "drop table if exists llx_accounting_account;" | mysql "-P$port" "-u$admin" "$passwd" "$base" 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" mysql "-P$port" "-u$admin" "$passwd" "$base" < "$mydir/$dumpfile"
export res=$? export res=$?
if [ $res -ne 0 ]; then 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 exit
fi fi

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,16 +1,16 @@
JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE 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 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 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 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 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 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 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 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 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 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 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 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 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 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 * 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 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 * 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 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 - 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/ 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.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html
https://www.europeanpaymentscouncil.eu/about-sepa 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 https://docs.oracle.com/cd/E39124_01/doc.91/e60210/fields_sepa_pay_file_appx.htm#EOAEL00515
To validate a SEPA file: To validate a SEPA file:
xmllint --schema pain.001.001.03.xsd T200801.xml --noout xmllint --schema pain.001.001.03.xsd T200801.xml --noout
To test a SEPA file: To test a SEPA file:
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa 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=${DB:=mariadb}
DB_ROOT=${DB_ROOT:=root} 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_CACHE_FILE="${TRAVIS_BUILD_DIR}/db_init.sql"
DB_PREFIX="llx21_"
TRAVIS_DOC_ROOT_PHP="${TRAVIS_DOC_ROOT_PHP:=$TRAVIS_BUILD_DIR/htdocs}" TRAVIS_DOC_ROOT_PHP="${TRAVIS_DOC_ROOT_PHP:=$TRAVIS_BUILD_DIR/htdocs}"
TRAVIS_DATA_ROOT_PHP="${TRAVIS_DATA_ROOT_PHP:=$TRAVIS_BUILD_DIR/documents}" 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 else
SUDO="sudo" SUDO="sudo"
fi fi
CONF_FILE=${CONF_FILE:=${TRAVIS_BUILD_DIR}/htdocs/conf/conf.php} CONF_FILE=${CONF_FILE:=${TRAVIS_BUILD_DIR}/htdocs/conf/conf.php}
function save_db_cache() ( function save_db_cache() (
set -x
rm "${DB_CACHE_FILE}".md5 2>/dev/null rm "${DB_CACHE_FILE}".md5 2>/dev/null
echo "Saving DB to cache file '${DB_CACHE_FILE}'" 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 \ --hex-blob --lock-tables=false --skip-add-locks \
| sed -e 's/DEFINER=[^ ]* / /' > ${DB_CACHE_FILE} | sed -e 's/DEFINER=[^ ]* / /' > ${DB_CACHE_FILE}
echo "${sum}" > "${DB_CACHE_FILE}".md5 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 if [ -r "${CONF_FILE}" ] ; then
echo "'${CONF_FILE} exists, not overwriting!" echo "'${CONF_FILE} exists, not overwriting!"
@@ -56,8 +63,8 @@ else
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo '$'dolibarr_main_db_type=\'mysqli\'';' echo '$'dolibarr_main_db_type=\'mysqli\'';'
echo '$'dolibarr_main_db_port=3306';' echo '$'dolibarr_main_db_port=3306';'
echo '$'dolibarr_main_db_user=\'travis\'';' echo '$'"dolibarr_main_db_user='${DB_USER}'"';'
echo '$'dolibarr_main_db_pass=\'password\'';' echo '$'"dolibarr_main_db_pass='${DB_PASS}'"';'
fi fi
if [ "$DB" = 'postgresql' ]; then if [ "$DB" = 'postgresql' ]; then
echo '$'dolibarr_main_db_type=\'pgsql\'';' echo '$'dolibarr_main_db_type=\'pgsql\'';'
@@ -65,12 +72,20 @@ else
echo '$'dolibarr_main_db_user=\'postgres\'';' echo '$'dolibarr_main_db_user=\'postgres\'';'
echo '$'dolibarr_main_db_pass=\'postgres\'';' echo '$'dolibarr_main_db_pass=\'postgres\'';'
fi fi
if [ "${DB_PREFIX}" != '' ]; then
echo '$'"dolibarr_main_db_prefix='${DB_PREFIX}'"';'
fi
echo '$'dolibarr_main_authentication=\'dolibarr\'';' echo '$'dolibarr_main_authentication=\'dolibarr\'';'
echo '$'force_install_createuser=true';'
echo '$'"dolibarr_main_db_collation='utf8_unicode_ci'"';'
} > "$CONF_FILE" } > "$CONF_FILE"
cat $CONF_FILE cat $CONF_FILE
echo echo
fi fi
# From here on, the DB_PREFIX can not be empty, set default value if empty
DB_PREFIX="${DB_PREFIX:=llx_}"
load_cache=0 load_cache=0
echo "Setting up database '$DB'" echo "Setting up database '$DB'"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
@@ -81,59 +96,63 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
${SUDO} mysqld_safe --skip-grant-tables --socket=/tmp/aaa & ${SUDO} mysqld_safe --skip-grant-tables --socket=/tmp/aaa &
sleep 3 sleep 3
${SUDO} ps fauxww ${SUDO} ps fauxww
if [ "${DB_PASS}" = "" ] ; then if [ "${DB_PASSROOT}" = "" ] ; then
PASS_OPT="-password=" ROOTPASS_OPT="-u ${DB_ROOT}"
PASS_OPT=""
else else
PASS_OPT="'-password=${DB_PASS}'" ROOTPASS_OPT="-u ${DB_ROOT} --password='${DB_PASSROOT}'"
fi fi
USERPASS_OPT="-u ${DB_USER} --password=\"${DB_PASS}\""
echo "MySQL set root password" echo "MySQL set root password"
if [ 1 = 1 ] ; then if [ 1 = 1 ] ; then
CMDS=( \ CMDS=( \
"" ""
"FLUSH PRIVILEGES; DROP DATABASE travis; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';" "FLUSH PRIVILEGES; DROP DATABASE travis; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';"
"CREATE USER 'root'@'localhost' IDENTIFIED BY '$DB_PASS';" "CREATE USER '${DB_ROOT}'@'localhost' IDENTIFIED BY '${DB_PASSROOT}';"
"CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY '$DB_PASS';" "CREATE USER '${DB_ROOT}'@'127.0.0.1' IDENTIFIED BY '${DB_PASSROOT}';"
"CREATE USER 'travis'@'localhost' IDENTIFIED BY 'password';" "CREATE USER '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASS}';"
"CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';" "CREATE USER '${DB_USER}'@'127.0.0.1' IDENTIFIED BY '${DB_PASS}';"
"GRANT ALL PRIVILEGES ON travis.* TO root@localhost;" "GRANT ALL PRIVILEGES ON travis.* TO ${DB_ROOT}@localhost;"
"GRANT ALL PRIVILEGES ON travis.* TO root@127.0.0.1;" "GRANT ALL PRIVILEGES ON travis.* TO ${DB_ROOT}@127.0.0.1;"
"GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;" "GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@127.0.0.1;"
"GRANT ALL PRIVILEGES ON travis.* TO travis@localhost;" "GRANT ALL PRIVILEGES ON travis.* TO ${DB_USER}@localhost;"
"FLUSH PRIVILEGES;" "FLUSH PRIVILEGES;"
) )
# Local, not changing root # Local, not changing root
for CMD in "${CMDS[@]}" ; do 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 done
else else
DB_ROOT='root' DB_ROOT='root'
DB_PASS='password' DB_PASSROOT='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;" 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 fi
echo "MySQL grant" 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}" ${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}" -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}@localhost; FLUSH PRIVILEGES;"
echo "MySQL list current users" 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" 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 kill `cat /var/lib/mysqld/mysqld.pid`
#sudo systemctl start mariadb #sudo systemctl start mariadb
echo "MySQL grant" 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" 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;'
# shellcheck disable=2046
# Compute md5 based on install file contents, and on db prefix
# filefunc.inc.php holds the version, so include it" # filefunc.inc.php holds the version, so include it"
# shellcheck disable=2046
sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum) sum=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f ; echo "${TRAVIS_BUILD_DIR}/filefunc.inc.php" ) | md5sum)
# shellcheck disable=2046 # shellcheck disable=2046
cnt=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc) cnt=$(md5sum $(find "${TRAVIS_BUILD_DIR}/htdocs/install" -type f) | wc)
echo "NEWSUM $sum COUNT:$cnt" echo "MD5SUM $sum COUNT:$cnt"
load_cache=0 load_cache=0
if [ -r "$DB_CACHE_FILE".md5 ] && [ -r "$DB_CACHE_FILE" ] && [ -x "$(which "${MYSQLDUMP}")" ] ; then if [ -r "$DB_CACHE_FILE".md5 ] && [ -r "$DB_CACHE_FILE" ] && [ -x "$(which "${MYSQLDUMP}")" ] ; then
cache_sum="$(<"$DB_CACHE_FILE".md5)" cache_sum="$(<"$DB_CACHE_FILE".md5)"
@@ -142,10 +161,10 @@ if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; the
if [ "$load_cache" = "1" ] ; then if [ "$load_cache" = "1" ] ; then
echo "MySQL load cached sql" 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 else
echo "MySQL load initial sql" 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 fi
elif [ "$DB" = 'postgresql' ]; then elif [ "$DB" = 'postgresql' ]; then
echo Install pgsql if run is for pgsql echo Install pgsql if run is for pgsql
@@ -188,9 +207,13 @@ set +e
fi fi
echo '$'force_install_dbserver=\'127.0.0.1\'';' echo '$'force_install_dbserver=\'127.0.0.1\'';'
echo '$'force_install_database=\'travis\'';' echo '$'force_install_database=\'travis\'';'
echo '$'force_install_databaselogin=\'travis\'';' echo '$'"force_install_databaselogin='${DB_USER}'"';'
echo '$'force_install_databasepass=\'\'';' echo '$'"force_install_databasepass='${DB_PASS}'"';'
echo '$'force_install_prefix=\'llx_\'';' if [ "${DB_PREFIX}" != '' ] ; then
echo '$'"force_install_prefix='${DB_PREFIX}'"';'
fi
#echo '$'"force_install_dolibarrlogin='admin'"';'
#echo '$'force_install_createuser=true';'
} > "$INSTALL_FORCED_FILE" } > "$INSTALL_FORCED_FILE"
if [ "$load_cache" != "1" ] ; then if [ "$load_cache" != "1" ] ; then
@@ -239,8 +262,16 @@ if [ "$load_cache" != "1" ] ; then
pVer="$v" pVer="$v"
done 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 "${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.\ 1. Install pre-commit tool.\
If you do not have python installed, install [python](https://www.python.org) first.\ 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` `python3 -m pip install pre-commit`
2. In your local git clone of the project, run `pre-commit install` to add the hooks 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 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 ```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 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: Note:
Code for precommits are saved into: 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 // PHPSTAN setup
$PHPSTANLEVEL = 4; $PHPSTANLEVEL = 9;
// PHAN setup. Configuration is required, otherwise phan is disabled. // PHAN setup. Configuration is required, otherwise phan is disabled.
$PHAN_CONFIG = "{$path}phan/config_extended.php"; $PHAN_CONFIG = "{$path}phan/config_extended.php";
@@ -149,7 +149,7 @@ $phpstanversion = $output_arrtd[0];
$output_arrtd = array(); $output_arrtd = array();
if ($dirphpstan != 'disabled') { 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"; print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n";
$resexectd = 0; $resexectd = 0;
exec($commandcheck, $output_arrtd, $resexectd); exec($commandcheck, $output_arrtd, $resexectd);
@@ -745,7 +745,7 @@ $html .= '<div class="boxallwidth">'."\n";
$html .= <<<END $html .= <<<END
<center><br>Thumbs of most active contributors<br> <center><br>Thumbs of most active contributors<br>
<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> </center>
<br> <br>
END; END;
@@ -883,7 +883,7 @@ $html .= '<h2><span class="fas fa-code pictofixedwidth"></span>'.$title_security
$html .= '<div class="boxallwidth">'."\n"; $html .= '<div class="boxallwidth">'."\n";
$html .= '<div class="div-table-responsive">'."\n"; $html .= '<div class="div-table-responsive">'."\n";
$html .= '<table class="list_technical_debt centpercent">'."\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) { foreach ($arrayofalerts as $key => $alert) {
$cve = ''; $cve = '';
$yogosha = empty($alert['issueidyogosha']) ? '' : $alert['issueidyogosha']; $yogosha = empty($alert['issueidyogosha']) ? '' : $alert['issueidyogosha'];

View File

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

View File

@@ -15,6 +15,8 @@ noe
udo udo
tim tim
ConfirmActionXxx
# Inside email # Inside email
ba ba
blacklist blacklist
@@ -71,7 +73,6 @@ unvalidate
# Some french strings # Some french strings
somme somme
caracteres
cas cas
sur sur
Datas Datas
@@ -84,3 +85,16 @@ fonction
espace espace
methode methode
datee datee
# Some string found because part of a text the is html entities escaped into file
tre
activ
# 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 $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"})) { 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->date_ech = $object->periode;
$object->periode = $object->date_ech;
$reponsesadd = str_split($obj->reponses); $reponsesadd = str_split($obj->reponses);
$sql .= " SET reponses = '".$db->escape($reponsesadd)."'"; $sql .= " SET reponses = '".$db->escape($reponsesadd)."'";
$sql .= " SET reponses = '0".$db->escape($obj->reponses)."'"; $sql .= " SET reponses = '0".$db->escape($obj->reponses)."'";
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0); $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>'; //$pice = '<i class="fas fa-briefcase inline-block"></i>';
//$typea = ($objp->typea == 'birth') ? $picb : $pice; //$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).'">'; 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).'">';
$date = $overview[0]->udate;
$dateb = $this->db->jdate($data[$j]->datea);
$dateemail = dol_stringtotime((string) $overview[0]->udate, 'gmt'); $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>'; $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; $typea = ($data[$j]->typea == 'birth') ? $picb : $pice;
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
GETPOSTINT("mouvement"), 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); 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").removeAttr("selected").change();
jQuery("#mouvement option[value=0]").attr("selected","selected").trigger("change"); jQuery("#mouvement option[value=0]").attr("selected","selected").trigger("change");
jQuery("#mouvement option[value=1]").attr("selected","selected").trigger("change"); jQuery("#mouvement option[value=1]").attr("selected","selected").trigger("change");
jQuery("#mouvement").trigger("change"); jQuery("#mouvement").trigger("change");
print '<td colspan="'.(6 + count($TWeek)).'">';
$TFirstDay = getFirstDayOfEachWeek($TWeek, date('Y', $firstdaytoshow));
$TFirstDay[reset($TWeek)] = 1;
$action = 'transfert'; $action = 'transfert';
$addform .= '<input type="hidden" name="dateerfc" value="'.dol_print_date($datee, 'dayhourrfc').'">'; $date_liv = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$newfiletmp = preg_replace('/\.od(s|t)/i', '', $newfile); $newfiletmp = preg_replace('/\.od(s|t)/i', '', $newfile);
$newfiletmp = preg_replace('/\.od[ts]/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->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); $this->periode = $this->db->jdate($obj->period);
$tmp = array('id_users' => $obj->id_users, 'nom' => $obj->name, 'reponses' => $obj->reponses); $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 //si les reponses ne concerne pas la colonne effacée, on concatenate
GETPOST("mouvement", 'alpha'), GETPOST("mouvement", 'alpha'),
GETPOSTINT("mouvement"), 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"); 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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=transfert&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
print '<td class="center">'.dol_print_date($link->datea, "dayhour", "tzuser").'</td>';
$action = 'transfert'; $action = 'transfert';
$date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); $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 = (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); $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")); $datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
$ensemblereponses = $obj->reponses; $ensemblereponses = $obj->reponses;
$field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field $field = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:).*$/', '', $tmpcrit); // the name of the field
$newcrit = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '', $tmpcrit); $newcrit = preg_replace('/(:[!<>=\s]+:|:in:|:notin:|:like:|:notlike:)/', '', $tmpcrit);
$object->datee = $datee;
$object->periode = $dateperiod; $object->periode = $dateperiod;
$return .= '<br><span class="opacitymedium">'.$langs->trans("Payement").'</span> : <span class="info-box-label">'.$this->type_payment.'</span>'; $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 .= " '".$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, date_creation)';
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)';
$sql = 'SELECT s.reponses'; $sql = 'SELECT s.reponses';
$sql2 .= " SET reponses = '".$db->escape($newcar)."'"; $sql2 .= " SET reponses = '".$db->escape($newcar)."'";
$taskstatic->datee = $db->jdate($obj->date_end);
$this->category->childs = array(); $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 $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 // mise a jour des reponses utilisateurs dans la base
if (!empty($arrayfields['t.datee']['checked'])) {
if ($user->hasRight('stock', 'mouvement', 'lire')) { if ($user->hasRight('stock', 'mouvement', 'lire')) {
if (empty($reyear) || empty($remonth) || empty($reday)) { if (empty($reyear) || empty($remonth) || empty($reday)) {
jQuery("#mouvement").change(function() { jQuery("#mouvement").change(function() {
preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg); 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&token='.newToken().'">'.$langs->trans("TransferStock").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=transfert">'.$langs->trans("TransferStock").'</a>';
print '<span class="opacitymedium">'.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).'</span>'; 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 '<td class="center nowraponall">'.dol_print_date($db->jdate($obj->period), 'day').'</td>';
print '<tr><td>'.$langs->trans("AddIn").'</td><td>'; "sme",
print dol_print_date($object->periode, "day");
$TWeek[$week_number] = $week_number;
$action = 'transfert'; $action = 'transfert';
$cle_rib = strtolower(checkES($rib, $CCC)); $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 : (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')); $datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
$datesubscription = 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; $ensemblereponses = $obj->reponses;
$head[$h][1] = $langs->trans("Referers"); $head[$h][1] = $langs->trans("Referers");
$head[$tab][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"; $out .= "<b>".$langs->trans("Referer").":</b> ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."<br>\n";
$reday = GETPOSTINT('reday'); $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 .= " (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 .= " 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 .= ", '".$this->db->idate($this->period)."'";
$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 .= ", 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 .= ", 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 .= ", periode = '".$this->db->idate($this->period ? $this->period : $this->periode)."'";
$sql .= ", datee";
$sql .= ", periode='".$this->db->idate($this->periode)."'";
$sql = "INSERT INTO ".$this->db->prefix()."links (entity, datea, url, label, objecttype, objectid)";
$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 = "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, id_sondage, reponses";
$sql = "SELECT id_users, nom as name, 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 = "<IMG SRC=\"jav&#x0D;ascript:alert('XSS');\">"; // Same
$test = '/javas:cript/google.com'; $test = '/javas:cript/google.com';
$this->periode = $this->date_creation + 3600 * 24 * 30; $this->periode = $this->date_creation + 3600 * 24 * 30;
$title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers'); $title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers');
$title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers'); $title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers');
$title = $langs->transnoentities("Balance")." - ".$langs->transnoentities("AllTime"); $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['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 ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) {
if ($user->hasRight('stock', 'mouvement', 'creer')) { if ($user->hasRight('stock', 'mouvement', 'creer')) {
if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) { 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($reyear) || empty($remonth) || empty($reday)) {
if (empty($this->datea)) { * @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing.
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);
$datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("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")); $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"));
@@ -201,61 +98,34 @@
$head[$h][1] = $langs->trans('Referers'); $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', $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); $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']; $opensurveysondage->mail_admin = $_SESSION['adresse'];
$pdf->SetXY($savx, $savy); $pdf->SetXY($savx, $savy);
$projectstatic->datee = $db->jdate($obj->projectdatee);
$reday = GETPOST('reday'); $reday = GETPOST('reday');
$savy = $pdf->getY(); $savy = $pdf->getY();
$somethingshown = $formactions->showactions($object, 'mouvement', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product $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 .= " (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_end)."'";
$sql .= " AND cs.periode >= '".$db->idate($search_date_limit_start)."'"; $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 .= " 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 .= " 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 .= " 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.= " ".MAIN_DB_PREFIX."notify_def as nd,";
$sql.= " AND nd.fk_action = ad.rowid"; $sql.= " AND nd.fk_action = ad.rowid";
$sql.= " WHERE u.rowid = nd.fk_user"; $sql.= " WHERE u.rowid = nd.fk_user";
$sql.= " nd.rowid, ad.code, ad.label"; $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'); $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 $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), '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 // Ligne de la periode d'analyse du rapport
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire // 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> <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 ($action == "transfert") {
if ($object->id > 0 && $action == 'addin') {
if (GETPOST('reday')) { if (GETPOST('reday')) {
if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("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 '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">'; print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
print '<td class="left" width="25%">'.$langs->trans("Referers").'</td>'; 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 '<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 ajax_combobox("mouvement");
print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname,cs.periode", "", $param, 'class="left"', $sortfield, $sortorder); 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); 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.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.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['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 $childs = array();
public $datea;
public $datee;
public $periode; public $periode;
public function getSumOfAmount($fuser = '', $dates = '', $datee = '')
return $TWeek;
unset($_SESSION["adresse"]); unset($_SESSION["adresse"]);
- creat,unitl,alltime,datas,referers - creat,unitl,alltime,datas,referers
- informations,medias,uptodate,reenable,crypted,developpers - informations,medias,uptodate,reenable,crypted,developpers
- ned - ned
* @param array $TWeek array of week numbers * Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
* @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);
$permissiontoadd = $user->hasRight('stock', 'mouvement', 'creer'); $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 $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'); $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 .= " 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.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, cs.date_ech, cs.amount as total, cs.paye,"; $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 .= " 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 = "SELECT id_users, nom as name, id_sondage, reponses"; $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'; $sql = 'SELECT nom as name, reponses';
$title = $langs->trans("Referers", $object->name); $title = $langs->trans("Referers", $object->name);
$usercancreate = $user->hasRight('stock', 'mouvement', 'creer'); $usercancreate = $user->hasRight('stock', 'mouvement', 'creer');
@@ -326,33 +158,20 @@ $usercandelete = $user->hasRight('stock', 'mouvement', 'creer');
$usercandelete = (($user->hasRight('stock', 'mouvement', 'supprimer'))); $usercandelete = (($user->hasRight('stock', 'mouvement', 'supprimer')));
$usercanread = $user->hasRight('stock', 'mouvement', 'lire'); $usercanread = $user->hasRight('stock', 'mouvement', 'lire');
$usercanread = (($user->hasRight('stock', 'mouvement', 'lire'))); $usercanread = (($user->hasRight('stock', 'mouvement', 'lire')));
* The hook contaxt commcard has been renamed thirdpartycomm $usercanupdatestock = $user->hasRight('stock', 'mouvement', 'creer');
* The hook contaxt thirdpartycard has been renamed thirdpartycontact
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere. * 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 - Fix: [ bug #485 ] Configurated amount for public auto-subscription form is not taken into account
- New: Add proposals into referer page of thirdparty. - New: Add proposals into referer page of thirdparty.
AmountIn
NEW: ModuleBuilder: Checkin comments begin and end before each actions 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 ( 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 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 (!$user->hasRight('stock', 'mouvement', 'lire')) {
if (!empty($arrayfields['cs.periode']['checked'])) { if (!empty($arrayfields['cs.periode']['checked'])) {
if (!empty($arrayfields['p.datee']['checked'])) {
if (!empty($arrayfields['t.datee']['checked'])) {
if ($action == "transfert") { if ($action == "transfert") {
if (empty($datee) && !empty($dateerfc)) { // deprecated
print $langs->trans("Developpers").':'; 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 '<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 '); 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
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).'">'; $sql = "SELECT id_users, nom as name, id_sondage, reponses, tms, date_creation";
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; print OUT "\\c ". $1;
next; 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 if (/\);/i) { # end of create table sequence
$create_sql =~ s/,$//g; # strip last , inside create table $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) 2005-2011 James Grant <james@lightbox.org> Lightbox Technologies Inc.
* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net> * 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -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 ' // 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 // 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);
$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') // 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 // 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);
$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') // 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 // 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 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); // $after=str_replace(" (E'","' ('",$after);
@@ -497,7 +498,7 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
$reg2 = array(); $reg2 = array();
if (preg_match('/ALTER TABLE ([^\s]+)/', $pkey, $reg2)) { if (preg_match('/ALTER TABLE ([^\s]+)/', $pkey, $reg2)) {
if (empty($arrayofprimaryalreadyintabledef[$reg2[1]])) { 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); $output .= str_replace("\n", "", $pkey);
// the postgres and mysql syntax for this is (at least, in the example im looking at) // 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. // identical, so we can just add it as is.

View File

@@ -42,6 +42,32 @@ const PREFIXES = [
'php' => ['/* ', ' * ', ' */', '<?php'], '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 * Update or add copyright notice in a file
* *
@@ -70,18 +96,45 @@ function updateCopyrightNotice($filename, $fileType, $name, $email)
$n = 50; $n = 50;
$lines = implode('', array_slice(file($filename), 0, $n)); $lines = implode('', array_slice(file($filename), 0, $n));
// Define the regex pattern for matching copyright notices // Based on the tendency to limit the length of the spacing between the name
$pattern = "~(?:{$r_prefix0}|{$r_prefix1})Copyright \(C\)\s+(?:(?:\d{4}-)?(?<year>\d{4}))\s+{$r_name}\s*\<{$r_email}>~"; // 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 // Check if the lines match the pattern
$matches = array(); $matches = array();
if (preg_match($pattern, $lines, $matches)) { 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 // Check if the existing year is different from the current year
if ($existingYear !== date('Y')) { if ($existingYear !== date('Y')) {
// Update the year range to include or be up to the current year // Extend the year range to the current year
$updatedNotice = preg_replace('/(\d{4})(-\d{4})?\s+/', $existingYear . '-' . date('Y') . "\t", $matches[0]); $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 // Replace the old notice with the updated one in the file
file_put_contents($filename, preg_replace($pattern, $updatedNotice, file_get_contents($filename))); 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 // If the existing year is the same, no need to update
} else { } else {
// Adjust tabs for proper alignment // 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 // No match found, add a new line to the header
$newNotice = "Copyright (C) " . date('Y') . "\t\t" . $name . $emailTabs . "<" . $email . ">"; $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 // Write the updated content back to the file
file_put_contents($filename, $fileContent); file_put_contents($filename, $fileContent);
// print $fileContent;
return true; // Change detected return true; // Change detected
} }

View File

@@ -1,25 +1,64 @@
#!/bin/bash #!/bin/bash
# # Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
# Count number of commits per user and per versions (using date for version detection)
#
# shellcheck disable=1113,2002,2006,2086,2164,2219
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" 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" TEMP_DIR=/tmp/git
rm -fr /tmp/git DOL_GIT="$TEMP_DIR/dolibarr"
echo "Create and go into /tmp/git" if ! git rev-parse ; then
mkdir /tmp/git echo "Delete $TEMP_DIR"
cd /tmp/git rm -fr "$TEMP_DIR"
git clone https://github.com/Dolibarr/dolibarr.git 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 firstline=1
((counter = 0))
for i in "${Releases[@]}" for i in "${Releases[@]}"
do do
if [ $firstline -eq 1 ]; then if [ $firstline -eq 1 ]; then
@@ -31,21 +70,28 @@ do
echo "=== Version $i (counter $counter):" echo "=== Version $i (counter $counter):"
echo "Get common commit ID between origin/${Releases[counter]} and origin/${Releases[counter+1]}" 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]}" 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 "Found commitid=$commitidcommon"
echo "Checkout into version $i" echo "Checkout version $i"
git checkout $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 --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 #cat /tmp/github_commits_perversion.txt
echo "Total for version $i:" echo "Total for version $i:"
echo -n "- Nb of commits: " echo -n "- Nb of commits: "
git log $commitidcommon.. --pretty=oneline | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion2.txt git log "$commitidcommon.." --pretty=oneline | tr '[:lower:]' '[:upper:]' > /tmp/github_commits_perversion2.txt
cat /tmp/github_commits_perversion2.txt | wc -l wc -l < /tmp/github_commits_perversion2.txt
echo -n "- Nb of different authors: " echo -n "- Nb of different authors: "
awk ' { print $2 } ' < /tmp/github_commits_perversion.txt | sort -u | wc -l awk ' { print $2 } ' < /tmp/github_commits_perversion.txt | sort -u | wc -l
echo "=======================" echo "======================="
echo echo
let "counter +=1" ((counter++))
done 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 'htdocs/accountancy/admin/productaccount.php' => ['PhanTypeMismatchArgumentNullableInternal'], // false positive
'internal' => ['PhanUndeclaredConstant'], '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) // (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( array(
// Documented: // Documented:
'none', 'none',
'password',
'array', 'array',
'int', 'int',
'intcomma', 'intcomma',
@@ -22,24 +23,16 @@ $sanitizeRegex
'aZ09', 'aZ09',
'aZ09arobase', 'aZ09arobase',
'aZ09comma', 'aZ09comma',
'email',
'san_alpha', 'san_alpha',
'restricthtml', 'restricthtml',
'nohtml', 'nohtml',
'custom', 'custom',
// Not documented: // Not documented:
'email',
'restricthtmlallowclass', 'restricthtmlallowclass',
'restricthtmlallowunvalid', 'restricthtmlallowunvalid',
'restricthtmlnolink', 'restricthtmlnolink',
//'ascii', 'restricthtmlallowlinkscript'
//'categ_id',
//'chaine',
//'html',
//'boolean',
//'double',
//'float',
//'string',
) )
).')*$/'; ).')*$/';
@@ -137,7 +130,7 @@ $VALID_MODULE_MAPPING = array(
'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives) 'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives)
'notification' => 'Notification', 'notification' => 'Notification',
'numberwords' => null, // Not provided by default, no module tests 'numberwords' => null, // Not provided by default, no module tests
'oauth' => 'Oauth', 'oauth' => 'OAuth',
'openstreetmap' => null, // External module? 'openstreetmap' => null, // External module?
'opensurvey' => 'OpenSurvey', 'opensurvey' => 'OpenSurvey',
'order' => 'Commande', 'order' => 'Commande',
@@ -230,6 +223,7 @@ return [
'simplify_ast' => true, 'simplify_ast' => true,
'analyzed_file_extensions' => ['php','inc'], 'analyzed_file_extensions' => ['php','inc'],
'globals_type_map' => [ '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', 'action' => 'string',
'actioncode' => 'string', 'actioncode' => 'string',
'badgeStatus0' => 'string', 'badgeStatus0' => 'string',
@@ -265,18 +259,21 @@ return [
'filtert' => 'int', 'filtert' => 'int',
'forceall' => 'int<0,1>', 'forceall' => 'int<0,1>',
'form' => '\Form', 'form' => '\Form',
'formcompany' => '\FormCompany',
'hookmanager' => '\HookManager', 'hookmanager' => '\HookManager',
'inputalsopricewithtax' => 'int<0,1>', 'inputalsopricewithtax' => 'int<0,1>',
'langs' => '\Translate', 'langs' => '\Translate',
'leftmenu' => 'string', 'leftmenu' => 'string',
'linkedObjectBlock' => '\CommonObject[]', // See htdocs/core/class/html.form.class.php
'mainmenu' => 'string', 'mainmenu' => 'string',
'menumanager' => '\MenuManager', 'menumanager' => '\MenuManager',
'mysoc' => '\Societe', 'mysoc' => '?\Societe',
'nblines' => '\int', 'nblines' => '\int',
'obj' => '\CommonObject', // Deprecated
'object_rights' => 'int|stdClass',
'objectoffield' => '\CommonObject', 'objectoffield' => '\CommonObject',
'objsoc' => '\Societe',
'senderissupplier' => 'int<0,2>', 'senderissupplier' => 'int<0,2>',
'shmkeys' => 'array<string,int>', // memory.lib
'shmoffset' => 'int', // memory.lib
'user' => '\User', 'user' => '\User',
'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type 'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334 // Disable because Phan infers Website type
'websitepage' => '\WebSitePage', 'websitepage' => '\WebSitePage',
@@ -325,13 +322,16 @@ return [
//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', //'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
'exclude_file_regex' => '@^(' // @phpstan-ignore-line 'exclude_file_regex' => '@^(' // @phpstan-ignore-line
.'dummy' // @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/.*/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) // Included as stub (better analysis)
.'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line .'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line
// Included as stub (old version + incompatible typing hints) // Included as stub (old version + incompatible typing hints)
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line .'|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/includes/stripe/.*' // @phpstan-ignore-line
.'|htdocs/conf/conf.php' // @phpstan-ignore-line .'|htdocs/conf/conf.php' // @phpstan-ignore-line
// .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line // .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line
@@ -354,9 +354,9 @@ return [
'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"], '/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
'/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"], '/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"],
'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"], '/^\\\\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_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"], '/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"],
'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"], '/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"],
], ],
@@ -392,7 +392,7 @@ return [
'UnknownElementTypePlugin', 'UnknownElementTypePlugin',
'WhitespacePlugin', 'WhitespacePlugin',
//'RemoveDebugStatementPlugin', // Reports echo, print, ... //'RemoveDebugStatementPlugin', // Reports echo, print, ...
//'SimplifyExpressionPlugin', 'SimplifyExpressionPlugin',
//'StrictComparisonPlugin', // Expects === //'StrictComparisonPlugin', // Expects ===
'SuspiciousParamOrderPlugin', 'SuspiciousParamOrderPlugin',
'UnsafeCodePlugin', 'UnsafeCodePlugin',
@@ -421,13 +421,14 @@ return [
'PhanCompatibleNegativeStringOffset', // return false positive 'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is '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 // 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time 'PhanTypeArraySuspiciousNullable', // About 440 occurrences
'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time // 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty', '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 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
'PhanPluginShortArray', // Dolibarr uses array() 'PhanPluginShortArray', // Dolibarr uses array()
'PhanPluginShortArrayList', // Dolibarr uses array() 'PhanPluginShortArrayList', // Dolibarr uses array()
@@ -439,7 +440,7 @@ return [
'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences 'PhanTypeMismatchArgument', // Also reported by phpstan < lvl6 - 12300+ occurrences
'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
'PhanPluginDuplicateAdjacentStatement', 'PhanPluginDuplicateAdjacentStatement',
@@ -449,10 +450,11 @@ return [
'PhanPluginRedundantAssignment', // Not essential, useless 'PhanPluginRedundantAssignment', // Not essential, useless
'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences 'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
'PhanPluginUnknownArrayMethodParamType', // Too many troubles to manage. 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 into config_extended only. // 'PhanPluginUnknownArrayMethodReturnType', // Too many troubles to manage. Is enabled in config_extended only.
'PhanUndeclaredGlobalVariable', // Too many false positives on .tpl.php files. Is enabled into 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 into config_extended only. // '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. // You can put relative paths to internal stubs in this config option.
// Phan will continue using its detailed type annotations, // Phan will continue using its detailed type annotations,

View File

@@ -66,11 +66,12 @@ $config['suppress_issue_types'] = [
'PhanCompatibleNegativeStringOffset', // return false positive 'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is '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 // 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time 'PhanTypeArraySuspiciousNullable', // About 400 cases
'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time // 'PhanTypeInvalidDimOffset', // Helps identify missing array indexes in types or reference to unset indexes
'PhanTypeObjectUnsetDeclaredProperty', '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 used tabs
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
@@ -93,6 +94,10 @@ $config['suppress_issue_types'] = [
'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning 'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
'PhanPluginRedundantAssignment', // Not essential, useless 'PhanPluginRedundantAssignment', // Not essential, useless
'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences '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; return $config;

View File

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

View File

@@ -135,8 +135,16 @@ class ParamMatchVisitor extends PluginAwarePostAnalysisVisitor
{ {
$class_name = $node->children['class']->children['name'] ?? null; $class_name = $node->children['class']->children['name'] ?? null;
if (!\is_string($class_name)) { 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 { try {
$class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name); $class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name);
} catch (FQSENException $_) { } 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 <?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 // phpcs:disable PEAR.Commenting,Generic.NamingConventions,PEAR.NamingConventions,Squiz.Scope.MethodScope.Missing
@@ -3162,7 +3163,7 @@ namespace Luracast\Restler {
505 => 'HTTP Version Not Supported', 505 => 'HTTP Version Not Supported',
); );
/** /**
* @param string $httpStatusCode http status code * @param int $httpStatusCode http status code
* @param string|null $errorMessage error message * @param string|null $errorMessage error message
* @param array $details any extra detail about the exception * @param array $details any extra detail about the exception
* @param Exception $previous previous exception if any * @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__ . '/../../../scripts/',
__DIR__ . '/../../../test/phpunit/', __DIR__ . '/../../../test/phpunit/',
]); ]);
$rectorConfig->skip([ $rectorConfig->skip([
'**/includes/**', '**/includes/**',
'**/custom/**', '**/custom/**',
@@ -55,6 +56,7 @@ return static function (RectorConfig $rectorConfig): void {
'**/rector/**', // Disable this line to test the "test.php" file. '**/rector/**', // Disable this line to test the "test.php" file.
__DIR__ . '/../../../htdocs/custom/', __DIR__ . '/../../../htdocs/custom/',
__DIR__ . '/../../../htdocs/install/doctemplates/*' __DIR__ . '/../../../htdocs/install/doctemplates/*'
//'test.php',
]); ]);
$rectorConfig->parallel(240); $rectorConfig->parallel(240);
@@ -70,9 +72,9 @@ return static function (RectorConfig $rectorConfig): void {
//$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class); //$rectorConfig->rule(ReplaceEachAssignmentWithKeyCurrentRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class); $rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector::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); //Not yet ready: $rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::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\UserRightsToFunction::class);
//$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class); //$rectorConfig->rule(Dolibarr\Rector\Renaming\UsePositiveExit::class);
// This fix <> into != but it breaks other rules, so added at end.
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
// Add all predefined rules to migrate to up to php 71. // Add all predefined rules to migrate to up to php 71.
// Warning this break tab spacing of arrays on several lines // Warning this break tab spacing of arrays on several lines
/*$rectorConfig->sets([ /*$rectorConfig->sets([
LevelSetList::UP_TO_PHP_70 LevelSetList::UP_TO_PHP_70
]);*/ ]);*/
// Add predefined rules for a given version only // Add predefined rules for a given version only
//$rectorConfig->import(SetList::PHP_70); //$rectorConfig->import(SetList::PHP_70);
//$rectorConfig->import(SetList::PHP_71); //$rectorConfig->import(SetList::PHP_71);

View File

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

View File

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

View File

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

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions> * Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* 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>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -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.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.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 // Load translation files required by the page
$langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries')); $langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries'));
@@ -62,18 +71,20 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
if ($user->socid > 0) { if ($user->socid > 0) {
accessforbidden(); accessforbidden();
} }
if (!$user->hasRight('accounting', 'chartofaccount')) { if (!$permissiontoadd) {
accessforbidden(); accessforbidden();
} }
// now $permissiontoadd or $user->hasRight('accounting', 'chartofaccount') are always equal to 1
// Load variable for pagination // Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
if (empty($page) || $page == -1) { 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; $page = 0;
} // If $page is not defined, or '' or -1 }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
@@ -103,7 +114,7 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$accounting = new AccountingAccount($db); $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')); $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 || (GETPOSTINT('chartofaccounts') > 0 && GETPOSTINT('chartofaccounts') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified
$error = 0; $error = 0;
if ($chartofaccounts > 0 && $permissiontoadd) { if ($chartofaccounts > 0 /* && $permissiontoadd */) {
$country_code = ''; $country_code = '';
// Get language code for this $chartofaccounts // Get language code for this $chartofaccounts
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; $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)) { if ($accounting->fetch($id)) {
$mode = GETPOSTINT('mode'); $mode = GETPOSTINT('mode');
$result = $accounting->accountDeactivate($id, $mode); $result = $accounting->accountDeactivate($id, $mode);
@@ -209,7 +220,7 @@ if (empty($reshook)) {
} }
$action = 'update'; $action = 'update';
} elseif ($action == 'enable' && $permissiontoadd) { } elseif ($action == 'enable' /* && $permissiontoadd */) {
if ($accounting->fetch($id)) { if ($accounting->fetch($id)) {
$mode = GETPOSTINT('mode'); $mode = GETPOSTINT('mode');
$result = $accounting->accountActivate($id, $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'; $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') { if ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1); $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(); $arrayofselected = is_array($toselect) ? $toselect : array();
$param = ''; $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); $param .= '&contextpage='.urlencode($contextpage);
} }
if ($limit > 0 && $limit != $conf->liste_limit) { if ($limit > 0 && $limit != $conf->liste_limit) {
@@ -388,9 +400,9 @@ if ($resql) {
// List of mass actions available // List of mass actions available
$arrayofmassactions = array(); $arrayofmassactions = array();
if ($user->hasRight('accounting', 'chartofaccount')) { // if ($permissiontoadd) { // test is always true
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete"); $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
} // }
if (in_array($massaction, array('presend', 'predelete', 'closed'))) { if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
$arrayofmassactions = array(); $arrayofmassactions = array();
} }
@@ -465,20 +477,21 @@ if ($resql) {
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $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); $accountstatic = new AccountingAccount($db);
$accountparent = new AccountingAccount($db); $accountparent = new AccountingAccount($db);
$totalarray = array(); $totalarray = array();
$totalarray['nbfield'] = 0; $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 '<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 // Fields title search
// -------------------------------------------------------------------- // --------------------------------------------------------------------
@@ -617,7 +630,7 @@ if ($resql) {
// Action column // Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center nowraponall">'; 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 '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
@@ -626,14 +639,14 @@ if ($resql) {
print img_delete(); print img_delete();
print '</a>'; print '</a>';
print '&nbsp;'; 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 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; $selected = 0;
if (in_array($obj->rowid, $arrayofselected)) { if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1; $selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
} }
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
} }
// }
print '</td>'."\n"; print '</td>'."\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;
@@ -773,7 +786,7 @@ if ($resql) {
// Action column // Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="center nowraponall">'; 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 '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
print img_edit(); print img_edit();
print '</a>'; print '</a>';
@@ -782,14 +795,14 @@ if ($resql) {
print img_delete(); print img_delete();
print '</a>'; print '</a>';
print '&nbsp;'; 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 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; $selected = 0;
if (in_array($obj->rowid, $arrayofselected)) { if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1; $selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
} }
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
} }
// }
print '</td>'."\n"; print '</td>'."\n";
if (!$i) { if (!$i) {
$totalarray['nbfield']++; $totalarray['nbfield']++;

View File

@@ -46,6 +46,14 @@ if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.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 // Load translation files required by the page
$langs->loadLangs(array('accountancy', 'admin', 'companies', 'compta', 'errors', 'holiday', 'hrm', 'resource')); $langs->loadLangs(array('accountancy', 'admin', 'companies', 'compta', 'errors', 'holiday', 'hrm', 'resource'));
@@ -68,10 +76,11 @@ $active = 1;
$sortfield = GETPOST("sortfield", 'aZ09comma'); $sortfield = GETPOST("sortfield", 'aZ09comma');
$sortorder = GETPOST("sortorder", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
if (empty($page) || $page == -1) { 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; $page = 0;
} // If $page is not defined, or '' or -1 }
$offset = $listlimit * $page; $offset = $listlimit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $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')); $hookmanager->initHooks(array('admin'));
// This page is a generic page to edit dictionaries // 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'; $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]); $titre = $langs->trans($tablib[$id]);
$linkback = ''; $linkback = '';
@@ -492,7 +501,7 @@ if ($resql) {
// There is several pages // There is several pages
if ($num > $listlimit) { if ($num > $listlimit) {
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">'; 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>'; print '</td></tr>';
} }
@@ -657,7 +666,7 @@ $db->close();
* Show fields in insert/edit mode * Show fields in insert/edit mode
* *
* @param string[] $fieldlist Array of fields * @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 $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 * @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 * @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.'/accountancy/class/accountancysystem.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.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; $error = 0;
// Load translation files required by the page // 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'; $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 // Create mode

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions> * Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr> * 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -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.'/accountancy/class/accountancycategory.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.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; $error = 0;
// Load translation files required by the page // Load translation files required by the page
@@ -117,7 +126,7 @@ $formaccounting = new FormAccounting($db);
$title= $langs->trans('AccountingCategory'); $title= $langs->trans('AccountingCategory');
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration'; $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>'; $linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$titlepicto = 'setup'; $titlepicto = 'setup';
@@ -164,7 +173,7 @@ if (!empty($cat_id)) {
} }
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) { 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 $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").'"> '; 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.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.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 // Load translation files required by the page
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "accountancy", "hrm")); $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'); $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')); $hookmanager->initHooks(array('admin'));
// This page is a generic page to edit dictionaries // 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'; $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]); $titre = $langs->trans($tablib[$id]);
$linkback = ''; $linkback = '';
@@ -617,7 +625,7 @@ if ($resql) {
// There is several pages // There is several pages
if ($num > $listlimit) { if ($num > $listlimit) {
print '<tr class="none"><td class="right" colspan="'.(2 + count($fieldlist)).'">'; 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>'; print '</td></tr>';
} }
@@ -635,7 +643,7 @@ if ($resql) {
} }
// Title line with search boxes // 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 // Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
@@ -947,22 +955,15 @@ $db->close();
* Show fields in insert/edit mode * Show fields in insert/edit mode
* *
* @param string[] $fieldlist Array of fields * @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 $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 * @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 * @return void
*/ */
function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $context = '') function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $context = '')
{ {
global $conf, $langs, $db;
global $form, $mysoc; global $form, $mysoc;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
}
foreach ($fieldlist as $field => $value) { foreach ($fieldlist as $field => $value) {
if ($fieldlist[$field] == 'country') { if ($fieldlist[$field] == 'country') {
print '<td>'; print '<td>';

View File

@@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2019-2024 Alexandre Spangaro <aspangaro@easya.solutions> /* Copyright (C) 2019-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* 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>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -29,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/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.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 // Load translation files required by the page
$langs->loadLangs(array("compta", "admin", "accountancy")); $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'; $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 = ''; $linkback = '';
print load_fiche_titre($langs->trans('MenuClosureAccounts'), $linkback, 'title_accountancy'); 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 // Define main accounts for closure
print '<table class="noborder centpercent">'; 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) { foreach ($list_account_main as $key) {
print '<tr class="oddeven value">'; print '<tr class="oddeven value">';
// Param // Param
@@ -148,16 +162,20 @@ print '</td></tr>';
// Accounting groups used for the balance sheet account // Accounting groups used for the balance sheet account
print '<tr class="oddeven">'; 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 '<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>'; print '</td></tr>';
// Accounting groups used for the income statement // Accounting groups used for the income statement
print '<tr class="oddeven">'; 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 '<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 '</td></tr>';
print "</table>\n"; 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/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.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 // Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "trips", "loan")); $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "trips", "loan"));
@@ -123,8 +132,9 @@ if (isModEnabled('societe')) {
* Actions * Actions
*/ */
$error = 0;
if ($action == 'update') { if ($action == 'update') {
$error = 0;
// Process $list_account_main // Process $list_account_main
foreach ($list_account_main as $constname) { foreach ($list_account_main as $constname) {
$constvalue = GETPOST($constname, 'alpha'); $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'; $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 = ''; $linkback = '';
print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy'); 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>'; print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>';
if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) { 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 '<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>'; print '</a></td>';
} else { } else {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">'; 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>'; print '<td>' . img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnSupplierDeposit") . '</td>';
if (getDolGlobalInt('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) { 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 '<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>'; print '</a></td>';
} else { } else {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">'; print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">';

View File

@@ -1,263 +0,0 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.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/>.
*/
/**
* \file htdocs/accountancy/admin/export.php
* \ingroup Accountancy (Double entries)
* \brief Setup page to configure accounting export module
*/
require '../../main.inc.php';
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.'/accountancy/class/accountancyexport.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
// Security access
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}
$action = GETPOST('action', 'aZ09');
// Parameters ACCOUNTING_EXPORT_*
$main_option = array(
'ACCOUNTING_EXPORT_PREFIX_SPEC',
);
$accountancyexport = new AccountancyExport($db);
$configuration = $accountancyexport->getTypeConfig();
$listparam = $configuration['param'];
$listformat = $configuration['format'];
$listcr = $configuration['cr'];
$model_option = array(
'1' => array(
'label' => 'ACCOUNTING_EXPORT_FORMAT',
'param' => $listformat,
),
'2' => array(
'label' => 'ACCOUNTING_EXPORT_SEPARATORCSV',
'param' => '',
),
'3' => array(
'label' => 'ACCOUNTING_EXPORT_ENDLINE',
'param' => $listcr,
),
'4' => array(
'label' => 'ACCOUNTING_EXPORT_DATE',
'param' => '',
),
);
/*
* Actions
*/
if ($action == 'update') {
$error = 0;
$modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV');
if (!empty($modelcsv)) {
if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
$error++;
}
//if ($modelcsv==AccountancyExport::$EXPORT_TYPE_QUADRATUS || $modelcsv==AccountancyExport::$EXPORT_TYPE_CIEL) {
// dolibarr_set_const($db, 'ACCOUNTING_EXPORT_FORMAT', 'txt', 'chaine', 0, '', $conf->entity);
//}
} else {
$error++;
}
foreach ($main_option as $constname) {
$constvalue = GETPOST($constname, 'alpha');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
foreach ($listparam[$modelcsv] as $key => $value) {
$constante = $key;
if (strpos($constante, 'ACCOUNTING') !== false) {
$constvalue = GETPOST($key, 'alpha');
if (!dolibarr_set_const($db, $constante, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
}
if (!$error) {
// reload
$configuration = $accountancyexport->getTypeConfig();
$listparam = $configuration['param'];
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/*
* View
*/
$form = new Form($db);
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacute;_en_Partie_Double#Configuration';
$title = $langs->trans('ExportOptions');
llxHeader('', $title, $help_url);
$linkback = '';
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans('ExportOptions'), $linkback, 'accountancy');
print "\n".'<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print ' function initfields()'."\n";
print ' {'."\n";
foreach ($listparam as $key => $param) {
print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n";
print ' {'."\n";
print ' //console.log("'.$param['label'].'");'."\n";
if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) {
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.getDolGlobalString('ACCOUNTING_EXPORT_FORMAT').'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n";
}
if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) {
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV').'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n";
}
if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) {
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n";
}
if (empty($param['ACCOUNTING_EXPORT_DATE'])) {
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n";
} else {
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("'.getDolGlobalString('ACCOUNTING_EXPORT_DATE').'");'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_DATE").removeAttr("disabled");'."\n";
}
print ' }'."\n";
}
print ' }'."\n";
print ' initfields();'."\n";
print ' jQuery("#ACCOUNTING_EXPORT_MODELCSV").change(function() {'."\n";
print ' initfields();'."\n";
print ' });'."\n";
print '})'."\n";
print '</script>'."\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
/*
* Main Options
*/
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans('ExportOptions').'</td>';
print "</tr>\n";
$num = count($main_option);
if ($num) {
foreach ($main_option as $key) {
print '<tr class="oddeven value">';
// Param
$label = $langs->trans($key);
print '<td>'.dol_escape_htmltag($label).'</td>';
// Value
print '<td>';
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
print '</td></tr>';
}
}
print '<tr class="oddeven">';
print '<td>'.$langs->trans("Selectmodelcsv").'</td>';
if (!$conf->use_javascript_ajax) {
print '<td class="nowrap">';
print $langs->trans("NotAvailableWhenAjaxDisabled");
print "</td>";
} else {
print '<td>';
$listofexporttemplates = $accountancyexport->getType(1);
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listofexporttemplates, getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
print '</td>';
}
print "</tr>";
$num2 = count($model_option);
if ($num2) {
foreach ($model_option as $key) {
print '<tr class="oddeven value">';
// Param
$label = $key['label'];
print '<td>'.$langs->trans($label).'</td>';
// Value
print '<td>';
if (is_array($key['param'])) {
print $form->selectarray($label, $key['param'], getDolGlobalString($label), 0);
} else {
print '<input type="text" size="20" id="'.$label.'" name="'.$key['label'].'" value="'.getDolGlobalString($label).'">';
}
print '</td></tr>';
}
print "</table>\n";
}
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Modify')).'" name="button"></div>';
print '</form>';
// End of page
llxFooter();
$db->close();

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