diff --git a/.codeclimate.yml b/.codeclimate.yml index a84e6c1fdd0..0c62d4ed5eb 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -4,10 +4,10 @@ languages: JavaScript: true PHP: true engines: - phpcodesniffer: true + phpcodesniffer: true exclude_paths: - 'build/*' - 'dev/*' - 'doc/*' - 'test/*' - - 'htdocs/includes/*' \ No newline at end of file + - 'htdocs/includes/*' diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 6b651234788..cd1513f3576 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -2,4 +2,4 @@ open_collective: dolibarr custom: https://wiki.dolibarr.org/index.php/Subscribe -github: [eldy] \ No newline at end of file +github: [eldy] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3795b1b7222..2c79a8cea03 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,7 +7,7 @@ body: attributes: value: | This is a template to help you report good issues. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report. - + - type: textarea id: bug attributes: @@ -27,19 +27,19 @@ body: attributes: label: Environment OS description: Server OS type and version - + - type: input id: environment-webserver attributes: label: Environment Web server description: Webserver type and version - + - type: input id: environment-php attributes: label: Environment PHP description: PHP version - + - type: input id: environment-database attributes: @@ -63,7 +63,7 @@ body: attributes: label: Steps to reproduce the behavior description: Verbose description - + - type: textarea id: files attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 885f3472d18..5d97ee6a5be 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -21,7 +21,7 @@ body: attributes: label: Use case description: Verbose description - + - type: textarea id: suggested-implementation attributes: diff --git a/.github/logToCs.py b/.github/logToCs.py new file mode 100755 index 00000000000..d08628cef84 --- /dev/null +++ b/.github/logToCs.py @@ -0,0 +1,417 @@ +#!/usr/bin/env python3 +# pylint: disable=invalid-name +""" +Convert a log to CheckStyle format. + +Url: https://github.com/mdeweerd/LogToCheckStyle + +The log can then be used for generating annotations in a github action. + +Note: this script is very young and "quick and dirty". + Patterns can be added to "PATTERNS" to match more messages. + +# Examples + +Assumes that logToCs.py is available as .github/logToCs.py. + +## Example 1: + + +```yaml + - run: | + pre-commit run -all-files | tee pre-commit.log + .github/logToCs.py pre-commit.log pre-commit.xml + - uses: staabm/annotate-pull-request-from-checkstyle-action@v1 + with: + files: pre-commit.xml + notices-as-warnings: true # optional +``` + +## Example 2: + + +```yaml + - run: | + pre-commit run --all-files | tee pre-commit.log + - name: Add results to PR + if: ${{ always() }} + run: | + .github/logToCs.py pre-commit.log | cs2pr +``` + +Author(s): + - https://github.com/mdeweerd + +License: MIT License + +""" + +import argparse +import os +import re +import sys +import xml.etree.ElementTree as ET # nosec + + +def remove_prefix(string, prefix): + """ + Remove prefix from string + + Provided for backward compatibility. + """ + if prefix and string.startswith(prefix): + return string[len(prefix) :] + return string + + +def convert_to_checkstyle(messages, root_path=None): + """ + Convert provided message to CheckStyle format. + """ + root = ET.Element("checkstyle") + for message in messages: + fields = parse_message(message) + if fields: + add_error_entry(root, **fields, root_path=root_path) + return ET.tostring(root, encoding="utf_8").decode("utf_8") + + +def convert_text_to_checkstyle(text, root_path=None): + """ + Convert provided message to CheckStyle format. + """ + root = ET.Element("checkstyle") + for fields in parse_file(text): + if fields: + add_error_entry(root, **fields, root_path=root_path) + return ET.tostring(root, encoding="utf_8").decode("utf_8") + + +ANY_REGEX = r".*?" +FILE_REGEX = r"\s*(?P\S.*?)\s*?" +FILEGROUP_REGEX = r"\s*(?P\S.*?)\s*?" +EOL_REGEX = r"[\r\n]" +LINE_REGEX = r"\s*(?P\d+?)\s*?" +COLUMN_REGEX = r"\s*(?P\d+?)\s*?" +SEVERITY_REGEX = r"\s*(?Perror|warning|notice|style|info)\s*?" +MSG_REGEX = r"\s*(?P.+?)\s*?" +MULTILINE_MSG_REGEX = r"\s*(?P(?:.|.[\r\n])+)" +# cpplint confidence index +CONFIDENCE_REGEX = r"\s*\[(?P\d+)\]\s*?" + + +# List of message patterns, add more specific patterns earlier in the list +# Creating patterns by using constants makes them easier to define and read. +PATTERNS = [ + # beautysh + # File ftp.sh: error: "esac" before "case" in line 90. + re.compile( + f"^File {FILE_REGEX}:{SEVERITY_REGEX}:" + f" {MSG_REGEX} in line {LINE_REGEX}.$" + ), + # beautysh + # File socks4echo.sh: error: indent/outdent mismatch: -2. + re.compile(f"^File {FILE_REGEX}:{SEVERITY_REGEX}: {MSG_REGEX}$"), + # yamllint + # ##[group].pre-commit-config.yaml + # ##[error]97:14 [trailing-spaces] trailing spaces + # ##[endgroup] + re.compile(rf"^##\[group\]{FILEGROUP_REGEX}$"), # Start file group + re.compile( + rf"^##\[{SEVERITY_REGEX}\]{LINE_REGEX}:{COLUMN_REGEX}{MSG_REGEX}$" + ), # Msg + re.compile(r"^##(?P\[endgroup\])$"), # End file group + # File socks4echo.sh: error: indent/outdent mismatch: -2. + re.compile(f"^File {FILE_REGEX}:{SEVERITY_REGEX}: {MSG_REGEX}$"), + # ESLint (JavaScript Linter), RoboCop, shellcheck + # path/to/file.js:10:2: Some linting issue + # path/to/file.rb:10:5: Style/Indentation: Incorrect indentation detected + # path/to/script.sh:10:1: SC2034: Some shell script issue + re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{COLUMN_REGEX}: {MSG_REGEX}$"), + # Cpplint default output: + # '%s:%s: %s [%s] [%d]\n' + # % (filename, linenum, message, category, confidence) + re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{MSG_REGEX}{CONFIDENCE_REGEX}$"), + # MSVC + # file.cpp(10): error C1234: Some error message + re.compile( + f"^{FILE_REGEX}\\({LINE_REGEX}\\):{SEVERITY_REGEX}{MSG_REGEX}$" + ), + # Java compiler + # File.java:10: error: Some error message + re.compile(f"^{FILE_REGEX}:{LINE_REGEX}:{SEVERITY_REGEX}:{MSG_REGEX}$"), + # Python + # File ".../logToCs.py", line 90 (note: code line follows) + re.compile(f'^File "{FILE_REGEX}", line {LINE_REGEX}$'), + # Pylint, others + # path/to/file.py:10: [C0111] Missing docstring + # others + re.compile(f"^{FILE_REGEX}:{LINE_REGEX}: {MSG_REGEX}$"), + # Shellcheck: + # In script.sh line 76: + re.compile( + f"^In {FILE_REGEX} line {LINE_REGEX}:{EOL_REGEX}?" + f"({MULTILINE_MSG_REGEX})?{EOL_REGEX}{EOL_REGEX}" + ), + # eslint: + # /path/to/filename + # 14:5 error Unexpected trailing comma comma-dangle + re.compile( + f"^{FILE_REGEX}{EOL_REGEX}" + rf"\s+{LINE_REGEX}:{COLUMN_REGEX}\s+{SEVERITY_REGEX}\s+{MSG_REGEX}$" + ), +] + +# Severities available in CodeSniffer report format +SEVERITY_NOTICE = "notice" +SEVERITY_WARNING = "warning" +SEVERITY_ERROR = "error" + + +def strip_ansi(text: str): + """ + Strip ANSI escape sequences from string (colors, etc) + """ + return re.sub(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])", "", text) + + +def parse_file(text): + """ + Parse all messages in a file + + Returns the fields in a dict. + """ + # pylint: disable=too-many-branches + # regex required to allow same group names + try: + import regex # pylint: disable=import-outside-toplevel + except ImportError as exc: + raise ImportError( + "The 'parsefile' method requires 'python -m pip install regex'" + ) from exc + + patterns = [pattern.pattern for pattern in PATTERNS] + # patterns = [PATTERNS[0].pattern] + + file_group = None # The file name for the group (if any) + full_regex = "(?:(?:" + (")|(?:".join(patterns)) + "))" + results = [] + + for fields in regex.finditer( + full_regex, strip_ansi(text), regex.MULTILINE + ): + if not fields: + continue + result = fields.groupdict() + + if len(result) == 0: + continue + + severity = result.get("severity", None) + file_name = result.get("file_name", None) + confidence = result.pop("confidence", None) + new_file_group = result.pop("file_group", None) + file_endgroup = result.pop("file_endgroup", None) + + if new_file_group is not None: + # Start of file_group, just store file + file_group = new_file_group + continue + + if file_endgroup is not None: + file_group = None + continue + + if file_name is None: + if file_group is not None: + file_name = file_group + result["file_name"] = file_name + else: + # No filename, skip + continue + + if confidence is not None: + # Convert confidence level of cpplint + # to warning, etc. + confidence = int(confidence) + + if confidence <= 1: + severity = SEVERITY_NOTICE + elif confidence >= 5: + severity = SEVERITY_ERROR + else: + severity = SEVERITY_WARNING + + if severity is None: + severity = SEVERITY_ERROR + else: + severity = severity.lower() + + if severity in ["info", "style"]: + severity = SEVERITY_NOTICE + + result["severity"] = severity + + results.append(result) + + return results + + +def parse_message(message): + """ + Parse message until it matches a pattern. + + Returns the fields in a dict. + """ + for pattern in PATTERNS: + fields = pattern.match(message) + if not fields: + continue + result = fields.groupdict() + if len(result) == 0: + continue + + if "confidence" in result: + # Convert confidence level of cpplint + # to warning, etc. + confidence = int(result["confidence"]) + del result["confidence"] + + if confidence <= 1: + severity = SEVERITY_NOTICE + elif confidence >= 5: + severity = SEVERITY_ERROR + else: + severity = SEVERITY_WARNING + result["severity"] = severity + + if "severity" not in result: + result["severity"] = SEVERITY_ERROR + else: + result["severity"] = result["severity"].lower() + + if result["severity"] in ["info", "style"]: + result["severity"] = SEVERITY_NOTICE + + return result + + # Nothing matched + return None + + +def add_error_entry( # pylint: disable=too-many-arguments + root, + severity, + file_name, + line=None, + column=None, + message=None, + source=None, + root_path=None, +): + """ + Add error information to the CheckStyle output being created. + """ + file_element = find_or_create_file_element( + root, file_name, root_path=root_path + ) + error_element = ET.SubElement(file_element, "error") + error_element.set("severity", severity) + if line: + error_element.set("line", line) + if column: + error_element.set("column", column) + if message: + error_element.set("message", message) + if source: + # To verify if this is a valid attribute + error_element.set("source", source) + + +def find_or_create_file_element(root, file_name: str, root_path=None): + """ + Find/create file element in XML document tree. + """ + + if root_path is not None: + file_name = remove_prefix(file_name, root_path) + for file_element in root.findall("file"): + if file_element.get("name") == file_name: + return file_element + file_element = ET.SubElement(root, "file") + file_element.set("name", file_name) + return file_element + + +def main(): + """ + Parse the script arguments and get the conversion done. + """ + parser = argparse.ArgumentParser( + description="Convert messages to Checkstyle XML format." + ) + parser.add_argument( + "input", help="Input file. Use '-' for stdin.", nargs="?", default="-" + ) + parser.add_argument( + "output", + help="Output file. Use '-' for stdout.", + nargs="?", + default="-", + ) + parser.add_argument( + "-i", + "--in", + dest="input_named", + help="Input filename. Overrides positional input.", + ) + parser.add_argument( + "-o", + "--out", + dest="output_named", + help="Output filename. Overrides positional output.", + ) + parser.add_argument( + "--root", + metavar="ROOT_PATH", + help="Root directory to remove from file paths." + " Defaults to working directory.", + default=os.getcwd(), + ) + + args = parser.parse_args() + + if args.input == "-" and args.input_named: + with open( + args.input_named, encoding="utf_8", errors="surrogateescape" + ) as input_file: + text = input_file.read() + elif args.input != "-": + with open( + args.input, encoding="utf_8", errors="surrogateescape" + ) as input_file: + text = input_file.read() + else: + text = sys.stdin.read() + + root_path = os.path.join(args.root, "") + + try: + checkstyle_xml = convert_text_to_checkstyle(text, root_path=root_path) + except ImportError: + checkstyle_xml = convert_to_checkstyle( + re.split(r"[\r\n]+", text), root_path=root_path + ) + + if args.output == "-" and args.output_named: + with open(args.output_named, "w", encoding="utf_8") as output_file: + output_file.write(checkstyle_xml) + elif args.output != "-": + with open(args.output, "w", encoding="utf_8") as output_file: + output_file.write(checkstyle_xml) + else: + print(checkstyle_xml) + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/exakat.yml b/.github/workflows/exakat.yml index 0b33ede5f4f..16e87acd81a 100644 --- a/.github/workflows/exakat.yml +++ b/.github/workflows/exakat.yml @@ -22,7 +22,7 @@ jobs: - name: Exakat uses: docker://exakat/exakat-ga with: - ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant' + ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant' ignore_dirs: '/htdocs/includes/,/htdocs/install/doctemplates/,/build/,/dev/,/doc/,/scripts/,/test/' - file_extensions: php - project_reports: Perfile \ No newline at end of file + file_extensions: php + project_reports: Perfile diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 1bb1184586f..6b0b0258823 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -1,6 +1,7 @@ name: "PHPCS" on: + push: pull_request: paths: - "**.php" @@ -11,6 +12,7 @@ jobs: phpcs: runs-on: ubuntu-latest steps: + # Get git sources - uses: actions/checkout@v4 with: fetch-depth: 50 # important! diff --git a/.github/workflows/phpcsfixer.yml.disabled b/.github/workflows/phpcsfixer.yml.disabled deleted file mode 100644 index 959ba5ad801..00000000000 --- a/.github/workflows/phpcsfixer.yml.disabled +++ /dev/null @@ -1,63 +0,0 @@ -name: GitHub CI PHPCS and PHPCBF - -on: - pull_request: - types: [opened] -#on: -# push: -# paths: -# - '**.php' - -jobs: - #filesChanged: - # uses: ./.github/workflows/files_changed.yaml - # with: - # folder_path: .* - - linter_name: - name: Run & fix PHP Code Sniffer - runs-on: ubuntu-latest - #needs: filesChanged - steps: - - uses: actions/checkout@v3 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} - # fetch-depth: 10 - - - name: echo Get list of all changed files - run: | - #echo ${{ needs.filesChanged.outputs.all_changed_files }} - #echo boolean_output=${{ needs.filesChanged.outputs.boolean_output }} - echo github.head_ref=${{github.head_ref}} - echo github.base_ref=${{github.base_ref}} - echo github.ref_name=${{github.ref_name}} - - - uses: eldy/phpcsfixer-action@master - with: - github_token: ${{ secrets.github_token }} - use_default_configuration_file: false - phpcs_standard: 'dev/setup/codesniffer/ruleset.xml' - phpcs_head_ref: ${{github.head_ref}} - phpcs_base_ref: ${{github.base_ref}} - phpcs_ref_name: ${{github.ref_name}} - phpcs_github_event_name: ${{github.event_name}} - phpcs_files: ${{ needs.filesChanged.outputs.all_changed_files }} - - #- uses: stefanzweifel/git-auto-commit-action@v4 # auto commit the fixes action for GitHub - # with: - # commit_message: Fix PHPCS errors by GitHub PHPCSfixer action - - - name: Commit changes - uses: EndBug/add-and-commit@v9.1.3 - with: - default_author: github_actions - committer_name: GitHub Actions - committer_email: actions@github.com - #author_name: PHP CS fixer - #author_email: eldy@destailleur.fr - #committer_name: PHP CS fixer - #committer_email: eldy@destailleur.fr - message: 'PHP CS fixer github action' - add: '*.php' - diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 484c1c84bee..e0a7d71b9b6 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,20 +1,17 @@ # This is a basic workflow to check code with PHPSTAN tool -name: PHPSTAN +name: "PHPStan" # Controls when the workflow will run -on: - # Triggers the workflow on pull request events but only for the develop branch - pull_request: - branches: [ develop ] +on: [push, pull_request] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: + # This workflow contains a single job + php-stan: # The type of runner that the job will run on runs-on: ubuntu-latest strategy: @@ -30,6 +27,8 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + + # Get PHP and addons - name: Setup PHP id: setup-php uses: shivammathur/setup-php@v2 @@ -37,25 +36,32 @@ jobs: php-version: "${{ matrix.php-version }}" tools: phpstan, cs2pr extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap, mysql, pgsql, sqlite3, ldap, xml, mcrypt + # ??? - uses: actions/setup-node@v3 with: node-version: 14.x registry-url: 'https://registry.npmjs.org' + + # Restore old cache - name: Restore phpstan cache uses: actions/cache/restore@v3 with: path: ./.github/tmp - key: "phpstan-cache-PR-${{ matrix.php-version }}-${{ github.run_id }}" + key: "phpstan-cache-${{ matrix.php-version }}-${{ github.run_id }}" restore-keys: | - phpstan-cache-PR-${{ matrix.php-version }}- - - name: Debug + phpstan-cache-${{ matrix.php-version }}- + - name: Show debug into run: cd ./.github/tmp && ls -al - - name: Run PHPSTAN - run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -c phpstan_action.neon | cs2pr --graceful-warnings + + # Run PHPStan + - name: Run PHPStan + run: phpstan -vvv analyse --error-format=checkstyle --memory-limit 4G -a build/phpstan/bootstrap_action.php -c phpstan.neon | cs2pr --graceful-warnings # continue-on-error: true + + # Save cache - name: "Save phpstan cache" uses: actions/cache/save@v3 if: always() with: path: ./.github/tmp - key: "phpstan-cache-PR-${{ matrix.php-version }}-${{ github.run_id }}" + key: "phpstan-cache-${{ matrix.php-version }}-${{ github.run_id }}" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000000..345048e8955 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,72 @@ +--- +name: pre-commit +on: + pull_request: + push: +jobs: + pre-commit: + runs-on: ubuntu-latest + env: + LOG_TO_CS: .github/logToCs.py + RAW_LOG: pre-commit.log + CS_XML: pre-commit.xml + steps: + - name: Install required tools + run: sudo apt-get update && sudo apt-get install cppcheck + if: false + # Checkout git sources to analyze + - uses: actions/checkout@v4 + # ??? + - name: Create requirements.txt if no requirements.txt or pyproject.toml + run: |- + [ -r requirements.txt ] || [ -r pyproject.toml ] || touch requirements.txt + # Install python and pre-commit tool + - uses: actions/setup-python@v4 + with: + cache: pip + python-version: '3.11' + - run: python -m pip install pre-commit regex + # Restore previous cache of precommit + - uses: actions/cache/restore@v3 + with: + path: ~/.cache/pre-commit/ + key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + # Run all the precommit tools (defined into pre-commit-config.yaml). We can force exclusion of some of them here. + - name: Run pre-commit hooks + env: + # SKIP is used by pre-commit to not execute certain hooks + SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer + run: | + set -o pipefail + pre-commit gc + pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG} + # If error, we convert log in the checkstyle format + - name: Convert Raw Log to CheckStyle format + if: ${{ failure() }} + run: | + python ${LOG_TO_CS} ${RAW_LOG} ${CS_XML} + # Annotate the git sources with the log messages + - name: Annotate Source Code with Messages + uses: staabm/annotate-pull-request-from-checkstyle-action@v1 + if: ${{ failure() }} + with: + files: ${{ env.CS_XML }} + notices-as-warnings: true # optional + prepend-filename: true # optional + # Save the precommit cache + - uses: actions/cache/save@v3 + if: ${{ always() }} + with: + path: ~/.cache/pre-commit/ + key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') + }} + # Upload result log files of precommit into the Artifact shared store + - name: Provide log as artifact + uses: actions/upload-artifact@v3 + if: ${{ always() }} + with: + name: precommit-logs + path: | + ${{ env.RAW_LOG }} + ${{ env.CS_XML }} + retention-days: 2 diff --git a/.github/workflows/stale-issues-safe.yml b/.github/workflows/stale-issues-safe.yml index af04675d48d..266227fc057 100644 --- a/.github/workflows/stale-issues-safe.yml +++ b/.github/workflows/stale-issues-safe.yml @@ -7,7 +7,7 @@ on: issue_comment: types: [created] workflow_dispatch: - + permissions: {} # none jobs: @@ -26,4 +26,3 @@ jobs: days-before-close: 10 operations-per-run: 100 dry-run: false - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..a3220cc9d85 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,137 @@ +--- +exclude: (?x)^( htdocs/includes/ckeditor/.* ) +repos: + # Several miscellaneous checks and fix (on yaml files, end of files fix) + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: no-commit-to-branch + args: [--branch, develop, --pattern, \d+.0] + - id: check-yaml + args: [--unsafe] + - id: check-json + - id: mixed-line-ending + exclude: (?x)^(htdocs/includes/tecnickcom/tcpdf/fonts/.*)$ + - id: trailing-whitespace + exclude_types: [markdown] + - id: end-of-file-fixer + types: [yaml] + - id: check-merge-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + exclude: (?x)^( dev/tools/dolibarr-postgres2mysql.php |test/other/test_serialize.php + |test/phpunit/textutf8.txt |test/phpunit/textiso.txt |htdocs/includes/.* + |htdocs/modulebuilder/template/.* |build/debian/dolibarr.postrm |build/debian/dolibarr.postinst + |build/debian/dolibarr.config )$ + - id: fix-byte-order-marker + - id: check-case-conflict + + # Beautify shell scripts + - repo: https://github.com/lovesegfault/beautysh.git + rev: v6.2.1 + hooks: + - id: beautysh + exclude: (?x)^(dev/setup/git/hooks/pre-commit)$ + args: [--tab] + + # Run local script + - repo: local + hooks: + - id: local-precommit-script + name: Run local script before commit if it exists + language: system + entry: bash -c '[ ! -x local.sh ] || ./local.sh' + pass_filenames: false + + # Check PHP syntax + - repo: https://github.com/bolovsky/pre-commit-php + rev: 1.5.1 + hooks: + - id: php-cbf + files: \.(php)$ + args: [-p] + - id: php-cs + - id: php-lint + + # Prettier (format code, only for non common files) + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.0.3 + hooks: + - id: prettier + stages: [manual] + exclude: (?x)^( .*\.(phar |min\.css |lock) |htdocs/(includes|theme/common)/.* + )$ + exclude_types: + - php + - executable + - binary + - shell + - javascript + - markdown + - html + - less + - plain-text + - scss + - css + - yaml + + # Check format of yam files + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.32.0 + hooks: + - id: yamllint + args: + - --no-warnings + - -d + - '{extends: relaxed, rules: {line-length: {max: 120}}}' + + # Execute codespell to fix typo errors (setup of codespell into dev/tools/codespell/) + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + # Due to a current limitation of configuration files, + # we can specify two dicts only on the CLI. + # You can update the contents of the exclude-file codespell-lines-ignore with the script + # dev/tools/codespell/addCodespellIgnores.sh + args: + - -D + - '-' + - -D + - dev/tools/codespell/codespell-dict.txt + - -I + - dev/tools/codespell/codespell-ignore.txt + - -x + - dev/tools/codespell/codespell-lines-ignore.txt + - --uri-ignore-words-list + - ned + exclude: (?x)^(.phan/stubs/.*)$ + additional_dependencies: [tomli] + - alias: codespell-lang-en_US + # Only for translations with specialised exceptions + # -D contains predefined conversion dictionaries + # -L is to ignore some words + id: codespell + files: ^htdocs/langs/en_US/.*$ + args: + - -D + - '-' + - -D + - dev/tools/codespell/codespell-dict.txt + - -L + - informations,medias,uptodate,reenable,crypted,developpers + - -L + - "creat,unitl,alltime,datas,referers" + - -I + - dev/tools/codespell/codespell-ignore.txt + - -x + - dev/tools/codespell/codespell-lines-ignore.txt + - --uri-ignore-words-list + - ned + + # Check some shell scripts + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.9.0.5 + hooks: + - id: shellcheck + args: [-W, '100'] diff --git a/.travis.yml b/.travis.yml index 5c42cd5371e..686b2d72176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ jobs: - stage: PHP min and max if: type = push php: '7.1' - env: + env: - DB=postgresql - TRAVIS_PHP_VERSION=7.1 - stage: PHP min and max @@ -49,7 +49,7 @@ jobs: - stage: PHP 8.3 if: type = push AND branch = develop php: '8.3' - env: + env: - DB=mysql - TRAVIS_PHP_VERSION=8.3 @@ -89,7 +89,7 @@ before_install: if [ "$TRAVIS_PHP_VERSION" = '8.3' ]; then sudo apt install unzip apache2 php8.3 php8.3-cli php8.3-curl php8.3-mysql php8.3-pgsql php8.3-gd php8.3-imap php8.3-intl php8.3-ldap php8.3-xml php8.3-mbstring php8.3-xml php8.3-zip libapache2-mod-php8.3 fi - + - | echo Install pgsql if run is for pgsql if [ "$DB" = 'postgresql' ]; then @@ -116,15 +116,15 @@ install: - | if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then sudo update-alternatives --set php /usr/bin/php7.1 - fi + fi if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then sudo update-alternatives --set php /usr/bin/php8.1 - fi + fi if [ "$TRAVIS_PHP_VERSION" = '8.2' ]; then sudo update-alternatives --set php /usr/bin/php8.2 - fi + fi php -i | head - - + - | echo "Updating Composer config" curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php @@ -133,7 +133,7 @@ install: php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer sudo chmod -R a+rwx /usr/local/bin/composer - + #sudo apt install composer composer -V composer -n config -g vendor-dir htdocs/includes @@ -229,7 +229,7 @@ before_script: #sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa & sleep 3 - sudo ps fauxww + sudo ps fauxww echo "MySQL set root password" sudo mysql -u root -h 127.0.0.1 -e "FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8'; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'password'; 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;" echo "MySQL grant" @@ -238,7 +238,7 @@ before_script: sudo mysql -u root -h 127.0.0.1 -ppassword -e 'use mysql; select * from user;' echo "List pid file" sudo mysql -u root -h 127.0.0.1 -ppassword -e "show variables like '%pid%';" - + #sudo kill `cat /var/lib/mysqld/mysqld.pid` #sudo systemctl start mariadb @@ -246,7 +246,7 @@ before_script: sudo mysql -u root -h 127.0.0.1 -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;' echo "MySQL flush" sudo mysql -u root -h 127.0.0.1 -ppassword -e 'FLUSH PRIVILEGES;' - + echo "MySQL load sql" sudo mysql -u root -h 127.0.0.1 -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql fi @@ -415,12 +415,12 @@ script: echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE #cat $INSTALL_FORCED_FILE echo - + - | echo "Upgrading Dolibarr" # Ensure we catch errors with -e. Set this to +e if you want to go to the end to see log files. # Note: We keep +e because with pgsql, one of upgrade process fails even if migration seems ok, so - # I disable stop on error to be able to continue. + # I disable stop on error to be able to continue. set +e cd htdocs/install php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log @@ -483,6 +483,9 @@ script: php upgrade.php 18.0.0 19.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade18001900.log || cat $TRAVIS_BUILD_DIR/upgrade18001900.log php upgrade2.php 18.0.0 19.0.0 > $TRAVIS_BUILD_DIR/upgrade18001900-2.log || cat $TRAVIS_BUILD_DIR/upgrade18001900-2.log php step5.php 18.0.0 19.0.0 > $TRAVIS_BUILD_DIR/upgrade18001900-3.log || cat $TRAVIS_BUILD_DIR/upgrade18001900-3.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 step5.php 19.0.0 20.0.0 > $TRAVIS_BUILD_DIR/upgrade19002000-3.log || cat $TRAVIS_BUILD_DIR/upgrade19002000-3.log set +e echo diff --git a/COPYRIGHT b/COPYRIGHT index fc50ab2093e..e35a544e3d0 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -69,7 +69,6 @@ jQuery jquerytreeview 1.4.1 MIT License Yes jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows) jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker jsGanttImproved 2.7.3 BSD License Yes JS library (to build Gantt reports) -JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone SwaggerUI 2.2.10 GPL-2+ Yes JS library to offer the REST API explorer Image libraries: @@ -79,7 +78,7 @@ Font libraries: Fontawesome 5.13 Font Awesome Free Licence Yes -For more licenses compatibility informations: https://www.gnu.org/licenses/licenses.en.html +For more licenses compatibility information: https://www.gnu.org/licenses/licenses.en.html Authors diff --git a/build/README b/build/README index 19cf4ad1ec2..dc9c743175f 100644 --- a/build/README +++ b/build/README @@ -34,7 +34,7 @@ See makepack-howto.txt for prerequisites. -------------------------------------------------------------------------------------------------- -- To build developper documentation, launch the script +- To build developer documentation, launch the script > perl dolibarr-doxygen-build.pl diff --git a/build/debian/README.howto b/build/debian/README.howto index 45df1e9df70..f01add2f013 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -81,7 +81,7 @@ export QUILT_PATCHES=debian/patches # dpkg -l List all packages # dpkg -b To build binary only package # dpkg -c package.deb List content of package -# dpkg -I package.deb Give informations on package +# dpkg -I package.deb Give information on package # dpkg -i package.deb Install a package # dpkg-reconfigure -plow package Reconfigure package # dpkg -L packagename List content of installed package @@ -173,7 +173,7 @@ or > ls /srv/chroot Puis pour se connecter et préparer l'environnement -> schroot -c name_of_chroot (exemple schroot -c unstable-amd64-sbuild) +> schroot -c name_of_chroot (example schroot -c unstable-amd64-sbuild) > cat /etc/debian_chroot to check which debian branch we are into > apt-get install vim dialog > vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok) @@ -249,7 +249,7 @@ ou > git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-x.y.z] Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-3.5.x] -Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file +Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommitted file Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match Note: Package is built into directory ../build-area Note: To compare 2 packages: debdiff package1.dsc package2.dsc @@ -345,7 +345,7 @@ To update dolibarr debian package when only files not into debian has changed: * Checkout the branch you want to work on: master of debian/... * Manually, add patches into debian/patches and update the file debian/series, or do the 2 steps with "quilt import filepatch.patch" -* You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch. +* You can test patching of series with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch. * Update the debian/changelog to add entry of change. Once files has been prepared, it's time to test: @@ -357,7 +357,7 @@ ou > git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5] Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5] -Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file +Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommitted file Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match Note: Package is built into directory ../build-area Note: To compare 2 packages: debdiff package1.dsc package2.dsc diff --git a/build/debian/control b/build/debian/control old mode 100755 new mode 100644 diff --git a/build/debian/copyright b/build/debian/copyright index b99b8a65b5d..5f1b73d9b64 100644 --- a/build/debian/copyright +++ b/build/debian/copyright @@ -64,7 +64,7 @@ License: GPL-3+ Files: htdocs/includes/ckeditor/* Copyright: 2003-2012 CKSource - Frederico Knabben License: GPL-2+ - The ckeditor is tripple licensed under the GNU General Public License (GPL), + The ckeditor is triple licensed under the GNU General Public License (GPL), GNU Lesser General Public License (LGPL), and Mozilla Public License (MPL). In Debian, it is distributed under the GNU General Public License (GPL). . diff --git a/build/debian/dolibarr.config b/build/debian/dolibarr.config index 931c5d502df..d9f5d9a3f37 100644 --- a/build/debian/dolibarr.config +++ b/build/debian/dolibarr.config @@ -2,6 +2,8 @@ # Debian install package run: config, preinst, prerm, postinst, postrm # +# shellcheck disable=1091,2034 + set -e diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst index 1ae26c74025..651f48e7066 100644 --- a/build/debian/dolibarr.postinst +++ b/build/debian/dolibarr.postinst @@ -1,6 +1,8 @@ #!/bin/sh # postinst script for dolibarr +# shellcheck disable=1091,2086,2154 + set -e # summary of how this script can be called: diff --git a/build/debian/dolibarr.postrm b/build/debian/dolibarr.postrm index d10f81c0c3e..6d877b16dfb 100644 --- a/build/debian/dolibarr.postrm +++ b/build/debian/dolibarr.postrm @@ -3,6 +3,8 @@ # # see: dh_installdeb(1) +# shellcheck disable=1091,2006,2034,2086,2089,2090 + #set -e set +e diff --git a/build/debian/get-orig-source.sh b/build/debian/get-orig-source.sh index fdd38ea0851..9b2de84c7a3 100755 --- a/build/debian/get-orig-source.sh +++ b/build/debian/get-orig-source.sh @@ -1,5 +1,7 @@ #!/bin/sh +# shellcheck disable=2034,2086,2103,2164 + tmpdir=$(mktemp -d) diff --git a/build/debian/rules b/build/debian/rules index df6abfd1b89..5f8b14e49ea 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -4,7 +4,7 @@ export DH_VERBOSE=1 export DH_OPTIONS=-v -#export DH_COMPAT=7 # This is the debhelper compatability version to use, now defined into compat file +#export DH_COMPAT=7 # This is the debhelper compatibility version to use, now defined into compat file %: diff --git a/build/docker/docker-run.sh b/build/docker/docker-run.sh index 69f9e8e227c..07bc35947cf 100755 --- a/build/docker/docker-run.sh +++ b/build/docker/docker-run.sh @@ -2,8 +2,8 @@ # Script used by the Dockerfile. # See README.md to know how to create a Dolibarr env with docker -usermod -u ${HOST_USER_ID} www-data -groupmod -g ${HOST_USER_ID} www-data +usermod -u "${HOST_USER_ID}" www-data +groupmod -g "${HOST_USER_ID}" www-data chgrp -hR www-data /var/www/html chmod g+rwx /var/www/html/conf @@ -15,8 +15,8 @@ fi echo "[docker-run] => Set Permission to www-data for /var/documents" chown -R www-data:www-data /var/documents -echo "[docker-run] => update ${PHP_INI_DIR}/conf.d/dolibarr-php.ini" -cat < ${PHP_INI_DIR}/conf.d/dolibarr-php.ini +echo "[docker-run] => update '${PHP_INI_DIR}/conf.d/dolibarr-php.ini'" +cat < "${PHP_INI_DIR}/conf.d/dolibarr-php.ini" date.timezone = ${PHP_INI_DATE_TIMEZONE:-UTC} memory_limit = ${PHP_INI_MEMORY_LIMIT:-256M} EOF diff --git a/build/docker/mariadb/Dockerfile b/build/docker/mariadb/Dockerfile index a4db0f42065..792f0623bd4 100644 --- a/build/docker/mariadb/Dockerfile +++ b/build/docker/mariadb/Dockerfile @@ -1,3 +1,3 @@ FROM mariadb:latest -# Enable comented out UTF8 charset/collation options +# Enable commented out UTF8 charset/collation options RUN sed '/utf8/ s/^#//' /etc/mysql/mariadb.cnf >/tmp/t && mv /tmp/t /etc/mysql/mariadb.cnf diff --git a/build/doxygen/dolibarr-doxygen-build.pl b/build/doxygen/dolibarr-doxygen-build.pl index 5a4849a3a5b..32a852f22d8 100755 --- a/build/doxygen/dolibarr-doxygen-build.pl +++ b/build/doxygen/dolibarr-doxygen-build.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl #-------------------------------------------------------------------- -# Lance la generation de la doc dev doxygen +# Start the generation of the development documentation with doxygen #-------------------------------------------------------------------- -# Detecte repertoire du script +# Determine the patho of this script ($DIR=$0) =~ s/([^\/\\]+)$//; $DIR||='.'; $DIR =~ s/([^\/\\])[\\\/]+$/$1/; diff --git a/build/doxygen/dolibarr-doxygen.doxyfile b/build/doxygen/dolibarr-doxygen.doxyfile index debb1ce6301..d6fc7b1ef9e 100644 --- a/build/doxygen/dolibarr-doxygen.doxyfile +++ b/build/doxygen/dolibarr-doxygen.doxyfile @@ -283,10 +283,10 @@ TYPEDEF_HIDES_STRUCT = NO # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. +# causing a significant performance penalty. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the +# a logarithmic scale so increasing the size by one will roughly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols diff --git a/build/doxygen/doxygen-awesome.css b/build/doxygen/doxygen-awesome.css index 0b1c8c20892..21150c99adc 100644 --- a/build/doxygen/doxygen-awesome.css +++ b/build/doxygen/doxygen-awesome.css @@ -160,7 +160,7 @@ html { --toc-background: var(--side-nav-background); --toc-foreground: var(--side-nav-foreground); - /* height of an item in any tree / collapsable table */ + /* height of an item in any tree / collapsible table */ --tree-item-height: 30px; --memname-font-size: var(--code-font-size); diff --git a/build/launchpad/README b/build/launchpad/README index fc284e70b20..b1ebcd25678 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -49,7 +49,7 @@ If you want to build/test package locally: Use URL pattern (stable): For stable: http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz -- For Dev, you can also add link serie to GIT HEAD. +- For Dev, you can also add link series to GIT HEAD. - For stable, you can init from command line cd bzr/dolibarr-stable bzr init diff --git a/build/makepack-dolibarrtheme.pl b/build/makepack-dolibarrtheme.pl index 954111a09cb..2171d87922e 100755 --- a/build/makepack-dolibarrtheme.pl +++ b/build/makepack-dolibarrtheme.pl @@ -258,7 +258,7 @@ foreach my $target (keys %CHOOSEDTARGET) { if ($CHOOSEDTARGET{$target} < 0) { print "Package $target not built (bad requirement).\n"; } else { - print "Package $target built succeessfully in $DESTI\n"; + print "Package $target built successfully in $DESTI\n"; } } diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index ca228f804d0..654bca95256 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -18,7 +18,7 @@ Prerequisites to build autoexe DoliWamp package from Linux (solution seems broke See file build/exe/doliwamp.iss to know the doliwamp version currently setup. > Add path to ISCC into PATH windows var: Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH -> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded), +> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommended), open file build/exe/doliwamp.iss and click on button "Compile". The .exe file will be build into directory build. @@ -47,7 +47,7 @@ Prerequisites to build autoexe DoliWamp package from Windows: This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step. -- Check all files are commited. +- Check all files are committed. - Update version/info in ChangeLog, for this you can: To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" To generate a changelog of a major new version x.y.0 (from a repo on branch x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" @@ -72,7 +72,7 @@ Recopy the content of the output file into the file ChangeLog. This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. -- Check all files are commited. +- Check all files are committed. - Update version/info in ChangeLog, for this you can: To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" To generate a changelog of a major new version x.y.0 (from a repo pn branch x.y), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" diff --git a/build/obs/README b/build/obs/README index 44427c01d49..6b047b42fcf 100644 --- a/build/obs/README +++ b/build/obs/README @@ -54,5 +54,5 @@ OBS:QualityCategory Stable|Testing|Development|Private For example: https://bugzilla.novell.com/show_bug.cgi?id=848083 to be a maintener of category https://build.opensuse.org/project/show/Application:ERP - Once done, go into project, category, subproject and enter a subproject for your application. -Fo example: Dolibarr +For example: Dolibarr - Then go onto project into your home and ask a publish to the category/you project your created. diff --git a/build/patch/README b/build/patch/README index ec769bd3d71..6b63713122f 100644 --- a/build/patch/README +++ b/build/patch/README @@ -4,6 +4,6 @@ Building a Patch file ################################################## This directory contains tools to build a patch after a developer has made changes on files in its Dolibarr tree. -The output patch file can then be submited on Dolibarr dev mailing-list, with explanation on its goal, for inclusion in main branch. +The output patch file can then be submitted on Dolibarr dev mailing-list, with explanation on its goal, for inclusion in main branch. Using this tool is now deprecated. You must use git pull requests to submit contributions. diff --git a/build/patch/buildpatch.sh b/build/patch/buildpatch.sh index 9eb787278b3..a2c5787e853 100755 --- a/build/patch/buildpatch.sh +++ b/build/patch/buildpatch.sh @@ -10,6 +10,8 @@ # with explanation on its goal, for inclusion in main branch. #---------------------------------------------------------------------------- +# shellcheck disable=2086,2291 + echo ----- Building patch file mypatch.patch ----- if [ -z "$1" ] || [ -z "$2" ]; then diff --git a/build/phpstan/README b/build/phpstan/README index 9df049e5526..30f7a20b24e 100644 --- a/build/phpstan/README +++ b/build/phpstan/README @@ -5,12 +5,16 @@ PHPStan requires PHP >= 7.1 Config File is: ./phpstan.neon -In dolibarr/build/phpstan += Installation = + +cd ./build/phpstan mkdir phpstan cd phpstan composer require --dev phpstan/phpstan -Build report from CLI: + += Build report from CLI = + In dolibarr/ mv htdocs/custom /tmp/ php build/phpstan/phpstan/vendor/bin/phpstan -v analyze -c ./phpstan.neon -a build/phpstan/bootstrap.php --memory-limit 4G --error-format=table htdocs/commande/class @@ -19,4 +23,4 @@ mv /tmp/custom htdocs Build HTML report from Cron: Example of line to add into a cron to generate a HTML report: -0 1 5 * * cd /home/dolibarr/preview.dolibarr.org/dolibarr; chmod -R u+w /home/dolibarr/preview.dolibarr.org/dolibarr; git pull; /home/dolibarr/phpstan/vendor/bin/phpstan -v analyze -a build/phpstan/bootstrap.php --memory-limit 4G --error-format=github | awk ' BEGIN{ print "Date "strftime("%Y-%m-%d")"
" } { print $0"
" } END{ print NR } ' > /home/dolibarr/doxygen.dolibarr.org/phpstan/index.html +0 1 5 * * cd /home/dolibarr/preview.dolibarr.org/dolibarr; chmod -R u+w /home/dolibarr/preview.dolibarr.org/dolibarr; git pull; /home/dolibarr/phpstan/vendor/bin/phpstan -v analyze --memory-limit 4G --error-format=github | awk ' BEGIN{ print "Date "strftime("%Y-%m-%d")"
" } { print $0"
" } END{ print NR } ' > /home/dolibarr/doxygen.dolibarr.org/phpstan/index.html diff --git a/build/phpstan/bootstrap.php b/build/phpstan/bootstrap.php index b0cb9f90ef0..8538401f4aa 100644 --- a/build/phpstan/bootstrap.php +++ b/build/phpstan/bootstrap.php @@ -16,5 +16,5 @@ if (!defined("NOHTTPSREDIRECT")) { define("NOHTTPSREDIRECT", '1'); } -global $conf, $langs, $user, $db; +global $conf, $db, $langs, $user; include_once __DIR__ . '/../../htdocs/main.inc.php'; diff --git a/build/phpstan/bootstrap_action.php b/build/phpstan/bootstrap_action.php index e40a132ead3..1d39c7377f5 100644 --- a/build/phpstan/bootstrap_action.php +++ b/build/phpstan/bootstrap_action.php @@ -1,5 +1,16 @@ cond_reglement_id = dol_getIdFromCode($db, $condpayment, 'c_payment_term', 'libelle_facture', 'rowid', 1); if (empty($object->cond_reglement_id)) { - print " - Error cant find payment mode for ".$condpayment."\n"; + print " - Error can't find payment mode for ".$condpayment."\n"; $errorrecord++; } } diff --git a/dev/initdemo/initdemo.sh b/dev/initdemo/initdemo.sh index be971b4d4be..f50b4084c63 100755 --- a/dev/initdemo/initdemo.sh +++ b/dev/initdemo/initdemo.sh @@ -12,6 +12,8 @@ # Usage: initdemo.sh confirm # usage: initdemo.sh confirm mysqldump_dolibarr_x.x.x.sql database port login pass #------------------------------------------------------ +# shellcheck disable=2006,2034,2046,2064,2068,2086,2155,2166,2186,2172,2268 +# shellcheck disable=2012,2016,2115 export mydir=`echo "$0" | sed -e 's/initdemo.sh//'`; diff --git a/dev/initdemo/initdemopassword.sh b/dev/initdemo/initdemopassword.sh index 1e5d96d1bb0..e2929441e76 100755 --- a/dev/initdemo/initdemopassword.sh +++ b/dev/initdemo/initdemopassword.sh @@ -8,6 +8,8 @@ # Usage: initdemopassword.sh confirm # usage: initdemopassword.sh confirm base port login pass #------------------------------------------------------ +# shellcheck disable=2006,2034,2046,2064,2068,2086,2155,2166,2186,2172,2268 +# shellcheck disable=2012,2016,2154 export mydir=`echo "$0" | sed -e 's/initdemopassword.sh//'`; diff --git a/dev/initdemo/removeconfdemo.sh b/dev/initdemo/removeconfdemo.sh index 9bbb01be2a6..a076ebc975b 100755 --- a/dev/initdemo/removeconfdemo.sh +++ b/dev/initdemo/removeconfdemo.sh @@ -9,7 +9,7 @@ # WARNING: This script erase setup of instance, # but not the database #------------------------------------------------------ - +# shellcheck disable=2006,2034,2046,2064,2068,2086,2155,2166,2186,2172,2268 export mydir=`echo "$0" | sed -e 's/removedemo.sh//'`; if [ "x$mydir" = "x" ] diff --git a/dev/initdemo/savedemo.sh b/dev/initdemo/savedemo.sh index 9b509aba788..3e1951fe78d 100755 --- a/dev/initdemo/savedemo.sh +++ b/dev/initdemo/savedemo.sh @@ -9,7 +9,7 @@ # Usage: savedemo.sh # usage: savedemo.sh mysqldump_dolibarr_x.x.x.sql database port login pass #------------------------------------------------------ - +# shellcheck disable=2012,2006,2034,2046,2064,2086,2155,2166,2186,2172,2268 export mydir=`echo "$0" | sed -e 's/savedemo.sh//'`; if [ "x$mydir" = "x" ] diff --git a/dev/setup/apache/virtualhost b/dev/setup/apache/virtualhost index 7eff1859d4f..798031fb404 100644 --- a/dev/setup/apache/virtualhost +++ b/dev/setup/apache/virtualhost @@ -71,7 +71,7 @@ - # Log directoves + # Log directives ErrorLog /var/log/apache2/myvirtualalias_error_log TransferLog /var/log/apache2/myvirtualalias_access_log @@ -82,7 +82,7 @@ AddEncoding gzip .jgz - # Add cach performance directives + # Add cache performance directives ExpiresActive On ExpiresByType image/x-icon A2592000 ExpiresByType image/gif A2592000 diff --git a/dev/setup/codesniffer/php.ini b/dev/setup/codesniffer/php.ini index 00f3b2d4efa..6a5fa9b6292 100644 --- a/dev/setup/codesniffer/php.ini +++ b/dev/setup/codesniffer/php.ini @@ -1533,7 +1533,7 @@ session.cache_expire = 180 ; - User may send URL contains active session ID ; to other person via. email/irc/etc. ; - URL that contains active session ID may be stored -; in publically accessible computer. +; in publicly accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. ; http://php.net/session.use-trans-sid diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index e286450f73b..4949fda7800 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -110,7 +110,7 @@ --> - + '; + +$html .= ''; + +$html .= ''."\n"; + + +// Contributors + +$html .= '
'."\n"; +$html .= '

Contributors

'."\n"; + +$html .= '
'."\n"; + +$html .= 'TODO...'; + +$html .= '
'; + +$html .= '
'."\n"; + + +// Project value + +$html .= '
'."\n"; +$html .= '

Project value

'."\n"; $html .= '
'."\n"; $html .= '
'; -$html .= 'COCOMO value
(Basic organic model)
'; +$html .= 'COCOMO value
(Basic organic model)
'; $html .= '$'.formatNumber((empty($arraycocomo['proj']['currency']) ? 0 : $arraycocomo['proj']['currency']) + (empty($arraycocomo['dep']['currency']) ? 0 : $arraycocomo['dep']['currency']), 2).''; $html .= '
'; $html .= '
'; -$html .= 'COCOMO effort
(Basic organic model)
'; +$html .= 'COCOMO effort
(Basic organic model)
'; $html .= ''.formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']); -$html .= ' monthes people'; +$html .= ' months people'; $html .= '
'; $html .= '
'; @@ -392,31 +492,48 @@ foreach ($output_arrtd as $line) { //print $line."\n"; preg_match('/^::error file=(.*),line=(\d+),col=(\d+)::(.*)$/', $line, $reg); if (!empty($reg[1])) { - $tmp .= ''.$reg[1].''.$reg[2].''.$reg[4].''."\n"; + if ($nblines < 20) { + $tmp .= ''; + } else { + $tmp .= ''; + } + $tmp .= ''.$reg[1].''; + $tmp .= ''; + $tmp .= ''.$reg[2].''; + $tmp .= ''; + $tmp .= ''.$reg[4].''; + $tmp .= ''."\n"; $nblines++; } } + +// Technical debt + $html .= '
'."\n"; -$html .= '

Technical debt (PHPStan level '.$phpstanlevel.' -> '.$nblines.' warnings)


'."\n"; +$html .= '

Technical debt (PHPStan level '.$phpstanlevel.' -> '.$nblines.' warnings)

'."\n"; $html .= '
'."\n"; $html .= '
'."\n"; -$html .= ''."\n"; -$html .= ''."\n"; +$html .= '
FileLineType
'."\n"; +$html .= ''."\n"; $html .= $tmp; +$html .= ''; $html .= '
FileLineType
Show all...
'; $html .= '
'; $html .= '
'; $html .= '
'."\n"; + +// JS code + $html .= ' '; } -print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''."\n"; // Fields title search @@ -2660,7 +2660,7 @@ while ($i < $imaxinloop) { } else { // BUGGED CODE. // DOES NOT TAKE INTO ACCOUNT MANUFACTURING. THIS CODE SHOULD BE USELESS. PREVIOUS CODE SEEMS COMPLETE. // COUNT STOCK WHEN WE SHOULD ALREADY HAVE VALUE - // Detailed virtual stock, looks bugged, uncomplete and need heavy load. + // Detailed virtual stock, looks bugged, incomplete and need heavy load. // stock order and stock order_supplier $stock_order = 0; $stock_order_supplier = 0; diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index d5be3f7b82d..4a51d05908d 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -473,9 +473,9 @@ if ($search_billed != '' && $search_billed >= 0) { if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) if ($search_status == 1 && !isModEnabled('expedition')) { - $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' + $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status "sent" into "validated" } else { - $sql .= ' AND c.fk_statut = '.((int) $search_status); // brouillon, validee, en cours, annulee + $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled } } if ($search_status == -2) { // To process @@ -2119,7 +2119,7 @@ if ($resql) { } else { // BUGGED CODE. // DOES NOT TAKE INTO ACCOUNT MANUFACTURING. THIS CODE SHOULD BE USELESS. PREVIOUS CODE SEEMS COMPLETE. // COUNT STOCK WHEN WE SHOULD ALREADY HAVE VALUE - // Detailed virtual stock, looks bugged, uncomplete and need heavy load. + // Detailed virtual stock, looks bugged, incomplete and need heavy load. // stock order and stock order_supplier $stock_order = 0; $stock_order_supplier = 0; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index c26a10cec34..6bd2223a627 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -261,7 +261,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t"; $sql .= " WHERE t.date_ech between ".$wheretail; $sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')'; - //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; + //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_UNPAID; if (!empty($projectid)) { $sql .= " AND fk_projet = ".((int) $projectid); } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 0960b984c04..522b2d56939 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) { dol_print_error($db); } } else { - Header('Location: index.php'); + header('Location: index.php'); exit; } diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 3ea7584d05f..88ab3172ad9 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -338,10 +338,10 @@ class CashControl extends CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { return $this->updateCommon($user, $notrigger); } @@ -349,11 +349,11 @@ class CashControl extends CommonObject /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { return $this->deleteCommon($user, $notrigger); //return $this->deleteCommon($user, $notrigger, 1); diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 1b02beaa5f4..e7df4ff4342 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -356,6 +356,47 @@ class Invoices extends DolibarrApi return $this->_cleanObjectDatas($this->invoice); } + /** + * Create an invoice using a contract. + * + * @param int $contractid Id of the contract + * @return Object Object with cleaned properties + * + * @url POST /createfromcontract/{contractid} + * + * @throws RestException 400 + * @throws RestException 401 + * @throws RestException 404 + * @throws RestException 405 + */ + public function createInvoiceFromContract($contractid) + { + require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; + + if (!DolibarrApiAccess::$user->hasRight('contrat', 'lire')) { + throw new RestException(401); + } + if (!DolibarrApiAccess::$user->rights->facture->creer) { + throw new RestException(401); + } + if (empty($contractid)) { + throw new RestException(400, 'Contract ID is mandatory'); + } + + $contract = new Contrat($this->db); + $result = $contract->fetch($contractid); + if (!$result) { + throw new RestException(404, 'Contract not found'); + } + + $result = $this->invoice->createFromContract($contract, DolibarrApiAccess::$user); + if ($result < 0) { + throw new RestException(405, $this->invoice->error); + } + $this->invoice->fetchObjectLinked(); + return $this->_cleanObjectDatas($this->invoice); + } + /** * Get lines of an invoice * @@ -623,6 +664,11 @@ class Invoices extends DolibarrApi } $this->invoice->$field = $value; + + // If cond reglement => update date lim reglement + if ($field == 'cond_reglement_id') { + $this->invoice->date_lim_reglement = $this->invoice->calculate_date_lim_reglement(); + } } // update bank account diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f6750d673e5..84db8a44be2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3007,7 +3007,7 @@ class Facture extends CommonInvoice // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Tags the invoice as incompletely paied and call the trigger BILL_UNPAYED + * Tags the invoice as incompletely paid and call the trigger BILL_UNPAYED * This method is used when a direct debit (fr:prelevement) is refused * or when a canceled invoice is reopened. * @@ -3242,7 +3242,7 @@ class Facture extends CommonInvoice } else { if ($key == 'EMAIL') { // Check for mandatory - if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEMail($this->thirdparty->email)) { + if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEmail($this->thirdparty->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); @@ -6623,10 +6623,10 @@ class FactureLigne extends CommonInvoiceLine * Delete line in database * * @param User $tmpuser User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function delete($tmpuser = null, $notrigger = false) + public function delete($tmpuser = null, $notrigger = 0) { global $user; diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index de21bfeadd1..b8a4bb77c64 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -60,7 +60,7 @@ class Cpaiement extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -70,12 +70,11 @@ class Cpaiement extends CommonDict /** * Create object into database * - * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, Id of created object if OK + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); @@ -226,12 +225,11 @@ class Cpaiement extends CommonDict /** * Update object into database * - * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { $error = 0; @@ -311,12 +309,11 @@ class Cpaiement extends CommonDict /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index a73c6e140c7..98d4adb5c60 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -41,14 +41,14 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'banks', 'compta', 'companies')); -$action = GETPOST('action', 'alpha'); -$massaction = GETPOST('massaction', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); +$action = GETPOST('action', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist'; +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist'; -$facid = GETPOST('facid', 'int'); -$socid = GETPOST('socid', 'int'); +$facid = GETPOST('facid', 'int'); +$socid = GETPOST('socid', 'int'); $userid = GETPOST('userid', 'int'); $search_ref = GETPOST("search_ref", "alpha"); @@ -68,9 +68,10 @@ $search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be $search_status = GETPOST('search_status', 'intcomma'); $search_sale = GETPOST('search_sale', 'int'); +$mode = GETPOST('mode', 'alpha'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 8e35e46de3f..31a5893185d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -439,10 +439,10 @@ class BonPrelevement extends CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { return $this->updateCommon($user, $notrigger); } @@ -2084,7 +2084,7 @@ class BonPrelevement extends CommonObject fputs($this->file, substr(strtoupper($client_nom)." ", 0, 24)); // Domiciliation facultative D1 - $domiciliation = strtr($rib_dom, array(" " => "-", CHR(13) => " ", CHR(10) => "")); + $domiciliation = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => "")); fputs($this->file, substr($domiciliation." ", 0, 24)); // Zone Reservee D2 @@ -2189,8 +2189,8 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).''.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$row_country_code.''.$CrLf; - $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); if (trim($addressline1)) { $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } @@ -2258,8 +2258,8 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).''.$CrLf; $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$row_country_code.''.$CrLf; - $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); if (trim($addressline1)) { $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } @@ -2436,8 +2436,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); if ($addressline1) { $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } @@ -2502,8 +2502,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); if ($addressline1) { $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 58a692d2f11..8c29fe94dc8 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -78,7 +78,7 @@ class LignePrelevement /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 13fffee6cc0..c66dda3df0a 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -67,7 +67,7 @@ class RejetPrelevement /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler * @param User $user Object user * @param string $type Type ('direct-debit' for direct debit or 'bank-transfer' for credit transfer) */ diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index c1ace761438..653c14b49e6 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -182,7 +182,7 @@ $months = array( $langs->trans("MonthShort12"), ); -llxheader('', $langs->trans('ReportInOut')); +llxHeader('', $langs->trans('ReportInOut')); $formaccounting = new FormAccounting($db); $form = new Form($db); diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 89b6db0e0cc..c670676806b 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -85,7 +85,7 @@ if ($id > 0 || $ref) { $permissiontoread = $user->rights->tax->charges->lire; $permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_UNPAID); $permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index baaadd685d1..1c106b8d399 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -82,7 +82,7 @@ class Cchargesociales /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -92,12 +92,11 @@ class Cchargesociales /** * Create object into database * - * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, Id of created object if OK + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); @@ -236,12 +235,11 @@ class Cchargesociales /** * Update object into database * - * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { $error = 0; @@ -310,12 +308,11 @@ class Cchargesociales /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index c0751d0f842..5ca22da196c 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -84,7 +84,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ $permissiontoread = $user->rights->tax->charges->lire; $permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_UNPAID); $permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1].'/vat'; diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 65dbb19aca7..d6d1a6c04d6 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -187,7 +187,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ $head = array(); if ($id > 0) { - // Si edition contact deja existant + // Si edition contact deja existent $object = new Contact($db); $res = $object->fetch($id, $user); if ($res < 0) { diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 301f9dbac0c..2061d2c711f 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -18,12 +18,12 @@ /** * \file htdocs/contact/canvas/actions_contactcard_common.class.php * \ingroup thirdparty - * \brief Fichier de la classe Thirdparty contact card controller (common) + * \brief File for the class Thirdparty contact card controller (common) */ /** * \class ActionsContactCardCommon - * \brief Classe permettant la gestion des contacts par defaut + * \brief Common Abstract Class for contact managmeent */ abstract class ActionsContactCardCommon { diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index adad330f60c..7816e07148a 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -19,20 +19,20 @@ /** * \file htdocs/contact/canvas/default/actions_contactcard_default.class.php * \ingroup thirdparty - * \brief Fichier de la classe Thirdparty contact card controller (default canvas) + * \brief File for the class Thirdparty contact card controller (default canvas) */ include_once DOL_DOCUMENT_ROOT.'/contact/canvas/actions_contactcard_common.class.php'; /** * \class ActionsContactCardDefault - * \brief Classe permettant la gestion des contacts par defaut + * \brief Default Class to manage contacts */ class ActionsContactCardDefault extends ActionsContactCardCommon { /** * Constructor * - * @param DoliDB $db Handler acces base de donnees + * @param DoliDB $db Handler access base de donnees * @param string $dirmodule Name of directory of module * @param string $targetmodule Name of directory of module where canvas is stored * @param string $canvas Name of canvas diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 1f3aa963476..43e65ab45be 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -175,7 +175,7 @@ if (empty($reshook)) { } - // Confirmation desactivation + // Confirmation deactivation if ($action == 'disable' && !empty($permissiontoadd)) { $object->fetch($id); if ($object->setstatus(0) < 0) { @@ -257,7 +257,7 @@ if (empty($reshook)) { $action = 'create'; } - if (!empty($object->email) && !isValidEMail($object->email)) { + if (!empty($object->email) && !isValidEmail($object->email)) { $langs->load("errors"); $error++; $errors[] = $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha')); @@ -348,7 +348,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (!empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)) && !isValidEMail(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (!empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)) && !isValidEmail(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $langs->load("errors"); $error++; $errors[] = $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha')); @@ -608,7 +608,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ $head = array(); if ($id > 0) { - // Si edition contact deja existant + // Si edition contact deja existent $object = new Contact($db); $res = $object->fetch($id, $user); if ($res < 0) { @@ -896,7 +896,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; - // Add personnal information + // Add personal information print load_fiche_titre('
'.$langs->trans("PersonalInformations").'
', '', ''); print '
'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 5931e4e5de6..92e3d3b2369 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -81,7 +81,7 @@ class Contact extends CommonObject * 'noteditable' says if field is not editable (1 or 0) * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'css' is the CSS style to use on field. For example: 'maxwidth200' @@ -557,10 +557,10 @@ class Contact extends CommonObject } /** - * Update informations into database + * Update information into database * * @param int $id Id of contact/address to update - * @param User $user Objet user making change + * @param User $user Object user making change * @param int $notrigger 0=no, 1=yes * @param string $action Current action for hookmanager * @param int $nosyncuser No sync linked user (external users and contacts are linked) @@ -889,7 +889,7 @@ class Contact extends CommonObject $this->db->begin(); - // Mis a jour contact + // Update the contact $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET"; $sql .= " birthday = ".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null"); $sql .= ", photo = ".($this->photo ? "'".$this->db->escape($this->photo)."'" : "null"); @@ -1961,7 +1961,7 @@ class Contact extends CommonObject global $langs; $lib = $langs->trans("ProspectLevel".$fk_prospectlevel); - // If lib not found in language file, we get label from cache/databse + // If lib not found in language file, we get label from cache/database if ($lib == $langs->trans("ProspectLevel".$fk_prospectlevel)) { $lib = $langs->getLabelFromKey($this->db, $fk_prospectlevel, 'c_prospectlevel', 'code', 'label'); } @@ -2120,7 +2120,7 @@ class Contact extends CommonObject /** * get "blacklist" mailing status - * set no_email attribut to 1 or 0 + * set no_email attribute to 1 or 0 * * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index ee74c92c52e..0692572d396 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -149,7 +149,7 @@ if (getDolGlobalString('LDAP_CONTACT_ACTIVE') && getDolGlobalInt('LDAP_CONTACT_A -// Affichage attributs LDAP +// Affichage attributes LDAP print load_fiche_titre($langs->trans("LDAPInformationsForThisContact")); print '
'; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 8ecd25f94ae..cacc80be90f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -441,7 +441,7 @@ if (getDolGlobalString('THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES')) $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields -// Select every potentiels, and note each potentiels which fit in search parameters +// Select every potentials, and note each potentials which fit in search parameters $tab_level = array(); $sql = "SELECT code, label, sortorder"; $sql .= " FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel"; diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index aec034fbe8c..b475262ca32 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -21,7 +21,7 @@ /** * \file htdocs/contact/perso.php * \ingroup societe - * \brief Onglet informations personnelles d'un contact + * \brief Onglet information personnelles d'un contact */ // Load Dolibarr environment diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 33818122a4f..5760cc9e670 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -117,7 +117,7 @@ if ($company->id) { } } -// Personal informations +// Personal information $v->setPhoneNumber($contact->phone_perso, "TYPE=HOME;VOICE"); if ($contact->birthday) { $v->setBirthday($contact->birthday); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index eedd7c948e0..7f6a0958e06 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -560,7 +560,7 @@ if (empty($reshook)) { $desc = $prod->description; - //If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time + //If text set in desc is the same as product descpription (as now it's preloaded) we add it only one time if ($product_desc == $desc && getDolGlobalString('PRODUIT_AUTOFILL_DESC')) { $product_desc = ''; } @@ -1690,7 +1690,7 @@ if ($action == 'create') { $colspan++; } - // Dates of service planed and real + // Dates of service planned and real if ($objp->subprice >= 0) { print ''; print ''; print '
'; @@ -1820,7 +1820,7 @@ if ($action == 'create') { $colspan++; } - // Line dates planed + // Line dates planned print '
'; print $langs->trans("DateStartPlanned").' '; @@ -1971,7 +1971,7 @@ if ($action == 'create') { print ''; - // Definie date debut et fin par defaut + // Definie date debut et fin par default $dateactstart = $objp->date_start; if (GETPOST('remonth')) { $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); @@ -2028,7 +2028,7 @@ if ($action == 'create') { print '
'; - // Definie date debut et fin par defaut + // Definie date debut et fin par default $dateactstart = $objp->date_start_real; if (GETPOST('remonth')) { $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 2cd4ec3d349..8e54ba37989 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -57,7 +57,7 @@ class Contracts extends DolibarrApi /** * Get properties of a contract object * - * Return an array with contract informations + * Return an array with contract information * * @param int $id ID of contract * @return Object Object with cleaned properties @@ -95,7 +95,7 @@ class Contracts extends DolibarrApi * @param int $page Page number * @param string $thirdparty_ids Thirdparty ids to filter contracts of (example '1' or '1,2,3') {@pattern /^[0-9,]*$/i} * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names * @return array Array of contract objects * * @throws RestException 404 Not found @@ -191,7 +191,7 @@ class Contracts extends DolibarrApi foreach ($request_data as $field => $value) { if ($field === 'caller') { - // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again whith the caller + // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller $this->contract->context['caller'] = $request_data['caller']; continue; } @@ -504,7 +504,7 @@ class Contracts extends DolibarrApi continue; } if ($field === 'caller') { - // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again whith the caller + // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller $this->contract->context['caller'] = $request_data['caller']; continue; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index cc7f992053c..2e7b222698a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -122,7 +122,7 @@ class Contrat extends CommonObject public $fk_soc; - public $societe; // Objet societe + public $societe; // Object societe /** * Status of the contract @@ -226,7 +226,7 @@ class Contrat extends CommonObject * 'noteditable' says if field is not editable (1 or 0) * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'css' is the CSS style to use on field. For example: 'maxwidth200' @@ -338,7 +338,7 @@ class Contrat extends CommonObject /** * Activate a contract line * - * @param User $user Objet User who activate contract + * @param User $user Object User who activate contract * @param int $line_id Id of line to activate * @param int $date_start Opening date * @param int|string $date_end Expected end date @@ -361,7 +361,7 @@ class Contrat extends CommonObject /** * Close a contract line * - * @param User $user Objet User who close contract + * @param User $user Object User who close contract * @param int $line_id Id of line to close * @param int $date_end End date * @param string $comment A comment typed by user @@ -490,7 +490,7 @@ class Contrat extends CommonObject /** * Validate a contract * - * @param User $user Objet User + * @param User $user Object User * @param string $force_number Reference to force on contract (not implemented yet) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Return integer <0 if KO, >0 if OK @@ -2163,7 +2163,7 @@ class Contrat extends CommonObject } /** - * Charge les informations d'ordre info dans l'objet contrat + * Charge les information d'ordre info dans l'objet contrat * * @param int $id id du contrat a charger * @return void @@ -2280,7 +2280,7 @@ class Contrat extends CommonObject /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * - * @param User $user Objet user + * @param User $user Object user * @param string $mode "inactive" pour services a activer, "expired" pour services expires * @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK */ @@ -2376,7 +2376,7 @@ class Contrat extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Charge indicateurs this->nb de tableau de bord + * Load the indicators this->nb for state board * * @return int Return integer <0 si ko, >0 si ok */ @@ -2467,7 +2467,7 @@ class Contrat extends CommonObject } } - // Initialise parametres + // Initialise parameters $this->id = 0; $this->specimen = 1; @@ -3130,7 +3130,7 @@ class ContratLigne extends CommonObjectLine /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -3744,7 +3744,7 @@ class ContratLigne extends CommonObjectLine /** * Activate a contract line * - * @param User $user Objet User who activate contract + * @param User $user Object User who activate contract * @param int $date Date real activation * @param int|string $date_end Date planned end. Use '-1' to keep it unchanged. * @param string $comment A comment typed by user @@ -3802,7 +3802,7 @@ class ContratLigne extends CommonObjectLine /** * Close a contract line * - * @param User $user Objet User who close contract + * @param User $user Object User who close contract * @param int $date_end_real Date end * @param string $comment A comment typed by user * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index d93128db070..86c7abfb7f2 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -50,7 +50,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { '; @@ -207,9 +209,21 @@ class box_funnel_of_prospection extends ModeleBoxes $stringtoprint .= ''; $stringtoprint .= "\n"; } + $customlabels[] = $customlabel; + if ($maxamount < $amount) { + $maxamount = $amount; + } } - $customlabels[] = $customlabel; } + + // Permit to have a bar if value inferior to a certain value + $valuetoaddtomindata = $maxamount / 100; + foreach ($data as $key => $value) { + if ($value != "") { + $data[$key] = $valuetoaddtomindata + $value; + } + } + $dataseries[] = $data; if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; diff --git a/htdocs/core/boxes/box_last_knowledgerecord.php b/htdocs/core/boxes/box_last_knowledgerecord.php index 7f9f67c71d5..f54a7787f6b 100644 --- a/htdocs/core/boxes/box_last_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_knowledgerecord.php @@ -46,7 +46,7 @@ class box_last_knowledgerecord extends ModeleBoxes public $boxlabel; /** - * @var array box dependancies + * @var array box dependencies */ public $depends = array("knowledgemanagement"); diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php index c0095043343..baf376bcbe7 100644 --- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php @@ -46,7 +46,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes public $boxlabel; /** - * @var array box dependancies + * @var array box dependencies */ public $depends = array("knowledgemanagement"); diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index a2e0f3bdcae..95377278a45 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -83,7 +83,7 @@ class box_project extends ModeleBoxes $companystatic = new Societe($this->db); $socid = 0; - //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. + //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment. // Get list of project id allowed to user (in a string list separated by coma) $projectsListId = ''; diff --git a/htdocs/core/boxes/box_project_opportunities.php b/htdocs/core/boxes/box_project_opportunities.php index 9ba1d5a61d9..aedb173421d 100644 --- a/htdocs/core/boxes/box_project_opportunities.php +++ b/htdocs/core/boxes/box_project_opportunities.php @@ -80,7 +80,7 @@ class box_project_opportunities extends ModeleBoxes $companystatic = new Societe($this->db); $socid = 0; - //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. + //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment. // Get list of project id allowed to user (in a string list separated by coma) $projectsListId = ''; diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index d917e64657c..ff020b312d6 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -88,7 +88,7 @@ class box_validated_projects extends ModeleBoxes $projectstatic = new Project($this->db); $socid = 0; - //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. + //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment. // Get list of project id allowed to user (in a string list separated by coma) $projectsListId = ''; diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 66ab4de6070..e99f4660a30 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -31,7 +31,7 @@ * * Boxes parent class */ -class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" boxes +class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" boxes { /** * @var DoliDB Database handler @@ -207,7 +207,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $MAXLENGTHBOX = 60; // Mettre 0 pour pas de limite + $MAXLENGTHBOX = 60; // When set to 0: no length limit $cachetime = 900; // 900 : 15mn $cachedir = DOL_DATA_ROOT.'/boxes/temp'; @@ -273,7 +273,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box //$out.= ''; - // Onwer + // Owner print '
date_contrat, 'day'); ?> hasRight('contrat', 'lire') && !getDolGlobalString('CONTRACT_SHOW_TOTAL_OF_PRODUCT_AS_PRICE')) { $totalcontrat = 0; diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 754e3eceda3..f5b8f27c939 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -58,11 +58,11 @@ if ($action == 'add' && !empty($permissiontoadd)) { foreach ($object->fields as $key => $val) { if ($object->fields[$key]['type'] == 'duration') { if (GETPOST($key.'hour') == '' && GETPOST($key.'min') == '') { - continue; // The field was not submited to be saved + continue; // The field was not submitted to be saved } } else { if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type'])) { - continue; // The field was not submited to be saved + continue; // The field was not submitted to be saved } } // Ignore special fields @@ -197,10 +197,10 @@ if ($action == 'add' && !empty($permissiontoadd)) { // Action to update record if ($action == 'update' && !empty($permissiontoadd)) { foreach ($object->fields as $key => $val) { - // Check if field was submited to be edited + // Check if field was submitted to be edited if ($object->fields[$key]['type'] == 'duration') { if (!GETPOSTISSET($key.'hour') || !GETPOSTISSET($key.'min')) { - continue; // The field was not submited to be saved + continue; // The field was not submitted to be saved } } elseif ($object->fields[$key]['type'] == 'boolean') { if (!GETPOSTISSET($key)) { @@ -209,7 +209,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { } } else { if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type']) && $object->fields[$key]['type']!=='checkbox') { - continue; // The field was not submited to be saved + continue; // The field was not submitted to be saved } } // Ignore special fields diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 65f722ff0bb..a563b791f51 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -348,7 +348,7 @@ if ($action == 'update') { $params['options'] = array($parameters=>null); } } else { - //Esle it's separated key/value and coma list + //Else it's separated key/value and coma list foreach ($parameters_array as $param_ligne) { list($key, $value) = explode(',', $param_ligne); if (!array_key_exists('options', $params)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index f48011c252a..459869c274a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -319,7 +319,7 @@ if (!$error && $massaction == 'confirm_presend') { if (empty($sendto)) { if ($objectobj->element == 'societe') { - $objectobj->thirdparty = $objectobj; // Hack so following code is comaptible when objectobj is a thirdparty + $objectobj->thirdparty = $objectobj; // Hack so following code is compatible when objectobj is a thirdparty } //print "No recipient for thirdparty ".$objectobj->thirdparty->name; @@ -334,7 +334,7 @@ if (!$error && $massaction == 'confirm_presend') { if (GETPOST('addmaindocfile')) { // TODO Use future field $objectobj->fullpathdoc to know where is stored default file - // TODO If not defined, use $objectobj->model_pdf (or defaut invoice config) to know what is template to use to regenerate doc. + // TODO If not defined, use $objectobj->model_pdf (or default invoice config) to know what is template to use to regenerate doc. $filename = dol_sanitizeFileName($objectobj->ref).'.pdf'; $subdir = ''; // TODO Set subdir to be compatible with multi levels dir trees @@ -674,7 +674,7 @@ if (!$error && $massaction == 'confirm_presend') { $resaction .= $langs->trans("NbSent").': '.($nbsent ? $nbsent : 0)."\n
"; if ($nbsent) { - $action = ''; // Do not show form post if there was at least one successfull sent + $action = ''; // Do not show form post if there was at least one successful sent //setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs'); setEventMessages($langs->trans("EMailSentForNElements", $nbsent.'/'.count($toselect)), null, 'mesgs'); setEventMessages($resaction, null, 'mesgs'); @@ -1215,7 +1215,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd setEventMessage('CategTypeNotFound', 'errors'); } if (!empty($affecttag_type_array)) { - //check if tag type submited exists into Tag Map categorie class + //check if tag type submitted exists into Tag Map categorie class require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categ = new Categorie($db); $to_affecttag_type_array=array(); @@ -1586,7 +1586,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $ // If no SQL error, we redirect to the request form if (!$error) { - // Calculcate number of days consumed + // Calculate number of days consumed $nbopenedday = num_open_day($objecttmp->date_debut_gmt, $objecttmp->date_fin_gmt, 0, 1, $objecttmp->halfday); $soldeActuel = $objecttmp->getCpforUser($objecttmp->fk_user, $objecttmp->fk_type); $newSolde = ($soldeActuel - $nbopenedday); diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index ebc6d5fe3ae..4bda5b8de86 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -91,7 +91,7 @@ if (GETPOST('removAll', 'alpha')) { foreach ($listofpaths as $key => $value) { $pathtodelete = $value; $filetodelete = $listofnames[$key]; - $result = dol_delete_file($pathtodelete, 1); // Delete uploded Files + $result = dol_delete_file($pathtodelete, 1); // Delete uploaded Files $langs->load("other"); setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs'); @@ -454,7 +454,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { $mesg .= '
Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; } else { - $mesg .= '
Unkown Error, please refers to your administrator'; + $mesg .= '
Unknown Error, please refer to your administrator'; } } $mesg .= ''; diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index b247c1c2cc5..3d3e24db88b 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -61,7 +61,7 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); //see #21072: Update a public note with a "document model not found" is not really a problem : the PDF is not created/updated - //but the note is saved, so just add a notification will be enought + //but the note is saved, so just add a notification will be enough $resultGenDoc = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($resultGenDoc < 0) { setEventMessages($object->error, $object->errors, 'warnings'); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 07b7aaf904a..2593b668bb0 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -159,7 +159,7 @@ if (!empty($conf->use_javascript_ajax) && !getDolGlobalString('MAIN_ECM_DISABLE_ jQuery(document).ready(function () { jQuery(".classfortooltip").tooltip({ show: { collision: "flipfit", effect:\'toggle\', delay:50 }, - hide: { delay: 50 }, /* If I enable effect:\'toggle\' here, a bug appears: the tooltip is shown when collpasing a new dir if it was shown before */ + hide: { delay: 50 }, /* If I enable effect:\'toggle\' here, a bug appears: the tooltip is shown when collapsing a new dir if it was shown before */ tooltipClass: "mytooltip", content: function () { return $(this).prop(\'title\'); /* To force to get title as is */ diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 3a56d1df6d3..4408e327e2b 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -99,7 +99,7 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto /*$time_update = (int) $conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY; // Always defined if (!empty($_SESSION['auto_check_events_not_before'])) { - // We start scan from the not before so if two tabs were opend at differents seconds and we close one (so the js timer), + // We start scan from the not before so if two tabs were opened at different moments and we close one (so the js timer), // then we are not losing periods $starttime = $_SESSION['auto_check_events_not_before']; // Protection to avoid too long sessions @@ -137,7 +137,7 @@ if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto $resql = $db->query($sql); if ($resql) { while ($obj = $db->fetch_object($resql)) { - // Message must be formated and translated to be used with javascript directly + // Message must be formatted and translated to be used with javascript directly $event = array(); $event['type'] = 'agenda'; $event['id_reminder'] = $obj->id_reminder; diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index ae7c0cd6dc4..1bc87d06145 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/ajax/objectonoff.php * \brief File to set status for an object. Called when ajax_object_onoff() is used. - * This Ajax service is oftenly called when option MAIN_DIRECT_STATUS_UPDATE is set. + * This Ajax service is often called when option MAIN_DIRECT_STATUS_UPDATE is set. */ if (!defined('NOTOKENRENEWAL')) { diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 49afbcc0953..996f7be806d 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -162,7 +162,7 @@ if ($action == "importSignature") { $param['online_sign_name'] = $online_sign_name; $param['pathtoimage'] = $upload_dir . $filename; - $s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297); + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); for ($i = 1; $i < ($pagecount + 1); $i++) { try { $tppl = $pdf->importPage($i); @@ -319,7 +319,7 @@ if ($action == "importSignature") { $param['online_sign_name'] = $online_sign_name; $param['pathtoimage'] = $upload_dir . $filename; - $s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297); + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); for ($i = 1; $i < ($pagecount + 1); $i++) { try { $tppl = $pdf->importPage($i); @@ -432,7 +432,7 @@ if ($action == "importSignature") { $param['online_sign_name'] = $online_sign_name; $param['pathtoimage'] = $upload_dir . $filename; - $s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297); + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); for ($i = 1; $i < ($pagecount + 1); $i++) { try { $tppl = $pdf->importPage($i); @@ -548,7 +548,7 @@ if ($action == "importSignature") { //$pdf->Open(); $pagecount = $pdf->setSourceFile($sourcefile); // original PDF - $s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297); + $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297); for ($i = 1; $i < ($pagecount + 1); $i++) { try { $tppl = $pdf->importPage($i); diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php index 96700b261da..fefd2e736ed 100644 --- a/htdocs/core/ajax/pingresult.php +++ b/htdocs/core/ajax/pingresult.php @@ -51,7 +51,7 @@ $hash_algo = GETPOST('hash_algo', 'alpha'); // Security check -// None. Beeing connected is enough. +// None. Being connected is enough. diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 6e7bba1e5de..ba7725d06aa 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -44,7 +44,7 @@ if (!isset($usedbyinclude) || empty($usedbyinclude)) { $res = @include '../../main.inc.php'; // Security check - // None. Beeing connected is enough. + // None. Being connected is enough. top_httphead('application/json'); diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 0c744adfa4a..8fdde13d467 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -22,7 +22,7 @@ /** * \file htdocs/core/boxes/box_actions.php * \ingroup actions - * \brief Module to build boxe for events + * \brief Module to build box for events */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; diff --git a/htdocs/core/boxes/box_actions_future.php b/htdocs/core/boxes/box_actions_future.php index ef94e988782..6a202bd9f2b 100644 --- a/htdocs/core/boxes/box_actions_future.php +++ b/htdocs/core/boxes/box_actions_future.php @@ -22,7 +22,7 @@ /** * \file htdocs/core/boxes/box_actions_future.php * \ingroup actions - * \brief Module to build boxe for events + * \brief Module to build box for events */ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 9540cc86ad7..698cd6504a2 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -156,8 +156,8 @@ class box_external_rss extends ModeleBoxes $title = mb_convert_encoding($title, 'ISO-8859-1'); } - $title = preg_replace("/([[:alnum:]])\?([[:alnum:]])/", "\\1'\\2", $title); // Gere probleme des apostrophes mal codee/decodee par utf8 - $title = preg_replace("/^\s+/", "", $title); // Supprime espaces de debut + $title = preg_replace("/([[:alnum:]])\?([[:alnum:]])/", "\\1'\\2", $title); // Manage issue of quotes improperly (de)coded in utf-8 + $title = preg_replace("/^\s+/", "", $title); // Remove leading whitespace $this->info_box_contents["$href"] = "$title"; $tooltip = $title; diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index 73e6a1c7522..7971a47eed2 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -186,6 +186,7 @@ class box_funnel_of_prospection extends ModeleBoxes $data = array(''); $customlabels = array(); $total = 0; + $maxamount = 0; foreach ($listofstatus as $status) { $customlabel = ''; $labelStatus = ''; @@ -198,8 +199,9 @@ class box_funnel_of_prospection extends ModeleBoxes $labelStatus = $listofopplabel[$status]; } $amount = (isset($valsamount[$status]) ? (float) $valsamount[$status] : 0); + $customlabel = $amount."€"; + $data[] = $amount; - $customlabel = $amount; $liststatus[] = $labelStatus; if (!$conf->use_javascript_ajax) { $stringtoprint .= '
'.price((isset($valsamount[$status]) ? (float) $valsamount[$status] : 0), 0, '', 1, -1, -1, $conf->currency).'
'; $out .= '
'; $out .= $sublink; - // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object + // The image must have the class 'boxhandle' because it's value used in DOM draggable objects to define the area used to catch the full object $out .= img_picto($langs->trans("MoveBox", $this->box_id), 'grip_title', 'class="opacitymedium boxhandle hideonsmartphone cursormove marginleftonly"'); $out .= img_picto($langs->trans("CloseBox", $this->box_id), 'close_title', 'class="opacitymedium boxclose cursorpointer marginleftonly" rel="x:y" id="imgclose'.$this->box_id.'"'); $label = $head['text']; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 43b700b7dd2..030af2d2e41 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -261,7 +261,7 @@ class CMailFile if (getDolGlobalString('MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS')) { // Off by default // Search into the body for findHtmlImages($dolibarr_main_data_root.'/medias'); if ($findimg<0) { @@ -382,7 +382,7 @@ class CMailFile dol_syslog("CMailFile::CMailfile: sendmode=".$this->sendmode." addr_bcc=$addr_bcc, replyto=$replyto", LOG_DEBUG); - // We set all data according to choosed sending method. + // We set all data according to chose sending method. // We also set a value for ->msgid if ($this->sendmode == 'mail') { // Use mail php function (default PHP method) @@ -421,7 +421,7 @@ class CMailFile // We now define $this->headers and $this->message $this->headers = $smtp_headers.$mime_headers; - // On nettoie le header pour qu'il ne se termine pas par un retour chariot. + // Clean the header to avoid that it terminates with a CR character. // This avoid also empty lines at end that can be interpreted as mail injection by email servers. $this->headers = preg_replace("/([\r\n]+)$/i", "", $this->headers); @@ -774,7 +774,7 @@ class CMailFile } } - // Action according to choosed sending method + // Action according to chose sending method if ($this->sendmode == 'mail') { // Use mail php function (default PHP method) // ------------------------------------------ @@ -826,7 +826,7 @@ class CMailFile } if (getDolGlobalString('MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM')) { - $additionnalparam .= ($additionnalparam ? ' ' : '').'-U '.$additionnalparam; // Use -U to add additionnal params + $additionnalparam .= ($additionnalparam ? ' ' : '').'-U '.$additionnalparam; // Use -U to add additional params } $linuxlike = 1; @@ -1357,7 +1357,7 @@ class CMailFile /** - * Correct an uncomplete html string + * Correct an incomplete html string * * @param string $msg String * @return string Completed string @@ -1800,7 +1800,7 @@ class CMailFile /** * Search images into html message and init array this->images_encoded if found * - * @param string $images_dir Location of physical images files. For example $dolibarr_main_data_root.'/medias' + * @param string $images_dir Path to store physical images files. For example $dolibarr_main_data_root.'/medias' * @return int >0 if OK, <0 if KO */ private function findHtmlImages($images_dir) @@ -1888,7 +1888,7 @@ class CMailFile * Seearch images with data:image format into html message. * If we find some, we create it on disk. * - * @param string $images_dir Location of where to store physicaly images files. For example $dolibarr_main_data_root.'/medias' + * @param string $images_dir Location of where to store physically images files. For example $dolibarr_main_data_root.'/medias' * @return int >0 if OK, <0 if KO */ private function findHtmlImagesIsSrcData($images_dir) @@ -1919,7 +1919,7 @@ class CMailFile if (!empty($matches) && !empty($matches[1])) { if (empty($images_dir)) { - // No temp directory provided, so we are not able to support convertion of data:image into physical images. + // No temp directory provided, so we are not able to support conversion of data:image into physical images. $this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk'; return -1; } @@ -1992,7 +1992,7 @@ class CMailFile $arrayaddress = explode(',', $address); - // Boucle sur chaque composant de l'adresse + // Boucle sur chaque composant de l'address $i = 0; foreach ($arrayaddress as $val) { $regs = array(); @@ -2061,7 +2061,7 @@ class CMailFile $arrayaddress = explode(',', $address); - // Boucle sur chaque composant de l'adresse + // Boucle sur chaque composant de l'address foreach ($arrayaddress as $val) { if (preg_match('/^(.*)<(.*)>$/i', trim($val), $regs)) { $name = trim($regs[1]); diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index a60d5db9f52..ae94b01a505 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -87,7 +87,7 @@ class CSMSFile { global $conf; - // On definit fin de ligne + // Define the line ending (TODO: Why not use PHP_EOL?) $this->eol = "\n"; if (preg_match('/^win/i', PHP_OS)) { $this->eol = "\r\n"; @@ -96,7 +96,7 @@ class CSMSFile $this->eol = "\r"; } - // If ending method not defined + // If SMS sending method not defined if (!getDolGlobalString('MAIN_SMS_SENDMODE')) { $this->error = 'No SMS Engine defined'; throw new Exception('No SMS Engine defined'); @@ -105,7 +105,7 @@ class CSMSFile dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".getDolGlobalString('MAIN_SMS_SENDMODE')." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".strlen($msg), LOG_DEBUG); dol_syslog("CSMSFile::CSMSFile: deferred=".$deferred." priority=".$priority." class=".$class, LOG_DEBUG); - // Action according to choosed sending method + // Action according to chosen sending method $this->addr_from = $from; $this->addr_to = $to; $this->deferred = $deferred; @@ -118,16 +118,16 @@ class CSMSFile /** - * Send sms that was prepared by constructor + * Send SMS that was prepared by constructor * - * @return boolean True if sms sent, false otherwise + * @return boolean True if SMS sent, false otherwise */ public function sendfile() { global $conf; $errorlevel = error_reporting(); - error_reporting($errorlevel ^ E_WARNING); // Desactive warnings + error_reporting($errorlevel ^ E_WARNING); // Disable warnings $res = false; @@ -141,7 +141,7 @@ class CSMSFile } if (!getDolGlobalString('MAIN_DISABLE_ALL_SMS')) { - // Action according to the choosed sending method + // Action according to the chose sending method if (getDolGlobalString('MAIN_SMS_SENDMODE')) { $sendmode = getDolGlobalString('MAIN_SMS_SENDMODE'); // $conf->global->MAIN_SMS_SENDMODE looks like a value 'module' $classmoduleofsender = getDolGlobalString('MAIN_MODULE_'.strtoupper($sendmode).'_SMS', $sendmode); // $conf->global->MAIN_MODULE_XXX_SMS looks like a value 'class@module' diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index f3f98c753ed..0a065041efe 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -43,7 +43,7 @@ class Ccountry extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -272,7 +272,7 @@ class Ccountry extends CommonDict } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) diff --git a/htdocs/core/class/cgenericdic.class.php b/htdocs/core/class/cgenericdic.class.php index 029552a9432..f488ab75937 100644 --- a/htdocs/core/class/cgenericdic.class.php +++ b/htdocs/core/class/cgenericdic.class.php @@ -59,7 +59,7 @@ class CGenericDic extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -71,12 +71,11 @@ class CGenericDic extends CommonDict /** * Create object into database * - * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, Id of created object if OK + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); @@ -294,12 +293,11 @@ class CGenericDic extends CommonDict /** * Update object into database * - * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { $error = 0; @@ -370,12 +368,11 @@ class CGenericDic extends CommonDict /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/core/class/commondict.class.php b/htdocs/core/class/commondict.class.php index 57ba7dec3ce..976dcac7e2a 100644 --- a/htdocs/core/class/commondict.class.php +++ b/htdocs/core/class/commondict.class.php @@ -28,7 +28,7 @@ abstract class CommonDict { /** - * @var DoliDb Database handler (result of a new DoliDB) + * @var DoliDB Database handler (result of a new DoliDB) */ public $db; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a33f3fc1b2d..aa7ae9144ae 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -71,7 +71,7 @@ abstract class CommonDocGenerator public $update_main_doc_field; /** - * @var string The name of constant to use to scan ODT files (Exemple: 'COMMANDE_ADDON_PDF_ODT_PATH') + * @var string The name of constant to use to scan ODT files (Example: 'COMMANDE_ADDON_PDF_ODT_PATH') */ public $scandir; @@ -877,7 +877,7 @@ abstract class CommonDocGenerator $array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs); } - // Add infor from $object->xxx where xxx has been loaded by fetch_origin() of shipment + // Add info from $object->xxx where xxx has been loaded by fetch_origin() of shipment if (!empty($object->commande) && is_object($object->commande)) { $array_shipment['order_ref'] = $object->commande->ref; $array_shipment['order_ref_customer'] = $object->commande->ref_customer; @@ -1087,7 +1087,7 @@ abstract class CommonDocGenerator // Sorting uasort($this->cols, array($this, 'columnSort')); - // Positionning + // Positioning $curX = $this->page_largeur - $this->marge_droite; // start from right // Array width @@ -1231,7 +1231,7 @@ abstract class CommonDocGenerator * print standard column content * * @param TCPDF $pdf pdf object - * @param float $curY curent Y position + * @param float $curY current Y position * @param string $colKey the column key * @param string $columnText column text * @return int Return integer <0 if KO, >= if OK @@ -1254,9 +1254,9 @@ abstract class CommonDocGenerator if (empty($columnText)) { return 0; } - $pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set curent position + $pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set current position $colDef = $this->cols[$colKey]; - // save curent cell padding + // save current cell padding $curentCellPaddinds = $pdf->getCellPaddings(); // set cell padding with column content definition $pdf->setCellPaddings(isset($colDef['content']['padding'][3]) ? $colDef['content']['padding'][3] : 0, isset($colDef['content']['padding'][0]) ? $colDef['content']['padding'][0] : 0, isset($colDef['content']['padding'][1]) ? $colDef['content']['padding'][1] : 0, isset($colDef['content']['padding'][2]) ? $colDef['content']['padding'][2] : 0); @@ -1274,7 +1274,7 @@ abstract class CommonDocGenerator * print description column content * * @param TCPDF $pdf pdf object - * @param float $curY curent Y position + * @param float $curY current Y position * @param string $colKey the column key * @param object $object CommonObject * @param int $i the $object->lines array key @@ -1288,7 +1288,7 @@ abstract class CommonDocGenerator { // load desc col params $colDef = $this->cols[$colKey]; - // save curent cell padding + // save current cell padding $curentCellPaddinds = $pdf->getCellPaddings(); // set cell padding with column content definition $pdf->setCellPaddings($colDef['content']['padding'][3], $colDef['content']['padding'][0], $colDef['content']['padding'][1], $colDef['content']['padding'][2]); @@ -1383,7 +1383,7 @@ abstract class CommonDocGenerator * * @param object $object line of common object * @param Translate $outputlangs Output language - * @param array $params array of additionals parameters + * @param array $params array of additional parameters * @return string Html string */ public function getExtrafieldsInHtml($object, $outputlangs, $params = array()) @@ -1394,7 +1394,7 @@ abstract class CommonDocGenerator return ""; } - // Load extrafields if not allready done + // Load extrafields if not already done if (empty($this->extrafieldsCache)) { $this->extrafieldsCache = new ExtraFields($this->db); } @@ -1463,7 +1463,7 @@ abstract class CommonDocGenerator $field->label = $outputlangs->transnoentities($label); $field->type = $extrafields->attributes[$object->table_element]['type'][$key]; - // dont display if empty + // don't display if empty if ($disableOnEmpty && empty($field->content)) { continue; } @@ -1612,7 +1612,7 @@ abstract class CommonDocGenerator } if (empty($hidetop)) { - // save curent cell padding + // save current cell padding $curentCellPaddinds = $pdf->getCellPaddings(); // Add space for lines (more if we need to show a second alternative language) @@ -1684,7 +1684,7 @@ abstract class CommonDocGenerator if (!empty($extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]) && array_key_exists('label', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) { - // Dont display separator yet even is set to be displayed (not compatible yet) + // Don't display separator yet even is set to be displayed (not compatible yet) if ($extrafields->attributes[$object->table_element]['type'][$key] == 'separate') { continue; } @@ -1701,7 +1701,7 @@ abstract class CommonDocGenerator if (!$enabled) { continue; - } // don't wast resourses if we don't need them... + } // don't waste resources if we don't need them... // Load language if required if (!empty($extrafields->attributes[$object->table_element]['langfile'][$key])) { @@ -1776,7 +1776,7 @@ abstract class CommonDocGenerator 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/class/commonincoterm.class.php b/htdocs/core/class/commonincoterm.class.php index 305e9bcd01c..3b1d820e58b 100644 --- a/htdocs/core/class/commonincoterm.class.php +++ b/htdocs/core/class/commonincoterm.class.php @@ -48,7 +48,7 @@ trait CommonIncoterm // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return incoterms informations + * Return incoterms information * TODO Use a cache for label get * * @return string incoterms info @@ -76,7 +76,7 @@ trait CommonIncoterm } /** - * Return incoterms informations for pdf display + * Return incoterms information for pdf display * * @return string|boolean Incoterms info or false */ diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 83f38d2a70f..ec6444e9f67 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -196,7 +196,7 @@ abstract class CommonInvoice extends CommonObject * If paid partially, $this->close_code can be: * - CLOSECODE_DISCOUNTVAT * - CLOSECODE_BADDEBT - * If paid completelly, this->close_code will be null + * If paid completely, this->close_code will be null */ const STATUS_CLOSED = 2; @@ -765,7 +765,7 @@ abstract class CommonInvoice extends CommonObject * Return label of object status * * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto - * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) * @return string Label of status */ public function getLibStatut($mode = 0, $alreadypaid = -1) @@ -780,7 +780,7 @@ abstract class CommonInvoice extends CommonObject * @param int $paye Status field paye * @param int $status Id status * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=long label + picto - * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, -1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, -1 otherwise) * @param int $type Type invoice. If -1, we use $this->type * @return string Label of status */ @@ -905,7 +905,7 @@ abstract class CommonInvoice extends CommonObject } $this->db->free($resqltemp); - /* Definition de la date limite */ + /* Definition de la date limit */ // 0 : adding the number of days if ($cdr_type == 0) { @@ -1230,7 +1230,7 @@ abstract class CommonInvoice extends CommonObject $result = $this->db->query($sql); if ($result < 0) { $error++; - $this->errors[] = "Error on updateing fk_prelevement_bons to ".$bon->id; + $this->errors[] = "Error on updating fk_prelevement_bons to ".$bon->id; } } */ @@ -1333,7 +1333,7 @@ abstract class CommonInvoice extends CommonObject $stripecard = null; if ($companypaymentmode->type == 'ban') { // Check into societe_rib if a payment mode for Stripe and ban payment exists - // To make a Stripe SEPA payment request, we must have the payment mode source already saved into societe_rib and retreived with ->sepaStripe + // To make a Stripe SEPA payment request, we must have the payment mode source already saved into societe_rib and retrieved with ->sepaStripe // The payment mode source is created when we create the bank account on Stripe with paymentmodes.php?action=create $stripecard = $stripe->sepaStripe($customer, $companypaymentmode, $stripeacc, $servicestatus, 0); } else { @@ -1436,7 +1436,7 @@ abstract class CommonInvoice extends CommonObject $postactionmessages[] = 'Success to request '.$type.' (' . $charge->id . ' with ' . $stripearrayofkeys['publishable_key'] . ')'; - // Save a stripe payment was done in realy life so later we will be able to force a commit on recorded payments + // Save a stripe payment was done in real life so later we will be able to force a commit on recorded payments // even if in batch mode (method doTakePaymentStripe), we will always make all action in one transaction with a forced commit. $this->stripechargedone++; @@ -1758,7 +1758,7 @@ abstract class CommonInvoice extends CommonObject $s .= "\n"; } if ($bankaccount->id > 0 && getDolGlobalString('PDF_SWISS_QRCODE_USE_OWNER_OF_ACCOUNT_AS_CREDITOR')) { - // If a bank account is prodived and we ask to use it as creditor, we use the bank address + // If a bank account is provided and we ask to use it as creditor, we use the bank address // TODO In a future, we may always use this address, and if name/address/zip/town/country differs from $mysoc, we can use the address of $mysoc into the final seller field ? $s .= "S\n"; $s .= dol_trunc($bankaccount->proprio, 70, 'right', 'UTF-8', 1)."\n"; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index dc1b14b3813..75fd4a5e47a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -52,7 +52,7 @@ abstract class CommonObject public $module; /** - * @var DoliDb Database handler (result of a new DoliDB) + * @var DoliDB Database handler (result of a new DoliDB) */ public $db; @@ -2926,12 +2926,11 @@ abstract class CommonObject * Change the shipping method * * @param int $shipping_method_id Id of shipping method - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @param User $userused Object user - * - * @return int 1 if OK, 0 if KO + * @return int 1 if OK, 0 if KO */ - public function setShippingMethod($shipping_method_id, $notrigger = false, $userused = null) + public function setShippingMethod($shipping_method_id, $notrigger = 0, $userused = null) { global $user; @@ -3051,11 +3050,11 @@ abstract class CommonObject * Change the bank account * * @param int $fk_account Id of bank account - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @param User $userused Object user - * @return int 1 if OK, 0 if KO + * @return int 1 if OK, 0 if KO */ - public function setBankAccount($fk_account, $notrigger = false, $userused = null) + public function setBankAccount($fk_account, $notrigger = 0, $userused = null) { global $user; @@ -6479,7 +6478,7 @@ abstract class CommonObject if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump('iii'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { - // If old value encrypted in database is same than submited new value, it means we don't change it, so we don't update. + // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. if ($algo == 'dolcrypt') { // dolibarr reversible encryption if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master @@ -6903,7 +6902,7 @@ abstract class CommonObject //var_dump($key.' '.$this->array_options["options_".$key].' '.$algo); if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump($this->oldcopy->array_options["options_".$key]); var_dump($this->array_options["options_".$key]); - if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submited new value, it means we don't change it, so we don't update. + if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submitted new value, it means we don't change it, so we don't update. if ($algo == 'dolcrypt') { // dolibarr reversible encryption if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master @@ -9617,10 +9616,10 @@ abstract class CommonObject * Create object into database * * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, Id of created object if OK */ - public function createCommon(User $user, $notrigger = false) + public function createCommon(User $user, $notrigger = 0) { global $langs; @@ -9911,10 +9910,10 @@ abstract class CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function updateCommon(User $user, $notrigger = false) + public function updateCommon(User $user, $notrigger = 0) { dol_syslog(get_class($this)."::updateCommon update", LOG_DEBUG); @@ -10013,11 +10012,11 @@ abstract class CommonObject * Delete object in database * * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @param int $forcechilddeletion 0=no, 1=Force deletion of children * @return int Return integer <0 if KO, 0=Nothing done because object has child, >0 if OK */ - public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0) + public function deleteCommon(User $user, $notrigger = 0, $forcechilddeletion = 0) { dol_syslog(get_class($this)."::deleteCommon delete", LOG_DEBUG); @@ -10225,13 +10224,11 @@ abstract class CommonObject * * @param User $user User that delete * @param int $idline Id of line to delete - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int >0 if OK, <0 if KO */ - public function deleteLineCommon(User $user, $idline, $notrigger = false) + public function deleteLineCommon(User $user, $idline, $notrigger = 0) { - global $conf; - $error = 0; $tmpforobjectclass = get_class($this); diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 9f53c4ada61..5efb3fadb2c 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -195,7 +195,7 @@ abstract class CommonObjectLine extends CommonObject } /** - * Empty function to prevent errors on call of this function must be overload if usefull + * Empty function to prevent errors on call of this function must be overload if useful * * @param string $sortorder Sort Order * @param string $sortfield Sort field diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 7bf9bd0222c..fc625e49b57 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -34,11 +34,11 @@ // 1.1 : + : Added unit in the constructor // + : Now Positions start @ (1,1).. then the first image @top-left of a page is (1,1) // + : Added in the description of a label : -// font-size : defaut char size (can be changed by calling Set_Char_Size(xx); +// font-size : default char size (can be changed by calling Set_Char_Size(xx); // paper-size : Size of the paper for this sheet (thanx to Al Canton) // metric : type of unit used in this description // You can define your label properties in inches by setting metric to 'in' -// and printing in millimiter by setting unit to 'mm' in constructor. +// and printing in millimeter by setting unit to 'mm' in constructor. // Added some labels : // 5160, 5161, 5162, 5163,5164 : thanx to Al Canton : acanton@adams-blake.com // 8600 : thanx to Kunal Walia : kunal@u.washington.edu @@ -93,7 +93,7 @@ abstract class CommonStickerGenerator extends CommonDocGenerator protected $_Height = 0; // Hauteur des caracteres protected $_Char_Size = 10; - // Hauteur par defaut d'une ligne + // Hauteur par default d'une ligne protected $_Line_Height = 10; // Type of metric.. Will help to calculate good values protected $_Metric = 'mm'; @@ -122,9 +122,9 @@ abstract class CommonStickerGenerator extends CommonDocGenerator // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Function to build PDF on disk, then output on HTTP strem. + * Function to build PDF on disk, then output on HTTP stream. * - * @param array $arrayofrecords Array of record informations (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) + * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $outputdir Output directory for pdf file diff --git a/htdocs/core/class/cproductnature.class.php b/htdocs/core/class/cproductnature.class.php index 7022de50ba1..2b518adbc53 100644 --- a/htdocs/core/class/cproductnature.class.php +++ b/htdocs/core/class/cproductnature.class.php @@ -50,7 +50,7 @@ class CProductNature extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/class/cregion.class.php b/htdocs/core/class/cregion.class.php index eb919c08791..ba0e966ba05 100644 --- a/htdocs/core/class/cregion.class.php +++ b/htdocs/core/class/cregion.class.php @@ -51,7 +51,7 @@ class Cregion extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -294,7 +294,7 @@ class Cregion extends CommonDict } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 2dc406fe6a1..0ed00e3e847 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -53,7 +53,7 @@ class Cstate extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -266,7 +266,7 @@ class Cstate extends CommonDict } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index 0e22b450a39..b1d88898338 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -41,7 +41,7 @@ class Ctypent extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 86435564e26..2b1a8cc26f1 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -51,7 +51,7 @@ class Ctyperesource extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -62,11 +62,10 @@ class Ctyperesource extends CommonDict * Create object into database * * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); @@ -259,12 +258,11 @@ class Ctyperesource extends CommonDict /** * Update object into database * - * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { $error = 0; @@ -326,12 +324,11 @@ class Ctyperesource extends CommonDict /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index e09a6ce88fb..cd16e4edeac 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -51,7 +51,7 @@ class CUnits extends CommonDict /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -460,7 +460,7 @@ class CUnits extends CommonDict // TODO : add base col into unit dictionary table $unit = $this->db->fetch_object($sql); if ($unit) { - // TODO : if base exists in unit dictionary table, remove this convertion exception and update convertion infos in database. + // TODO : if base exists in unit dictionary table, remove this conversion exception and update conversion infos in database. // Example time hour currently scale 3600 will become scale 2 base 60 if ($unit->unit_type == 'time') { return (float) $unit->scale; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 059f9a2f393..55f590f91ab 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -70,7 +70,7 @@ class DefaultValues extends CommonObject * 'noteditable' says if field is not editable (1 or 0) * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' @@ -137,7 +137,7 @@ class DefaultValues extends CommonObject /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -175,10 +175,10 @@ class DefaultValues extends CommonObject * Create object into database * * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { return $this->createCommon($user, $notrigger); } @@ -322,10 +322,10 @@ class DefaultValues extends CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { return $this->updateCommon($user, $notrigger); } @@ -333,11 +333,11 @@ class DefaultValues extends CommonObject /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { return $this->deleteCommon($user, $notrigger); } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 4d3f15b8d1c..6f8157ca22c 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -294,7 +294,7 @@ class DiscountAbsolute extends CommonObject /** - * Delete object in database. If fk_facture_source is defined, we delete all familiy with same fk_facture_source. If not, only with id is removed + * Delete object in database. If fk_facture_source is defined, we delete all family with same fk_facture_source. If not, only with id is removed * * @param User $user Object of user asking to delete * @return int Return integer <0 if KO, >0 if OK @@ -354,9 +354,9 @@ class DiscountAbsolute extends CommonObject // Delete but only if not used $sql = "DELETE FROM ".$this->db->prefix()."societe_remise_except "; if ($this->fk_facture_source) { - $sql .= " WHERE fk_facture_source = ".((int) $this->fk_facture_source); // Delete all lines of same serie + $sql .= " WHERE fk_facture_source = ".((int) $this->fk_facture_source); // Delete all lines of same series } elseif ($this->fk_invoice_supplier_source) { - $sql .= " WHERE fk_invoice_supplier_source = ".((int) $this->fk_invoice_supplier_source); // Delete all lines of same serie + $sql .= " WHERE fk_invoice_supplier_source = ".((int) $this->fk_invoice_supplier_source); // Delete all lines of same series } else { $sql .= " WHERE rowid = ".((int) $this->id); // Delete only line } diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 9f4f844e9de..80856441d2d 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -201,7 +201,7 @@ class DolGeoIP } /** - * Return verion of data file + * Return version of data file * * @return string Version of datafile */ diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 606ad2719af..66898fb0ec3 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -76,7 +76,7 @@ class DolGraph public $showpointvalue = 1; public $showpercent = 0; public $combine = 0; // 0.05 if you want to combine records < 5% into "other" - public $graph; // Objet Graph (Artichow, Phplot...) + public $graph; // Object Graph (Artichow, Phplot...) /** * @var boolean Mirrors graph values */ @@ -350,7 +350,7 @@ class DolGraph /** * Set type * - * @param array $type Array with type for each serie. Example: array('type1', 'type2', ...) where type can be: + * @param array $type Array with type for each series. Example: array('type1', 'type2', ...) where type can be: * 'pie', 'piesemicircle', 'polar', 'lines', 'linesnopoint', 'bars', 'horizontalbars'... * @return void */ @@ -534,7 +534,7 @@ class DolGraph /** * Show pointvalue or not * - * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value, 2=Show values for each serie on same point + * @param int $showpointvalue 1=Show value for each point, as tooltip or inline (default), 0=Hide value, 2=Show values for each series on same point * @return void */ public function setShowPointValue($showpointvalue) @@ -633,7 +633,7 @@ class DolGraph $nbseries = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); foreach ($this->data as $x) { // Loop on each x - for ($i = 0; $i < $nbseries; $i++) { // Loop on each serie + for ($i = 0; $i < $nbseries; $i++) { // Loop on each series if (is_null($max)) { $max = $x[$i + 1]; // $i+1 because the index 0 is the legend } elseif ($max < $x[$i + 1]) { @@ -663,7 +663,7 @@ class DolGraph $nbseries = (empty($this->data[0]) ? 0 : count($this->data[0]) - 1); foreach ($this->data as $x) { // Loop on each x - for ($i = 0; $i < $nbseries; $i++) { // Loop on each serie + for ($i = 0; $i < $nbseries; $i++) { // Loop on each series if (is_null($min)) { $min = $x[$i + 1]; // $i+1 because the index 0 is the legend } elseif ($min > $x[$i + 1]) { @@ -801,10 +801,10 @@ class DolGraph //if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x $i = $firstlot; - $serie = array(); - while ($i < $nblot) { // Loop on each serie - $values = array(); // Array with horizontal y values (specific values of a serie) for each abscisse x - $serie[$i] = "var d" . $i . " = [];\n"; + $series = array(); + while ($i < $nblot) { // Loop on each series + $values = array(); // Array with horizontal y values (specific values of a series) for each abscisse x + $series[$i] = "var d" . $i . " = [];\n"; // Fill array $values $x = 0; @@ -817,13 +817,13 @@ class DolGraph if (isset($this->type[$firstlot]) && in_array($this->type[$firstlot], array('pie', 'piesemicircle', 'polar'))) { foreach ($values as $x => $y) { if (isset($y)) { - $serie[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n"; + $series[$i] .= 'd' . $i . '.push({"label":"' . dol_escape_js($legends[$x]) . '", "data":' . $y . '});' . "\n"; } } } else { foreach ($values as $x => $y) { if (isset($y)) { - $serie[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n"; + $series[$i] .= 'd' . $i . '.push([' . $x . ', ' . $y . ']);' . "\n"; } } } @@ -857,8 +857,8 @@ class DolGraph $this->stringtoshow .= '' . "\n"; } else { while ($i < $nblot) { - $this->stringtoshow .= '' . "\n"; - $this->stringtoshow .= $serie[$i] . "\n"; + $this->stringtoshow .= '' . "\n"; + $this->stringtoshow .= $series[$i] . "\n"; $i++; } } @@ -1093,14 +1093,14 @@ class DolGraph // Works with line but not with bars //if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x - $serie = array(); + $series = array(); $arrayofgroupslegend = array(); //var_dump($this->data); $i = $firstlot; - while ($i < $nblot) { // Loop on each serie - $values = array(); // Array with horizontal y values (specific values of a serie) for each abscisse x (with x=0,1,2,...) - $serie[$i] = ""; + while ($i < $nblot) { // Loop on each series + $values = array(); // Array with horizontal y values (specific values of a series) for each abscisse x (with x=0,1,2,...) + $series[$i] = ""; // Fill array $values $x = 0; @@ -1128,9 +1128,9 @@ class DolGraph $j = 0; foreach ($values as $x => $y) { if (isset($y)) { - $serie[$i] .= ($j > 0 ? ", " : "") . $y; + $series[$i] .= ($j > 0 ? ", " : "") . $y; } else { - $serie[$i] .= ($j > 0 ? ", " : "") . 'null'; + $series[$i] .= ($j > 0 ? ", " : "") . 'null'; } $j++; } @@ -1138,7 +1138,7 @@ class DolGraph $values = null; // Free mem $i++; } - //var_dump($serie); + //var_dump($series); //var_dump($arrayofgroupslegend); $tag = dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-', '.')))); @@ -1173,7 +1173,7 @@ class DolGraph } else { while ($i < $nblot) { //$this->stringtoshow .= ''."\n"; - //$this->stringtoshow .= $serie[$i]."\n"; + //$this->stringtoshow .= $series[$i]."\n"; $i++; } } @@ -1218,11 +1218,11 @@ class DolGraph $this->stringtoshow .= 'rotation: -Math.PI,' . "\n"; } $this->stringtoshow .= 'elements: { arc: {' . "\n"; - // Color of earch arc + // Color of each arc $this->stringtoshow .= 'backgroundColor: ['; $i = 0; $foundnegativecolor = 0; - foreach ($legends as $val) { // Loop on each serie + foreach ($legends as $val) { // Loop on each series if ($i > 0) { $this->stringtoshow .= ', ' . "\n"; } @@ -1245,7 +1245,7 @@ class DolGraph if ($foundnegativecolor) { $this->stringtoshow .= 'borderColor: ['; $i = 0; - foreach ($legends as $val) { // Loop on each serie + foreach ($legends as $val) { // Loop on each series if ($i > 0) { $this->stringtoshow .= ', ' . "\n"; } @@ -1277,7 +1277,7 @@ class DolGraph labels: ['; $i = 0; - foreach ($legends as $val) { // Loop on each serie + foreach ($legends as $val) { // Loop on each series if ($i > 0) { $this->stringtoshow .= ', '; } @@ -1289,7 +1289,7 @@ class DolGraph datasets: ['; $i = 0; $i = 0; - while ($i < $nblot) { // Loop on each serie + while ($i < $nblot) { // Loop on each series $color = 'rgb(' . $this->datacolor[$i][0] . ', ' . $this->datacolor[$i][1] . ', ' . $this->datacolor[$i][2] . ')'; if ($i > 0) { @@ -1298,7 +1298,7 @@ class DolGraph $this->stringtoshow .= '{' . "\n"; //$this->stringtoshow .= 'borderColor: \''.$color.'\', '; //$this->stringtoshow .= 'backgroundColor: \''.$color.'\', '; - $this->stringtoshow .= ' data: [' . $serie[$i] . ']'; + $this->stringtoshow .= ' data: [' . $series[$i] . ']'; $this->stringtoshow .= '}' . "\n"; $i++; } @@ -1342,7 +1342,25 @@ class DolGraph if (empty($showlegend)) { $this->stringtoshow .= 'legend: { display: false }, '."\n"; } else { - $this->stringtoshow .= 'legend: { maxWidth: '.round(intVal($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n"; + $this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n"; + } + if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) { + $this->stringtoshow .= 'tooltip: { mode: \'nearest\', + callbacks: {'; + if (is_array($this->tooltipsTitles)) { + $this->stringtoshow .=' + title: function(tooltipItem, data) { + var tooltipsTitle ='.json_encode($this->tooltipsTitles).' + return tooltipsTitle[tooltipItem[0].datasetIndex]; + },'; + } + if (is_array($this->tooltipsLabels)) { + $this->stringtoshow .= 'label: function(tooltipItem, data) { + var tooltipslabels ='.json_encode($this->tooltipsLabels).' + return tooltipslabels[tooltipItem.datasetIndex] + }'; + } + $this->stringtoshow .='}},'; } $this->stringtoshow .= "}, \n"; @@ -1396,7 +1414,7 @@ class DolGraph labels: ['; $i = 0; - foreach ($legends as $val) { // Loop on each serie + foreach ($legends as $val) { // Loop on each series if ($i > 0) { $this->stringtoshow .= ', '; } @@ -1414,7 +1432,7 @@ class DolGraph $i = 0; $iinstack = 0; $oldstacknum = -1; - while ($i < $nblot) { // Loop on each serie + while ($i < $nblot) { // Loop on each series $foundnegativecolor = 0; $usecolorvariantforgroupby = 0; // We used a 'group by' and we have too many colors so we generated color variants per @@ -1441,10 +1459,10 @@ class DolGraph if ($iinstack) { // Change color with offset of $iinstack //var_dump($newcolor); - if ($iinstack % 2) { // We increase agressiveness of reference color for color 2, 4, 6, ... + if ($iinstack % 2) { // We increase aggressiveness of reference color for color 2, 4, 6, ... $ratio = min(95, 10 + 10 * $iinstack); // step of 20 $brightnessratio = min(90, 5 + 5 * $iinstack); // step of 10 - } else { // We decrease agressiveness of reference color for color 3, 5, 7, .. + } else { // We decrease aggressiveness of reference color for color 3, 5, 7, .. $ratio = max(-100, -15 * $iinstack + 10); // step of -20 $brightnessratio = min(90, 10 * $iinstack); // step of 20 } @@ -1503,7 +1521,7 @@ class DolGraph } $this->stringtoshow .= 'data: ['; - $this->stringtoshow .= $this->mirrorGraphValues ? '[-' . $serie[$i] . ',' . $serie[$i] . ']' : $serie[$i]; + $this->stringtoshow .= $this->mirrorGraphValues ? '[-' . $series[$i] . ',' . $series[$i] . ']' : $series[$i]; $this->stringtoshow .= ']'; $this->stringtoshow .= '}' . "\n"; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 9e347343982..231698ee186 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -75,7 +75,7 @@ class EmailSenderProfile extends CommonObject * 'noteditable' says if field is not editable (1 or 0) * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'css' is the CSS style to use on field. For example: 'maxwidth200' @@ -138,7 +138,7 @@ class EmailSenderProfile extends CommonObject /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -158,10 +158,10 @@ class EmailSenderProfile extends CommonObject * Create object into database * * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { return $this->createCommon($user, $notrigger); } @@ -251,10 +251,10 @@ class EmailSenderProfile extends CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { return $this->updateCommon($user, $notrigger); } @@ -262,17 +262,17 @@ class EmailSenderProfile extends CommonObject /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { return $this->deleteCommon($user, $notrigger); } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @return string String with URL @@ -342,7 +342,7 @@ class EmailSenderProfile extends CommonObject } /** - * Charge les informations d'ordre info dans l'objet commande + * Charge les information d'ordre info dans l'objet commande * * @param int $id Id of order * @return void diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index bd3c7d05055..42c3cf2890d 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -30,7 +30,7 @@ * which are stored in the object. Try it, it's fun! * * METHODS - * $m->evalute($expr) + * $m->evaluate($expr) * Evaluates the expression and returns the result. If an error occurs, * prints a warning and returns false. If $expr is a function assignment, * returns true on success. @@ -263,7 +263,7 @@ class EvalMath return $this->trigger(4, "illegal character '_'", "_"); // but not in the input expression // =============== } elseif ((in_array($op, $ops) or $ex) and $expecting_op) { // are we putting an operator on the stack? - if ($ex) { // are we expecting an operator but have a number/variable/function/opening parethesis? + if ($ex) { // are we expecting an operator but have a number/variable/function/opening parenthesis? $op = '*'; $index--; // it's an implicit multiplication } @@ -347,7 +347,7 @@ class EvalMath } elseif (in_array($op, $ops) and !$expecting_op) { return $this->trigger(8, "unexpected operator '$op'", $op); } else { // I don't even want to know what you did to get here - return $this->trigger(9, "an unexpected error occured"); + return $this->trigger(9, "an unexpected error occurred"); } if ($index == strlen($expr)) { if (in_array($op, $ops)) { // did we end with an operator? bad. diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 5d28ea7501e..afedee6759f 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -290,7 +290,7 @@ class ExtraFields * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check - * @param string $list Visibily + * @param string $list Visibility * @param string $help Help on tooltip * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value @@ -464,7 +464,7 @@ class ExtraFields $sql .= " FROM ".$this->db->prefix()."extrafields"; $sql .= " WHERE elementtype = '".$this->db->escape($elementtype)."'"; $sql .= " AND name = '".$this->db->escape($attrname)."'"; - //$sql.= " AND entity IN (0,".$conf->entity.")"; Do not test on entity here. We want to see if there is still on field remaning in other entities before deleting field in table + //$sql.= " AND entity IN (0,".$conf->entity.")"; Do not test on entity here. We want to see if there is still on field remaining in other entities before deleting field in table $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); @@ -663,7 +663,7 @@ class ExtraFields * @param array $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check - * @param string $list Visiblity + * @param string $list Visibility * @param string $help Help on tooltip. * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value @@ -736,7 +736,7 @@ class ExtraFields } if ($entity === '' || $entity != '0') { - // We dont want on all entities, we delete all and current + // We don't want on all entities, we delete all and current $sql_del = "DELETE FROM ".$this->db->prefix()."extrafields"; $sql_del .= " WHERE name = '".$this->db->escape($attrname)."'"; $sql_del .= " AND entity IN (0, ".($entity === '' ? $conf->entity : $entity).")"; @@ -824,7 +824,7 @@ class ExtraFields // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load the array of extrafields defintion $this->attributes + * Load the array of extrafields definition $this->attributes * * @param string $elementtype Type of element ('all' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param boolean $forceload Force load of extra fields whatever is status of cache. @@ -933,7 +933,7 @@ class ExtraFields * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) * @param int $objectid Current object id - * @param string $extrafieldsobjectkey The key to use to store retreived data (commonly $object->table_element) + * @param string $extrafieldsobjectkey The key to use to store retrieved data (commonly $object->table_element) * @param int $mode 1=Used for search filters * @return string */ @@ -1440,28 +1440,28 @@ class ExtraFields // Pattern for word=$ID$ $word = '\b[a-zA-Z0-9-\.-_]+\b=\$ID\$'; - // Removing space arount =, ( and ) + // Removing spaces around =, ( and ) $InfoFieldList[4] = preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]); $nbPreg = 1; // While we have parenthesis while ($nbPreg != 0) { - // Init des compteurs + // Initialise counters $nbPregRepl = $nbPregSel = 0; - // On retire toutes les parenthèses sans = avant + // Remove all parenthesis not preceded with '=' sign $InfoFieldList[4] = preg_replace('#([^=])(\([^)^(]*('.$word.')[^)^(]*\))#', '$1 $3 ', $InfoFieldList[4], -1, $nbPregRepl); - // On retire les espaces autour des = et parenthèses + // Remove all escape characters around '=' and parenthesis $InfoFieldList[4] = preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]); - // On retire toutes les parenthèses avec = avant + // Remove all parentheses preceded with '=' $InfoFieldList[4] = preg_replace('#\b[a-zA-Z0-9-\.-_]+\b=\([^)^(]*('.$word.')[^)^(]*\)#', '$1 ', $InfoFieldList[4], -1, $nbPregSel); - // On retire les espaces autour des = et parenthèses + // On retire les escapes autour des = et parenthèses $InfoFieldList[4] = preg_replace('# *(=|\(|\)) *#', '$1', $InfoFieldList[4]); - // Calcul du compteur général pour la boucle + // UPdate the totals counter for the loop $nbPreg = $nbPregRepl + $nbPregSel; } - // Si l'on a un AND ou un OR, avant ou après + // In case there is AND ou OR, before or after $matchCondition = array(); preg_match('#(AND|OR|) *('.$word.') *(AND|OR|)#', $InfoFieldList[4], $matchCondition); while (!empty($matchCondition[0])) { @@ -1481,7 +1481,7 @@ class ExtraFields } } - // Si l'on a un AND ou un OR, avant ou après + // In case there is AND ou OR, before or after preg_match('#(AND|OR|) *('.$word.') *(AND|OR|)#', $InfoFieldList[4], $matchCondition); } } else { @@ -1583,8 +1583,8 @@ class ExtraFields } elseif ($type == 'link') { $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath' /* Removed. - The selectForForms is called with parameter $objectfield defined, so tha app can retreive the filter inside the ajax component instead of being provided as parameters. The - filter was use to pass SQL requests leading to serious SQL injection problem. This should not be possible. Also the call of the ajax was broken by some WAF. + The selectForForms is called with parameter $objectfield defined, so that the app can retrieve the filter inside the ajax component instead of being provided as parameters. The + filter was used to pass SQL requests leading to serious SQL injection problems. This should not be possible. Also the call of the ajax was broken by some WAF. if (strpos($param_list[0], '$ID$') !== false && !empty($objectid)) { $param_list[0] = str_replace('$ID$', $objectid, $param_list[0]); }*/ @@ -1595,7 +1595,7 @@ class ExtraFields $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element if ($element == 'socpeople') { $element = 'contact'; - } else if ( $element == 'projet' ) { + } elseif ( $element == 'projet' ) { $element = 'project'; } @@ -1627,7 +1627,7 @@ class ExtraFields * @param string $value Value to show * @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering) * @param string $extrafieldsobjectkey Required (for example $object->table_element). - * @return string Formated value + * @return string Formatted value */ public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjectkey = '') { @@ -1938,7 +1938,7 @@ class ExtraFields $out = ''; // Only if something to display (perf) - if ($value) { // If we have -1 here, pb is into insert, not into ouptut (fix insert instead of changing code here to compensate) + if ($value) { // If we have -1 here, pb is into insert, not into output (fix insert instead of changing code here to compensate) $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath' $InfoFieldList = explode(":", $param_list[0]); @@ -1980,7 +1980,7 @@ class ExtraFields * * @param string $key Key of attribute * @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data - * @return string Formated value + * @return string Formatted value */ public function getAlignFlag($key, $extrafieldsobjectkey = '') { @@ -2050,7 +2050,7 @@ class ExtraFields } $disabledcookiewrite = 0; if ($mode == 'create') { - // On create mode, force separator group to not be collapsable + // On create mode, force separator group to not be collapsible $extrafield_collapse_display_value = 1; $expand_display = true; // We force group to be shown expanded $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie diff --git a/htdocs/core/class/extralanguages.class.php b/htdocs/core/class/extralanguages.class.php index b5e05ca04e2..9d3af41b6b7 100644 --- a/htdocs/core/class/extralanguages.class.php +++ b/htdocs/core/class/extralanguages.class.php @@ -129,7 +129,7 @@ class ExtraLanguages * @param string $key Key of attribute * @param string $value Preselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value) * @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data - * @param string $moreparam To add more parametes on html input tag + * @param string $moreparam To add more parameters on html input tag * @param string $keysuffix Prefix string to add after name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) @@ -163,7 +163,7 @@ class ExtraLanguages * @param string $value Value to show * @param string $extrafieldsobjectkey If defined (for example $object->table_element), function uses the new method to get extrafields data * @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering) - * @return string Formated value + * @return string Formatted value */ public function showOutputField($key, $value, $extrafieldsobjectkey, $moreparam = '') { diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index d0cd306d2f2..53379f3323f 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -63,8 +63,8 @@ class FileUpload //print 'fileupload.class.php: element='.$element.' pathname='.$pathname.' filename='.$filename.' dir_output='.$dir_output."\n"; if (empty($dir_output)) { - setEventMessage('The element '.$element.' is not supported for uploading file. dir_output is unknow.', 'errors'); - throw new Exception('The element '.$element.' is not supported for uploading file. dir_output is unknow.'); + setEventMessage('The element '.$element.' is not supported for uploading file. dir_output is unknown.', 'errors'); + throw new Exception('The element '.$element.' is not supported for uploading file. dir_output is unknown.'); } // If pathname and filename are null then we can still upload files if we have specified upload_dir on $options @@ -283,7 +283,7 @@ class FileUpload /** * Make validation on an uploaded file * - * @param string $uploaded_file Uploade file + * @param string $uploaded_file Upload file * @param object $file File * @param string $error Error * @param string $index Index @@ -398,7 +398,7 @@ class FileUpload * handleFileUpload. * Validate data, move the uploaded file then create the thumbs if this is an image. * - * @param string $uploaded_file Uploade file + * @param string $uploaded_file Upload file * @param string $name Name * @param int $size Size * @param string $type Type diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 6fd2fbd8249..17670047896 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -69,10 +69,10 @@ class HookManager /** - * Init array $this->hooks with instantiated action controlers. + * Init array $this->hooks with instantiated action controllers. * First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file. * This makes $conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...)) - * When initHooks function is called, with initHooks(list_of_contexts), an array $this->hooks is defined with instance of controler + * When initHooks function is called, with initHooks(list_of_contexts), an array $this->hooks is defined with instance of controller * class found into file /mymodule/class/actions_mymodule.class.php (if module has declared the context as a managed context). * Then when a hook executeHooks('aMethod'...) is called, the method aMethod found into class will be executed. * @@ -127,7 +127,7 @@ class HookManager } } } - // Log the init of hook but only for hooks thare are declared to be managed + // Log the init of hook but only for hooks there are declared to be managed if (count($arraytolog) > 0) { dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG); } @@ -150,7 +150,7 @@ class HookManager * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @return int For 'addreplace' hooks (doActions, formConfirm, formObjectOptions, pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. * For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0 if we want to keep standard actions, >0 uf we want to stop/replace standard actions (at least one > 0 and replacement will be done), <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. - * All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller. + * All types can also return some values into an array ->results that will be merged into this->resArray for caller. * $this->error or this->errors are also defined by class called by this function if error. */ public function executeHooks($method, $parameters = array(), &$object = null, &$action = '') @@ -168,7 +168,7 @@ class HookManager // Define type of hook ('output' or 'addreplace'). $hooktype = 'addreplace'; - // TODO Remove hooks with type 'output' (exemple createFrom). All hooks must be converted into 'addreplace' hooks. + // TODO Remove hooks with type 'output' (example createFrom). All hooks must be converted into 'addreplace' hooks. if (in_array($method, array( 'createFrom', 'dashboardAccountancy', diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 90b17804022..09d9cd4a3b9 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -228,7 +228,7 @@ class FormAccounting extends Form * Return list of accounting category. * Use mysoc->country_id or mysoc->country_code so they must be defined. * - * @param string $selected Preselected type + * @param int $selected Preselected type * @param string $htmlname Name of field in form * @param int $useempty Set to 1 if we want an empty value * @param int $maxlen Max length of text in combo box @@ -236,7 +236,7 @@ class FormAccounting extends Form * @param int $allcountries All countries * @return string HTML component with the select */ - public function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) + public function select_accounting_category($selected = 0, $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { // phpcs:enable global $langs, $mysoc; @@ -459,7 +459,7 @@ class FormAccounting extends Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return list of auxilary accounts. Cumulate list from customers, suppliers and users. + * Return list of auxiliary accounts. Cumulate list from customers, suppliers and users. * * @param string $selectid Preselected pcg_type * @param string $htmlname Name of field in html form @@ -559,7 +559,7 @@ class FormAccounting extends Form * @param string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Affiche valeur vide dans liste - * @param string $output_format (html/opton (for option html only)/array (to return options arrays + * @param string $output_format (html/option (for option html only)/array (to return options arrays * @return string|array HTML select component or array of select options */ public function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 7989f5a2502..5f78ac336ce 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -253,7 +253,7 @@ class FormActions // Ref print '
'.$actioncomm->getNomUrl(1, -1).''; if (!empty($actioncomm->userownerid)) { if (isset($cacheusers[$actioncomm->userownerid]) && is_object($cacheusers[$actioncomm->userownerid])) { diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 47834959db5..125bb04a30e 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -62,7 +62,7 @@ class FormAdmin * @param int $showwarning Show a warning if language is not complete * @param int $disabled Disable edit of select * @param string $morecss Add more css styles - * @param int $showcode 1=Add language code into label at begining, 2=Add language code into label at end + * @param int $showcode 1=Add language code into label at beginning, 2=Add language code into label at end * @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @param int $multiselect Make the combo a multiselect * @param array $onlykeys Array of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...) @@ -224,7 +224,7 @@ class FormAdmin $filelib = preg_replace('/\.php$/i', '', $file); $prefix = ''; - // 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other + // 0=Recommended, 1=Experimental, 2=Development, 3=Other if (preg_match('/^eldy/i', $file)) { $prefix = '0'; } elseif (preg_match('/^smartphone/i', $file)) { @@ -487,7 +487,7 @@ class FormAdmin /** - * Function to shwo the combo select to chose a type of field (varchar, int, email, ...) + * Function to show the combo select to chose a type of field (varchar, int, email, ...) * * @param string $htmlname Name of HTML select component * @param string $type Type preselected diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index e8dd0e9daa9..6d58b9a6198 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/class/html.formbarcode.class.php - * \brief Fichier de la classe des fonctions predefinie de composants html + * \brief Fichier de la class des functions predefinie de composants html */ diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index fb09ff65486..6ad18d5034d 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -85,7 +85,7 @@ class FormCategory extends Form /** * Prints a select form for products categories - * @param string $selected Id category pre-selection + * @param int $selected Id category pre-selection * @param string $htmlname Name of HTML field * @param int $showempty Add an empty field * @return int|null diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ed1c6e97980..81f01f73815 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -280,7 +280,7 @@ class FormCompany extends Form $out = ''; - // Serch departements/cantons/province active d'une region et pays actif + // Search departements/cantons/province active d'une region et pays actif $sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM"; $sql .= " " . $this->db->prefix() . "c_departements as d, " . $this->db->prefix() . "c_regions as r," . $this->db->prefix() . "c_country as c"; $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid"; @@ -325,7 +325,7 @@ class FormCompany extends Form $out .= ''; $i++; @@ -514,11 +514,11 @@ class FormCompany extends Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. - * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. + * Return the list of all juridical entity types for all countries or a specific country. + * A country separator is included in case the list for all countries is returned. * - * @param string $selected Code forme juridique a pre-selectionne - * @param mixed $country_codeid 0=liste tous pays confondus, sinon code du pays a afficher + * @param string $selected Preselected code for juridical type + * @param mixed $country_codeid 0=All countries, else the code of the country to display * @param string $filter Add a SQL filter on list * @return void * @deprecated Use print xxx->select_juridicalstatus instead @@ -532,8 +532,8 @@ class FormCompany extends Form // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. - * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays + * Return the list of all juridical entity types for all countries or a specific country. + * A country separator is included in case the list for all countries is returned. * * @param string $selected Preselected code of juridical type * @param int $country_codeid 0=list for all countries, otherwise list only country requested @@ -550,7 +550,7 @@ class FormCompany extends Form $out = ''; - // On recherche les formes juridiques actives des pays actifs + // Lookup the active juridical types for the active countries $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code"; $sql .= " FROM " . $this->db->prefix() . "c_forme_juridique as f, " . $this->db->prefix() . "c_country as c"; $sql .= " WHERE f.fk_pays=c.rowid"; @@ -853,7 +853,7 @@ class FormCompany extends Form * showContactRoles on view and edit mode * * @param string $htmlname Html component name and id - * @param Contact $contact Contact Obejct + * @param Contact $contact Contact Object * @param string $rendermode view, edit * @param array $selected $key=>$val $val is selected Roles for input mode * @param string $morecss More css diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index f71f1736a33..fc869901f01 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -63,7 +63,7 @@ class FormContract * @param string $morecss More CSS * @return int Nbr of contract if OK, <0 if KO */ - public function select_contract($socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0, $morecss = 'minwidth150') + public function select_contract($socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0, $morecss = 'minwidth150') { // phpcs:enable global $user, $conf, $langs; @@ -190,7 +190,7 @@ class FormContract * @param int $noouput 1=Return the output instead of display * @return string|void html string */ - public function formSelectContract($page, $socid = -1, $selected = '', $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0) + public function formSelectContract($page, $socid = -1, $selected = 0, $htmlname = 'contrattid', $maxlength = 16, $showempty = 1, $showRef = 0, $noouput = 0) { global $langs; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 609458ce839..a4484a49dd6 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/class/html.formcron.class.php - * \brief Fichier de la classe des fonctions predefinie de composants html cron + * \brief Fichier de la class des functions predefinie de composants html cron */ diff --git a/htdocs/core/class/html.formexpensereport.class.php b/htdocs/core/class/html.formexpensereport.class.php index bcb80a780dd..a94e076a3ba 100644 --- a/htdocs/core/class/html.formexpensereport.class.php +++ b/htdocs/core/class/html.formexpensereport.class.php @@ -50,8 +50,8 @@ class FormExpenseReport /** - * Retourne la liste deroulante des differents etats d'une note de frais. - * Les valeurs de la liste sont les id de la table c_expensereport_statuts + * Return the combobox for the different statuses of an expense report + * The list values are the ids for the table c_expensereport_statuts * * @param int $selected preselect status * @param string $htmlname Name of HTML select @@ -59,7 +59,7 @@ class FormExpenseReport * @param int $useshortlabel Use short labels * @return string HTML select with status */ - public function selectExpensereportStatus($selected = '', $htmlname = 'fk_statut', $useempty = 1, $useshortlabel = 0) + public function selectExpensereportStatus($selected = 0, $htmlname = 'fk_statut', $useempty = 1, $useshortlabel = 0) { global $langs; @@ -74,7 +74,7 @@ class FormExpenseReport $arrayoflabels = $tmpep->labelStatusShort; } foreach ($arrayoflabels as $key => $val) { - if ($selected != '' && $selected == $key) { + if (!empty($selected) && $selected == $key) { $html .= ''; - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray = $this->withtouser; foreach ($tmparray as $key => $val) { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); @@ -757,7 +757,7 @@ class FormMail extends Form $out .= $langs->trans("MailToCCUsers"); $out .= ''; - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray = $this->withtoccuser; foreach ($tmparray as $key => $val) { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); @@ -792,7 +792,7 @@ class FormMail extends Form // Ask delivery receipt if (!empty($this->withdeliveryreceipt) && getDolGlobalInt('MAIN_EMAIL_SUPPORT_ACK')) { - $out .= $this->getHtmlForDeliveryReceipt(); + $out .= $this->getHtmlForDeliveryreceipt(); } // Topic @@ -1123,7 +1123,7 @@ class FormMail extends Form $tmparray[$key]['label'] = $label; $tmparray[$key]['label'] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]['label']); - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray[$key]['label'] = dol_htmlentities($tmparray[$key]['label'], ENT_QUOTES|ENT_SUBSTITUTE, 'UTF-8', true); $tmparray[$key]['labelhtml'] = $label; @@ -1176,7 +1176,7 @@ class FormMail extends Form $tmparray[$key]['label'] = $label; $tmparray[$key]['label'] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]['label']); - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray[$key]['label'] = dol_htmlentities($tmparray[$key]['label'], ENT_QUOTES|ENT_SUBSTITUTE, 'UTF-8', true); $tmparray[$key]['labelhtml'] = $label; @@ -1223,7 +1223,7 @@ class FormMail extends Form $tmparray[$key]['label'] = $label; $tmparray[$key]['label'] = str_replace(array('<', '>'), array('(', ')'), $tmparray[$key]['label']); - // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time + // multiselect array convert html entities into options tags, even if we don't want this, so we encode them a second time $tmparray[$key]['label'] = dol_htmlentities($tmparray[$key]['label'], ENT_QUOTES|ENT_SUBSTITUTE, 'UTF-8', true); $tmparray[$key]['labelhtml'] = $label; diff --git a/htdocs/core/class/html.formmargin.class.php b/htdocs/core/class/html.formmargin.class.php index 688f55aa0cb..fab8416ff2e 100644 --- a/htdocs/core/class/html.formmargin.class.php +++ b/htdocs/core/class/html.formmargin.class.php @@ -18,12 +18,12 @@ /** * \file htdocs/core/class/html.formmargin.class.php * \ingroup core - * \brief Fichier de la classe des fonctions predefinie de composants html autre + * \brief Fichier de la class des functions predefinie de composants html autre */ /** - * Classe permettant la generation de composants html autre + * Class permettant la generation de composants html autre * Only common components are here. */ class FormMargin @@ -98,7 +98,7 @@ class FormMargin } $pv = $line->total_ht; - // We choosed to have line->pa_ht always positive in database, so we guess the correct sign + // We chose to have line->pa_ht always positive in database, so we guess the correct sign $pa_ht = (($pv < 0 || ($pv == 0 && in_array($object->element, array('facture', 'facture_fourn')) && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index ef4d8d68be7..82d80ba3336 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; class FormOrder extends Form { /** - * Return combo list of differents status of a orders + * Return combo list of different statuses of orders * * @param string $selected Preselected value * @param int $short Use short labels diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 21a7a67dc3f..b8f788d70ff 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -28,12 +28,12 @@ /** * \file htdocs/core/class/html.formother.class.php * \ingroup core - * \brief Fichier de la classe des fonctions predefinie de composants html autre + * \brief Fichier de la class des functions predefinie de composants html autre */ /** - * Classe permettant la generation de composants html autre + * Class permettant la generation de composants html autre * Only common components are here. */ class FormOther @@ -523,7 +523,7 @@ class FormOther $sql_usr .= " AND u.fk_soc = ".((int) $user->socid); } - //Add hook to filter on user (for exemple on usergroup define in custom modules) + //Add hook to filter on user (for example on usergroup define in custom modules) if (!empty($reshook)) { $sql_usr .= $hookmanager->resArray[0]; } @@ -546,7 +546,7 @@ class FormOther $sql_usr .= " AND u2.rowid = sc.fk_user AND sc.fk_soc = ".((int) $user->socid); - //Add hook to filter on user (for exemple on usergroup define in custom modules) + //Add hook to filter on user (for example on usergroup define in custom modules) if (!empty($reshook)) { $sql_usr .= $hookmanager->resArray[1]; } @@ -1006,16 +1006,16 @@ class FormOther $color = substr($color, 1, 6); - $rouge = hexdec(substr($color, 0, 2)); //conversion du canal rouge - $vert = hexdec(substr($color, 2, 2)); //conversion du canal vert - $bleu = hexdec(substr($color, 4, 2)); //conversion du canal bleu + $red = hexdec(substr($color, 0, 2)); // Red channel conversion + $green = hexdec(substr($color, 2, 2)); // Green channel conversion + $blue = hexdec(substr($color, 4, 2)); // Blue channel conversion - $couleur = imagecolorallocate($image, $rouge, $vert, $bleu); - //print $rouge.$vert.$bleu; - imagefill($image, 0, 0, $couleur); //on remplit l'image - // On cree la couleur et on l'attribue a une variable pour ne pas la perdre - ImagePng($image, $file); //renvoie une image sous format png - ImageDestroy($image); + $couleur = imagecolorallocate($image, $red, $green, $blue); + //print $red.$green.$blue; + imagefill($image, 0, 0, $couleur); // Fill the image + // Create the colr and store it in a variable to maintain it + imagepng($image, $file); // Returns an image in PNG format + imagedestroy($image); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1216,7 +1216,7 @@ class FormOther $confuserzone = 'MAIN_BOXES_'.$areacode; // $boxactivated will be array of boxes enabled into global setup - // $boxidactivatedforuser will be array of boxes choosed by user + // $boxidactivatedforuser will be array of boxes chose by user $selectboxlist = ''; $boxactivated = InfoBox::listBoxes($db, 'activated', $areacode, (empty($user->conf->$confuserzone) ? null : $user), array(), 0); // Search boxes of common+user (or common only if user has no specific setup) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 77f0395041d..6e3f37d824c 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -760,7 +760,7 @@ class FormProjets extends Form } /** - * Return combo list of differents status of a orders + * Return combo list of different statuses of orders * * @param string $selected Preselected value * @param int $short Use short labels diff --git a/htdocs/core/class/html.formpropal.class.php b/htdocs/core/class/html.formpropal.class.php index ef3312df0f3..3142b991aae 100644 --- a/htdocs/core/class/html.formpropal.class.php +++ b/htdocs/core/class/html.formpropal.class.php @@ -50,7 +50,7 @@ class FormPropal } /** - * Return combo list of differents status of a proposal + * Return combo list of different statuses of a proposal * Values are id of table c_propalst * * @param string $selected Preselected value diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 8f4c23ea5d7..16f301493f4 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -82,6 +82,7 @@ class FormSetup */ public $errors = array(); + /** * Constructor * @@ -343,7 +344,7 @@ class FormSetup /** - * Method used to test module builder convertion to this form usage + * Method used to test module builder conversion to this form usage * * @param array $params an array of arrays of params from old modulBuilder params * @return boolean @@ -362,7 +363,7 @@ class FormSetup /** * From old - * Method was used to test module builder convertion to this form usage. + * Method was used to test module builder conversion to this form usage. * * @param string $confKey the conf name to store * @param array $params an array of params from old modulBuilder params @@ -375,7 +376,7 @@ class FormSetup } /* - * Exemple from old module builder setup page + * Example from old module builder setup page * // 'MYMODULE_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>1), // 'MYMODULE_MYPARAM2'=>array('type'=>'textarea','enabled'=>1), //'MYMODULE_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), @@ -387,7 +388,7 @@ class FormSetup */ $item = new FormSetupItem($confKey); - // need to be ignored from scrutinizer setTypeFromTypeString was created as deprecated to incite developper to use object oriented usage + // need to be ignored from scrutinizer setTypeFromTypeString was created as deprecated to incite developer to use object oriented usage /** @scrutinizer ignore-deprecated */ $item->setTypeFromTypeString($params['type']); if (!empty($params['enabled'])) { @@ -405,7 +406,7 @@ class FormSetup /** * Used to export param array for /core/actions_setmoduleoptions.inc.php template - * Method exists only for manage setup convertion + * Method exists only for manage setup conversion * * @return array $arrayofparameters for /core/actions_setmoduleoptions.inc.php */ @@ -684,7 +685,7 @@ class FormSetupItem } /** - * reload conf value from databases is an aliase of loadValueFromConf + * reload conf value from databases is an alias of loadValueFromConf * * @deprecated * @return bool @@ -1055,7 +1056,7 @@ class FormSetupItem * to be sure we can manage evolution easily * * @param string $type possible values based on old module builder setup : 'string', 'textarea', 'category:'.Categorie::TYPE_CUSTOMER', 'emailtemplate', 'thirdparty_type' - * @deprecated yes this setTypeFromTypeString came deprecated because it exists only for manage setup convertion + * @deprecated yes this setTypeFromTypeString came deprecated because it exists only for manage setup conversion * @return bool */ public function setTypeFromTypeString($type) @@ -1148,7 +1149,7 @@ class FormSetupItem if ($result < 0) { $this->setErrors($c->errors); } - $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text + $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text $toprint = array(); foreach ($ways as $way) { $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 69ff394fa8d..01662f85d8a 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -20,13 +20,13 @@ /** * \file htdocs/core/class/html.formsms.class.php * \ingroup core - * \brief Fichier de la classe permettant la generation du formulaire html d'envoi de mail unitaire + * \brief Fichier de la class permettant la generation du formulaire html d'envoi de mail unitaire */ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; /** - * Classe permettant la generation du formulaire d'envoi de Sms + * Class permettant la generation du formulaire d'envoi de Sms * Usage: $formsms = new FormSms($db) * $formsms->proprietes=1 ou chaine ou tableau de valeurs * $formsms->show_form() affiche le formulaire @@ -105,7 +105,7 @@ class FormSms * Show the form to input an sms. * * @param string $morecss Class on first column td - * @param int $showform Show form tags and submit button (recommanded is to use with value 0) + * @param int $showform Show form tags and submit button (recommended is to use with value 0) * @return void */ public function show_form($morecss = 'titlefield', $showform = 1) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 972458dd5c8..0d4c358e3ec 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1055,10 +1055,10 @@ class FormTicket if (empty($tabscript[$groupcodefather])) { $tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ? '_child_'.($levelid-1) : '').'").val() == "'.dol_escape_js($groupcodefather).'"){ $(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show() - console.log("We show childs tickets of '.$groupcodefather.' group ticket") + console.log("We show child tickets of '.$groupcodefather.' group ticket") }else{ $(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").hide() - console.log("We hide childs tickets of '.$groupcodefather.' group ticket") + console.log("We hide child tickets of '.$groupcodefather.' group ticket") }'; } } @@ -1335,8 +1335,8 @@ class FormTicket //var_dump($keytoavoidconflict); if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (!empty($arraydefaultmessage->joinfiles) && !empty($this->param['fileinit']) && is_array($this->param['fileinit'])) { - foreach ($this->param['fileinit'] as $file) { - $formmail->add_attached_files($file, basename($file), dol_mimetype($file)); + foreach ($this->param['fileinit'] as $path) { + $formmail->add_attached_files($path, basename($path), dol_mimetype($path)); } } } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 33797b7b821..700fc8600ee 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/class/interfaces.class.php * \ingroup core - * \brief Fichier de la classe de gestion des triggers + * \brief Fichier de la class de gestion des triggers */ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; @@ -59,10 +59,10 @@ class Interfaces * This function call all qualified triggers. * * @param string $action Trigger event code - * @param object $object Objet concerned. Some context information may also be provided into array property object->context. - * @param User $user Objet user - * @param Translate $langs Objet lang - * @param Conf $conf Objet conf + * @param object $object Object concerned. Some context information may also be provided into array property object->context. + * @param User $user Object user + * @param Translate $langs Object lang + * @param Conf $conf Object conf * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. */ public function run_triggers($action, $object, $user, $langs, $conf) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index d7b774d3a40..6362783f6ce 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -84,28 +84,28 @@ class Ldap /** * User administrateur Ldap - * Active Directory ne supporte pas les connexions anonymes + * Active Directory does not allow anonymous connections */ public $searchUser; /** - * Mot de passe de l'administrateur - * Active Directory ne supporte pas les connexions anonymes + * Administraot Password + * Active Directory does not allow anonymous connections */ public $searchPassword; /** - * DN des utilisateurs + * Users DN */ public $people; /** - * DN des groupes + * Groups DN */ public $groups; /** - * Code erreur retourne par le serveur Ldap + * @var string|null Error code provided by the LDAP server */ public $ldapErrorCode; /** - * Message texte de l'erreur + * @var string|null Error text message */ public $ldapErrorText; @@ -326,7 +326,7 @@ class Ldap dol_syslog(get_class($this)."::connect_bind this->connection is ok", LOG_DEBUG); } - // Upgrade connexion to TLS, if requested by the configuration + // Upgrade connection to TLS, if requested by the configuration if (getDolGlobalString('LDAP_SERVER_USE_TLS')) { // For test/debug //ldap_set_option($this->connection, LDAP_OPT_DEBUG_LEVEL, 7); @@ -554,7 +554,7 @@ class Ldap $result = @ldap_add($this->connection, $dn, $info); if ($result) { - dol_syslog(get_class($this)."::add successfull", LOG_DEBUG); + dol_syslog(get_class($this)."::add successful", LOG_DEBUG); return 1; } else { $this->ldapErrorCode = @ldap_errno($this->connection); @@ -612,7 +612,7 @@ class Ldap $result = @ldap_modify($this->connection, $dn, $info); if ($result) { - dol_syslog(get_class($this)."::modify successfull", LOG_DEBUG); + dol_syslog(get_class($this)."::modify successful", LOG_DEBUG); return 1; } else { $this->error = @ldap_error($this->connection); @@ -628,7 +628,7 @@ class Ldap * @param string $dn Old DN entry key (uid=qqq,ou=xxx,dc=aaa,dc=bbb) (before update) * @param string $newrdn New RDN entry key (uid=qqq) * @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) - * @param User $user Objet user that modify + * @param User $user Object user that modify * @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry. * @return int Return integer <0 if KO, >0 if OK */ @@ -655,7 +655,7 @@ class Ldap $result = @ldap_rename($this->connection, $dn, $newrdn, $newparent, $deleteoldrdn); if ($result) { - dol_syslog(get_class($this)."::rename successfull", LOG_DEBUG); + dol_syslog(get_class($this)."::rename successful", LOG_DEBUG); return 1; } else { $this->error = @ldap_error($this->connection); @@ -870,7 +870,7 @@ class Ldap * * @param string $dn DN entry key * @param array $info Attributes array - * @param User $user Objet user that create + * @param User $user Object user that create * @return int Return integer <0 if KO, >0 if OK */ public function addAttribute($dn, $info, $user) @@ -901,7 +901,7 @@ class Ldap $result = @ldap_mod_add($this->connection, $dn, $info); if ($result) { - dol_syslog(get_class($this)."::add_attribute successfull", LOG_DEBUG); + dol_syslog(get_class($this)."::add_attribute successful", LOG_DEBUG); return 1; } else { $this->error = @ldap_error($this->connection); @@ -916,7 +916,7 @@ class Ldap * * @param string $dn DN entry key * @param array $info Attributes array - * @param User $user Objet user that create + * @param User $user Object user that create * @return int Return integer <0 if KO, >0 if OK */ public function updateAttribute($dn, $info, $user) @@ -947,7 +947,7 @@ class Ldap $result = @ldap_mod_replace($this->connection, $dn, $info); if ($result) { - dol_syslog(get_class($this)."::updateAttribute successfull", LOG_DEBUG); + dol_syslog(get_class($this)."::updateAttribute successful", LOG_DEBUG); return 1; } else { $this->error = @ldap_error($this->connection); @@ -962,7 +962,7 @@ class Ldap * * @param string $dn DN entry key * @param array $info Attributes array - * @param User $user Objet user that create + * @param User $user Object user that create * @return int Return integer <0 if KO, >0 if OK */ public function deleteAttribute($dn, $info, $user) @@ -993,7 +993,7 @@ class Ldap $result = @ldap_mod_del($this->connection, $dn, $info); if ($result) { - dol_syslog(get_class($this)."::deleteAttribute successfull", LOG_DEBUG); + dol_syslog(get_class($this)."::deleteAttribute successful", LOG_DEBUG); return 1; } else { $this->error = @ldap_error($this->connection); @@ -1114,7 +1114,7 @@ class Ldap } elseif (((string) $activefilter == 'member') && $this->filter) { $filter = '('.$this->filtermember.')'; } else { - // If this->filter/this->filtergroup is empty, make fiter on * (all) + // If this->filter/this->filtergroup is empty, make filter on * (all) $filter = '('.ldap_escape($useridentifier, '', LDAP_ESCAPE_FILTER).'=*)'; } } else { // Use a filter forged using the $search value @@ -1270,8 +1270,8 @@ class Ldap * Fonction de recherche avec filtre * this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee * Ne pas utiliser pour recherche d'une liste donnee de proprietes - * car conflit majuscule-minuscule. A n'utiliser que pour les pages - * 'Fiche LDAP' qui affiche champ lisibles par defaut. + * car conflict majuscule-minuscule. A n'utiliser que pour les pages + * 'Fiche LDAP' qui affiche champ lisibles par default. * * @param string $checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) * @param string $filter Search filter (ex: (sn=nom_personne) ) diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 8ad73725935..bd265349c3f 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -274,7 +274,7 @@ class Link extends CommonObject /** * Return nb of links * - * @param DoliDb $dbs Database handler + * @param DoliDB $dbs Database handler * @param string $objecttype Type of the associated object in dolibarr * @param int $objectid Id of the associated object in dolibarr * @return int Nb of links, -1 if error diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index 3fe0d59ad89..0b908997d15 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/class/menu.class.php * \ingroup core - * \brief Fichier de la classe de gestion du menu gauche + * \brief Fichier de la class de gestion du menu gauche */ diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 08d110637cd..b0a7768d919 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -572,7 +572,7 @@ class Menubase // We initialize newmenu with first already found menu entries $this->newmenu = $newmenu; - // Now complete $this->newmenu->list to add entries found into $tabMenu that are childs of mainmenu=$menutopid, using the fk_menu link that is int (old method) + // Now complete $this->newmenu->list to add entries found into $tabMenu that are children of mainmenu=$menutopid, using the fk_menu link that is int (old method) $this->recur($tabMenu, $menutopid, 1); // Now complete $this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu) @@ -631,7 +631,7 @@ class Menubase * @param string $myleftmenu Value for left that defined leftmenu * @param int $type_user Looks for menu entry for 0=Internal users, 1=External users * @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...) - * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be alreay filled) + * @param array $tabMenu Array to store new entries found (in most cases, it's empty, but may be already filled) * @return int >0 if OK, <0 if KO */ public function menuLoad($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index b96e0fdd2dc..1fee391154c 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -599,7 +599,7 @@ class RssParser array_unshift($this->stack, $el); } elseif ($this->_format == 'atom' && $el == 'link') { - // Atom support many links per containging element. + // Atom support many links per containing element. // Magpie treats link elements of type rel='alternate' // as being equivalent to RSS's simple link element. if (isset($attrs['rel']) && $attrs['rel'] == 'alternate') { @@ -664,7 +664,7 @@ class RssParser $this->inchannel = false; } elseif ($this->_format == 'atom' and $this->incontent) { // balance tags properly - // note: i don't think this is actually neccessary + // note: i don't think this is actually necessary if ($this->stack[0] == $el) { $this->append_content(""); } else { @@ -819,7 +819,7 @@ class RssParser * @param string $ent * @param string|false $base * @param string $sysID - * @param string[false $pubID + * @param string|false $pubID * @return bool function extEntHandler($parser, $ent, $base, $sysID, $pubID) { print 'extEntHandler ran'; @@ -836,7 +836,7 @@ function extEntHandler($parser, $ent, $base, $sysID, $pubID) { */ function xml2php($xml) { - $fils = 0; + $threads = 0; $tab = false; $array = array(); foreach ($xml->children() as $key => $value) { @@ -863,11 +863,11 @@ function xml2php($xml) $array[$key] = $child; } - $fils++; + $threads++; } - if ($fils == 0) { + if ($threads == 0) { return (string) $xml; } diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 5291d3d9e02..17578875897 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -87,7 +87,7 @@ class SMTPs /** * Who will the Message be sent to; TO, CC, BCC - * Multi-diminsional array containg addresses the message will + * Multi-diminsional array containing addresses the message will * be sent TO, CC or BCC */ private $_msgRecipients = null; @@ -169,7 +169,7 @@ class SMTPs private $_smtpsTransEncode = '7bit'; /** - * Boundary String for MIME seperation + * Boundary String for MIME separation */ private $_smtpsBoundary = null; @@ -185,7 +185,7 @@ class SMTPs /** * Determines the method inwhich the message are to be sent. - * - 'sockets' [0] - conect via network to SMTP server - default + * - 'sockets' [0] - connect via network to SMTP server - default * - 'pipe [1] - use UNIX path to EXE * - 'phpmail [2] - use the PHP built-in mail function * NOTE: Only 'sockets' is implemented @@ -194,7 +194,7 @@ class SMTPs /** * If '$_transportType' is set to '1', then this variable is used - * to define the UNIX file system path to the sendmail execuable + * to define the UNIX file system path to the sendmail executable */ private $_mailPath = '/usr/lib/sendmail'; @@ -375,14 +375,14 @@ class SMTPs } /** - * build RECIPIENT List, all addresses who will recieve this message + * build RECIPIENT List, all addresses who will receive this message * * @return void */ public function buildRCPTlist() { // Pull TO list - $_aryToList = $this->getTO(); + $_aryToList = $this->getTo(); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -399,7 +399,7 @@ class SMTPs // We have to make sure the HOST given is valid // This is done here because '@fsockopen' will not give me this - // information if it failes to connect because it can't find the HOST + // information if it fails to connect because it can't find the HOST $host = $this->getHost(); $usetls = preg_match('@tls://@i', $host); @@ -476,8 +476,8 @@ class SMTPs require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; // Send the RFC2554 specified EHLO. - // This improvment as provided by 'SirSir' to - // accomodate both SMTP AND ESMTP capable servers + // This improvement as provided by 'SirSir' to + // accommodate both SMTP AND ESMTP capable servers $host = $this->getHost(); $usetls = preg_match('@tls://@i', $host); @@ -825,11 +825,11 @@ class SMTPs /** * Determines the method inwhich the messages are to be sent. - * - 'sockets' [0] - conect via network to SMTP server + * - 'sockets' [0] - connect via network to SMTP server * - 'pipe [1] - use UNIX path to EXE * - 'phpmail [2] - use the PHP built-in mail function * - * @param int $_type Interger value representing Mail Transport Type + * @param int $_type Integer value representing Mail Transport Type * @return void */ public function setTransportType($_type = 0) @@ -841,7 +841,7 @@ class SMTPs /** * Return the method inwhich the message is to be sent. - * - 'sockets' [0] - conect via network to SMTP server + * - 'sockets' [0] - connect via network to SMTP server * - 'pipe [1] - use UNIX path to EXE * - 'phpmail [2] - use the PHP built-in mail function * @@ -853,9 +853,9 @@ class SMTPs } /** - * Path to the sendmail execuable + * Path to the sendmail executable * - * @param string $_path Path to the sendmail execuable + * @param string $_path Path to the sendmail executable * @return boolean * */ @@ -1009,7 +1009,7 @@ class SMTPs /** * Content-Transfer-Encoding, Defaulted to '7bit' - * This can be changed for 2byte characers sets + * This can be changed for 2byte characters sets * Known Encode Types * - 7bit Simple 7-bit ASCII * - 8bit 8-bit coding with line termination characters @@ -1041,7 +1041,7 @@ class SMTPs /** * Content-Transfer-Encoding, Defaulted to '0' [ZERO] - * This can be changed for 2byte characers sets + * This can be changed for 2byte characters sets * Known Encode Types * - [0] 7bit Simple 7-bit ASCII * - [1] 8bit 8-bit coding with line termination characters @@ -1141,7 +1141,7 @@ class SMTPs /** * Inserts given addresses into structured format. - * This method takes a list of given addresses, via an array or a COMMA delimted string, and inserts them into a highly + * This method takes a list of given addresses, via an array or a COMMA delimited string, and inserts them into a highly * structured array. This array is designed to remove duplicate addresses and to sort them by Domain. * * @param string $_type TO, CC, or BCC lists to add addrresses into @@ -1173,7 +1173,7 @@ class SMTPs // Strip off the end '>' $_strAddr = str_replace('>', '', $_strAddr); - // Seperate "Real Name" from eMail address + // Separate "Real Name" from eMail address $_tmpaddr = null; $_tmpaddr = explode('<', $_strAddr); @@ -1184,7 +1184,7 @@ class SMTPs $aryHost[$_tmpHost[1]][$_type][$_tmpHost[0]] = $_tmpaddr[0]; } else { // We only have an eMail address - // Strip off the beggining '<' + // Strip off the beginning '<' $_strAddr = str_replace('<', '', $_strAddr); $_tmpHost = explode('@', $_strAddr); @@ -1207,7 +1207,7 @@ class SMTPs * - "Real Name" is optional * - if "Real Name" does not exist, the angle brackets are optional * This will split an email address into 4 or 5 parts. - * - $_aryEmail[org] = orignal string + * - $_aryEmail[org] = original string * - $_aryEmail[real] = "real name" - if there is one * - $_aryEmail[addr] = address part "username@domain.tld" * - $_aryEmail[host] = "domain.tld" @@ -1219,7 +1219,7 @@ class SMTPs private function _strip_email($_strAddr) { // phpcs:enable - // Keep the orginal + // Keep the original $_aryEmail['org'] = $_strAddr; // Set entire string to Lower Case @@ -1228,7 +1228,7 @@ class SMTPs // Drop "stuff' off the end $_strAddr = trim($_strAddr, ' ">'); - // Seperate "Real Name" from eMail address, if we have one + // Separate "Real Name" from eMail address, if we have one $_tmpAry = explode('<', $_strAddr); // Do we have a "Real name" @@ -1258,7 +1258,7 @@ class SMTPs /** * Returns an array of bares addresses for use with 'RCPT TO:' * This is a "build as you go" method. Each time this method is called - * the underlaying array is destroyed and reconstructed. + * the underlying array is destroyed and reconstructed. * * @return array Returns an array of bares addresses */ @@ -1416,7 +1416,7 @@ class SMTPs } /** - * Constructes and returns message header + * Constructs and returns message header * * @return string Complete message header */ @@ -1425,7 +1425,7 @@ class SMTPs global $conf; $_header = 'From: '.$this->getFrom('org')."\r\n" - . 'To: '.$this->getTO()."\r\n"; + . 'To: '.$this->getTo()."\r\n"; if ($this->getCC()) { $_header .= 'Cc: '.$this->getCC()."\r\n"; @@ -1825,7 +1825,7 @@ class SMTPs /** * Set flag which determines whether to calculate message MD5 checksum. * - * @param string $_flag Message Priority + * @param boolean $_flag MD5flag * @return void */ public function setMD5flag($_flag = false) @@ -1836,7 +1836,7 @@ class SMTPs /** * Gets flag which determines whether to calculate message MD5 checksum. * - * @return boolean Message Priority + * @return boolean MD5flag */ public function getMD5flag() { @@ -2073,11 +2073,11 @@ class SMTPs * - added '$_smtpMD5' as a class property * - added 'setMD5flag()' to set above property * - added 'getMD5flag()' to retrieve above property - * - 'setAttachment()' will add an MD5 checksum to attachements if above property is set + * - 'setAttachment()' will add an MD5 checksum to attachments if above property is set * - 'setBodyContent()' will add an MD5 checksum to message parts if above property is set * - 'getBodyContent()' will insert the MD5 checksum for messages and attachments if above property is set - * - removed leading dashes from message boundry - * - added propery "Close message boundry" tomessage block + * - removed leading dashes from message boundary + * - added property "Close message boundary" tomessage block * - corrected some comments in various places * - removed some incorrect comments in others * @@ -2102,8 +2102,8 @@ class SMTPs * - remove potentially illegal characters from boundary * * Revision 1.10 2005/08/19 20:39:32 jswalter - * - added _server_connect()' as a seperate method to handle server connectivity. - * - added '_server_authenticate()' as a seperate method to handle server authentication. + * - added _server_connect()' as a separate method to handle server connectivity. + * - added '_server_authenticate()' as a separate method to handle server authentication. * - 'sendMsg()' now uses the new methods to handle server communication. * - modified 'server_parse()' and 'socket_send_str()' to give error codes and messages. * @@ -2123,7 +2123,7 @@ class SMTPs * * Revision 1.8 2005/06/24 21:00:20 jswalter * - corrected comments - * - corrected the defualt value for 'setPriority()' + * - corrected the default value for 'setPriority()' * - modified 'setAttachement()' to process multiple attachments correctly * - modified 'getBodyContent()' to handle multiple attachments * Bug 310 @@ -2156,7 +2156,7 @@ class SMTPs * - modified 'setBodyContent()' to store data in a sub-array for better * parsing within the 'getBodyContent()' method * - modified 'getBodyContent()' to process contents array better. - * Also modified to handle attachements. + * Also modified to handle attachments. * - added 'setAttachement()' so files and other data can be attached * to messages * - added '_setErr()' and 'getErrors()' as an attempt to begin an error @@ -2176,7 +2176,7 @@ class SMTPs * - added getSensitivity() method to use new Sensitivity array * - created seters and getter for Priority with new Prioity value array property * - changed config file include from 'include_once' - * - modified getHeader() to ustilize new Message Sensitivity and Priorty properties + * - modified getHeader() to ustilize new Message Sensitivity and Priority properties * * Revision 1.5 2005/03/14 22:25:27 walter * - added references @@ -2186,13 +2186,13 @@ class SMTPs * - 'sendMsg()' now uses Object properties and methods to build message * - 'setConfig()' to load external file * - 'setForm()' will "strip" the email address out of "address" string - * - modifed 'getFrom()' to handle "striping" the email address + * - modified 'getFrom()' to handle "striping" the email address * - '_buildArrayList()' creates a multi-dimensional array of addresses * by domain, TO, CC & BCC and then by User Name. * - '_strip_email()' pulls email address out of "full Address" string' * - 'get_RCPT_list()' pulls out "bare" emaill address form address array * - 'getHeader()' builds message Header from Object properties - * - 'getBodyContent()' builds full messsage body, even multi-part + * - 'getBodyContent()' builds full message body, even multi-part * * Revision 1.4 2005/03/02 20:53:35 walter * - core Setters & Getters defined @@ -2209,6 +2209,6 @@ class SMTPs * * Revision 1.1 2005/03/01 19:22:49 walter * - initial commit - * - basic shell with some commets + * - basic shell with some comments * */ diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index 801ce765a8c..1a590c51588 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -178,7 +178,7 @@ abstract class Stats /** * Return amount of elements by month for several years. - * Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php + * Criteria used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php * The caller of class can add more filters into sql request by adding criteris into the $stats->where property just after * calling constructor. * diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 901e1f0de91..fdc8f939903 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -93,7 +93,7 @@ class TimeSpent extends CommonObject * 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0') * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage) * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' @@ -156,7 +156,7 @@ class TimeSpent extends CommonObject /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -200,10 +200,10 @@ class TimeSpent extends CommonObject * Create object into database * * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { $resultcreate = $this->createCommon($user, $notrigger); @@ -403,10 +403,10 @@ class TimeSpent extends CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { return $this->updateCommon($user, $notrigger); } @@ -414,11 +414,11 @@ class TimeSpent extends CommonObject /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers, true=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { return $this->deleteCommon($user, $notrigger); //return $this->deleteCommon($user, $notrigger, 1); @@ -429,10 +429,10 @@ class TimeSpent extends CommonObject * * @param User $user User that delete * @param int $idline Id of line to delete - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int >0 if OK, <0 if KO */ - public function deleteLine(User $user, $idline, $notrigger = false) + public function deleteLine(User $user, $idline, $notrigger = 0) { if ($this->status < 0) { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; @@ -460,7 +460,7 @@ class TimeSpent extends CommonObject // Protection if ($this->status == self::STATUS_VALIDATED) { - dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); + dol_syslog(get_class($this)."::validate action abandoned: already validated", LOG_WARNING); return 0; } @@ -673,7 +673,7 @@ class TimeSpent extends CommonObject } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) @@ -994,7 +994,7 @@ class TimeSpent extends CommonObject * Create a document onto disk according to template module. * * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param Translate $outputlangs object lang a utiliser pour traduction * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index c5ce86c4e8c..03c2fc7f59d 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/class/translate.class.php * \ingroup core - * \brief File for Tanslate class + * \brief File for Translate class */ @@ -197,7 +197,7 @@ class Translate * then in htdocs/module/langs/code_CODE/file.lang instead of htdocs/langs/code_CODE/file.lang * @param integer $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US) * @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed) - * @param int $forcelangdir To force a different lang directory + * @param string $forcelangdir To force a different lang directory * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf. * @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found * @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK @@ -571,7 +571,7 @@ class Translate * Return translated value of key for special keys ("Currency...", "Civility...", ...). * Search in lang file, then into database. Key must be any complete entry into lang file: CurrencyEUR, ... * If not found, return key. - * The string return is not formated (translated with transnoentitiesnoconv). + * The string return is not formatted (translated with transnoentitiesnoconv). * NOTE: To avoid infinite loop (getLabelFromKey->transnoentities->getTradFromKey->getLabelFromKey), if you modify this function, * check that getLabelFromKey is never called with the same value than $key. * @@ -776,7 +776,7 @@ class Translate /** - * Retourne la version traduite du texte passe en parametre complete du code pays + * Retourne la version traduite du texte passe en parameter complete du code pays * * @param string $str string root to translate * @param string $countrycode country code (FR, ...) @@ -899,7 +899,7 @@ class Translate * Return if a filename $filename exists for current language (or alternate language) * * @param string $filename Language filename to search - * @param integer $searchalt Search also alernate language file + * @param integer $searchalt Search also alternate language file * @return boolean true if exists and readable */ public function file_exists($filename, $searchalt = 0) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 3d0cc1ae52c..ec3c4d15505 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2016 Laurent Destailleur * Copyright (C) 2021 Regis Houssin * Copyright (C) 2022 Anthony Berton + * Copyright (C) 2023 William Mead * * 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 @@ -215,7 +216,7 @@ class Utils * @param string $file 'auto' or filename to build * @param int $keeplastnfiles Keep only last n files (not used yet) * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec' - need size of dump in memory, but low memory method is used if GETPOST('lowmemorydump') is set, 2=Use the 'popen' method (low memory method) - * @param int $lowmemorydump 1=Use the low memory method. If $lowmemorydump is set, it means we want to make the compression using an external pipe instead retreiving the content of the dump in PHP memory array $output_arr and then print it into the PHP pipe open with xopen(). + * @param int $lowmemorydump 1=Use the low memory method. If $lowmemorydump is set, it means we want to make the compression using an external pipe instead retrieving the content of the dump in PHP memory array $output_arr and then print it into the PHP pipe open with xopen(). * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ public function dumpDatabase($compression = 'none', $type = 'auto', $usedefault = 1, $file = 'auto', $keeplastnfiles = 0, $execmethod = 0, $lowmemorydump = 0) @@ -294,7 +295,7 @@ class Utils $outputerror = $outputfile.'.err'; dol_mkdir($conf->admin->dir_output.'/backup'); - // Parameteres execution + // Parameters execution $command = $cmddump; $command = preg_replace('/(\$|%)/', '', $command); // We removed chars that can be used to inject vars that contains space inside path of command without seeing there is a space to bypass the escapeshellarg. if (preg_match("/\s/", $command)) { @@ -542,7 +543,7 @@ class Utils //print "$outputfile -> $outputerror"; @dol_delete_file($outputerror, 1, 0, 0, null, false, 0); @rename($outputfile, $outputerror); - // Si safe_mode on et command hors du parametre exec, on a un fichier out vide donc errormsg vide + // Si safe_mode on et command hors du parameter exec, on a un fichier out vide donc errormsg vide if (!$errormsg) { $langs->load("errors"); $errormsg = $langs->trans("ErrorFailedToRunExternalCommand"); @@ -600,7 +601,7 @@ class Utils $outputerror = $outputfile.'.err'; dol_mkdir($conf->admin->dir_output.'/backup'); - // Parameteres execution + // Parameters execution $command = $cmddump; $command = preg_replace('/(\$|%)/', '', $command); // We removed chars that can be used to inject vars that contains space inside path of command without seeing there is a space to bypass the escapeshellarg. if (preg_match("/\s/", $command)) { @@ -685,7 +686,7 @@ class Utils * @param string $outputfile A path for an output file (used only when method is 2). For example: $conf->admin->dir_temp.'/out.tmp'; * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method * @param string $redirectionfile If defined, a redirection of output to this file is added. - * @param int $noescapecommand 1=Do not escape command. Warning: Using this parameter needs you alreay have sanitized the $command parameter. If not, it will lead to security vulnerability. + * @param int $noescapecommand 1=Do not escape command. Warning: Using this parameter needs you already have sanitized the $command parameter. If not, it will lead to security vulnerability. * This parameter is provided for backward compatibility with external modules. Always use 0 in core. * @param string $redirectionfileerr If defined, a redirection of error is added to this file instead of to channel 1. * @return array array('result'=>...,'output'=>...,'error'=>...). result = 0 means OK. @@ -1172,7 +1173,7 @@ class Utils $resqldrop = $db->query('SHOW CREATE TABLE '.$table); $row2 = $db->fetch_row($resqldrop); if (empty($row2[1])) { - fwrite($handle, "\n-- WARNING: Show create table ".$table." return empy string when it should not.\n"); + fwrite($handle, "\n-- WARNING: Show create table ".$table." return empty string when it should not.\n"); } else { fwrite($handle, $row2[1].";\n"); //fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n"); @@ -1268,7 +1269,7 @@ class Utils * @param string $message Message * @param string $filename List of files to attach (full path of filename on file system) * @param string $filter Filter file send - * @param string $sizelimit Limit size to send file + * @param int $sizelimit Limit size to send file * @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK) */ public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '', $sizelimit = 100000000) @@ -1404,7 +1405,7 @@ class Utils } $cron_job = new Cronjob($db); - $cron_job->fetchAll('DESC', 't.rowid', 100, 0, 1, '', 1); // Fetch jobs that are currently running + $cron_job->fetchAll('DESC', 't.rowid', 100, 0, 1, [], 1); // Fetch jobs that are currently running // Iterate over all jobs in processing (this can't be this job since his state is set to 0 before) foreach ($cron_job->lines as $job_line) { diff --git a/htdocs/core/class/utils_diff.class.php b/htdocs/core/class/utils_diff.class.php index 2925bffc3b6..e9ce4838a08 100644 --- a/htdocs/core/class/utils_diff.class.php +++ b/htdocs/core/class/utils_diff.class.php @@ -31,7 +31,7 @@ class Diff * * @param string $string1 First string * @param string $string2 Second string - * @param string $compareCharacters true to compare characters, and false to compare lines; this optional parameter defaults to false + * @param boolean $compareCharacters true to compare characters, and false to compare lines; this optional parameter defaults to false * @return array Array of diff */ public static function compare($string1, $string2, $compareCharacters = false) @@ -150,7 +150,7 @@ class Diff } /** - * Returns the partial diff for the specificed sequences, in reverse order. + * Returns the partial diff for the specified sequences, in reverse order. * The parameters are: * * @param string $table the table returned by the computeTable function diff --git a/htdocs/core/class/validate.class.php b/htdocs/core/class/validate.class.php index 50d290f7517..02ed867a5d8 100644 --- a/htdocs/core/class/validate.class.php +++ b/htdocs/core/class/validate.class.php @@ -28,7 +28,7 @@ class Validate { /** - * @var DoliDb Database handler (result of a new DoliDB) + * @var DoliDB Database handler (result of a new DoliDB) */ public $db; @@ -94,10 +94,10 @@ class Validate * Check for e-mail validity * * @param string $email e-mail address to validate - * @param int $maxLength string max length + * @param int $maxLength string max length (not used) * @return boolean Validity is ok or not */ - public function isEmail($email, $maxLength = false) + public function isEmail($email, $maxLength = 0) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $this->error = $this->outputLang->trans('RequireValidEmail'); diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index e2694520577..345ad056c4e 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -83,7 +83,7 @@ function dol_quoted_printable_encode($input, $line_max = 76) /** - * Class to buld vCard files + * Class to build vCard files */ class vCard { @@ -139,7 +139,7 @@ class vCard } /** - * mise en forme du nom formate + * mise en forme du nom format * * @param string $name Name * @return void @@ -150,7 +150,7 @@ class vCard } /** - * mise en forme du nom complet + * mise en forme du nom complete * * @param string $family Family name * @param string $first First name @@ -396,7 +396,7 @@ class vCard $this->setProdId('Dolibarr '.DOL_VERSION); - $this->setUid('DOLIBARR-USERID-'.dol_trunc(md5('vcard'.$dolibarr_main_instance_unique_id), 8, 'right', 'UTF-8', 1).'-'.$object->id); + $this->setUID('DOLIBARR-USERID-'.dol_trunc(md5('vcard'.$dolibarr_main_instance_unique_id), 8, 'right', 'UTF-8', 1).'-'.$object->id); $this->setName($object->lastname, $object->firstname, "", $object->civility_code, ""); $this->setFormattedName($object->getFullName($langs, 1)); diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index ff288424d37..a67597fcaea 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -300,7 +300,7 @@ if (is_array($search_groupby) && count($search_groupby)) { $sql .= " FROM ".MAIN_DB_PREFIX.$tabletouse." as ".$tablealiastouse; } - // Add a where here keeping only the citeria on $tabletouse + // Add a where here keeping only the criteria on $tabletouse // TODO /*$sqlfilters = ... GETPOST('search_component_params_hidden', 'alphanohtml'); if ($sqlfilters) { @@ -642,7 +642,7 @@ if (!empty($search_measures) && !empty($search_xaxis)) { // Init the list of tables added. We include by default always the main table. $listoftablesalreadyadded = array($object->table_element => $object->table_element); - // Add LEFT JOIN for all parent tables mentionned into the Xaxis + // Add LEFT JOIN for all parent tables mentioned into the Xaxis //var_dump($arrayofxaxis); var_dump($search_xaxis); foreach ($search_xaxis as $key => $val) { if (!empty($arrayofxaxis[$val])) { @@ -669,7 +669,7 @@ if (!empty($search_measures) && !empty($search_xaxis)) { } } - // Add LEFT JOIN for all parent tables mentionned into the Group by + // Add LEFT JOIN for all parent tables mentioned into the Group by //var_dump($arrayofgroupby); var_dump($search_groupby); foreach ($search_groupby as $key => $val) { if (!empty($arrayofgroupby[$val])) { @@ -696,7 +696,7 @@ if (!empty($search_measures) && !empty($search_xaxis)) { } } - // Add LEFT JOIN for all parent tables mentionned into the Yaxis + // Add LEFT JOIN for all parent tables mentioned into the Yaxis //var_dump($arrayofgroupby); var_dump($search_groupby); foreach ($search_measures as $key => $val) { if (!empty($arrayofmesures[$val])) { @@ -1011,11 +1011,11 @@ $db->close(); * @param mixed $object Any object * @param string $tablealias Alias of table * @param string $labelofobject Label of object - * @param array $arrayofmesures Array of mesures already filled + * @param array $arrayofmesures Array of measures already filled * @param int $level Level * @param int $count Count * @param string $tablepath Path of all tables ('t' or 't,contract' or 't,contract,societe'...) - * @return array Array of mesures + * @return array Array of measures */ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesures, $level = 0, &$count = 0, &$tablepath = '') { @@ -1032,7 +1032,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu } if ($level == 0) { - // Add the count of record only for the main/first level object. Parents are necessarly unique for each record. + // Add the count of record only for the main/first level object. Parents are necessarily unique for each record. $arrayofmesures[$tablealias.'.count'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': Count', 'labelnohtml' => $labelofobject.': Count', @@ -1047,7 +1047,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu // Add main fields of object foreach ($object->fields as $key => $val) { if (!empty($val['isameasure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofmesures[$tablealias.'.'.$key.'-sum'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' ('.$langs->trans("Sum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1200,7 +1200,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, continue; } if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofxaxis[$tablealias.'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1223,7 +1223,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, 'tablefromt' => $tablepath ); } else { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofxaxis[$tablealias.'.'.$key] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']), 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1246,7 +1246,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, } if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('timestamp', 'date', 'datetime'))) { - $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intVal($extrafields->attributes[$object->table_element]['pos'][$key])); + $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intval($extrafields->attributes[$object->table_element]['pos'][$key])); $arrayofxaxis[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), @@ -1362,7 +1362,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup continue; } if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofgroupby[$tablealias.'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1385,7 +1385,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup 'tablefromt' => $tablepath ); } else { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofgroupby[$tablealias.'.'.$key] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']), 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1408,7 +1408,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup } if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('timestamp', 'date', 'datetime'))) { - $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intVal($extrafields->attributes[$object->table_element]['pos'][$key])); + $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intval($extrafields->attributes[$object->table_element]['pos'][$key])); $arrayofgroupby[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 1a7454e92ca..e1bc75888e6 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -65,7 +65,7 @@ interface Database * Start transaction * * @param string $textinlog Add a small text into log. '' by default. - * @return int 1 if transaction successfuly opened or already opened, 0 if error + * @return int 1 if transaction successfully opened or already opened, 0 if error */ public function begin($textinlog = ''); @@ -228,7 +228,7 @@ interface Database * Canceling a transaction and returning to old values * * @param string $log Add more log to default log line - * @return int 1 if cancelation ok or transaction not open, 0 if error + * @return int 1 if cancellation ok or transaction not open, 0 if error */ public function rollback($log = ''); @@ -245,7 +245,7 @@ interface Database public function query($query, $usesavepoint = 0, $type = 'auto', $result_mode = 0); /** - * Connexion to server + * Connection to server * * @param string $host database server host * @param string $login login @@ -317,7 +317,7 @@ interface Database /** * Return generic error code of last operation. * - * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * @return string Error code (Examples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ public function errno(); @@ -446,7 +446,7 @@ interface Database * 19700101020000 -> 7200 whaterver is TZ if gmt=1 * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ + * @param bool $gm 1=Input information are GMT values, otherwise local to server TZ * @return int|string Date TMS or '' */ public function jdate($string, $gm = false); @@ -488,9 +488,9 @@ interface Database public function free($resultset = null); /** - * Close database connexion + * Close database connection * - * @return boolean True if disconnect successfull, false otherwise + * @return boolean True if disconnect successful, false otherwise * @see connect() */ public function close(); @@ -504,9 +504,9 @@ interface Database // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return connexion ID + * Return connection ID * - * @return string Id connexion + * @return string Id connection */ public function DDLGetConnectId(); // phpcs:enable diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index a6469cf6939..7d28007ec81 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -89,8 +89,8 @@ abstract class DoliDB implements Database * Format a SQL IF * * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') - * @param string $resok resultat si test egal - * @param string $resko resultat si test non egal + * @param string $resok resultat si test equal + * @param string $resko resultat si test non equal * @return string SQL string */ public function ifsql($test, $resok, $resko) @@ -114,18 +114,18 @@ abstract class DoliDB implements Database /** * Format a SQL REGEXP * - * @param string $subject string tested + * @param string $subject Field name to test * @param string $pattern SQL pattern to match - * @param int $sqlstring whether or not the string being tested is an SQL expression + * @param int $sqlstring 0=the string being tested is a hard coded string, 1=the string is a field * @return string SQL string */ public function regexpsql($subject, $pattern, $sqlstring = 0) { if ($sqlstring) { - return "(". $subject ." REGEXP '" . $pattern . "')"; + return "(". $subject ." REGEXP '" . $this->escape($pattern) . "')"; } - return "('". $subject ."' REGEXP '" . $pattern . "')"; + return "('". $this->escape($subject) ."' REGEXP '" . $this->escape($pattern) . "')"; } @@ -134,7 +134,7 @@ abstract class DoliDB implements Database * Function to use to build INSERT, UPDATE or WHERE predica * * @param int $param Date TMS to convert - * @param mixed $gm 'gmt'=Input informations are GMT values, 'tzserver'=Local to server TZ + * @param mixed $gm 'gmt'=Input information are GMT values, 'tzserver'=Local to server TZ * @return string Date in a string YYYY-MM-DD HH:MM:SS */ public function idate($param, $gm = 'tzserver') @@ -171,7 +171,7 @@ abstract class DoliDB implements Database * Start transaction * * @param string $textinlog Add a small text into log. '' by default. - * @return int 1 if transaction successfuly opened or already opened, 0 if error + * @return int 1 if transaction successfully opened or already opened, 0 if error */ public function begin($textinlog = '') { @@ -218,7 +218,7 @@ abstract class DoliDB implements Database * Cancel a transaction and go back to initial data values * * @param string $log Add more log to default log line - * @return resource|int 1 if cancelation is ok or transaction not open, 0 if error + * @return resource|int 1 if cancellation is ok or transaction not open, 0 if error */ public function rollback($log = '') { @@ -281,7 +281,7 @@ abstract class DoliDB implements Database * Define sort criteria of request * * @param string $sortfield List of sort fields, separated by comma. Example: 't1.fielda,t2.fieldb' - * @param string $sortorder Sort order, separated by comma. Example: 'ASC,DESC'. Note: If the quantity fo sortorder values is lower than sortfield, we used the last value for missing values. + * @param string $sortorder Sort order, separated by comma. Example: 'ASC,DESC'. Note: If the quantity for sortorder values is lower than sortfield, we used the last value for missing values. * @return string String to provide syntax of a sort sql string */ public function order($sortfield = '', $sortorder = '') @@ -338,7 +338,7 @@ abstract class DoliDB implements Database * 19700101020000 -> 7200 whaterver is server TZ if $gm='gmt' * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param mixed $gm 'gmt'=Input informations are GMT values, 'tzserver'=Local to server TZ + * @param mixed $gm 'gmt'=Input information are GMT values, 'tzserver'=Local to server TZ * @return int|string Date TMS or '' */ public function jdate($string, $gm = 'tzserver') @@ -366,7 +366,7 @@ abstract class DoliDB implements Database /** * Return first result from query as object * Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries - * Dont add LIMIT to your query, it will be added by this method + * Don't add LIMIT to your query, it will be added by this method * * @param string $sql The sql query string * @return bool|int|object False on failure, 0 on empty, object on success @@ -391,7 +391,7 @@ abstract class DoliDB implements Database /** * Return all results from query as an array of objects * Note : This method executes a given SQL query and retrieves all row of results as an array of objects. It should only be used with SELECT queries - * be carefull with this method use it only with some limit of results to avoid performences loss. + * be careful with this method use it only with some limit of results to avoid performances loss. * * @param string $sql The sql query string * @return bool|array Result diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index cb7d98b04ab..fae891e07ec 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -47,7 +47,7 @@ class DoliDBMysqli extends DoliDB /** * Constructor. - * This create an opened connexion to a database server and eventually to a database + * This create an opened connection to a database server and eventually to a database * * @param string $type Type of database (mysql, pgsql...). Not used. * @param string $host Address of database server @@ -91,7 +91,7 @@ class DoliDBMysqli extends DoliDB } // Try server connection - // We do not try to connect to database, only to server. Connect to database is done later in constrcutor + // We do not try to connect to database, only to server. Connect to database is done later in constructor $this->db = $this->connect($host, $user, $pass, '', $port); if ($this->db && empty($this->db->connect_errno)) { @@ -284,9 +284,9 @@ class DoliDBMysqli extends DoliDB /** - * Close database connexion + * Close database connection * - * @return bool True if disconnect successfull, false otherwise + * @return bool True if disconnect successful, false otherwise * @see connect() */ public function close() @@ -338,7 +338,7 @@ class DoliDBMysqli extends DoliDB try { if (!$this->database_name) { - // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) + // SQL query not needing a database connection (example: CREATE DATABASE) $ret = $this->db->query($query, $result_mode); } else { $ret = $this->db->query($query, $result_mode); @@ -378,7 +378,7 @@ class DoliDBMysqli extends DoliDB public function fetch_object($resultset) { // phpcs:enable - // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion + // If the resultset was not provided, we get the last one for this connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -396,7 +396,7 @@ class DoliDBMysqli extends DoliDB public function fetch_array($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -413,14 +413,14 @@ class DoliDBMysqli extends DoliDB public function fetch_row($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_bool($resultset)) { if (!is_object($resultset)) { $resultset = $this->_results; } return $resultset->fetch_row(); } else { - // si le curseur est un booleen on retourne la valeur 0 + // si le curseur est un boolean on retourne la valeur 0 return 0; } } @@ -436,7 +436,7 @@ class DoliDBMysqli extends DoliDB public function num_rows($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -454,7 +454,7 @@ class DoliDBMysqli extends DoliDB public function affected_rows($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -465,14 +465,14 @@ class DoliDBMysqli extends DoliDB /** - * Libere le dernier resultset utilise sur cette connexion + * Libere le dernier resultset utilise sur cette connection * * @param mysqli_result $resultset Curseur de la requete voulue * @return void */ public function free($resultset = null) { - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -507,12 +507,12 @@ class DoliDBMysqli extends DoliDB /** * Return generic error code of last operation. * - * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * @return string Error code (Examples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ public function errno() { if (!$this->connected) { - // Si il y a eu echec de connexion, $this->db n'est pas valide. + // Si il y a eu echec de connection, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } else { // Constants to convert a MySql error code to a generic Dolibarr error code @@ -564,7 +564,7 @@ class DoliDBMysqli extends DoliDB public function error() { if (!$this->connected) { - // Si il y a eu echec de connexion, $this->db n'est pas valide pour mysqli_error. + // Si il y a eu echec de connection, $this->db n'est pas valide pour mysqli_error. return 'Not connected. Check setup parameters in conf/conf.php file and your mysql client and server versions'; } else { return $this->db->error; @@ -648,9 +648,9 @@ class DoliDBMysqli extends DoliDB // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return connexion ID + * Return connection ID * - * @return string Id connexion + * @return string Id connection */ public function DDLGetConnectId() { @@ -706,7 +706,7 @@ class DoliDBMysqli extends DoliDB * List tables into a database * * @param string $database Name of database - * @param string $table Nmae of table filter ('xxx%') + * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ public function DDLListTables($database, $table = '') @@ -738,7 +738,7 @@ class DoliDBMysqli extends DoliDB * List tables into a database * * @param string $database Name of database - * @param string $table Nmae of table filter ('xxx%') + * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ public function DDLListTablesFull($database, $table = '') @@ -770,7 +770,7 @@ class DoliDBMysqli extends DoliDB * List information of columns into a table. * * @param string $table Name of table - * @return array Tableau des informations des champs de la table + * @return array Tableau des information des champs de la table */ public function DDLInfoTable($table) { @@ -923,8 +923,8 @@ class DoliDBMysqli extends DoliDB * * @param string $table Name of table * @param string $field_name Name of field to add - * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] - * @param string $field_position Optionnel ex.: "after champtruc" + * @param string $field_desc Associative table with description of field to insert [parameter name][parameter value] + * @param string $field_position Optional e.g.: "after some_field" * @return int Return integer <0 if KO, >0 if OK */ public function DDLAddField($table, $field_name, $field_desc, $field_position = "") @@ -1037,8 +1037,8 @@ class DoliDBMysqli extends DoliDB * Create a user and privileges to connect to database (even if database does not exists yet) * * @param string $dolibarr_main_db_host Ip server or '%' - * @param string $dolibarr_main_db_user Nom user a creer - * @param string $dolibarr_main_db_pass Mot de passe user a creer + * @param string $dolibarr_main_db_user Nom new user + * @param string $dolibarr_main_db_pass Password for the new user * @param string $dolibarr_main_db_name Database name where user must be granted * @return int Return integer <0 if KO, >=0 if OK */ @@ -1258,7 +1258,7 @@ class mysqliDoli extends mysqli { /** * Constructor. - * This create an opened connexion to a database server and eventually to a database + * This create an opened connection to a database server and eventually to a database * * @param string $host Address of database server * @param string $user Name of database user diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 566cccf332a..d2b832a0dc6 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -25,13 +25,13 @@ /** * \file htdocs/core/db/pgsql.class.php - * \brief Fichier de la classe permettant de gerer une base pgsql + * \brief Fichier de la class permettant de gerer une base pgsql */ require_once DOL_DOCUMENT_ROOT.'/core/db/DoliDB.class.php'; /** - * Class to drive a Postgresql database for Dolibarr + * Class to drive a PostgreSQL database for Dolibarr */ class DoliDBPgsql extends DoliDB { @@ -51,11 +51,11 @@ class DoliDBPgsql extends DoliDB const VERSIONMIN = '9.0.0'; // Version min database /** - * @var boolean $unescapeslashquot Set this to 1 when calling SQL queries, to say that SQL is not standard but already escaped for Mysql. Used by Postgresql driver + * @var boolean $unescapeslashquot Set this to 1 when calling SQL queries, to say that SQL is not standard but already escaped for Mysql. Used by PostgreSQL driver */ public $unescapeslashquot = false; /** - * @var boolean $standard_conforming_string Set this to true if postgres accept only standard encoding of sting using '' and not \' + * @var boolean $standard_conforming_string Set this to true if postgres accept only standard encoding of string using '' and not \' */ public $standard_conforming_strings = false; @@ -67,12 +67,12 @@ class DoliDBPgsql extends DoliDB /** * Constructor. - * This create an opened connexion to a database server and eventually to a database + * This create an opened connection to a database server and eventually to a database * * @param string $type Type of database (mysql, pgsql...). Not used. * @param string $host Address of database server * @param string $user Nom de l'utilisateur autorise - * @param string $pass Mot de passe + * @param string $pass Password * @param string $name Nom de la database * @param int $port Port of database server */ @@ -112,7 +112,7 @@ class DoliDBPgsql extends DoliDB return; } - // Essai connexion serveur + // Essai connection serveur //print "$host, $user, $pass, $name, $port"; $this->db = $this->connect($host, $user, $pass, $name, $port); @@ -127,7 +127,7 @@ class DoliDBPgsql extends DoliDB dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect ".$this->error.'. Failed to connect to host='.$host.' port='.$port.' user='.$user, LOG_ERR); } - // Si connexion serveur ok et si connexion base demandee, on essaie connexion base + // If server connection serveur ok and DB connection is requested, try to connect to DB if ($this->connected && $name) { if ($this->select_db($name)) { $this->database_selected = true; @@ -241,7 +241,7 @@ class DoliDBPgsql extends DoliDB $line = preg_replace('/^float/i', 'numeric', $line); $line = preg_replace('/(\s*)float/i', '\\1numeric', $line); - //Check tms timestamp field case (in Mysql this field is defautled to now and + //Check tms timestamp field case (in Mysql this field is defaulted to now and // on update defaulted by now $line = preg_replace('/(\s*)tms(\s*)timestamp/i', '\\1tms timestamp without time zone DEFAULT now() NOT NULL', $line); @@ -320,11 +320,11 @@ class DoliDBPgsql extends DoliDB } } - // To have postgresql case sensitive + // To have PostgreSQL case sensitive $count_like = 0; $line = str_replace(' LIKE \'', ' ILIKE \'', $line, $count_like); if (getDolGlobalString('PSQL_USE_UNACCENT') && $count_like > 0) { - // @see https://docs.postgresql.fr/11/unaccent.html : 'unaccent()' function must be installed before + // @see https://docs.PostgreSQL.fr/11/unaccent.html : 'unaccent()' function must be installed before $line = preg_replace('/\s+(\(+\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line); } @@ -361,7 +361,7 @@ class DoliDBPgsql extends DoliDB $line = preg_replace('/FROM\s*\(([a-z_]+\s+as\s+[a-z_]+)\s*,\s*([a-z_]+\s+as\s+[a-z_]+\s*),\s*([a-z_]+\s+as\s+[a-z_]+\s*),\s*([a-z_]+\s+as\s+[a-z_]+\s*),\s*([a-z_]+\s+as\s+[a-z_]+\s*)\)/i', 'FROM \\1, \\2, \\3, \\4, \\5', $line); //print $line."\n"; - // Replace espacing \' by ''. + // Replace spacing ' with ''. // By default we do not (should be already done by db->escape function if required // except for sql insert in data file that are mysql escaped so we removed them to // be compatible with standard_conforming_strings=on that considers \ as ordinary character). @@ -378,8 +378,8 @@ class DoliDBPgsql extends DoliDB // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Select a database - * Ici postgresql n'a aucune fonction equivalente de mysql_select_db - * On compare juste manuellement si la database choisie est bien celle activee par la connexion + * PostgreSQL does not have an equivalent for `mysql_select_db` + * Only compare if the chosen DB is the one active on the connection * * @param string $database Name of database * @return bool true if OK, false if KO @@ -395,7 +395,7 @@ class DoliDBPgsql extends DoliDB } /** - * Connexion to server + * Connection to server * * @param string $host Database server host * @param string $login Login @@ -485,9 +485,9 @@ class DoliDBPgsql extends DoliDB } /** - * Close database connexion + * Close database connection * - * @return boolean True if disconnect successfull, false otherwise + * @return boolean True if disconnect successful, false otherwise * @see connect() */ public function close() @@ -517,7 +517,7 @@ class DoliDBPgsql extends DoliDB $query = trim($query); - // Convert MySQL syntax to PostgresSQL syntax + // Convert MySQL syntax to PostgreSQL syntax $query = $this->convertSQLFromMysql($query, $type, ($this->unescapeslashquot && $this->standard_conforming_strings)); //print "After convertSQLFromMysql:\n".$query."
    \n"; @@ -593,7 +593,7 @@ class DoliDBPgsql extends DoliDB public function fetch_object($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_resource($resultset) && !is_object($resultset)) { $resultset = $this->_results; } @@ -610,7 +610,7 @@ class DoliDBPgsql extends DoliDB public function fetch_array($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_resource($resultset) && !is_object($resultset)) { $resultset = $this->_results; } @@ -627,7 +627,7 @@ class DoliDBPgsql extends DoliDB public function fetch_row($resultset) { // phpcs:enable - // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion + // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connection if (!is_resource($resultset) && !is_object($resultset)) { $resultset = $this->_results; } @@ -645,7 +645,7 @@ class DoliDBPgsql extends DoliDB public function num_rows($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_resource($resultset) && !is_object($resultset)) { $resultset = $this->_results; } @@ -663,7 +663,7 @@ class DoliDBPgsql extends DoliDB public function affected_rows($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_resource($resultset) && !is_object($resultset)) { $resultset = $this->_results; } @@ -674,14 +674,14 @@ class DoliDBPgsql extends DoliDB /** - * Libere le dernier resultset utilise sur cette connexion + * Libere le dernier resultset utilise sur cette connection * * @param resource $resultset Result set of request * @return void */ public function free($resultset = null) { - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_resource($resultset) && !is_object($resultset)) { $resultset = $this->_results; } @@ -741,10 +741,10 @@ class DoliDBPgsql extends DoliDB /** * Format a SQL IF * - * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') - * @param string $resok resultat si test egal - * @param string $resko resultat si test non egal - * @return string chaine formate SQL + * @param string $test Test expression (example: 'cd.statut=0', 'field IS NULL') + * @param string $resok Result to generate when test is True + * @param string $resko Result to generate when test is False + * @return string chaine format SQL */ public function ifsql($test, $resok, $resko) { @@ -754,30 +754,30 @@ class DoliDBPgsql extends DoliDB /** * Format a SQL REGEXP * - * @param string $subject string tested + * @param string $subject Field name to test * @param string $pattern SQL pattern to match - * @param int $sqlstring whether or not the string being tested is an SQL expression + * @param int $sqlstring 0=the string being tested is a hard coded string, 1=the string is a field * @return string SQL string */ public function regexpsql($subject, $pattern, $sqlstring = 0) { if ($sqlstring) { - return "(". $subject ." ~ '" . $pattern . "')"; + return "(". $subject ." ~ '" . $this->escape($pattern) . "')"; } - return "('". $subject ."' ~ '" . $pattern . "')"; + return "('". $this->escape($subject) ."' ~ '" . $this->escape($pattern) . "')"; } /** * Renvoie le code erreur generique de l'operation precedente. * - * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * @return string Error code (Examples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ public function errno() { if (!$this->connected) { - // Si il y a eu echec de connexion, $this->db n'est pas valide. + // Si il y a eu echec de connection, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } else { // Constants to convert error code to a generic Dolibarr error code @@ -847,7 +847,7 @@ class DoliDBPgsql extends DoliDB /** * Get last ID after an insert INSERT * - * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql + * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec PostgreSQL * @param string $fieldid Field name * @return string Id of row */ @@ -911,9 +911,9 @@ class DoliDBPgsql extends DoliDB // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return connexion ID + * Return connection ID * - * @return string Id connexion + * @return string Id connection */ public function DDLGetConnectId() { @@ -1016,7 +1016,7 @@ class DoliDBPgsql extends DoliDB * List information of columns into a table. * * @param string $table Name of table - * @return array Tableau des informations des champs de la table + * @return array Tableau des information des champs de la table * */ public function DDLInfoTable($table) @@ -1205,7 +1205,7 @@ class DoliDBPgsql extends DoliDB * * @param string $table Name of table * @param string $field_name Name of field to add - * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] + * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parameter][valeur du parameter] * @param string $field_position Optionnel ex.: "after champtruc" * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index c6eeb736325..0faa455d23c 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -51,12 +51,12 @@ class DoliDBSqlite3 extends DoliDB /** * Constructor. - * This create an opened connexion to a database server and eventually to a database + * This create an opened connection to a database server and eventually to a database * * @param string $type Type of database (mysql, pgsql...). Not used. * @param string $host Address of database server * @param string $user Nom de l'utilisateur autorise - * @param string $pass Mot de passe + * @param string $pass Password * @param string $name Nom de la database * @param int $port Port of database server */ @@ -98,8 +98,8 @@ class DoliDBSqlite3 extends DoliDB return; }*/ - // Essai connexion serveur - // We do not try to connect to database, only to server. Connect to database is done later in constrcutor + // Essai connection serveur + // We do not try to connect to database, only to server. Connect to database is done later in constructor $this->db = $this->connect($host, $user, $pass, $name, $port); if ($this->db) { @@ -307,7 +307,7 @@ class DoliDBSqlite3 extends DoliDB /** - * Connexion to server + * Connection to server * * @param string $host database server host * @param string $login login @@ -368,9 +368,9 @@ class DoliDBSqlite3 extends DoliDB /** - * Close database connexion + * Close database connection * - * @return bool True if disconnect successfull, false otherwise + * @return bool True if disconnect successful, false otherwise * @see connect() */ public function close() @@ -411,8 +411,8 @@ class DoliDBSqlite3 extends DoliDB $reg = array(); if (preg_match('/ALTER\s+TABLE\s*(.*)\s*ADD\s+CONSTRAINT\s+(.*)\s*FOREIGN\s+KEY\s*\(([\w,\s]+)\)\s*REFERENCES\s+(\w+)\s*\(([\w,\s]+)\)/i', $query, $reg)) { // Ajout d'une clef étrangère à la table - // procédure de remplacement de la table pour ajouter la contrainte - // Exemple : ALTER TABLE llx_adherent ADD CONSTRAINT adherent_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid) + // procédure de replacement de la table pour ajouter la contrainte + // Example : ALTER TABLE llx_adherent ADD CONSTRAINT adherent_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid) // -> CREATE TABLE ( ... ,CONSTRAINT adherent_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid)) $foreignFields = $reg[5]; $foreignTable = $reg[4]; @@ -467,7 +467,7 @@ class DoliDBSqlite3 extends DoliDB } } - // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) + // Ordre SQL ne necessitant pas de connection a une base (example: CREATE DATABASE) try { //$ret = $this->db->exec($query); $ret = $this->db->query($query); // $ret is a Sqlite3Result @@ -515,7 +515,7 @@ class DoliDBSqlite3 extends DoliDB public function fetch_object($resultset) { // phpcs:enable - // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion + // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -538,7 +538,7 @@ class DoliDBSqlite3 extends DoliDB public function fetch_array($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -557,14 +557,14 @@ class DoliDBSqlite3 extends DoliDB public function fetch_row($resultset) { // phpcs:enable - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_bool($resultset)) { if (!is_object($resultset)) { $resultset = $this->_results; } return $resultset->fetchArray(SQLITE3_NUM); } else { - // si le curseur est un booleen on retourne la valeur 0 + // si le curseur est un boolean on retourne la valeur 0 return false; } } @@ -582,7 +582,7 @@ class DoliDBSqlite3 extends DoliDB // phpcs:enable // FIXME: SQLite3Result does not have a queryString member - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -605,7 +605,7 @@ class DoliDBSqlite3 extends DoliDB // phpcs:enable // FIXME: SQLite3Result does not have a queryString member - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -626,7 +626,7 @@ class DoliDBSqlite3 extends DoliDB */ public function free($resultset = null) { - // If resultset not provided, we take the last used by connexion + // If resultset not provided, we take the last used by connection if (!is_object($resultset)) { $resultset = $this->_results; } @@ -661,12 +661,12 @@ class DoliDBSqlite3 extends DoliDB /** * Renvoie le code erreur generique de l'operation precedente. * - * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * @return string Error code (Examples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ public function errno() { if (!$this->connected) { - // Si il y a eu echec de connexion, $this->db n'est pas valide. + // Si il y a eu echec de connection, $this->db n'est pas valide. return 'DB_ERROR_FAILED_TO_CONNECT'; } else { // Constants to convert error code to a generic Dolibarr error code @@ -735,7 +735,7 @@ class DoliDBSqlite3 extends DoliDB public function error() { if (!$this->connected) { - // Si il y a eu echec de connexion, $this->db n'est pas valide pour sqlite_error. + // Si il y a eu echec de connection, $this->db n'est pas valide pour sqlite_error. return 'Not connected. Check setup parameters in conf/conf.php file and your sqlite version'; } else { return $this->error; @@ -819,9 +819,9 @@ class DoliDBSqlite3 extends DoliDB // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Return connexion ID + * Return connection ID * - * @return string Id connexion + * @return string Id connection */ public function DDLGetConnectId() { @@ -931,7 +931,7 @@ class DoliDBSqlite3 extends DoliDB * List information of columns into a table. * * @param string $table Name of table - * @return array Tableau des informations des champs de la table + * @return array Tableau des information des champs de la table * TODO modify for sqlite */ public function DDLInfoTable($table) @@ -1075,10 +1075,10 @@ class DoliDBSqlite3 extends DoliDB /** * Create a new field into table * - * @param string $table Name of table - * @param string $field_name Name of field to add - * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] - * @param string $field_position Optionnel ex.: "after champtruc" + * @param string $table Table name + * @param string $field_name Field name to add + * @param string $field_desc Associative table with description of field to insert [parameter name][parameter value] + * @param string $field_position Optional e.g.: "after some_field" * @return int Return integer <0 if KO, >0 if OK */ public function DDLAddField($table, $field_name, $field_desc, $field_position = "") @@ -1171,7 +1171,7 @@ class DoliDBSqlite3 extends DoliDB * * @param string $dolibarr_main_db_host Ip serveur * @param string $dolibarr_main_db_user Nom user a creer - * @param string $dolibarr_main_db_pass Mot de passe user a creer + * @param string $dolibarr_main_db_pass Password user a creer * @param string $dolibarr_main_db_name Database name where user must be granted * @return int Return integer <0 if KO, >=0 if OK */ @@ -1366,12 +1366,14 @@ class DoliDBSqlite3 extends DoliDB } /** - * Permet le chargement d'une fonction personnalisee dans le moteur de base de donnees. - * Note: le nom de la fonction personnalisee est prefixee par 'db'. La fonction doit être - * statique et publique. Le nombre de parametres est determine automatiquement. + * Add a custom function in the database engine (STORED PROCEDURE) + * Notes: + * - The custom function is prefixed with 'db' + * - The function must be static and public. + * - The number of arguments is automatically determined when arg_count is < 0 * - * @param string $name Le nom de la fonction a definir dans Sqlite - * @param int $arg_count Arg count + * @param string $name Function name to define in Sqlite + * @param int $arg_count Arguments count * @return void */ private function addCustomFunction($name, $arg_count = -1) diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php index ec02afa8817..ca9a01bc37d 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php @@ -579,7 +579,7 @@ function CreateServerFolder($folderPath, $lastFolder = null) // Check if the parent exists, or create it. if (!empty($sParent) && !file_exists($sParent)) { - //prevents agains infinite loop when we can't create root folder + //prevents against infinite loop when we can't create root folder if (!is_null($lastFolder) && $lastFolder === $sParent) { return "Can't create $folderPath directory"; } @@ -678,7 +678,7 @@ function Server_MapPath($path) * Is Allowed Extension * * @param string $sExtension File extension - * @param string $resourceType ressource type + * @param string $resourceType resource type * @return boolean true or false */ function IsAllowedExt($sExtension, $resourceType) @@ -702,7 +702,7 @@ function IsAllowedExt($sExtension, $resourceType) /** * Is Allowed Type * - * @param string $resourceType ressource type + * @param string $resourceType resource type * @return boolean true or false */ function IsAllowedType($resourceType) @@ -933,7 +933,7 @@ function ConvertToXmlAttribute($value) } /** - * Check whether given extension is in html etensions list + * Check whether given extension is in html extensions list * * @param string $ext Extension * @param array $formExtensions Array of extensions diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.php b/htdocs/core/filemanagerdol/connectors/php/connector.php index 9e12ca36728..080e331b048 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.php @@ -47,7 +47,7 @@ function DoResponse() return; } - // Get the main request informaiton. + // Get the main request information. $sCommand = $_GET['Command']; $sResourceType = $_GET['Type']; $sCurrentFolder = GetCurrentFolder(); diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js index 7276e37755c..f3b348f798a 100644 --- a/htdocs/core/js/dst.js +++ b/htdocs/core/js/dst.js @@ -25,9 +25,11 @@ $(document).ready(function () { - var timezone = jstz.determine(); - console.log("Timezone detected for user: "+timezone.name()); - + //var timezone = jstz.determine(); // old method using jstimezonedetect library + //console.log("Timezone detected for user: "+timezone.name()); + var timezone = Intl.DateTimeFormat().resolvedOptions().timeZone + console.log("Timezone detected by Intl for user: "+timezone); + // Detect and save TZ and DST var rightNow = new Date(); var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0); @@ -49,8 +51,8 @@ $(document).ready(function () { var dst_first=DisplayDstSwitchDates('first'); var dst_second=DisplayDstSwitchDates('second'); //alert(dst); + $('#tz_string').val(timezone); // returns TZ string $('#tz').val(std_time_offset); // returns TZ - $('#tz_string').val(timezone.name()); // returns TZ string $('#dst_observed').val(dst); // returns if DST is observed on summer $('#dst_first').val(dst_first); // returns DST first switch in year $('#dst_second').val(dst_second); // returns DST second switch in year diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index a53835e1137..f051990b13e 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -232,7 +232,7 @@ if ($conf->browser->layout != 'phone') { print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n"; print ' jQuery(document).ready(function() { - /* If page_y set, we set scollbar with it */ + /* If page_y set, we set scrollbar with it */ page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */ if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */ if (page_y > 0) diff --git a/htdocs/core/js/lib_gravatar.js.php b/htdocs/core/js/lib_gravatar.js.php index 700f8872654..d7ca7bea933 100644 --- a/htdocs/core/js/lib_gravatar.js.php +++ b/htdocs/core/js/lib_gravatar.js.php @@ -67,7 +67,7 @@ function get_avatar_from_service(service, userid, size) { // implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback // for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) // for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) - // for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) + // for gravatar use get_avatar_from_service('gravatar', md5 hash email@address, size-in-px ) // for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) // for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) // everything else will go to the fallback diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 360efa0b5c8..190bef849e9 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -269,7 +269,7 @@ function formatDate(date,format) { // alert('formatDate date='+date+' format='+format); - // Force parametres en chaine + // Force parameters en chaine format=format+""; var result=""; @@ -337,7 +337,7 @@ function getDateFromFormat(val,format) { // alert('getDateFromFormat val='+val+' format='+format); - // Force parametres en chaine + // Force parameters en chaine val=val+""; format=format+""; @@ -561,14 +561,14 @@ function hideMessage(fieldId,message) { * * @param string url Url (warning: as any url called in ajax mode, the url called here must not renew the token) * @param string code Code - * @param string intput Array of complementary actions to do if success + * @param string input Array of complementary actions to do if success * @param int entity Entity * @param int strict Strict * @param int forcereload Force reload * @param int userid User id * @param int value Value to set * @param string token Token - * @retun boolean + * @return boolean */ function setConstant(url, code, input, entity, strict, forcereload, userid, token, value) { var saved_url = url; /* avoid undefined url */ @@ -668,7 +668,7 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke * * @param {string} url Url (warning: as any url called in ajax mode, the url called here must not renew the token) * @param {string} code Code - * @param {string} intput Array of complementary actions to do if success + * @param {string} input Array of complementary actions to do if success * @param {int} entity Entity * @param {int} strict Strict * @param {int} forcereload Force reload @@ -765,7 +765,7 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke * @param string action Action * @param string url Url * @param string code Code - * @param string intput Array of complementary actions to do if success + * @param string input Array of complementary actions to do if success * @param string box Box * @param int entity Entity * @param int yesButton yesButton @@ -884,7 +884,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, } }); if ( !valid ) { - // remove invalid value, as it didnt match anything + // remove invalid value, as it didn't match anything $( this ).val( "" ); select.val( "" ); input.data("ui-autocomplete").term = ""; @@ -1265,7 +1265,7 @@ function price2numjs(amount) { amount = amount.replace(thousand, ''); // Replace of thousand before replace of dec to avoid pb if thousand is . amount = amount.replace(dec, '.'); - //console.log("amount before="+amount+" rouding="+rounding) + //console.log("amount before="+amount+" rounding="+rounding) var res = Math.round10(amount, - rounding); // Other solution is // var res = dolroundjs(amount, rounding) diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index 2f8192a29fe..3a980043d37 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -212,7 +212,7 @@ function check_events() { result = 1; } else { - console.log("Cancel check_events() with dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page+". Check is useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); + console.log("Cancel check_events() with dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page+". Check is useless because javascript Notification.permission is "+Notification.permission+" (blocked manually or web site is not https)."); result = 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check) } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 529e53a13cd..3afbc7bd247 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -162,7 +162,7 @@ function versiondolibarrarray() * @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0) * @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value * @param int $colspan 2=Add a colspan=2 on td - * @param int $onlysqltoimportwebsite Only sql resquests used to import a website template are allowed + * @param int $onlysqltoimportwebsite Only sql requests used to import a website template are allowed * @param string $database Database (replace __DATABASE__ with this value) * @return int Return integer <=0 if KO, >0 if OK */ @@ -880,7 +880,7 @@ function modulehelp_prepare_head($object) $h = 0; $head = array(); - // FIX for compatibity habitual tabs + // FIX for compatibility habitual tabs $object->id = $object->numero; $head[$h][0] = DOL_URL_ROOT."/admin/modulehelp.php?id=".$object->id.'&mode=desc'; @@ -1217,7 +1217,7 @@ function activateModule($value, $withdeps = 1, $noconfverification = 0) } if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && !empty($objMod->conflictwith)) { - // Desactivation des modules qui entrent en conflit + // Deactivation des modules qui entrent en conflict $num = count($objMod->conflictwith); for ($i = 0; $i < $num; $i++) { foreach ($modulesdir as $dir) { @@ -1326,7 +1326,7 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab { global $db, $modules, $conf, $langs; - dol_syslog("complete_dictionary_with_modules Search external modules to complete the list of dictionnary tables", LOG_DEBUG, 1); + dol_syslog("complete_dictionary_with_modules Search external modules to complete the list of dictionary tables", LOG_DEBUG, 1); // Search modules $modulesdir = dolGetModulesDirs(); @@ -1377,10 +1377,13 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab } } + // phpcs:disable // Complete the arrays &$tabname,&$tablib,&$tabsql,&$tabsqlsort,&$tabfield,&$tabfieldvalue,&$tabfieldinsert,&$tabrowid,&$tabcond - if (empty($objMod->dictionaries) && !empty($objMod->dictionnaries)) { - $objMod->dictionaries = $objMod->dictionnaries; // For backward compatibility + // Note: "diction"."naries" to prevent codespell from detecting a spelling error. + if (empty($objMod->dictionaries) && !empty($objMod->{"dicton"."naries"})) { + $objMod->dictionaries = $objMod->{"diction"."naries"}; // For backward compatibility } + // phpcs:enable if (!empty($objMod->dictionaries)) { //var_dump($objMod->dictionaries['tabname']); @@ -1668,7 +1671,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu $form = new Form($db); if (empty($strictw3c)) { - dol_syslog("Warning: Function form_constantes is calle with parameter strictw3c = 0, this is deprecated. Value must be 2 now.", LOG_DEBUG); + dol_syslog("Warning: Function 'form_constantes' was called with parameter strictw3c = 0, this is deprecated. Value must be 2 now.", LOG_DEBUG); } if (!empty($strictw3c) && $strictw3c == 1) { print "\n".'
    '; @@ -2001,7 +2004,7 @@ function phpinfo_array() } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ @@ -2040,7 +2043,7 @@ function company_admin_prepare_head() } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 01f64f98c16..1ed670a12bb 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -2,7 +2,7 @@ /* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ * @param int $showbirthday Show birthday * @param string $filtera Filter on create by user * @param string $filtert Filter on assigned to user - * @param string $filterd Filter of done by user + * @param string $filtered Filter of done by user * @param int $pid Product id * @param int $socid Third party id * @param string $action Action string @@ -48,8 +48,26 @@ * @param int $resourceid Preselected value of resource for filter on resource * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode = '', $usergroupid = '', $excludetype = '', $resourceid = 0) -{ +function print_actions_filter( + $form, + $canedit, + $status, + $year, + $month, + $day, + $showbirthday, + $filtera, + $filtert, + $filtered, + $pid, + $socid, + $action, + $showextcals = array(), + $actioncode = '', + $usergroupid = 0, + $excludetype = '', + $resourceid = 0 +) { global $user, $langs, $db, $hookmanager; global $massaction; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index af150fb1bce..f78c59b7b41 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -72,7 +72,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen var autoselect = '.((int) $autoselect).'; var options = '.json_encode($ajaxoptions).'; /* Option of actions to do after keyup, or after select */ - /* Remove selected id as soon as we type or delete a char (it means old selection is wrong). Use keyup/down instead of change to avoid loosing the product id. This is needed only for select of predefined product */ + /* Remove selected id as soon as we type or delete a char (it means old selection is wrong). Use keyup/down instead of change to avoid losing the product id. This is needed only for select of predefined product */ $("input#search_'.$htmlnamejquery.'").keydown(function(e) { if (e.keyCode != 9) /* If not "Tab" key */ { diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index 3e8604c7599..75788627cec 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -24,7 +24,7 @@ /** * \file htdocs/core/lib/bank.lib.php * \ingroup bank - * \brief Ensemble de fonctions de base pour le module banque + * \brief Ensemble de functions de base pour le module banque */ @@ -273,11 +273,11 @@ function various_payment_prepare_head($object) } /** - * Check SWIFT informations for a bank account + * Check SWIFT information for a bank account * * @param Account $account A bank account (used to get BIC/SWIFT) * @param string $swift Swift value (used to get BIC/SWIFT, param $account non used if provided) - * @return boolean True if informations are valid, false otherwise + * @return boolean True if information are valid, false otherwise */ function checkSwiftForAccount(Account $account = null, $swift = null) { @@ -294,11 +294,11 @@ function checkSwiftForAccount(Account $account = null, $swift = null) } /** - * Check IBAN number informations for a bank account. + * Check IBAN number information for a bank account. * * @param Account $account A bank account * @param string $ibantocheck Bank account number (used to get BAN, $account not used if provided) - * @return boolean True if informations are valid, false otherwise + * @return boolean True if information are valid, false otherwise */ function checkIbanForAccount(Account $account = null, $ibantocheck = null) { @@ -338,10 +338,10 @@ function getIbanHumanReadable(Account $account) } /** - * Check account number informations for a bank account + * Check account number information for a bank account * * @param Account $account A bank account - * @return boolean True if informations are valid, false otherwise + * @return boolean True if information are valid, false otherwise */ function checkBanForAccount($account) { @@ -361,13 +361,13 @@ function checkBanForAccount($account) if ($country_code == 'FR') { // France rules $coef = array(62, 34, 3); - // Concatenation des differents codes. + // Concatenate the code parts $rib = strtolower(trim($account->code_banque).trim($account->code_guichet).trim($account->number).trim($account->cle)); - // On remplace les eventuelles lettres par des chiffres. + // On replace les eventuelles lettres par des chiffres. //$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz","12345678912345678912345678"); //Ne marche pas $rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789"); - // Separation du rib en 3 groupes de 7 + 1 groupe de 2. - // Multiplication de chaque groupe par les coef du tableau + // Separation du rib en 3 groups de 7 + 1 group de 2. + // Multiplication de chaque group par les coef du tableau for ($i = 0, $s = 0; $i < 3; $i++) { $code = substr($rib, 7 * $i, 7); @@ -395,9 +395,9 @@ function checkBanForAccount($account) } if ($country_code == 'AU') { // Australian if (strlen($account->code_banque) > 7) { - return false; // Sould be 6 but can be 123-456 + return false; // Should be 6 but can be 123-456 } elseif (strlen($account->code_banque) < 6) { - return false; // Sould be 6 + return false; // Should be 6 } else { return true; } diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index d6c721d8ccb..2455c630320 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -457,9 +457,9 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, } $im = imagecreate($total_x, $total_y); /* create two images */ - $col_bg = ImageColorAllocate($im, $bg_color[0], $bg_color[1], $bg_color[2]); - $col_bar = ImageColorAllocate($im, $bar_color[0], $bar_color[1], $bar_color[2]); - $col_text = ImageColorAllocate($im, $text_color[0], $text_color[1], $text_color[2]); + $col_bg = imagecolorallocate($im, $bg_color[0], $bg_color[1], $bg_color[2]); + $col_bar = imagecolorallocate($im, $bar_color[0], $bar_color[1], $bar_color[2]); + $col_text = imagecolorallocate($im, $text_color[0], $text_color[1], $text_color[2]); $height = round($total_y - ($scale * 10)); $height2 = round($total_y - $space['bottom']); @@ -504,7 +504,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, header("Content-Type: image/gif; name=\"barcode.gif\""); imagegif($im); } elseif (!empty($filebarcode)) { - // To wxrite into afile onto disk + // To write into a file onto disk imagepng($im, $filebarcode); } else { header("Content-Type: image/png; name=\"barcode.png\""); diff --git a/htdocs/core/lib/categories.lib.php b/htdocs/core/lib/categories.lib.php index 7f75adedec6..2bc74923e52 100644 --- a/htdocs/core/lib/categories.lib.php +++ b/htdocs/core/lib/categories.lib.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/lib/categories.lib.php - * \brief Ensemble de fonctions de base pour le module categorie + * \brief Ensemble de functions de base pour le module categorie * \ingroup categorie */ diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ac64addd641..baf7817a2af 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -29,7 +29,7 @@ /** * \file htdocs/core/lib/company.lib.php - * \brief Ensemble de fonctions de base pour le module societe + * \brief Ensemble de functions de base pour le module societe * \ingroup societe */ @@ -463,7 +463,7 @@ function societe_prepare_head2($object) /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ @@ -691,7 +691,7 @@ function currency_name($code_iso, $withcode = '', $outputlangs = null) $outputlangs->load("dict"); - // If there is a translation, we can send immediatly the label + // If there is a translation, we can send immediately the label if ($outputlangs->trans("Currency".$code_iso) != "Currency".$code_iso) { return ($withcode ? $code_iso.' - ' : '').$outputlangs->trans("Currency".$code_iso); } @@ -1098,7 +1098,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl } } - // Initialize array of search criterias + // Initialize array of search criteria $search = array(); foreach ($arrayfields as $key => $val) { $queryName = 'search_'.substr($key, 2); @@ -1156,7 +1156,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); - print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '
    '; // You can use div-table-responsive-no-min if you don't need reserved height for your table print "\n".''."\n"; $param = "socid=".urlencode($object->id); @@ -1872,7 +1872,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $result = $contactaction->fetchResources(); if ($result < 0) { dol_print_error($db); - setEventMessage("company.lib::show_actions_done Error fetch ressource", 'errors'); + setEventMessage("company.lib::show_actions_done Error fetch resource", 'errors'); } //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index d8d74f4056e..c4285d10bda 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/lib/contact.lib.php - * \brief Ensemble de fonctions de base pour les contacts + * \brief Ensemble de functions de base pour les contacts */ /** diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index edc4c0fa8a4..6b94903e3fc 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/lib/contract.lib.php - * \brief Ensemble de fonctions de base pour le module contrat + * \brief Ensemble de functions de base pour le module contrat */ /** @@ -139,7 +139,7 @@ function contract_prepare_head(Contrat $object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index be7a7c5996b..df3383dab6c 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -233,7 +233,7 @@ function convertTime2Seconds($iHours = 0, $iMinutes = 0, $iSeconds = 0) * - 'year': only year part); * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfWeek Length of week (default 7) - * @return string Formated text of duration + * @return string Formatted text of duration * Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00 * @see convertTime2Seconds() */ @@ -368,7 +368,7 @@ function convertDurationtoHour($duration_value, $duration_unit) * @param int|string $year_date Year date * @param int $excludefirstand Exclude first and * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. - * Note: In database, dates are always fot the server TZ. + * Note: In database, dates are always for the server TZ. * @return string $sqldate String with SQL filter */ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index 275b69aea2b..f0ac7aef03d 100644 --- a/htdocs/core/lib/doleditor.lib.php +++ b/htdocs/core/lib/doleditor.lib.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/lib/doleditor.lib.php - * \brief Ensemble de fonctions de base pour la gestion des utilisaterus et groupes + * \brief Ensemble de functions de base pour la gestion des utilisaterus et groups */ /** diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index da3836460e4..cfb3bacff68 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/lib/ecm.lib.php - * \brief Ensemble de fonctions de base pour le module ecm + * \brief Ensemble de functions de base pour le module ecm * \ingroup ecm */ @@ -171,7 +171,7 @@ function ecm_prepare_head_fm($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index 76f060d627f..f431a292704 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -67,7 +67,7 @@ function expedition_prepare_head(Expedition $object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php index 0bd84fc02f3..be79e4ecb03 100644 --- a/htdocs/core/lib/expensereport.lib.php +++ b/htdocs/core/lib/expensereport.lib.php @@ -124,7 +124,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 53d3e944e69..2045003d1c0 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/lib/fichinter.lib.php - * \brief Ensemble de fonctions de base pour le module fichinter + * \brief Ensemble de functions de base pour le module fichinter * \ingroup fichinter */ @@ -162,7 +162,7 @@ function fichinter_prepare_head($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 29b956c9d7a..060cb3f836f 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -29,7 +29,7 @@ /** * Make a basename working with all page code (default PHP basenamed fails with cyrillic). - * We supose dir separator for input is '/'. + * We suppose dir separator for input is '/'. * * @param string $pathfile String to find basename. * @return string Basename of input @@ -306,7 +306,7 @@ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $s /** * Complete $filearray with data from database. - * This will call doldir_list_indatabase to complate filearray. + * This will call doldir_list_indatabase to complete filearray. * * @param array $filearray Array of files obtained using dol_dir_list * @param string $relativedir Relative dir from DOL_DATA_ROOT @@ -859,7 +859,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep //if (! $overwriteifexists && $destexists) return 0; // The overwriteifexists is for files only, so propagated to dol_copy only. if (!$destexists) { - // We must set mask just before creating dir, becaause it can be set differently by dol_copy + // We must set mask just before creating dir, because it can be set differently by dol_copy umask(0); $dirmaskdec = octdec($newmask); if (empty($newmask) && getDolGlobalString('MAIN_UMASK')) { @@ -1084,7 +1084,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te } // Currently method is restricted to files (dol_delete_files previously used is for files, and mask usage if for files too) - // to allow mask usage for dir, we shoul introduce a new param "isdir" to 1 to complete newmask like this + // to allow mask usage for dir, we should introduce a new param "isdir" to 1 to complete newmask like this // if ($isdir) $newmaskdec |= octdec('0111'); // Set x bit required for directories dolChmod($newpathofdestfile, $newmask); } @@ -2067,7 +2067,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo } /** - * Delete files into database index using search criterias. + * Delete files into database index using search criteria. * * @param string $dir Directory name (full real path without ending /) * @param string $file File name @@ -2143,7 +2143,7 @@ function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '' $ret = $image->readImage($filetoconvert); } catch (Exception $e) { $ext = pathinfo($fileinput, PATHINFO_EXTENSION); - dol_syslog("Failed to read image using Imagick (Try to install package 'apt-get install php-imagick ghostscript' and check there is no policy to disable ".$ext." convertion in /etc/ImageMagick*/policy.xml): ".$e->getMessage(), LOG_WARNING); + dol_syslog("Failed to read image using Imagick (Try to install package 'apt-get install php-imagick ghostscript' and check there is no policy to disable ".$ext." conversion in /etc/ImageMagick*/policy.xml): ".$e->getMessage(), LOG_WARNING); return 0; } if ($ret) { @@ -2575,7 +2575,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('( * Security check when accessing to a document (used by document.php, viewimage.php and webservices to get documents). * TODO Replace code that set $accessallowed by a call to restrictedArea() * - * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Exemple: 'medias', 'invoice', 'logs', 'tax-vat', ... + * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Example: 'medias', 'invoice', 'logs', 'tax-vat', ... * @param string $original_file Relative path with filename, relative to modulepart. * @param string $entity Restrict onto entity (0=no restriction) * @param User $fuser User object (forced) @@ -2644,7 +2644,11 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } // Wrapping for miscellaneous medias files - if ($modulepart == 'medias' && !empty($dolibarr_main_data_root)) { + if ($modulepart == 'common') { + // Wrapping for some images + $accessallowed = 1; + $original_file = DOL_DOCUMENT_ROOT.'/public/theme/common/'.$original_file; + } elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root)) { if (empty($entity) || empty($conf->medias->multidir_output[$entity])) { return array('accessallowed'=>0, 'error'=>'Value entity must be provided'); } @@ -2662,7 +2666,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping for doctemplates of websites $accessallowed = ($fuser->rights->website->write && preg_match('/\.jpg$/i', basename($original_file))); $original_file = $dolibarr_main_data_root.'/doctemplates/websites/'.$original_file; - } elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root)) { + } elseif ($modulepart == 'packages' && !empty($dolibarr_main_data_root)) { // To download zip of modules // Wrapping for *.zip package files, like when used with url http://.../document.php?modulepart=packages&file=module_myfile.zip // Dir for custom dirs $tmp = explode(',', $dolibarr_main_document_root_alt); @@ -3031,7 +3035,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = $conf->commande->multidir_output[$entity].'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")"; } elseif ($modulepart == 'project' && !empty($conf->project->multidir_output[$entity])) { - // Wrapping pour les projets + // Wrapping pour les projects if ($fuser->hasRight('projet', $lire) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 921d31af701..44981c12b3e 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -165,7 +165,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id; $head[$h][1] = $langs->trans("OrderDispatch"); - //If dispach process running we add the number of item to dispatch into the head + //If dispatch process running we add the number of item to dispatch into the head if (in_array($object->statut, array($object::STATUS_ORDERSENT, $object::STATUS_RECEIVED_PARTIALLY, $object::STATUS_RECEIVED_COMPLETELY))) { $sumQtyAllreadyDispatched = 0; $sumQtyOrdered = 0; @@ -246,7 +246,7 @@ function ordersupplier_prepare_head(CommandeFournisseur $object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d686883cd7f..c9fed272eaa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -250,8 +250,8 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port) require_once DOL_DOCUMENT_ROOT."/core/db/".$type.'.class.php'; $class = 'DoliDB'.ucfirst($type); - $dolidb = new $class($type, $host, $user, $pass, $name, $port); - return $dolidb; + $db = new $class($type, $host, $user, $pass, $name, $port); + return $db; } /** @@ -10847,8 +10847,6 @@ function ajax_autoselect($htmlname, $addlink = '', $textonlink = 'Link') */ function dolIsAllowedForPreview($file) { - global $conf; - // Check .noexe extension in filename if (preg_match('/\.noexe$/i', $file)) { return 0; @@ -12936,7 +12934,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n $result = $contactaction->fetchResources(); if ($result < 0) { dol_print_error($db); - setEventMessage("actions.lib::show_actions_messaging Error fetch ressource", 'errors'); + setEventMessage("actions.lib::show_actions_messaging Error fetch resource", 'errors'); } //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 45ccfc70b95..0db8cabbefb 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -136,10 +136,10 @@ function dol_getDefaultFormat(Translate $outputlangs = null) /** - * Show informations on an object + * Show information on an object * TODO Move this into html.formother * - * @param object $object Objet to show + * @param object $object Object to show * @param int $usetable Output into a table * @return void */ @@ -754,7 +754,7 @@ function isValidVATID($company) */ function clean_url($url, $http = 1) { - // Fixed by Matelli (see http://matelli.fr/showcases/patchs-dolibarr/fix-cleaning-url.html) + // Fixed by Matelli (see http://matelli.fr/showcases/patch%73-dolibarr/fix-cleaning-url.html) // To include the minus sign in a char class, we must not escape it but put it at the end of the class // Also, there's no need of escape a dot sign in a class $regs = array(); @@ -790,7 +790,7 @@ function clean_url($url, $http = 1) * Returns an email value with obfuscated parts. * * @param string $mail Email - * @param string $replace Replacement character (defaul: *) + * @param string $replace Replacement character (default: *) * @param int $nbreplace Number of replacement character (default: 8) * @param int $nbdisplaymail Number of character unchanged (default: 4) * @param int $nbdisplaydomain Number of character unchanged of domain (default: 3) @@ -888,7 +888,7 @@ function array2table($data, $tableMarkup = 1, $tableoptions = '', $troptions = ' * @param string $mask Mask to use * @param string $table Table containing field with counter * @param string $field Field containing already used values of counter - * @param string $where To add a filter on selection (for exemple to filter on invoice types) + * @param string $where To add a filter on selection (for example to filter on invoice types) * @param Societe $objsoc The company that own the object we need a counter for * @param string $date Date to use for the {y},{m},{d} tags. * @param string $mode 'next' for next value or 'last' for last value @@ -1185,7 +1185,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $maskLike = dol_string_nospecial($mask); $maskLike = str_replace("%", "_", $maskLike); - // Replace protected special codes with matching number of _ as wild card caracter + // Replace protected special codes with matching number of _ as wild card character $maskLike = preg_replace('/\{yyyy\}/i', '____', $maskLike); $maskLike = preg_replace('/\{yy\}/i', '__', $maskLike); $maskLike = preg_replace('/\{y\}/i', '_', $maskLike); @@ -1256,7 +1256,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ // Define $maskLike $maskLike = dol_string_nospecial($mask); $maskLike = str_replace("%", "_", $maskLike); - // Replace protected special codes with matching number of _ as wild card caracter + // Replace protected special codes with matching number of _ as wild card character $maskLike = preg_replace('/\{yyyy\}/i', '____', $maskLike); $maskLike = preg_replace('/\{yy\}/i', '__', $maskLike); $maskLike = preg_replace('/\{y\}/i', '_', $maskLike); @@ -1325,7 +1325,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ // Define $maskrefclient_maskLike $maskrefclient_maskLike = dol_string_nospecial($mask); $maskrefclient_maskLike = str_replace("%", "_", $maskrefclient_maskLike); - // Replace protected special codes with matching number of _ as wild card caracter + // Replace protected special codes with matching number of _ as wild card character $maskrefclient_maskLike = str_replace(dol_string_nospecial('{yyyy}'), '____', $maskrefclient_maskLike); $maskrefclient_maskLike = str_replace(dol_string_nospecial('{yy}'), '__', $maskrefclient_maskLike); $maskrefclient_maskLike = str_replace(dol_string_nospecial('{y}'), '_', $maskrefclient_maskLike); @@ -1623,9 +1623,9 @@ function numero_semaine($time) /* * Norme ISO-8601: - * - La semaine 1 de toute annee est celle qui contient le 4 janvier ou que la semaine 1 de toute annee est celle qui contient le 1er jeudi de janvier. - * - La majorite des annees ont 52 semaines mais les annees qui commence un jeudi et les annees bissextiles commencant un mercredi en possede 53. - * - Le 1er jour de la semaine est le Lundi + * - Week 1 of the year contains Jan 4th, or contains the first Thursday of January. + * - Most years have 52 weeks, but 53 weeks for years starting on a Thursday and bisectile years that start on a Wednesday. + * - The first day of a week is Monday */ // Definition du Jeudi de la semaine @@ -1707,7 +1707,7 @@ function weight_convert($weight, &$from_unit, $to_unit) } /** - * Save personnal parameter + * Save personal parameter * * @param DoliDB $db Handler database * @param Conf $conf Object conf @@ -1719,7 +1719,7 @@ function weight_convert($weight, &$from_unit, $to_unit) */ function dol_set_user_param($db, $conf, &$user, $tab) { - // Verification parametres + // Verification parameters if (count($tab) < 1) { return -1; } @@ -1775,11 +1775,11 @@ function dol_set_user_param($db, $conf, &$user, $tab) } /** - * Returns formated reduction + * Returns formatted reduction * * @param int $reduction Reduction percentage * @param Translate $langs Output language - * @return string Formated reduction + * @return string Formatted reduction */ function dol_print_reduction($reduction, $langs) { @@ -1795,7 +1795,7 @@ function dol_print_reduction($reduction, $langs) /** * Return OS version. - * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarly OS PHP runs on. + * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarily OS PHP runs on. * * @param string $option Option string * @return string OS version @@ -1951,7 +1951,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) /** * This function evaluates a string that should be a valid IPv4 - * Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patchs of PHP (5.6.25). See https://github.com/php/php-src/pull/1954. + * Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patches of PHP (5.6.25). See https://github.com/php/php-src/pull/1954. * * @param string $ip IP Address * @return int 0 if not valid or reserved range, 1 if valid and public IP, 2 if valid and private range IP @@ -2422,7 +2422,7 @@ function colorAgressiveness($hex, $ratio = -50, $brightness = 0) if ($color < 128) { $color -= ($color * ($ratio / 100)); } - } else { // We decrease agressiveness + } else { // We decrease aggressiveness if ($color > 128) { $color -= (($color - 128) * (abs($ratio) / 100)); } @@ -2690,7 +2690,7 @@ function price2fec($amount) if (empty($amount)) { $amount = 0; // To have a numeric value if amount not defined or = '' } - $amount = (is_numeric($amount) ? $amount : 0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) + $amount = (is_numeric($amount) ? $amount : 0); // Check if amount is numeric, for example, an error occurred when amount value = o (letter) instead 0 (number) // Output decimal number by default $nbdecimal = (!getDolGlobalString('ACCOUNTING_FEC_DECIMAL_LENGTH') ? 2 : $conf->global->ACCOUNTING_FEC_DECIMAL_LENGTH); diff --git a/htdocs/core/lib/functions_ch.lib.php b/htdocs/core/lib/functions_ch.lib.php index cb683ceec1f..d8db03ae52f 100644 --- a/htdocs/core/lib/functions_ch.lib.php +++ b/htdocs/core/lib/functions_ch.lib.php @@ -156,14 +156,14 @@ function dol_ch_controle_bvrb($bvrb) // Clean data $bv = str_replace(' ', '', $bvrb); - // Make control + // Check (verify/validate) $report = 0; while (dol_strlen($bv) > 1) { $match = substr($bv, 0, 1); $report = $tableau[$report][$match]; $bv = substr($bv, 1); } - $controle = $tableau[$report][10]; + $check = $tableau[$report][10]; - return ($controle == $bv); + return ($check == $bv); } diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 5dc4bc5b1a1..ab6d878809b 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -30,7 +30,7 @@ * * @param string $url URL to call. * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE' - * @param string $param Parameters of URL (x=value1&y=value2) or may be a formated content with $postorget='PUTALREADYFORMATED' + * @param string $param Parameters of URL (x=value1&y=value2) or may be a formatted content with $postorget='PUTALREADYFORMATED' * @param integer $followlocation 0=Do not follow, 1=Follow location. * @param string[] $addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....) * @param string[] $allowedschemes List of schemes that are allowed ('http' + 'https' only by default) @@ -69,7 +69,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } curl_setopt($ch, CURLINFO_HEADER_OUT, true); // To be able to retrieve request header and log it - // By default use tls decied by PHP. + // By default use the TLS version decided by PHP. // You can force, if supported a version like TLSv1 or TLSv1.2 if (getDolGlobalString('MAIN_CURL_SSLVERSION')) { curl_setopt($ch, CURLOPT_SSLVERSION, $conf->global->MAIN_CURL_SSLVERSION); @@ -239,11 +239,11 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = dol_syslog("getURLContent request=".$request); if (getDolGlobalInt('MAIN_CURL_DEBUG')) { - // This may contains binary data, so we dont output reponse by default. + // This may contains binary data, so we don't output response by default. dol_syslog("getURLContent request=".$request, LOG_DEBUG, 0, '_curl'); dol_syslog("getURLContent response =".$response, LOG_DEBUG, 0, '_curl'); } - dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it + dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we don't output it $rep = array(); if (curl_errno($ch)) { diff --git a/htdocs/core/lib/holiday.lib.php b/htdocs/core/lib/holiday.lib.php index eb0ca243c90..76361b759c4 100644 --- a/htdocs/core/lib/holiday.lib.php +++ b/htdocs/core/lib/holiday.lib.php @@ -23,7 +23,7 @@ */ /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @param Object $object Holiday * @return array head @@ -74,7 +74,7 @@ function holiday_prepare_head($object) /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @return array head */ diff --git a/htdocs/core/lib/hrm.lib.php b/htdocs/core/lib/hrm.lib.php index 20f0f585426..a84123662b9 100644 --- a/htdocs/core/lib/hrm.lib.php +++ b/htdocs/core/lib/hrm.lib.php @@ -60,7 +60,7 @@ function establishment_prepare_head($object) } /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @return array head */ diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index b1959900794..5dc10149a72 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -61,12 +61,10 @@ function getDefaultImageSizes() * Return if a filename is file name of a supported image format * * @param int $acceptsvg 0=Default (depends on setup), 1=Always accept SVG as image files - * @return string Return list fo image format + * @return string Return list of image formats */ function getListOfPossibleImageExt($acceptsvg = 0) { - global $conf; - $regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php if ($acceptsvg || getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_IMAGES')) { $regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript @@ -123,7 +121,7 @@ function image_format_supported($file, $acceptsvg = 0) } if ($imgfonction) { if (!function_exists($imgfonction)) { - // Fonctions of conversion not available in this PHP + // Functions of conversion not available in this PHP return 0; } @@ -199,7 +197,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, // Si le fichier n'a pas ete indique return 'Bad parameter file'; } elseif (!file_exists($file)) { - // Si le fichier passe en parametre n'existe pas + // Si le fichier passe en parameter n'existe pas return $langs->trans("ErrorFileNotFound", $file); } elseif (image_format_supported($file) < 0) { return 'This filename '.$file.' does not seem to be an image filename.'; @@ -255,7 +253,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } if ($imgfonction) { if (!function_exists($imgfonction)) { - // Fonctions de conversion non presente dans ce PHP + // Functions de conversion non presente dans ce PHP return 'Read of image not possible. This PHP does not support GD functions '.$imgfonction; } } @@ -283,7 +281,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, } if ($imgfonction) { if (!function_exists($imgfonction)) { - // Fonctions de conversion non presente dans ce PHP + // Functions de conversion non presente dans ce PHP return 'Write of image not possible. This PHP does not support GD functions '.$imgfonction; } } @@ -335,7 +333,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, $trans_colour = -1; // By default, undefined switch ($newExt) { case 'gif': // Gif - $trans_colour = imagecolorallocate($imgTarget, 255, 255, 255); // On procede autrement pour le format GIF + $trans_colour = imagecolorallocate($imgTarget, 255, 255, 255); // The method is different for the GIF format imagecolortransparent($imgTarget, $trans_colour); break; case 'jpg': // Jpg @@ -343,7 +341,7 @@ function dol_imageResizeOrCrop($file, $mode, $newWidth, $newHeight, $src_x = 0, $trans_colour = imagecolorallocatealpha($imgTarget, 255, 255, 255, 0); break; case 'png': // Png - imagealphablending($imgTarget, false); // Pour compatibilite sur certain systeme + imagealphablending($imgTarget, false); // For compatibility with certain systems $trans_colour = imagecolorallocatealpha($imgTarget, 255, 255, 255, 127); // Keep transparent channel break; case 'bmp': // Bmp @@ -453,7 +451,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) if ($infoImg[2] === IMAGETYPE_PNG) { // In fact there is no exif on PNG but just in case imagealphablending($img, false); imagesavealpha($img, true); - $img = imagerotate($img, $deg, imageColorAllocateAlpha($img, 0, 0, 0, 127)); + $img = imagerotate($img, $deg, imagecolorallocatealpha($img, 0, 0, 0, 127)); imagealphablending($img, false); imagesavealpha($img, true); } else { @@ -665,7 +663,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', if ($infoImg[2] === 'IMAGETYPE_PNG') { // In fact there is no exif on PNG but just in case imagealphablending($img, false); imagesavealpha($img, true); - $rotated = imagerotate($img, $exifAngle, imageColorAllocateAlpha($img, 0, 0, 0, 127)); + $rotated = imagerotate($img, $exifAngle, imagecolorallocatealpha($img, 0, 0, 0, 127)); imagealphablending($rotated, false); imagesavealpha($rotated, true); } else { diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index 96ad79f03e6..371bc6ed7c1 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -22,7 +22,7 @@ /** * \file htdocs/core/lib/import.lib.php - * \brief Ensemble de fonctions de base pour le module import + * \brief Ensemble de functions de base pour le module import * \ingroup import */ diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 5f4a4527a03..9a21f14c45c 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -160,7 +160,7 @@ function facture_prepare_head($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ @@ -243,7 +243,7 @@ function invoice_admin_prepare_head() /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @param Facture $object Invoice object * @return array head array with tabs @@ -306,7 +306,7 @@ function invoice_rec_prepare_head($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @param Facture $object Invoice object * @return array head array with tabs @@ -981,7 +981,7 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) * * @param int $maxCount (Optional) The maximum count of elements inside the table * @param int $socid (Optional) Show only results from the supplier with this id - * @return string A HTML table that conatins a list with open (unpaid) supplier invoices + * @return string A HTML table that contains a list with open (unpaid) supplier invoices */ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) { @@ -1169,7 +1169,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) * * @param int $maxCount (Optional) The maximum count of elements inside the table * @param int $socid (Optional) Show only results from the supplier with this id - * @return string A HTML table that conatins a list with open (unpaid) supplier invoices + * @return string A HTML table that contains a list with open (unpaid) supplier invoices */ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) { diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 382de7d61ab..c2a7fd730c1 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -115,7 +115,7 @@ function dol_json_encode($elements) * Return text according to type * * @param mixed $val Value to show - * @return string Formated value + * @return string Formatted value */ function _val($val) { @@ -308,7 +308,7 @@ function dol_json_decode($json, $assoc = false) * Return text according to type * * @param string $val Value to decode - * @return string Formated value + * @return string Formatted value */ function _unval($val) { @@ -327,7 +327,7 @@ function _unval($val) * * Normally should be handled by mb_convert_encoding, but * provides a slower PHP-only method for installations - * that lack the multibye string extension. + * that lack the multibyte string extension. * * @param string $utf16 UTF-16 character * @return string UTF-8 character @@ -370,7 +370,7 @@ function utf162utf8($utf16) * * Normally should be handled by mb_convert_encoding, but * provides a slower PHP-only method for installations - * that lack the multibye string extension. + * that lack the multibyte string extension. * * @param string $utf8 UTF-8 character * @return string UTF-16 character diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 08131124639..96d458f01c8 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/lib/ldap.lib.php - * \brief Ensemble de fonctions de base pour le module LDAP + * \brief Ensemble de functions de base pour le module LDAP * \ingroup ldap */ diff --git a/htdocs/core/lib/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php index e3e81f25aeb..7ddc9b68615 100644 --- a/htdocs/core/lib/mailmanspip.lib.php +++ b/htdocs/core/lib/mailmanspip.lib.php @@ -18,11 +18,11 @@ /** * \file htdocs/core/lib/member.lib.php - * \brief Ensemble de fonctions de base pour les adherents + * \brief Ensemble de functions de base pour les adherents */ /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @return array Tabs of the module */ diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 778379e84a2..8283de2dc75 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -25,7 +25,7 @@ */ /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @param Adherent $object Member * @return array head @@ -167,7 +167,7 @@ function member_prepare_head(Adherent $object) } /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @param AdherentType $object Member * @return array head @@ -214,7 +214,7 @@ function member_type_prepare_head(AdherentType $object) } /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @return array head */ @@ -275,7 +275,7 @@ function member_admin_prepare_head() /** - * Return array head with list of tabs to view object stats informations + * Return array head with list of tabs to view object stats information * * @param Adherent $object Member or null * @return array head @@ -329,7 +329,7 @@ function member_stats_prepare_head($object) } /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @param Subscription $object Subscription * @return array head diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index 54b3bdeffd3..82f4c355738 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -219,7 +219,7 @@ function dol_getcache($memoryid) function dol_getshmopaddress($memoryid) { global $shmkeys, $shmoffset; - if (empty($shmkeys[$memoryid])) { // No room reserved for thid memoryid, no way to use cache + if (empty($shmkeys[$memoryid])) { // No room reserved for this memoryid, no way to use cache return 0; } return $shmkeys[$memoryid] + $shmoffset; diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php index ae0cc19193e..33505fec7ce 100644 --- a/htdocs/core/lib/modulebuilder.lib.php +++ b/htdocs/core/lib/modulebuilder.lib.php @@ -534,7 +534,7 @@ function compareFirstValue($a, $b) * @param array|null $right $right to update or add * @param string|null $objectname name of object * @param string|null $module name of module - * @param int $action 0 for delete, 1 for add, 2 for update, -1 when delete object completly, -2 for generate rights after add + * @param int $action 0 for delete, 1 for add, 2 for update, -1 when delete object completely, -2 for generate rights after add * @return int 1 if OK,-1 if KO */ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $module, $action) @@ -610,7 +610,7 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $ $permissions = $perms_grouped; - // parcourir les objets + // parcourir les objects $o=0; foreach ($permissions as &$object) { // récupérer la permission de l'objet @@ -639,9 +639,9 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $ } } $rights_str = implode("", $rights); - // delete all permission from file + // delete all permissions from file deletePerms($file); - // rewrite all permission again + // rewrite all permissions again dolReplaceInFile($file, array('/* BEGIN MODULEBUILDER PERMISSIONS */' => '/* BEGIN MODULEBUILDER PERMISSIONS */'."\n\t\t".$rights_str)); return 1; } else { @@ -859,7 +859,7 @@ function getFromFile($file, $start, $end) function writePermsInAsciiDoc($file, $destfile) { global $langs; - //search and get all permssion in stirng + //search and get all permissions in string $start = '/* BEGIN MODULEBUILDER PERMISSIONS */'; $end = '/* END MODULEBUILDER PERMISSIONS */'; $content = getFromFile($file, $start, $end); @@ -951,7 +951,7 @@ function addObjectsToApiFile($file, $objects, $modulename) $varcomented = "@var MyObject \$myobject {@type MyObject}"; $constructObj = "\$this->myobject = new MyObject(\$this->db);"; - // add properties and declare them in consturctor + // add properties and declare them in constructor foreach ($content as $lineNumber => &$lineContent) { if (strpos($lineContent, $varcomented) !== false) { $lineContent = ''; @@ -995,7 +995,7 @@ function addObjectsToApiFile($file, $objects, $modulename) /** * Remove Object variables and methods from API_Module File * @param string $file file api module - * @param string $objectname name of object whant to remove + * @param string $objectname name of object want to remove * @param string $modulename name of module * @return int 1 if OK, -1 if KO */ @@ -1055,10 +1055,10 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action) return -1; } if ($action == 0 && !empty($key)) { - // delete menu manuelly + // delete menu manually array_splice($menus, array_search($menus[$key], $menus), 1); } elseif ($action == 1) { - // add menu manualy + // add menu manually array_push($menus, $menuWantTo); } elseif ($action == 2 && !empty($key) && !empty($menuWantTo)) { // update right from permissions array @@ -1255,7 +1255,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul } } - // rewrite dictionnary if + // rewrite dictionary if $dictionnaires['langs'] = $modulename.'@'.$modulename; $dictionnaires['tabname'][] = strtolower($namedic); $dictionnaires['tablib'][] = ucfirst(substr($namedic, 2)); @@ -1276,7 +1276,7 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul } /** - * Generate Urls and add them to documentaion module + * Generate Urls and add them to documentation module * * @param string $file_api filename or path of api * @param string $file_doc filename or path of documentation @@ -1315,9 +1315,9 @@ function writeApiUrlsInDoc($file_api, $file_doc) $error++; } - // buil format asciidoc for urls in table + // build format asciidoc for urls in table if (!$error) { - $asciiDocTable = "[options=\"header\"]\n|===\n|Objet | URLs\n"; + $asciiDocTable = "[options=\"header\"]\n|===\n|Object | URLs\n"; // phpcs:ignore foreach ($groupedUrls as $objectName => $urls) { $urlsList = implode(" +\n*", $urls); $asciiDocTable .= "|$objectName | \n*$urlsList +\n"; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 01effcb725d..2b39661e6e7 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/lib/order.lib.php - * \brief Ensemble de fonctions de base pour le module commande + * \brief Ensemble de functions de base pour le module commande * \ingroup commande */ @@ -171,7 +171,7 @@ function commande_prepare_head(Commande $object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/parsemd.lib.php b/htdocs/core/lib/parsemd.lib.php index 5e72271303e..428a88c9758 100644 --- a/htdocs/core/lib/parsemd.lib.php +++ b/htdocs/core/lib/parsemd.lib.php @@ -26,7 +26,7 @@ * * @param string $content MD content * @param string $parser 'parsedown' or 'nl2br' - * @param string $replaceimagepath Replace path to image with another path. Exemple: ('doc/'=>'xxx/aaa/') + * @param string $replaceimagepath Replace path to image with another path. Example: ('doc/'=>'xxx/aaa/') * @return string Parsed content */ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) @@ -36,7 +36,7 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) //$content = preg_replace('/([^<]+)<\/a>/', '[\3](\1){:target="\2"}', $content); $content = preg_replace('/([^<]+)<\/a>/', '[\3](\1)', $content); - // Replace HTML coments + // Replace HTML comments $content = preg_replace('//Ums', '', $content); // We remove HTML comment that are not MD comment because they will be escaped and output when setSafeMode is set to true. if (is_array($replaceimagepath)) { @@ -64,7 +64,7 @@ function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null) * * @param string $content MD content * @param string $parser 'dolibarr' - * @param string $replaceimagepath Replace path to image with another path. Exemple: ('doc/'=>'xxx/aaa/') + * @param string $replaceimagepath Replace path to image with another path. Example: ('doc/'=>'xxx/aaa/') * @return string Parsed content */ function dolMd2Asciidoc($content, $parser = 'dolibarr', $replaceimagepath = null) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index ecb2aecc83d..13f7289a478 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -230,7 +230,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '', $amount = 0) /** * Return string with full Url * - * @param int $mode 0=True url, 1=Url formated with colors + * @param int $mode 0=True url, 1=Url formatted with colors * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member', 'boothlocation', ...) * @param string $ref Ref of object * @param int|float $amount Amount of money to request for diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index eb1e08ea01a..1719172b40e 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -40,7 +40,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ @@ -332,7 +332,7 @@ function pdf_getHeightForLogo($logo, $url = false) * Function to try to calculate height of a HTML Content * * @param TCPDF $pdf PDF initialized object - * @param string $htmlcontent HTML Contect + * @param string $htmlcontent HTML Content * @return int Height * @see getStringHeight() */ @@ -421,7 +421,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali /** - * Return a string with full address formated for output on documents + * Return a string with full address formatted for output on documents * * @param Translate $outputlangs Output langs object * @param Societe $sourcecompany Source company object @@ -822,7 +822,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) /** - * Show bank informations for PDF generation + * Show bank information for PDF generation * * @param TCPDF $pdf Object PDF * @param Translate $outputlangs Object lang @@ -871,7 +871,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $cury += 3; } - if (!getDolGlobalString('PDF_BANK_HIDE_NUMBER_SHOW_ONLY_BICIBAN')) { // Note that some countries still need bank number, BIC/IBAN not enougth for them + if (!getDolGlobalString('PDF_BANK_HIDE_NUMBER_SHOW_ONLY_BICIBAN')) { // Note that some countries still need bank number, BIC/IBAN not enough for them // Note: // bank = code_banque (FR), sort code (GB, IR. Example: 12-34-56) // desk = code guichet (FR), used only when $usedetailedbban = 1 @@ -1004,10 +1004,10 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, * @param int $marge_gauche Margin left (no more used) * @param int $page_hauteur Page height * @param Object $object Object shown in PDF - * @param int $showdetails Show company adress details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) + * @param int $showdetails Show company address details into footer (0=Nothing, 1=Show address, 2=Show managers, 3=Both) * @param int $hidefreetext 1=Hide free text, 0=Show free text * @param int $page_largeur Page width - * @param int $watermark Watermark text to print on page + * @param string $watermark Watermark text to print on page * @return int Return height of bottom margin including footer text */ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails = 0, $hidefreetext = 0, $page_largeur = 0, $watermark = '') @@ -1351,14 +1351,16 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } } // Show page nb only on iso languages (so default Helvetica font) - // if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica') { $pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0)); - // $pdf->MultiCell(18, 2, $pdf->getPageNumGroupAlias().' / '.$pdf->getPageGroupAlias(), 0, 'R', 0); - // $pdf->MultiCell(18, 2, $pdf->PageNo().' / '.$pdf->getAliasNbPages(), 0, 'R', 0); // doesn't works with all fonts - // $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell - $pagination = $pdf->PageNo().' / '.$pdf->getNumPages(); + + if (getDolGlobalString('PDF_USE_GETALIASNBPAGE_FOR_TOTAL')) { + // $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell + $pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages(); // seems to not works with all fonts like ru_UK + } else { + $pagination = $pdf->PageNo().' / '.$pdf->getNumPages(); // seems to always work even with $pdf->Cell. But some users has reported wrong nb (no way to reproduce) + } + $pdf->MultiCell(18, 2, $pagination, 0, 'R', 0); - // } // Show Draft Watermark if (!empty($watermark)) { @@ -1539,7 +1541,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, // Description short of product line $libelleproduitservice = $label; if (!empty($libelleproduitservice) && getDolGlobalString('PDF_BOLD_PRODUCT_LABEL')) { - // Adding may convert the original string into a HTML string. Sowe have to first + // Adding may convert the original string into a HTML string. So we have to first // convert \n into
    we text is not already HTML. if (!dol_textishtml($libelleproduitservice)) { $libelleproduitservice = str_replace("\n", '
    ', $libelleproduitservice); @@ -2212,12 +2214,11 @@ function pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails = 0) * @param int $i Current line number * @param Translate $outputlangs Object langs for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) - * @param HookManager $hookmanager Hook manager instance * @return string Value for unit cell */ -function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false) +function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0) { - global $langs; + global $hookmanager, $langs; $reshook = 0; $result = ''; @@ -2473,7 +2474,7 @@ function pdf_getLinkedObjects(&$object, $outputlangs) foreach ($object->linkedObjects as $objecttype => $objects) { if ($objecttype == 'facture') { - // For invoice, we don't want to have a reference line on document. Image we are using recuring invoice, we will have a line longer than document width. + // For invoice, we don't want to have a reference line on document. Image we are using recurring invoice, we will have a line longer than document width. } elseif ($objecttype == 'propal' || $objecttype == 'supplier_proposal') { $outputlangs->load('propal'); diff --git a/htdocs/core/lib/phpsessionindb.lib.php b/htdocs/core/lib/phpsessionindb.lib.php index 7d19730674e..f856ac71c90 100644 --- a/htdocs/core/lib/phpsessionindb.lib.php +++ b/htdocs/core/lib/phpsessionindb.lib.php @@ -28,7 +28,7 @@ // - create table ll_session from the llx_session-disabled.sql file // - uncomment the include DOL_DOCUMENT_ROOT.'/core/lib/phpsessionindb.inc.php into main.inc.php // - in your PHP.ini, set: session.save_handler = user -// The session_set_save_handler() at end of this fille will replace default session management. +// The session_set_save_handler() at end of this file will replace default session management. /** diff --git a/htdocs/core/lib/prelevement.lib.php b/htdocs/core/lib/prelevement.lib.php index ce1b9c4e584..4f20d697c60 100644 --- a/htdocs/core/lib/prelevement.lib.php +++ b/htdocs/core/lib/prelevement.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/lib/prelevement.lib.php - * \brief Ensemble de fonctions de base pour le module prelevement + * \brief Ensemble de functions de base pour le module prelevement * \ingroup propal */ @@ -117,7 +117,7 @@ function prelevement_check_config($type = 'direct-debit') } /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @param BonPrelevement $object Member * @param int $nbOfInvoices No of invoices diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 76c00e877e1..12b22ed33a4 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -44,7 +44,7 @@ * @param float $uselocaltax2_rate 0=do not use localtax2, >0=apply and get value from localtaxes_array (or database if empty), -1=autodetect according to seller if we must apply, get value from localtaxes_array (or database if empty). Try to always use -1. * @param float $remise_percent_global 0 * @param string $price_base_type 'HT'=Unit price parameter $pu is HT, 'TTC'=Unit price parameter $pu is TTC (HT+VAT but not Localtax. TODO Add also mode 'INCT' when pu is price HT+VAT+LT1+LT2) - * @param int $info_bits Miscellaneous informations on line + * @param int $info_bits Miscellaneous information on line * @param int $type 0/1=Product/service * @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc. * @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function). @@ -277,33 +277,33 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt // We work to define prices using the price without tax $result[6] = price2num($tot_sans_remise, 'MT'); $result[8] = price2num($tot_sans_remise * (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)) + $localtaxes[0], 'MT'); // Selon TVA NPR ou non - $result8bis = price2num($tot_sans_remise * (1 + ($txtva / 100)) + $localtaxes[0], 'MT'); // Si TVA consideree normale (non NPR) + $result8bis = price2num($tot_sans_remise * (1 + ($txtva / 100)) + $localtaxes[0], 'MT'); // Si TVA consideree normal (non NPR) $result[7] = price2num($result8bis - ($result[6] + $localtaxes[0]), 'MT'); $result[0] = price2num($tot_avec_remise, 'MT'); $result[2] = price2num($tot_avec_remise * (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)) + $localtaxes[1], 'MT'); // Selon TVA NPR ou non - $result2bis = price2num($tot_avec_remise * (1 + ($txtva / 100)) + $localtaxes[1], 'MT'); // Si TVA consideree normale (non NPR) + $result2bis = price2num($tot_avec_remise * (1 + ($txtva / 100)) + $localtaxes[1], 'MT'); // Si TVA consideree normal (non NPR) $result[1] = price2num($result2bis - ($result[0] + $localtaxes[1]), 'MT'); // Total VAT = TTC - (HT + localtax) $result[3] = price2num($pu, 'MU'); $result[5] = price2num($pu * (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)) + $localtaxes[2], 'MU'); // Selon TVA NPR ou non - $result5bis = price2num($pu * (1 + ($txtva / 100)) + $localtaxes[2], 'MU'); // Si TVA consideree normale (non NPR) + $result5bis = price2num($pu * (1 + ($txtva / 100)) + $localtaxes[2], 'MU'); // Si TVA consideree normal (non NPR) $result[4] = price2num($result5bis - ($result[3] + $localtaxes[2]), 'MU'); } else { // We work to define prices using the price with tax $result[8] = price2num($tot_sans_remise + $localtaxes[0], 'MT'); $result[6] = price2num($tot_sans_remise / (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)), 'MT'); // Selon TVA NPR ou non - $result6bis = price2num($tot_sans_remise / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR) + $result6bis = price2num($tot_sans_remise / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normal (non NPR) $result[7] = price2num($result[8] - ($result6bis + $localtaxes[0]), 'MT'); $result[2] = price2num($tot_avec_remise + $localtaxes[1], 'MT'); $result[0] = price2num($tot_avec_remise / (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)), 'MT'); // Selon TVA NPR ou non - $result0bis = price2num($tot_avec_remise / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normale (non NPR) + $result0bis = price2num($tot_avec_remise / (1 + ($txtva / 100)), 'MT'); // Si TVA consideree normal (non NPR) $result[1] = price2num($result[2] - ($result0bis + $localtaxes[1]), 'MT'); // Total VAT = TTC - (HT + localtax) $result[5] = price2num($pu + $localtaxes[2], 'MU'); $result[3] = price2num($pu / (1 + ((($info_bits & 1) ? 0 : $txtva) / 100)), 'MU'); // Selon TVA NPR ou non - $result3bis = price2num($pu / (1 + ($txtva / 100)), 'MU'); // Si TVA consideree normale (non NPR) + $result3bis = price2num($pu / (1 + ($txtva / 100)), 'MU'); // Si TVA consideree normal (non NPR) $result[4] = price2num($result[5] - ($result3bis + $localtaxes[2]), 'MU'); } diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a2e42cde0c9..d0de3ba385a 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/lib/product.lib.php - * \brief Ensemble de fonctions de base pour le module produit et service + * \brief Ensemble de functions de base pour le module produit et service * \ingroup product */ @@ -313,7 +313,7 @@ function productlot_prepare_head($object) /** -* Return array head with list of tabs to view object informations. +* Return array head with list of tabs to view object information. * * @return array head array with tabs */ @@ -374,7 +374,7 @@ function product_admin_prepare_head() /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/profid.lib.php b/htdocs/core/lib/profid.lib.php index a2610078a7f..de4f5c70403 100644 --- a/htdocs/core/lib/profid.lib.php +++ b/htdocs/core/lib/profid.lib.php @@ -24,7 +24,7 @@ /** - * Check if a string passes the Luhn agorithm test. + * Check if a string passes the Luhn algorithm test. * @param string|int $str string to check * @return bool True if the string passes the Luhn algorithm check, False otherwise * @since Dolibarr V20 @@ -97,3 +97,150 @@ function isValidSiret($siret) return false; } } + + +/** + * Check the syntax validity of a Portuguese (PT) Tax Identification Number (TIN). + * (NIF = Número de Identificação Fiscal) + * + * @param string $str NIF to check + * @return boolean True if valid, False otherwise + * @since Dolibarr V20 + */ +function isValidTinForPT($str) +{ + $str = trim($str); + $str = preg_replace('/(\s)/', '', $str); + + if (preg_match('/(^[0-9]{9}$)/', $str)) { + return true; + } else { + return false; + } +} + + +/** + * Check the syntax validity of an Algerian (DZ) Tax Identification Number (TIN). + * (NIF = Numéro d'Identification Fiscale) + * + * @param string $str TIN to check + * @return boolean True if valid, False otherwise + * @since Dolibarr V20 + */ +function isValidTinForDZ($str) +{ + $str = trim($str); + $str = preg_replace('/(\s)/', '', $str); + + if (preg_match('/(^[0-9]{15}$)/', $str)) { + return true; + } else { + return false; + } +} + + +/** + * Check the syntax validity of a Belgium (BE) Tax Identification Number (TIN). + * (NN = Numéro National) + * + * @param string $str NN to check + * @return boolean True if valid, False otherwise + * @since Dolibarr V20 + */ +function isValidTinForBE($str) +{ + // https://economie.fgov.be/fr/themes/entreprises/banque-carrefour-des/actualites/structure-du-numero + $str = trim($str); + $str = preg_replace('/(\s)/', '', $str); + + if (preg_match('/(^[0-9]{4}\.[0-9]{3}\.[0-9]{3}$)/', $str)) { + return true; + } else { + return false; + } +} + + +/** + * Check the syntax validity of a Spanish (ES) Tax Identification Number (TIN), where: + * - NIF = Número de Identificación Fiscal + * - CIF = Código de Identificación Fiscal + * - NIE = Número de Identidad de Extranjero + * + * @param string $str TIN to check + * @return int 1 if NIF ok, 2 if CIF ok, 3 if NIE ok, -1 if NIF bad, -2 if CIF bad, -3 if NIE bad, 0 if unexpected bad + * @since Dolibarr V20 + */ +function isValidTinForES($str) +{ + $str = trim($str); + $str = preg_replace('/(\s)/', '', $str); + $str = strtoupper($str); + + //Check format + if (!preg_match('/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/', $str)) { + return 0; + } + + $num = array(); + for ($i = 0; $i < 9; $i++) { + $num[$i] = substr($str, $i, 1); + } + + //Check NIF + if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $str)) { + if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($str, 0, 8) % 23, 1)) { + return 1; + } else { + return -1; + } + } + + //algorithm checking type code CIF + $sum = $num[2] + $num[4] + $num[6]; + for ($i = 1; $i < 8; $i += 2) { + $sum += intval(substr((2 * $num[$i]), 0, 1)) + intval(substr((2 * $num[$i]), 1, 1)); + } + $n = 10 - substr($sum, strlen($sum) - 1, 1); + + //Check special NIF + if (preg_match('/^[KLM]{1}/', $str)) { + if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($str, 1, 8) % 23, 1)) { + return 1; + } else { + return -1; + } + } + + //Check CIF + if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $str)) { + if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1)) { + return 2; + } else { + return -2; + } + } + + //Check NIE T + if (preg_match('/^[T]{1}/', $str)) { + if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $str)) { + return 3; + } else { + return -3; + } + } + + //Check NIE XYZ + if (preg_match('/^[XYZ]{1}/', $str)) { + if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X', 'Y', 'Z'), array('0', '1', '2'), $str), 0, 8) % 23, 1)) { + return 3; + } else { + return -3; + } + } + + //Can not be verified + return -4; +} diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index fcf4c865a2a..6afc152a83f 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -593,7 +593,7 @@ function project_admin_prepare_head() * @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project) * @param string $dummy Not used. * @param int $showbilltime Add the column 'TimeToBill' and 'TimeBilled' - * @param array $arrayfields Array with displayed coloumn information + * @param array $arrayfields Array with displayed column information * @param array $arrayofselected Array with selected fields * @return int Nb of tasks shown */ @@ -625,12 +625,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t for ($i = 0; $i < $numlines; $i++) { if ($parent == 0 && $level >= 0) { - $level = 0; // if $level = -1, we dont' use sublevel recursion, we show all lines + $level = 0; // if $level = -1, we don't use sublevel recursion, we show all lines } // Process line // print "i:".$i."-".$lines[$i]->fk_project.'
    '; - if ($lines[$i]->fk_task_parent == $parent || $level < 0) { // if $level = -1, we dont' use sublevel recursion, we show all lines + if ($lines[$i]->fk_task_parent == $parent || $level < 0) { // if $level = -1, we don't use sublevel recursion, we show all lines // Show task line. $showline = 1; $showlineingray = 0; @@ -656,8 +656,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // User is not allowed on this project and project is not public, so we hide line if (!in_array($lines[$i]->fk_project, $projectsArrayId)) { // Note that having a user assigned to a task into a project user has no permission on, should not be possible - // because assignement on task can be done only on contact of project. - // If assignement was done and after, was removed from contact of project, then we can hide the line. + // because assignment on task can be done only on contact of project. + // If assignment was done and after, was removed from contact of project, then we can hide the line. $showline = 0; } } @@ -1031,7 +1031,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $totalAverageDeclaredProgress = round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2); $totalCalculatedProgress = round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2); - // this conf is actually hidden, by default we use 10% for "be carefull or warning" + // this conf is actually hidden, by default we use 10% for "be careful or warning" $warningRatio = getDolGlobalString('PROJECT_TIME_SPEND_WARNING_PERCENT') ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; // define progress color according to time spend vs workload @@ -1141,7 +1141,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t /** - * Output a task line into a pertime intput mode + * Output a task line into a pertime input mode * * @param string $inc Line number (start to 0, then increased by recursive call) * @param string $parent Id of parent task to show (0 to show all) @@ -1155,7 +1155,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t * @param int $preselectedday Preselected day * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and substasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0) { @@ -1362,7 +1362,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec /** - * Output a task line into a pertime intput mode + * Output a task line into a pertime input mode * * @param string $inc Line number (start to 0, then increased by recursive call) * @param string $parent Id of parent task to show (0 to show all) @@ -1378,7 +1378,7 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec * @param int $oldprojectforbreak Old project id of last project break * @param array $arrayfields Array of additional column * @param Extrafields $extrafields Object extrafields - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and substasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, $preselectedday, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null) { @@ -1759,7 +1759,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr /** - * Output a task line into a perday intput mode + * Output a task line into a perday input mode * * @param string $inc Line output identificator (start to 0, then increased by recursive call) * @param int $firstdaytoshow First day to show @@ -1775,7 +1775,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr * @param int $oldprojectforbreak Old project id of last project break * @param array $arrayfields Array of additional column * @param Extrafields $extrafields Object extrafields - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and substasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $arrayfields = array(), $extrafields = null) { @@ -2157,7 +2157,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ } /** - * Output a task line into a perday intput mode + * Output a task line into a perday input mode * * @param string $inc Line output identificator (start to 0, then increased by recursive call) * @param int $firstdaytoshow First day to show @@ -2172,7 +2172,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ * @param array $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break * @param array $TWeek Array of week numbers - * @return array Array with time spent for $fuser for each day of week on tasks in $lines and substasks + * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks */ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask, &$isavailable, $oldprojectforbreak = 0, $TWeek = array()) { @@ -2826,8 +2826,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks /** * @param Task $task the task object - * @param bool|string $label true = auto, false = dont display, string = replace output - * @param bool|string $progressNumber true = auto, false = dont display, string = replace output + * @param bool|string $label true = auto, false = don't display, string = replace output + * @param bool|string $progressNumber true = auto, false = don't display, string = replace output * @param bool $hideOnProgressNull hide if progress is null * @param bool $spaced used to add space at bottom (made by css) * @return string @@ -2862,7 +2862,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide if ($task->planned_workload) { $progressCalculated = round(100 * (float) $task->duration_effective / (float) $task->planned_workload, 2); - // this conf is actually hidden, by default we use 10% for "be carefull or warning" + // this conf is actually hidden, by default we use 10% for "be careful or warning" $warningRatio = getDolGlobalString('PROJECT_TIME_SPEND_WARNING_PERCENT') ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; $diffTitle = '
    '.$langs->trans('ProgressDeclared').' : '.$task->progress.(isset($task->progress) ? '%' : ''); @@ -2979,7 +2979,7 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '') if ($task->planned_workload) { $progressCalculated = round(100 * (float) $task->duration_effective / (float) $task->planned_workload, 2); - // this conf is actually hidden, by default we use 10% for "be carefull or warning" + // this conf is actually hidden, by default we use 10% for "be careful or warning" $warningRatio = getDolGlobalString('PROJECT_TIME_SPEND_WARNING_PERCENT') ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; if ((float) $progressCalculated > (float) ($task->progress * $warningRatio)) { diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 681ebe94eef..f311fc57967 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/lib/propal.lib.php - * \brief Ensemble de fonctions de base pour le module propal + * \brief Ensemble de functions de base pour le module propal * \ingroup propal */ @@ -151,7 +151,7 @@ function propal_prepare_head($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/reception.lib.php b/htdocs/core/lib/reception.lib.php index a2598b65091..2dce74e6a11 100644 --- a/htdocs/core/lib/reception.lib.php +++ b/htdocs/core/lib/reception.lib.php @@ -111,7 +111,7 @@ function reception_prepare_head(Reception $object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index b8210bd65a3..6038510a7fa 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -96,7 +96,7 @@ function salaries_prepare_head($object) } /** - * Return array head with list of tabs to view object informations + * Return array head with list of tabs to view object information * * @return array head */ diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index ff149b232db..420867a1015 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -107,7 +107,7 @@ function dolGetRandomBytes($length) } /** - * Encode a string with a symetric encryption. Used to encrypt sensitive data into database. + * Encode a string with a symmetric encryption. Used to encrypt sensitive data into database. * Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ. * This function is called for example by dol_set_const() when saving a sensible data into database configuration table llx_const. * @@ -169,7 +169,7 @@ function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = } /** - * Decode a string with a symetric encryption. Used to decrypt sensitive data saved into database. + * Decode a string with a symmetric encryption. Used to decrypt sensitive data saved into database. * Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ. * * @param string $chain string to decode @@ -223,8 +223,8 @@ function dolDecrypt($chain, $key = '') /** * Returns a hash (non reversible encryption) of a string. - * If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (recommanded value is 'password_hash') - * If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash'). + * If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function (recommended value is 'password_hash') + * If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorithm is something else than 'password_hash'). * * @param string $chain String to hash * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4': for OpenLdap, '5':sha256, '6':password_hash). @@ -357,7 +357,7 @@ function dolGetLdapPasswordHash($password, $type = 'md5') * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional). Can use '' if NA. * @param string $dbt_select Field rowid name, for select into tableandshare if not "rowid". Not used if objectid is null (optional) * @param int $isdraft 1=The object with id=$objectid is a draft - * @param int $mode Mode (0=default, 1=return without dieing) + * @param int $mode Mode (0=default, 1=return without dying) * @return int If mode = 0 (default): Always 1, die process if not allowed. If mode = 1: Return 0 if access not allowed. * @see dol_check_secure_access_document(), checkUserAccessToObject() */ diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 3405ba614e6..0261b43d547 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -45,7 +45,7 @@ function dol_getwebuser($mode) } /** - * Return a login if login/pass was successfull + * Return a login if login/pass was successful * * @param string $usertotest Login value to test * @param string $passwordtotest Password value to test @@ -97,7 +97,7 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth $function = 'check_user_password_'.$mode; $login = call_user_func($function, $usertotest, $passwordtotest, $entitytotest, $context); if ($login && $login != '--bad-login-validity--') { - // Login is successfull with this method + // Login is successful with this method $test = false; // To stop once at first login success $conf->authmode = $mode; // This properties is defined only when logged to say what mode was successfully used /*$dol_tz = GETPOST('tz'); @@ -479,7 +479,7 @@ function encodedecode_dbpassconf($level = 0) * Return a generated password using default module * * @param boolean $generic true=Create generic password (32 chars/numbers), false=Use the configured password generation module - * @param array $replaceambiguouschars Discard ambigous characters. For example array('I'). + * @param array $replaceambiguouschars Discard ambiguous characters. For example array('I'). * @param int $length Length of random string (Used only if $generic is true) * @return string New value for password * @see dol_hash(), dolJSToSetRandomPassword() @@ -562,7 +562,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len } /** - * Ouput javacript to autoset a generated password using default module into a HTML element. + * Output javascript to autoset a generated password using default module into a HTML element. * * @param string $htmlname HTML name of element to insert key into * @param string $htmlnameofbutton HTML name of button diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index b072c3e51fd..eecef7aaaec 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -406,7 +406,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; } - // Batch number managment + // Batch number management /*TODO Add link to expeditiondet_batch if (!empty($conf->productbatch->enabled)) { @@ -438,7 +438,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') } }*/ - // Informations on receipt + // Information on receipt if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY')) { include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; $expedition->fetchObjectLinked($expedition->id, $expedition->element); diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index a41df25a9d2..0290ec78080 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -52,7 +52,7 @@ function showOnlineSignatureUrl($type, $ref, $obj = null) /** * Return string with full Url * - * @param int $mode 0=True url, 1=Url formated with colors + * @param int $mode 0=True url, 1=Url formatted with colors * @param string $type Type of URL ('proposal', ...) * @param string $ref Ref of object * @param int $localorexternal 0=Url for browser, 1=Url for external access diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index d397ff26311..9b790c39558 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -56,8 +56,8 @@ function stock_prepare_head($object) /* Disabled because will never be implemented. Table always empty. if (!empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) { - // Should not be enabled by defaut because does not work yet correctly because - // personnal stocks are not tagged into table llx_entrepot + // Should not be enabled by default because does not work yet correctly because + // personal stocks are not tagged into table llx_entrepot $head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$object->id; $head[$h][1] = $langs->trans("Users"); $head[$h][2] = 'user'; @@ -84,7 +84,7 @@ function stock_prepare_head($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/supplier_proposal.lib.php b/htdocs/core/lib/supplier_proposal.lib.php index dccdee72072..f1d0793e5cb 100644 --- a/htdocs/core/lib/supplier_proposal.lib.php +++ b/htdocs/core/lib/supplier_proposal.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/lib/propal.lib.php - * \brief Ensemble de fonctions de base pour le module propal + * \brief Ensemble de functions de base pour le module propal * \ingroup propal */ @@ -105,7 +105,7 @@ function supplier_proposal_prepare_head($object) } /** - * Return array head with list of tabs to view object informations. + * Return array head with list of tabs to view object information. * * @return array head array with tabs */ diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index b9da77dc6f7..0a353042113 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -107,7 +107,7 @@ function tax_prepare_head(ChargeSociales $object) * @param string $direction 'sell' or 'buy' * @param int $m Month * @param int $q Quarter - * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developped, -3 if error + * @return array|int Array with details of VATs (per third parties), -1 if no accountancy module, -2 if not yet developed, -3 if error */ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $direction, $m = 0, $q = 0) { @@ -696,7 +696,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di * @param int $modetax Not used * @param int $direction 'sell' (customer invoice) or 'buy' (supplier invoices) * @param int $m Month - * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developped, -3 if error + * @return array|int Array with details of VATs (per rate), -1 if no accountancy module, -2 if not yet developed, -3 if error */ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m = 0) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 3745eddf513..019a3e24eb6 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2019-2022 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * * 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 @@ -213,7 +213,7 @@ function generate_random_id($car = 16) * @param array $arrayofcss Array of complementary css files * @return void */ -function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $user, $conf, $langs, $mysoc; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index d679d230566..b12b8e28d3c 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -106,7 +106,7 @@ function tree_showpad(&$fulltree, $key, $silent = 0) * @param array $pere Array with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu=>,'fk_leftmenu=>) * @param int $rang Level of element * @param string $iddivjstree Id to use for parent ul element - * @param int $donoresetalreadyloaded Do not reset global array $donoresetalreadyloaded used to avoid to go down on an aleady processed record + * @param int $donoresetalreadyloaded Do not reset global array $donoresetalreadyloaded used to avoid to go down on an already processed record * @param int $showfk 1=show fk_links to parent into label (used by menu editor only) * @param string $moreparam Add more param on url of elements * @return void diff --git a/htdocs/core/lib/trip.lib.php b/htdocs/core/lib/trip.lib.php index cdc7360fbf8..31ed60ad716 100644 --- a/htdocs/core/lib/trip.lib.php +++ b/htdocs/core/lib/trip.lib.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/lib/trip.lib.php - * \brief Ensemble de fonctions de base pour les deplacements + * \brief Ensemble de functions de base pour les deplacements */ /** diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 5f0bfd8915d..bc9400e0476 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -108,7 +108,7 @@ function dolKeepOnlyPhpCode($str) /** * Convert a page content to have correct links (based on DOL_URL_ROOT) into an html content. It replaces also dynamic content with '...php...' - * Used to ouput the page on the Preview from backoffice. + * Used to output the page on the Preview from backoffice. * * @param Website $website Web site object * @param string $content Content to replace @@ -271,7 +271,7 @@ function dolReplaceSmileyCodeWithUTF8($content) /** * Render a string of an HTML content and output it. - * Used to ouput the page when viewed from a server (Dolibarr or Apache). + * Used to output the page when viewed from a server (Dolibarr or Apache). * * @param string $content Content string * @param string $contenttype Content type @@ -637,7 +637,7 @@ function includeContainer($containerref) */ function getStructuredData($type, $data = array()) { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs; // Very important. Required to have var available when running included containers. $type = strtolower($type); @@ -842,7 +842,7 @@ function getStructuredData($type, $data = array()) */ function getSocialNetworkHeaderCards($params = null) { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. $out = ''; @@ -916,7 +916,7 @@ function getSocialNetworkHeaderCards($params = null) */ function getSocialNetworkSharingLinks() { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. $out = ''."\n"; @@ -968,6 +968,107 @@ function getSocialNetworkSharingLinks() return $out; } + +/** + * Return HTML content to add structured data for an article, news or Blog Post. + * + * @param Object $object Object + * @return string HTML img content or '' if no image found + * @see getImagePublicURLOfObject() + */ +function getNbOfImagePublicURLOfObject($object) +{ + global $db; + + $nb = 0; + + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + $regexforimg = getListOfPossibleImageExt(0); + $regexforimg = '('.$regexforimg.')$'; + + $sql = "SELECT COUNT(rowid) as nb"; + $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; + $sql .= " WHERE entity IN (".getEntity($object->element).")"; + $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object + $sql .= " AND ".$db->regexpsql('filename', $regexforimg, 1); + $sql .= " AND share IS NOT NULL"; // Only image that are public + + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + if ($obj) { + $nb = $obj->nb; + } + } + + return $nb; +} + +/** + * Return HTML content to add structured data for an article, news or Blog Post. + * + * @param Object $object Object + * @param int $no Numero of image (if there is several images. 1st one by default) + * @param string $extName Extension to differentiate thumb file name ('', '_small', '_mini') + * @return string HTML img content or '' if no image found + * @see getNbOfImagePublicURLOfObject() + */ +function getImagePublicURLOfObject($object, $no = 1, $extName = '') +{ + global $db; + + $image_path = ''; + + include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + $regexforimg = getListOfPossibleImageExt(0); + $regexforimg = '('.$regexforimg.')$'; + + $sql = "SELECT rowid, ref, share, filename, cover, position"; + $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; + $sql .= " WHERE entity IN (".getEntity($object->element).")"; + $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object + $sql .= " AND ".$db->regexpsql('filename', $regexforimg, 1); + $sql .= $db->order("cover,position,rowid", "ASC,ASC,ASC"); + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + $found = 0; + $foundnotshared = 0; + while ($i < $num) { + $obj = $db->fetch_object($resql); + if ($obj) { + if (empty($obj->share)) { + $foundnotshared++; + } else { + $found++; + + $image_path = DOL_URL_ROOT.'/viewimage.php?hashp='.urlencode($obj->share); + if ($extName) { + //getImageFileNameForSize($dir.$file, '_small') + $image_path .= '&extname='.urlencode($extName); + } + } + } + if ($found >= $no) { + break; + } + $i++; + } + if (!$found && $foundnotshared) { + $image_path = DOL_URL_ROOT.'/viewimage.php?modulepart=common&file=nophotopublic.png'; + } + } + + if (empty($image_path)) { + $image_path = DOL_URL_ROOT.'/viewimage.php?modulepart=common&file=nophoto.png'; + } + + return $image_path; +} + + /** * Return list of containers object that match a criteria. * WARNING: This function can be used by websites. @@ -985,7 +1086,7 @@ function getSocialNetworkSharingLinks() */ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $sortfield = 'date_creation', $sortorder = 'DESC', $langcode = '', $otherfilters = 'null', $status = 1) { - global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers. + global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running included containers. $error = 0; $arrayresult = array('code'=>'', 'list'=>array()); @@ -1140,7 +1241,7 @@ function getPagesFromSearchCriterias($type, $algo, $searchstring, $max = 25, $so * * @param Website $object Object website * @param WebsitePage $objectpage Object website page - * @param string $urltograb URL to grab (exemple: http://www.nltechno.com/ or http://www.nltechno.com/dir1/ or http://www.nltechno.com/dir1/mapage1) + * @param string $urltograb URL to grab (example: http://www.nltechno.com/ or http://www.nltechno.com/dir1/ or http://www.nltechno.com/dir1/mapage1) * @param string $tmp Content to parse * @param string $action Var $action * @param string $modifylinks 0=Do not modify content, 1=Replace links with a link to viewimage @@ -1214,7 +1315,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors'); $action = 'create'; } else { - $alreadygrabbed[$urltograbbis] = 1; // Track that file was alreay grabbed. + $alreadygrabbed[$urltograbbis] = 1; // Track that file was already grabbed. dol_mkdir(dirname($filetosave)); @@ -1283,7 +1384,7 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors'); $action = 'create'; } else { - $alreadygrabbed[$urltograbbis] = 1; // Track that file was alreay grabbed. + $alreadygrabbed[$urltograbbis] = 1; // Track that file was already grabbed. dol_mkdir(dirname($filetosave)); diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 8767a8a227c..639fbba277c 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -651,8 +651,8 @@ function showWebsiteTemplates(Website $website) * - Block if bad code in the new string. * - Block also if user has no permission to change PHP code. * - * @param string $phpfullcodestringold PHP old string. For exemple "" - * @param string $phpfullcodestring PHP new string. For exemple "" + * @param string $phpfullcodestringold PHP old string. For example "" + * @param string $phpfullcodestring PHP new string. For example "" * @return int Error or not * @see dolKeepOnlyPhpCode() */ diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php index a26604b18bc..a0150d403c8 100644 --- a/htdocs/core/lib/ws.lib.php +++ b/htdocs/core/lib/ws.lib.php @@ -26,7 +26,7 @@ /** * Check authentication array and set error, errorcode, errorlabel * - * @param array $authentication Array with authentication informations ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) + * @param array $authentication Array with authentication information ('login'=>,'password'=>,'entity'=>,'dolibarrkey'=>) * @param int $error Number of errors * @param string $errorcode Error string code * @param string $errorlabel Error string label diff --git a/htdocs/core/login/README.txt b/htdocs/core/login/README.txt index 0231ef807fa..118fff0854a 100644 --- a/htdocs/core/login/README.txt +++ b/htdocs/core/login/README.txt @@ -1,6 +1,6 @@ -README (english) +README (English) --------------------------------------------- -Decription of htdocs/core/login directory +Description of htdocs/core/login directory --------------------------------------------- This directory contains files that handle the way to validate passwords. diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index 143dcd33779..42467f123bf 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -114,7 +114,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes if ($cryptType == 'auto') { if ($passcrypted && dol_verifyHash($passtyped, $passcrypted, '0')) { $passok = true; - dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - hash ".$cryptType." of pass is ok"); + dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication ok - hash ".$cryptType." of pass is ok"); } } @@ -123,7 +123,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes if ((!$passcrypted || $passtyped) && ($passclear && ($passtyped == $passclear))) { $passok = true; - dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentification ok - found old pass in database", LOG_WARNING); + dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication ok - found old pass in database", LOG_WARNING); } } diff --git a/htdocs/core/login/functions_googleoauth.php b/htdocs/core/login/functions_googleoauth.php index 6e72f3c48cc..dda4a0e78cf 100644 --- a/htdocs/core/login/functions_googleoauth.php +++ b/htdocs/core/login/functions_googleoauth.php @@ -113,7 +113,7 @@ function check_user_password_googleoauth($usertotest, $passwordtotest, $entityto $_POST['dol_use_jmobile'] = $tmparray['dol_use_jmobile']; } - // If googleoauth_login has been set (by google_oauthcallback after a successfull OAUTH2 request on openid scope + // If googleoauth_login has been set (by google_oauthcallback after a successful OAUTH2 request on openid scope if (!empty($_SESSION['googleoauth_receivedlogin']) && dol_verifyHash($conf->file->instance_unique_id.$usertotest, $_SESSION['googleoauth_receivedlogin'], '0')) { unset($_SESSION['googleoauth_receivedlogin']); $login = $usertotest; diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 00670738053..02ea104a2b3 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -137,7 +137,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) // Forge LDAP user and password to test with them // If LDAP need a dn with login like "uid=jbloggs,ou=People,dc=foo,dc=com", default dn may work even if previous code with - // admin login no exectued. + // admin login no executed. $ldap->searchUser = $ldapuserattr."=".$usertotest.",".$ldapdn; // Default dn (will work if LDAP accept a dn with login value inside) // But if LDAP need a dn with name like "cn=Jhon Bloggs,ou=People,dc=foo,dc=com", previous part must have been executed to have // dn detected into ldapUserDN. @@ -187,7 +187,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($login && !empty($conf->ldap->enabled) && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') == Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { // ldap2dolibarr synchronization dol_syslog("functions_ldap::check_user_password_ldap Sync ldap2dolibarr"); - // On charge les attributs du user ldap + // On charge les attributes du user ldap if ($ldapdebug) { print "DEBUG: login ldap = ".$login."
    \n"; } @@ -216,12 +216,12 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $resultFetchUser = $usertmp->fetch('', $login, $sid, 1, ($entitytotest > 0 ? $entitytotest : -1)); if ($resultFetchUser > 0) { dol_syslog("functions_ldap::check_user_password_ldap Sync user found user id=".$usertmp->id); - // On verifie si le login a change et on met a jour les attributs dolibarr + // Verify if the login changed and update the Dolibarr attributes if ($usertmp->login != $ldap->login && $ldap->login) { $usertmp->login = $ldap->login; $usertmp->update($usertmp); - // TODO Que faire si update echoue car on update avec un login deja existant pour un autre compte. + // TODO What to do if the update fails because the login already exists for another account. } //$resultUpdate = $usertmp->update_ldap2dolibarr($ldap); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 60480d6c9cb..ff26edcd027 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -449,7 +449,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $i++; } } else { - // Should not happend. Entries are added + // Should not happen. Entries are added $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); } } else { diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 890e4257da0..eee9f086be2 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -197,7 +197,7 @@ class MenuManager print $val['titre']; print '
    '."\n"; - // Search submenu fot this mainmenu entry + // Search submenu for this mainmenu entry $tmpmainmenu = $val['mainmenu']; $tmpleftmenu = 'all'; $submenu = new Menu(); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 94c4d961750..09d631d6d1c 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -738,8 +738,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu = $menu; - $mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION["mainmenu"]); - $leftmenu = ($forceleftmenu ? '' : (empty($_SESSION["leftmenu"]) ? 'none' : $_SESSION["leftmenu"])); + $mainmenu = ($forcemainmenu ? $forcemainmenu : $_SESSION["mainmenu"]??''); + $leftmenu = ($forceleftmenu ? '' : (empty($_SESSION["leftmenu"]) ? 'none' : $_SESSION["leftmenu"]??'')); if (is_null($mainmenu)) { $mainmenu = 'home'; @@ -1787,7 +1787,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $i++; } } else { - // Should not happend. Entries are added + // Should not happen. Entries are added $newmenu->add('', $langs->trans("NoJournalDefined"), 2, $user->hasRight('accounting', 'comptarapport', 'lire')); } } else { @@ -1901,7 +1901,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->hasRight('compta', 'resultat', 'lire')); if (isModEnabled('propal')) { $newmenu->add("/compta/stats/prev.php?leftmenu=report","Previsionnel",2,$user->hasRight('compta', 'resultat', 'lire')); - $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->hasRight('compta', 'resultat', 'lire')); + $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transferred",2,$user->hasRight('compta', 'resultat', 'lire')); } */ @@ -2266,9 +2266,9 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->hasRight('projet', 'creer')); if (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { - $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); + $newmenu->add("/projet/list.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); } elseif (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 1) { - $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); + $newmenu->add("/projet/list.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode); $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode); } elseif (getDolGlobalInt('PROJECT_USE_OPPORTUNITIES') == 2) { // 2 = leads only diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 50d1086104e..1d3bb633db6 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -197,7 +197,7 @@ class MenuManager print $val['titre']; print ''."\n"; - // Search submenu fot this mainmenu entry + // Search submenu for this mainmenu entry $tmpmainmenu = $val['mainmenu']; $tmpleftmenu = 'all'; $submenu = new Menu(); diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 542cb1a493a..c67e783bd48 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -187,7 +187,7 @@ class MenuManager print $val['titre']; print ''."\n"; - // Search submenu fot this mainmenu entry + // Search submenu for this mainmenu entry $tmpmainmenu = $val['mainmenu']; $tmpleftmenu = 'all'; $submenu = new Menu(); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 1f300718385..2a81062d00e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -37,7 +37,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it into unActivateModule to be able to disable a module whose files were removed. { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -69,7 +69,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it public $family; /** - * @var array Custom family informations + * @var array Custom family information * @see $family * * e.g.: @@ -425,7 +425,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Enables a module. - * Inserts all informations into database. + * Inserts all information into database. * * @param array $array_sql SQL requests to be executed when enabling module * @param string $options String with options when disabling module: @@ -1112,8 +1112,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * Create tables and keys required by module: * - Files table.sql or table-module.sql with create table instructions * - Then table.key.sql or table-module.key.sql with create keys instructions - * - Then data_xxx.sql (usualy provided by external modules only) - * - Then update_xxx.sql (usualy provided by external modules only) + * - Then data_xxx.sql (usually provided by external modules only) + * - Then update_xxx.sql (usually provided by external modules only) * Files must be stored in subdirectory 'tables' or 'data' into directory $reldir (Example: '/install/mysql/' or '/module/sql/') * This function may also be called by : * - _load_tables('/install/mysql/', 'modulename') into the this->init() of core module descriptors. diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index d94334250a2..78b348c0f4b 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -294,7 +294,7 @@ class doc_generic_asset_odt extends ModelePDFAsset $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 31b8799d472..46262b3c1dc 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_standard_asset extends ModelePDFAsset { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -120,7 +120,7 @@ class pdf_standard_asset extends ModelePDFAsset } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // used for notes ans other stuff + $this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff $this->tabTitleHeight = 5; // default height @@ -582,7 +582,7 @@ class pdf_standard_asset extends ModelePDFAsset $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Quantity // Enough for 6 chars @@ -1159,18 +1159,18 @@ class pdf_standard_asset extends ModelePDFAsset ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1182,7 +1182,7 @@ class pdf_standard_asset extends ModelePDFAsset 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index f9645d66853..1e69ae8b371 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** - * Classe permettant de generer les projets au modele Ban + * Class permettant de generer les projects au modele Ban */ class pdf_ban extends ModeleBankAccountDoc diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index b1d67a3da4e..18419b0c97d 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -534,7 +534,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param TCPDF $pdf Object PDF * @param CompanyBankAccount $object Object invoice * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _signature_area(&$pdf, $object, $posy, $outputlangs) diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index f88228eb746..017f9385ae7 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -208,7 +208,7 @@ class modTcpdfbarcode extends ModeleBarCode } /** - * get available output_modes for tcpdf class wth its translated description + * get available output_modes for tcpdf class with its translated description * * @param string $dolEncodingType dolibarr barcode encoding type * @return string tcpdf encoding type diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 3962613f7f0..c242c479e84 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -284,9 +284,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode /** * Return if a code is used (by other element) * - * @param DoliDB $db Handler acces base + * @param DoliDB $db Handler access base * @param string $code Code to check - * @param Product $product Objet product + * @param Product $product Object product * @return int 0 if available, <0 if KO */ public function verif_dispo($db, $code, $product) diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 955db0a20ff..2c7a716aded 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -285,9 +285,9 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode /** * Return if a code is used (by other element) * - * @param DoliDB $db Handler acces base + * @param DoliDB $db Handler access base * @param string $code Code to check - * @param Societe $thirdparty Objet third-party + * @param Societe $thirdparty Object third-party * @return int 0 if available, <0 if KO */ public function verif_dispo($db, $code, $thirdparty) diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 7301d29fef3..2dddba86689 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -304,7 +304,7 @@ class doc_generic_bom_odt extends ModelePDFBom $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index db0704d6494..864997ac473 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -375,7 +375,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $lineinpage = 0; $num = count($this->lines); for ($j = 0; $j < $num; $j++) { - // Dynamic max line heigh calculation + // Dynamic max line height calculation $dynamic_line_height = array(); $dynamic_line_height[] = $pdf->getStringHeight(60, $outputlangs->convToOutputCharset($this->lines[$j]->bank_chq)); $dynamic_line_height[] = $pdf->getStringHeight(80, $outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq)); diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 015fc18fed0..8779292a144 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -310,7 +310,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 88de6414416..eb36e298227 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_einstein extends ModelePDFCommandes { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -469,7 +469,7 @@ class pdf_einstein extends ModelePDFCommandes // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } @@ -756,7 +756,7 @@ class pdf_einstein extends ModelePDFCommandes $posy=$pdf->GetY()+1; }*/ - // Show planed date of delivery + // Show planned date of delivery if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); @@ -869,7 +869,7 @@ class pdf_einstein extends ModelePDFCommandes * @param Commande $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param Translate $outputlangsbis Object lang for output bis * @return int Position pour suite */ diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index e02d239a5bd..2b051a87d75 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_eratosthene extends ModelePDFCommandes { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -130,7 +130,7 @@ class pdf_eratosthene extends ModelePDFCommandes } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // used for notes ans other stuff + $this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff $this->tabTitleHeight = 5; // default height @@ -658,7 +658,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } @@ -958,7 +958,7 @@ class pdf_eratosthene extends ModelePDFCommandes $posy=$pdf->GetY()+1; }*/ - // Show planed date of delivery + // Show planned date of delivery if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); @@ -1069,7 +1069,7 @@ class pdf_eratosthene extends ModelePDFCommandes * @param Commande $object Object to show * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param Translate $outputlangsbis Object lang for output bis * @return int Position pour suite */ @@ -1716,18 +1716,18 @@ class pdf_eratosthene extends ModelePDFCommandes ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1739,7 +1739,7 @@ class pdf_eratosthene extends ModelePDFCommandes 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 8ffc21c69b3..b0fc0edb705 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -308,7 +308,7 @@ class doc_generic_contract_odt extends ModelePDFContract $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 260baee7172..a3bae6c2475 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; class pdf_strato extends ModelePDFContract { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php index 486ce956866..f8ea2fb1664 100644 --- a/htdocs/core/modules/contract/mod_contract_olive.php +++ b/htdocs/core/modules/contract/mod_contract_olive.php @@ -46,7 +46,7 @@ class mod_contract_olive extends ModelNumRefContracts public $code_modifiable = 1; // Code modifiable - public $code_modifiable_invalide = 1; // Code modifiable si il est invalide + public $code_modifiable_invalide = 1; // Code modifiable si il est invalid public $code_modifiable_null = 1; // Code modifiables si il est null diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 56f71ce36e8..03a9f649e70 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -25,7 +25,7 @@ /** * \file htdocs/core/modules/delivery/doc/pdf_storm.modules.php * \ingroup livraison - * \brief File of class to manage receving receipts with template Storm + * \brief File of class to manage receiving receipts with template Storm */ require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_storm extends ModelePDFDeliveryOrder { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -460,7 +460,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Quantity @@ -892,18 +892,18 @@ class pdf_storm extends ModelePDFDeliveryOrder ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -915,7 +915,7 @@ class pdf_storm extends ModelePDFDeliveryOrder 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index d2a0eabdedf..1b4fb4a84d7 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -24,7 +24,7 @@ /** * \file htdocs/core/modules/delivery/doc/pdf_typhon.modules.php * \ingroup livraison - * \brief File of class to manage receving receipts with template Typhon + * \brief File of class to manage receiving receipts with template Typhon */ require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_typhon extends ModelePDFDeliveryOrder { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -382,7 +382,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default /* // TVA diff --git a/htdocs/core/modules/delivery/mod_delivery_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php index 7a0713025cf..579f4af7ced 100644 --- a/htdocs/core/modules/delivery/mod_delivery_jade.php +++ b/htdocs/core/modules/delivery/mod_delivery_jade.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/modules/delivery/mod_delivery_jade.php * \ingroup delivery - * \brief Fichier contenant la classe du modele de numerotation de reference de bon de livraison Jade + * \brief Fichier contenant la class du modele de numerotation de reference de bon de livraison Jade */ require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; /** * \class mod_delivery_jade - * \brief Classe du modele de numerotation de reference de bon de livraison Jade + * \brief Class du modele de numerotation de reference de bon de livraison Jade */ class mod_delivery_jade extends ModeleNumRefDeliveryOrder diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index d25df47624d..bb1b2e7ad33 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -21,13 +21,13 @@ /** * \file htdocs/core/modules/delivery/mod_delivery_saphir.php * \ingroup expedition - * \brief Fichier contenant la classe du modele de numerotation de reference de livraison Saphir + * \brief Fichier contenant la class du modele de numerotation de reference de livraison Saphir */ require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; /** * \class mod_delivery_saphir - * \brief Classe du modele de numerotation de reference de livraison Saphir + * \brief Class du modele de numerotation de reference de livraison Saphir */ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder { @@ -162,7 +162,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder * Return next free ref * * @param Societe $objsoc Object thirdparty - * @param Object $object Objet livraison + * @param Object $object Object livraison * @return string Descriptive text */ public function delivery_get_num($objsoc = 0, $object = '') diff --git a/htdocs/core/modules/delivery/modules_delivery.php b/htdocs/core/modules/delivery/modules_delivery.php index eab3918dace..5f727d5f4ce 100644 --- a/htdocs/core/modules/delivery/modules_delivery.php +++ b/htdocs/core/modules/delivery/modules_delivery.php @@ -24,8 +24,8 @@ /** * \file htdocs/core/modules/delivery/modules_delivery.php * \ingroup expedition - * \brief Fichier contenant la classe mere de generation de bon de livraison en PDF - * et la classe mere de numerotation des bons de livraisons + * \brief Fichier contenant la class mere de generation de bon de livraison en PDF + * et la class mere de numerotation des bons de livraisons */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php'; /** - * Classe mere des modeles de bon de livraison + * Class mere des modeles de bon de livraison */ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator { @@ -60,7 +60,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de bon de livraison + * Class mere des modeles de numerotation des references de bon de livraison */ abstract class ModeleNumRefDeliveryOrder extends CommonNumRefGenerator { diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 795d803b9d8..e56b7580ced 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -38,7 +38,7 @@ class html_cerfafr extends ModeleDon /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/modules/dons/html_generic.modules.php b/htdocs/core/modules/dons/html_generic.modules.php index c1bb138fdc7..fa16c9a03b1 100644 --- a/htdocs/core/modules/dons/html_generic.modules.php +++ b/htdocs/core/modules/dons/html_generic.modules.php @@ -39,7 +39,7 @@ class html_generic extends ModeleDon /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index f35415d6e0f..deb3b68733e 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -308,7 +308,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a SHIPPING contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a SHIPPING contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 3cf292e4a91..7ddf42614a6 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_espadon extends ModelePdfExpedition { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -775,7 +775,7 @@ class pdf_espadon extends ModelePdfExpedition * @param Expedition $object Object expedition * @param int $deja_regle Amount already paid * @param int $posy Start Position - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position for suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) @@ -1233,18 +1233,18 @@ class pdf_espadon extends ModelePdfExpedition ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1256,7 +1256,7 @@ class pdf_espadon extends ModelePdfExpedition 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index a4d790f2285..e154510777a 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_merou extends ModelePdfExpedition { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 8e3595c1d08..6fe85fa3683 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; class pdf_rouget extends ModelePdfExpedition { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -506,7 +506,7 @@ class pdf_rouget extends ModelePdfExpedition $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default $pdf->SetXY($this->posxweightvol, $curY); $weighttxt = ''; @@ -649,7 +649,7 @@ class pdf_rouget extends ModelePdfExpedition * @param Expedition $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 82d81cdb4b7..3040f848c7e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/userbankaccount.class.php'; class pdf_standard extends ModeleExpenseReport { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -322,7 +322,6 @@ class pdf_standard extends ModeleExpenseReport } $iniY = $tab_top + 7; - $initialY = $tab_top + 7; $nexY = $tab_top + 7; $showpricebeforepagebreak = 1; @@ -488,7 +487,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetFillColor(248, 248, 248); if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) { - // TODO Show vat amout per tax level + // TODO Show vat amount per tax level $posy += 5; $pdf->SetXY(130, $posy); $pdf->SetTextColor(0, 0, 60); @@ -551,7 +550,7 @@ class pdf_standard extends ModeleExpenseReport * @param ExpenseReport $object Object to show * @param int $linenumber line number * @param int $curY current y position - * @param int $default_font_size default siez of font + * @param int $default_font_size default font size * @param Translate $outputlangs Object lang for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return void @@ -807,7 +806,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(80, 5, $outputlangs->transnoentities("TripNDF")." :", 0, 'L'); $pdf->rect($posx, $posy, $this->page_largeur - $this->marge_gauche - $posx, $hautcadre); - // Informations for expense report (dates and users workflow) + // Information for expense report (dates and users workflow) if ($object->fk_user_author > 0) { $userfee = new User($this->db); $userfee->fetch($object->fk_user_author); diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index df1fc7ee783..6bc4c6671dd 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -19,7 +19,7 @@ /** * \file htdocs/core/modules/expensereport/mod_expensereport_sand.php * \ingroup expensereport - * \brief Fichier contenant la classe du modele de numerotation de reference de note de frais Sand + * \brief Fichier contenant la class du modele de numerotation de reference de note de frais Sand */ require_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index 82b8a36cb8c..4a7f8b510e4 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; /** * Parent class for export modules */ -class ModeleExports extends CommonDocGenerator // This class can't be abstract as there is instance propreties loaded by listOfAvailableExportFormat +class ModeleExports extends CommonDocGenerator // This class can't be abstract as there is instance properties loaded by listOfAvailableExportFormat { /** * @var string Error code (or message) diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 3742801f80f..0344b4a3c53 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -86,7 +86,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Recupere emetteur $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { - $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini + $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par default, si n'etait pas defini } } @@ -309,7 +309,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a BILLING contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a BILLING contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 818d157964b..6c58f02900a 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_crabe extends ModelePDFFactures { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -439,7 +439,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - // $pdf->GetY() here can't be used. It is bottom of the second addresse box but first one may be higher + // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher // $tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) $tab_top = 90 + $top_shift; // top_shift is an addition for linked objects or addons (0 in most cases) @@ -673,7 +673,7 @@ class pdf_crabe extends ModelePDFFactures // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } @@ -770,7 +770,7 @@ class pdf_crabe extends ModelePDFFactures if (!isset($this->tva[$vatrate])) { $this->tva[$vatrate] = 0; } - $this->tva[$vatrate] += $tvaligne; // ->tva is abandonned, we use now ->tva_array that is more complete + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete $vatcode = $object->lines[$i]->vat_src_code; if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; @@ -1327,7 +1327,7 @@ class pdf_crabe extends ModelePDFFactures * @param Facture $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param Translate $outputlangsbis Object lang for output bis * @return int Position pour suite */ diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0130fa8c0db..1d6b8104d87 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_sponge extends ModelePDFFactures { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -164,7 +164,7 @@ class pdf_sponge extends ModelePDFFactures } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // used for notes ans other stuff + $this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff $this->tabTitleHeight = 5; // default height @@ -447,7 +447,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - // $pdf->GetY() here can't be used. It is bottom of the second addresse box but first one may be higher + // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) @@ -493,7 +493,7 @@ class pdf_sponge extends ModelePDFFactures $this->tab_top_newpage += 0; - // Define heigth of table for lines (for first page) + // Define height of table for lines (for first page) $tab_height = $this->page_hauteur - $this->tab_top - $this->heightforfooter - $this->heightforfreetext - $this->getHeightForQRInvoice(1, $object, $langs); $nexY = $this->tab_top - 1; @@ -807,7 +807,7 @@ class pdf_sponge extends ModelePDFFactures // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } @@ -929,7 +929,7 @@ class pdf_sponge extends ModelePDFFactures if (!isset($this->tva[$vatrate])) { $this->tva[$vatrate] = 0; } - $this->tva[$vatrate] += $tvaligne; // ->tva is abandonned, we use now ->tva_array that is more complete + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete $vatcode = $object->lines[$i]->vat_src_code; if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; @@ -1421,7 +1421,7 @@ class pdf_sponge extends ModelePDFFactures * @param Facture $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param Translate $outputlangsbis Object lang for output bis * @return int Position pour suite */ @@ -1713,7 +1713,7 @@ class pdf_sponge extends ModelePDFFactures } //} - // Situations totals migth be wrong on huge amounts with old mode 1 + // Situations totals might be wrong on huge amounts with old mode 1 if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1 && $object->situation_cycle_ref && $object->situation_counter > 1) { $sum_pdf_tva = 0; foreach ($this->tva as $tvakey => $tvaval) { @@ -2026,7 +2026,7 @@ class pdf_sponge extends ModelePDFFactures // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** - * Show top header of page. This include the logo, ref and address blocs + * Show top header of page. This include the logo, ref and address blocks * * @param TCPDF $pdf Object PDF * @param Facture $object Object to show @@ -2458,18 +2458,18 @@ class pdf_sponge extends ModelePDFFactures ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -2481,7 +2481,7 @@ class pdf_sponge extends ModelePDFFactures 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index a87513c216e..9f1a312e705 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_soleil extends ModelePDFFicheinter { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 8f014e68111..09ac4078e63 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; /** - * Class to manage numbering of intervention cards with rule Artic. + * Class to manage numbering of intervention cards with rule Arctic. */ class mod_arctic extends ModeleNumRefFicheinter { diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index 20050edf0c6..2abbbe07264 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -70,10 +70,10 @@ abstract class ModeleNumRefFicheinter extends CommonNumRefGenerator /** * Create an intervention document on disk using template defined into FICHEINTER_ADDON_PDF * - * @param DoliDB $db objet base de donnee + * @param DoliDB $db object base de donnee * @param Object $object Object fichinter - * @param string $modele force le modele a utiliser ('' par defaut) - * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param string $modele force le modele a utiliser ('' par default) + * @param Translate $outputlangs object lang a utiliser pour traduction * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref @@ -117,7 +117,7 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0, foreach (array('doc', 'pdf') as $prefix) { $file = $prefix."_".$modele.".modules.php"; - // On verifie l'emplacement du modele + // Get the location of the module and verify it exists $file = dol_buildpath($reldir."core/modules/fichinter/doc/".$file, 0); if (file_exists($file)) { $filefound = 1; diff --git a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard.modules.php index 10c4bdb1ee4..66b3c56faae 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard.modules.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; class pdf_standard extends ModelePDFEvaluation { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -268,7 +268,6 @@ class pdf_standard extends ModelePDFEvaluation } $iniY = $tab_top + 7; - $initialY = $tab_top + 7; $nexY = $tab_top + 7; $pdf->setTopMargin($tab_top_newpage); @@ -454,7 +453,7 @@ class pdf_standard extends ModelePDFEvaluation * @param Evaluation $object Object to show * @param int $linenumber line number * @param int $curY current y position - * @param int $default_font_size default siez of font + * @param int $default_font_size default font size * @param Translate $outputlangs Object lang for output * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines) * @return void @@ -583,7 +582,7 @@ class pdf_standard extends ModelePDFEvaluation // Sender properties $carac_emetteur = ''; - // employee informations + // employee information $employee = new User($this->db); $employee->fetch($object->fk_user); $carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('Employee').' : '.$outputlangs->convToOutputCharset(ucfirst($employee->firstname) . ' ' . strtoupper($employee->lastname)); @@ -611,7 +610,7 @@ class pdf_standard extends ModelePDFEvaluation /*$pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($posx, $posy - 5); - $pdf->MultiCell(190, 5, $outputlangs->transnoentities("Informations"), '', 'L');*/ + $pdf->MultiCell(190, 5, $outputlangs->transnoentities("Information"), '', 'L');*/ $pdf->SetXY($posx, $posy); $pdf->SetFillColor(224, 224, 224); $pdf->MultiCell(190, $hautcadre, "", 0, 'R', 1); diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 124fe9f7bbc..cbade8098ee 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -66,7 +66,7 @@ class ImportCsv extends ModeleImports public $handle; // Handle fichier - public $cacheconvert = array(); // Array to cache list of value found after a convertion + public $cacheconvert = array(); // Array to cache list of value found after a conversion public $cachefieldtable = array(); // Array to cache list of value found into fields@tables @@ -254,18 +254,18 @@ class ImportCsv extends ModeleImports if (getDolGlobalString('IMPORT_CSV_FORCE_CHARSET')) { // Forced charset if (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8') { $newarrayres[$key]['val'] = $val; - $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null + $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we consider it's null } else { $newarrayres[$key]['val'] = mb_convert_encoding($val, 'UTF-8', 'ISO-8859-1'); - $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null + $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we consider it's null } } else { // Autodetect format (UTF8 or ISO) if (utf8_check($val)) { $newarrayres[$key]['val'] = $val; - $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null + $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we consider it's null } else { $newarrayres[$key]['val'] = mb_convert_encoding($val, 'UTF-8', 'ISO-8859-1'); - $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we considere it's null + $newarrayres[$key]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we consider it's null } } } @@ -917,7 +917,7 @@ class ImportCsv extends ModeleImports // This is required when updating table with some extrafields. When inserting a record in parent table, we can make // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record // may already exists. So we rescan the extrafield table to know if record exists or not for the rowid. - // Note: For extrafield tablename, we have in importfieldshidden_array an enty 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object' + // Note: For extrafield tablename, we have in importfieldshidden_array an entry 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object' $sqlSelect = "SELECT rowid FROM ".$tablename; if (empty($keyfield)) { diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 14e4b561eae..badf9469140 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -70,7 +70,7 @@ class ImportXlsx extends ModeleImports public $handle; // Handle fichier - public $cacheconvert = array(); // Array to cache list of value found after a convertion + public $cacheconvert = array(); // Array to cache list of value found after a conversion public $cachefieldtable = array(); // Array to cache list of value found into fields@tables @@ -959,7 +959,7 @@ class ImportXlsx extends ModeleImports // This is required when updating table with some extrafields. When inserting a record in parent table, we can make // a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record // may already exists. So we rescan the extrafield table to know if record exists or not for the rowid. - // Note: For extrafield tablename, we have in importfieldshidden_array an enty 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object' + // Note: For extrafield tablename, we have in importfieldshidden_array an entry 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object' $sqlSelect = "SELECT rowid FROM " . $tablename; diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 9017e81aa14..19339df0ead 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -30,7 +30,7 @@ class mailing_advthirdparties extends MailingTargets public $desc = "Third parties"; public $require_admin = 0; - public $require_module = array("none"); // This module should not be displayed as Selector in mailling + public $require_module = array("none"); // This module should not be displayed as Selector in mailing /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png @@ -188,7 +188,7 @@ class mailing_advthirdparties extends MailingTargets */ public function getSqlArrayForStats() { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optional //var $statssql=array(); //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index ac1e6979217..bbe821716f0 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -391,7 +391,7 @@ class mailing_contacts1 extends MailingTargets if (empty($this->evenunsubscribe)) { $sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = sp.email and mu.entity = ".((int) $conf->entity).")"; } - // Exclude unsubscribed email adresses + // Exclude unsubscribed email addresses $sql .= " AND sp.statut = 1"; $sql .= " AND sp.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; diff --git a/htdocs/core/modules/mailings/eventorganization.modules.php b/htdocs/core/modules/mailings/eventorganization.modules.php index 006405f63c8..0c578cb055d 100644 --- a/htdocs/core/modules/mailings/eventorganization.modules.php +++ b/htdocs/core/modules/mailings/eventorganization.modules.php @@ -141,7 +141,7 @@ class mailing_eventorganization extends MailingTargets */ public function getSqlArrayForStats() { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optional //var $statssql=array(); //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 06fb4f6125a..7a8d2d86f44 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; class MailingTargets // This can't be abstract as it is used for some method { /** - * @var DoliDb Database handler (result of a new DoliDB) + * @var DoliDB Database handler (result of a new DoliDB) */ public $db; diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php index 739ef8c52f8..ef64329899a 100644 --- a/htdocs/core/modules/mailings/partnership.modules.php +++ b/htdocs/core/modules/mailings/partnership.modules.php @@ -163,7 +163,7 @@ class mailing_partnership extends MailingTargets */ public function getSqlArrayForStats() { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optional //var $statssql=array(); //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 9dc1c18f696..5cf555762d7 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -71,7 +71,7 @@ class mailing_pomme extends MailingTargets $sql = "SELECT '".$this->db->escape($langs->trans("DolibarrUsers"))."' as label,"; $sql .= " count(distinct(u.email)) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test + $sql .= " WHERE u.email != ''"; // u.email IS NOT NULL est implicit dans ce test $sql .= " AND u.entity IN (0,".$conf->entity.")"; $statssql[0] = $sql; @@ -94,7 +94,7 @@ class mailing_pomme extends MailingTargets $sql = "SELECT count(distinct(u.email)) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE u.email != ''"; // u.email IS NOT NULL est implicite dans ce test + $sql .= " WHERE u.email != ''"; // u.email IS NOT NULL est implicit dans ce test $sql .= " AND u.entity IN (0,".$conf->entity.")"; if (empty($this->evenunsubscribe)) { $sql .= " AND NOT EXISTS (SELECT rowid FROM ".MAIN_DB_PREFIX."mailing_unsubscribe as mu WHERE mu.email = u.email and mu.entity = ".((int) $conf->entity).")"; @@ -167,7 +167,7 @@ class mailing_pomme extends MailingTargets $sql = "SELECT u.rowid as id, u.email as email, null as fk_contact,"; $sql .= " u.lastname, u.firstname as firstname, u.civility as civility_id, u.login, u.office_phone"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test + $sql .= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicit dans ce test $sql .= " AND u.entity IN (0,".$conf->entity.")"; $sql .= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; if (GETPOSTISSET("filter") && GETPOST("filter") == '1') { @@ -176,7 +176,7 @@ class mailing_pomme extends MailingTargets if (GETPOSTISSET("filter") && GETPOST("filter") == '0') { $sql .= " AND u.statut=0"; } - if (GETPOSTISSET("filteremployee") && GETPOSt("filteremployee") == '1') { + if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '1') { $sql .= " AND u.employee=1"; } if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '0') { diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index b11f80712ec..52882aeb856 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -230,7 +230,7 @@ class mailing_thirdparties extends MailingTargets */ public function getSqlArrayForStats() { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optional //var $statssql=array(); //$this->statssql[0]="SELECT field1 as label, count(distinct(email)) as nb FROM mytable WHERE email IS NOT NULL"; diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index e1eed1ffb6d..55c5ce0bc54 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -164,7 +164,7 @@ class mailing_xinputfile extends MailingTargets if (!empty($buffer)) { //print 'xx'.dol_strlen($buffer).empty($buffer)."
    \n"; - if (isValidEMail($email)) { + if (isValidEmail($email)) { if ($old != $email) { $cibles[$j] = array( 'email' => $email, diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index a141cb7881e..1f1a7cb5aa8 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -135,7 +135,7 @@ class mailing_xinputuser extends MailingTargets $cibles = array(); if (!empty($email)) { - if (isValidEMail($email)) { + if (isValidEmail($email)) { $cibles[] = array( 'email' => $email, 'lastname' => $lastname, diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index fb8d7d1e378..827449ebb5f 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -298,7 +298,7 @@ class doc_generic_member_odt extends ModelePDFMember $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index f2c023564c1..bf521d58c42 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -262,7 +262,7 @@ class pdf_standard extends CommonStickerGenerator /** * Function to build PDF on disk, then output on HTTP stream. * - * @param Adherent $object Member object. Old usage: Array of record informations (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>) + * @param Adherent $object Member object. Old usage: Array of record information (array('textleft'=>,'textheader'=>, ...'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file. Example: '5161', 'AVERYC32010', 'CARD', ... * @param string $mode Tell if doc module is called for 'member', ... @@ -418,7 +418,7 @@ class pdf_standard extends CommonStickerGenerator $pdf->SetAutoPageBreak(false); $this->_Metric_Doc = $this->Tformat['metric']; - // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja servie + // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja service $posX = 1; $posY = 1; if ($posX > 0) { diff --git a/htdocs/core/modules/member/modules_member.class.php b/htdocs/core/modules/member/modules_member.class.php index 984ce4fa295..897bdd03086 100644 --- a/htdocs/core/modules/member/modules_member.class.php +++ b/htdocs/core/modules/member/modules_member.class.php @@ -59,7 +59,7 @@ abstract class ModelePDFMember extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de members + * Class mere des modeles de numerotation des references de members */ abstract class ModeleNumRefMembers extends CommonNumRefGenerator { diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index e19b6e244a6..956ebb3c3a5 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -147,7 +147,7 @@ class modAdherent extends DolibarrModules $this->const[$r][0] = "ADHERENT_MAILMAN_ADMIN_PASSWORD"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; - $this->const[$r][3] = "Mot de passe Admin des liste mailman"; + $this->const[$r][3] = "Password admin mailman lists"; $this->const[$r][4] = 0; $r++; @@ -207,9 +207,9 @@ class modAdherent extends DolibarrModules $r = 0; // $this->rights[$r][0] Id permission (unique tous modules confondus) - // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) + // $this->rights[$r][1] Libelle par default si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) // $this->rights[$r][2] Non utilise - // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut + // $this->rights[$r][3] 1=Permis par default, 0=Non permis par default // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index b74db69921b..94a0677fec0 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -125,9 +125,9 @@ class modAgenda extends DolibarrModules $r = 0; // $this->rights[$r][0] Id permission (unique tous modules confondus) - // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) + // $this->rights[$r][1] Libelle par default si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) // $this->rights[$r][2] Non utilise - // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut + // $this->rights[$r][3] 1=Permis par default, 0=Non permis par default // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code // $r++; diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 9621904ebe6..27af84dca96 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -106,7 +106,7 @@ class modApi extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index a0fb405887e..299b2564ec5 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -135,7 +135,7 @@ class modAsset extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 3a55acc8124..cfa5c7a650c 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -66,7 +66,7 @@ class modBanque extends DolibarrModules //------------- $this->config_page_url = array("bank.php"); - // Dependancies + // Dependencies $this->depends = array(); $this->requiredby = array("modComptabilite", "modAccounting", "modPrelevement"); $this->conflictwith = array(); diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index 861bca9c1d2..b6ac87127b3 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -81,22 +81,22 @@ class modBarcode extends DolibarrModules $this->rights[$r][0] = 301; // id de la permission $this->rights[$r][1] = 'Generate PDF sheets of barcodes'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'read'; $r++; $this->rights[$r][0] = 304; // id de la permission $this->rights[$r][1] = 'Read barcodes'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire_advance'; $r++; $this->rights[$r][0] = 305; // id de la permission $this->rights[$r][1] = 'Create/modify barcodes'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer_advance'; $r++; diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 18d38c7c63a..eb91bf4ef47 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -65,7 +65,7 @@ class modBlockedLog extends DolibarrModules //------------- $this->config_page_url = array('blockedlog.php?withtab=1@blockedlog'); - // Dependancies + // Dependencies //------------- $this->hidden = false; // A condition to disable module $this->depends = array('always'=>'modFacture'); // List of modules id that must be enabled if this module is enabled diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index c3b642626a9..2832ec9da99 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -155,7 +155,7 @@ class modBom extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index b1fb1c7ecdf..a11bff28ed5 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -179,7 +179,7 @@ class modBookCal extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in customer order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modBookmark.class.php b/htdocs/core/modules/modBookmark.class.php index 80e7675fd97..2dca829e7d1 100644 --- a/htdocs/core/modules/modBookmark.class.php +++ b/htdocs/core/modules/modBookmark.class.php @@ -56,7 +56,7 @@ class modBookmark extends DolibarrModules // Data directories to create when module is enabled $this->dirs = array(); - // Dependancies + // Dependencies $this->depends = array(); $this->requiredby = array(); $this->langfiles = array("bookmarks"); @@ -80,22 +80,22 @@ class modBookmark extends DolibarrModules $r++; $this->rights[$r][0] = 331; // id de la permission $this->rights[$r][1] = 'Lire les bookmarks'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 332; // id de la permission $this->rights[$r][1] = 'Creer/modifier les bookmarks'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 333; // id de la permission $this->rights[$r][1] = 'Supprimer les bookmarks'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 00343e438e4..43c92e4810c 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -90,21 +90,21 @@ class modCategorie extends DolibarrModules $this->rights[$r][0] = 241; // id de la permission $this->rights[$r][1] = 'Lire les categories'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecated) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 242; // id de la permission $this->rights[$r][1] = 'Creer/modifier les categories'; // libelle de la permission $this->rights[$r][2] = 'w'; // type de la permission (deprecated) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 243; // id de la permission $this->rights[$r][1] = 'Supprimer les categories'; // libelle de la permission $this->rights[$r][2] = 'd'; // type de la permission (deprecated) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php index f4edbee6c3f..d08a8438954 100644 --- a/htdocs/core/modules/modCollab.class.php +++ b/htdocs/core/modules/modCollab.class.php @@ -63,7 +63,7 @@ class modCollab extends DolibarrModules //------------- $this->config_page_url = array(/*'collab.php'*/); - // Dependancies + // Dependencies //------------- $this->hidden = getDolGlobalString('MODULE_COLLAB_DISABLED'); // A condition to disable module $this->depends = array(); // List of modules id that must be enabled if this module is enabled diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 2d626adc396..eb276ea8c3d 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -67,7 +67,7 @@ class modCommande extends DolibarrModules // Config pages $this->config_page_url = array("commande.php"); - // Dependancies + // Dependencies $this->depends = array("modSociete"); $this->requiredby = array("modExpedition"); $this->conflictwith = array(); diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index c11dd5ce047..44d9962ef6c 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -64,7 +64,7 @@ class modCron extends DolibarrModules //------------- $this->config_page_url = array("cron.php@cron"); - // Dependancies + // Dependencies //------------- $this->hidden = getDolGlobalString('MODULE_CRON_DISABLED'); // A condition to disable module $this->depends = array(); // List of modules id that must be enabled if this module is enabled diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 97fc2642874..c8eed3a7c34 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -29,7 +29,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; // The class name should start with a lower case mod for Dolibarr to pick it up -// so we ignore the Squiz.Classes.ValidClassName.NotCamelCaps rule. +// so we ignore the Squiz.Class.ValidClassName.NotCamelCaps rule. // @codingStandardsIgnoreStart /** * Description and activation class for module datapolicy @@ -160,7 +160,7 @@ class modDataPolicy extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index 3f0faf48949..f699b0e5e94 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -129,7 +129,7 @@ class modDav extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index 590c29e03ad..c8feb86fc19 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -49,7 +49,7 @@ class modDebugBar extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "A tool for developper adding a debug bar in your browser."; + $this->description = "A tool for developer adding a debug bar in your browser."; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); @@ -80,8 +80,8 @@ class modDebugBar extends DolibarrModules $this->rights[1][0] = 431; // id de la permission $this->rights[1][1] = 'Use Debug Bar'; // libelle de la permission - $this->rights[1][2] = 'u'; // type de la permission (deprecie a ce jour) - $this->rights[1][3] = 0; // La permission est-elle une permission par defaut + $this->rights[1][2] = 'u'; // type de la permission (deprecated) + $this->rights[1][3] = 0; // La permission est-elle une permission par default $this->rights[1][4] = 'read'; } diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index c3e8fd96f52..0ff36b2e4fb 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -17,7 +17,7 @@ */ /** - * \defgroup deplacement Module trips + * \defgroup deplacement Module traves * \brief Module pour gerer les deplacements et notes de frais * \file htdocs/core/modules/modDeplacement.class.php * \ingroup deplacement @@ -62,7 +62,7 @@ class modDeplacement extends DolibarrModules $this->config_page_url = array(); $this->langfiles = array("companies", "trips"); - // Dependancies + // Dependencies $this->depends = array(); $this->requiredby = array(); @@ -77,7 +77,7 @@ class modDeplacement extends DolibarrModules $this->rights_class = 'deplacement'; $this->rights[1][0] = 171; - $this->rights[1][1] = 'Lire ses notes de frais et deplacements et celles de sa hierarchy'; + $this->rights[1][1] = 'View own expense and travel reports, and its hierarchy'; $this->rights[1][2] = 'r'; $this->rights[1][3] = 0; $this->rights[1][4] = 'lire'; diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 30497f7c698..48428e3f326 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -58,7 +58,7 @@ class modDon extends DolibarrModules // Data directories to create when module is enabled $this->dirs = array("/don/temp"); - // Dependancies + // Dependencies $this->depends = array(); $this->requiredby = array(); diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php index a6575ee9dd4..f580c18ef30 100644 --- a/htdocs/core/modules/modDynamicPrices.class.php +++ b/htdocs/core/modules/modDynamicPrices.class.php @@ -59,7 +59,7 @@ class modDynamicPrices extends DolibarrModules //------------- $this->config_page_url = array("dynamic_prices.php@product"); - // Dependancies + // Dependencies //------------- $this->depends = array(); $this->requiredby = array(); diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index cf9f0dbc5f1..1912c92827b 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -127,7 +127,7 @@ class modEmailCollector extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 5bcf2f77bac..0f709e1ccad 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -168,7 +168,7 @@ class modEventOrganization extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index b895b57bfc8..b1ce595d2ca 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -167,8 +167,8 @@ class modExpedition extends DolibarrModules $r++; $this->rights[$r][0] = 105; // id de la permission $this->rights[$r][1] = 'Envoyer les expeditions aux clients'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'shipping_advance'; $this->rights[$r][5] = 'send'; diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index d5ec3e34032..525760c6ac3 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -35,7 +35,7 @@ class modExpenseReport extends DolibarrModules /** * Constructor. Define names, constants, directories, boxes, permissions * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index eba11ac1089..ac84fd96b7b 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -18,7 +18,7 @@ /** * \defgroup externalrss Module externalrss - * \brief Module pour inclure des informations externes RSS + * \brief Module pour inclure des information externes RSS * \file htdocs/core/modules/modExternalRss.class.php * \ingroup externalrss * \brief Description and activation file for the module externalrss diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index bdb44069936..4c34316ade1 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -295,7 +295,7 @@ class modFournisseur extends DolibarrModules $r++; $this->rights[$r][0] = 1236; - $this->rights[$r][1] = 'Exporter les factures fournisseurs, attributs et reglements'; + $this->rights[$r][1] = 'Exporter les factures fournisseurs, attributes et reglements'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'facture'; diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 48491c5fbe5..927325431fd 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -140,7 +140,7 @@ class modHRM extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index 62b35b97662..cec8cfcc3fd 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -182,7 +182,7 @@ class modKnowledgeManagement extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 69678a85c29..8944a951c05 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -77,17 +77,17 @@ class modLabel extends DolibarrModules $this->rights[1][0] = 601; // id de la permission $this->rights[1][1] = 'Read stickers'; - $this->rights[1][3] = 0; // La permission est-elle une permission par defaut + $this->rights[1][3] = 0; // La permission est-elle une permission par default $this->rights[1][4] = 'lire'; $this->rights[2][0] = 602; // id de la permission $this->rights[2][1] = 'Create/modify stickers'; - $this->rights[2][3] = 0; // La permission est-elle une permission par defaut + $this->rights[2][3] = 0; // La permission est-elle une permission par default $this->rights[2][4] = 'creer'; $this->rights[4][0] = 609; // id de la permission $this->rights[4][1] = 'Delete stickers'; - $this->rights[4][3] = 0; // La permission est-elle une permission par defaut + $this->rights[4][3] = 0; // La permission est-elle une permission par default $this->rights[4][4] = 'supprimer'; } diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index f4b883763e4..626c8e7c0ca 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -93,8 +93,8 @@ class modMailing extends DolibarrModules $r++; $this->rights[$r][0] = 221; // id de la permission $this->rights[$r][1] = 'Consulter les mailings'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 6c8dfda12c9..3f88584d3bf 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -127,22 +127,22 @@ class modMargin extends DolibarrModules $r++; $this->rights[$r][0] = 59001; // id de la permission $this->rights[$r][1] = 'Visualiser les marges'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'liretous'; $r++; $this->rights[$r][0] = 59002; // id de la permission $this->rights[$r][1] = 'Définir les marges'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 59003; // id de la permission $this->rights[$r][1] = 'Read every user margin'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'read'; $this->rights[$r][5] = 'all'; } diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index 2139c2f0a91..dd0715b4e7e 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -166,7 +166,7 @@ class modMrp extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 20ae486d46c..a93f386af8e 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -111,7 +111,7 @@ class modMultiCurrency extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 0a6e8d0b23e..fcfa34e3fa9 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -87,9 +87,9 @@ class modOauth extends DolibarrModules $r = 0; // $this->rights[$r][0] Id permission (unique tous modules confondus) - // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) + // $this->rights[$r][1] Libelle par default si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) // $this->rights[$r][2] Non utilise - // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut + // $this->rights[$r][3] 1=Permis par default, 0=Non permis par default // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index f8fa512c36e..be6da6264f2 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -197,7 +197,7 @@ class modPartnership extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index 27f87ea87c4..5feb71c96e4 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -86,9 +86,9 @@ class modPrinting extends DolibarrModules $r = 0; // $this->rights[$r][0] Id permission (unique tous modules confondus) - // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) + // $this->rights[$r][1] Libelle par default si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) // $this->rights[$r][2] Non utilise - // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut + // $this->rights[$r][3] 1=Permis par default, 0=Non permis par default // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index be44400b1d7..35a75ca1345 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -115,30 +115,30 @@ class modProduct extends DolibarrModules $this->rights[$r][0] = 31; // id de la permission $this->rights[$r][1] = 'Read products'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 32; // id de la permission $this->rights[$r][1] = 'Create/modify products'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 33; // id de la permission $this->rights[$r][1] = 'Read prices products'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'product_advance'; $this->rights[$r][5] = 'read_prices'; $r++; $this->rights[$r][0] = 34; // id de la permission $this->rights[$r][1] = 'Delete products'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 27606feb190..e289dcf1713 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -53,7 +53,7 @@ class modProjet extends DolibarrModules $this->module_position = '14'; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "Gestion des projets"; + $this->description = "Gestion des projects"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; @@ -142,60 +142,60 @@ class modProjet extends DolibarrModules $r++; $this->rights[$r][0] = 41; // id de la permission $this->rights[$r][1] = "Read projects and tasks (shared projects or projects I am contact for)"; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 42; // id de la permission $this->rights[$r][1] = "Create/modify projects and tasks (shared projects or projects I am contact for)"; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 44; // id de la permission $this->rights[$r][1] = "Delete project and tasks (shared projects or projects I am contact for)"; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; $this->rights[$r][0] = 45; // id de la permission $this->rights[$r][1] = "Export projects"; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'export'; $r++; $this->rights[$r][0] = 141; // id de la permission $this->rights[$r][1] = "Read all projects and tasks (also private projects I am not contact for)"; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'lire'; $r++; $this->rights[$r][0] = 142; // id de la permission $this->rights[$r][1] = "Create/modify all projects and tasks (also private projects I am not contact for)"; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'creer'; $r++; $this->rights[$r][0] = 144; // id de la permission $this->rights[$r][1] = "Delete all projects and tasks (also private projects I am not contact for)"; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'all'; $this->rights[$r][5] = 'supprimer'; $r++; $this->rights[$r][0] = 145; // id de la permission $this->rights[$r][1] = "Can enter time consumed on assigned tasks (timesheet)"; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'time'; // Menus diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 18d29d64324..48c733a76b3 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -131,53 +131,53 @@ class modPropale extends DolibarrModules $r++; $this->rights[$r][0] = 21; // id de la permission $this->rights[$r][1] = 'Read commercial proposals'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 22; // id de la permission $this->rights[$r][1] = 'Create and update commercial proposals'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 24; // id de la permission $this->rights[$r][1] = 'Validate commercial proposals'; // Validate proposal - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'propal_advance'; $this->rights[$r][5] = 'validate'; $r++; $this->rights[$r][0] = 25; // id de la permission $this->rights[$r][1] = 'Send commercial proposals to customers'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'propal_advance'; $this->rights[$r][5] = 'send'; $r++; $this->rights[$r][0] = 26; // id de la permission $this->rights[$r][1] = 'Close commercial proposals'; // Set proposal to signed or refused - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'propal_advance'; $this->rights[$r][5] = 'close'; $r++; $this->rights[$r][0] = 27; // id de la permission $this->rights[$r][1] = 'Delete commercial proposals'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; $this->rights[$r][0] = 28; // id de la permission $this->rights[$r][1] = 'Exporting commercial proposals and attributes'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'export'; diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 4e544f0cf79..ae755358000 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -87,9 +87,9 @@ class modReceiptPrinter extends DolibarrModules $r = 0; // $this->rights[$r][0] Id permission (unique tous modules confondus) - // $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) + // $this->rights[$r][1] Libelle par default si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission) // $this->rights[$r][2] Non utilise - // $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut + // $this->rights[$r][3] 1=Permis par default, 0=Non permis par default // $this->rights[$r][4] Niveau 1 pour nommer permission dans code // $this->rights[$r][5] Niveau 2 pour nommer permission dans code diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index bd66a1db3f0..f5f8429f5db 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -136,8 +136,8 @@ class modReception extends DolibarrModules $r++; $this->rights[$r][0] = $this->numero.$r; // id de la permission $this->rights[$r][1] = 'Envoyer les receptions aux clients'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'reception_advance'; $this->rights[$r][5] = 'send'; diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index c33c9a5daa6..c8c5b623845 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -175,7 +175,7 @@ class modRecruitment extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index acca9803b2d..49b1ed8f19d 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -123,7 +123,7 @@ class modResource extends DolibarrModules // 'product' to add a tab in product view // 'stock' to add a tab in stock view // 'propal' to add a tab in propal view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'contract' to add a tab in contract view // 'user' to add a tab in user view // 'group' to add a tab in group view diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 7062dac67eb..d4e7dffe945 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -89,30 +89,30 @@ class modService extends DolibarrModules $this->rights[$r][0] = 531; // id de la permission $this->rights[$r][1] = 'Read services'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 532; // id de la permission $this->rights[$r][1] = 'Create/modify services'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 533; // id de la permission $this->rights[$r][1] = 'Read prices services'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'service_advance'; $this->rights[$r][5] = 'read_prices'; $r++; $this->rights[$r][0] = 534; // id de la permission $this->rights[$r][1] = 'Delete les services'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index e4f34e432ec..7c1edc59adb 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -138,8 +138,8 @@ class modSociete extends DolibarrModules $r++; $this->rights[$r][0] = 121; // id de la permission $this->rights[$r][1] = 'Read third parties'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; /*$r++; @@ -162,8 +162,8 @@ class modSociete extends DolibarrModules $r++; $this->rights[$r][0] = 122; // id de la permission $this->rights[$r][1] = 'Create and update third parties'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; /* $r++; @@ -186,15 +186,15 @@ class modSociete extends DolibarrModules $r++; $this->rights[$r][0] = 125; // id de la permission $this->rights[$r][1] = 'Delete third parties'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; $this->rights[$r][0] = 126; // id de la permission $this->rights[$r][1] = 'Export third parties'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'export'; $r++; @@ -226,32 +226,32 @@ class modSociete extends DolibarrModules $r++; $this->rights[$r][0] = 281; // id de la permission $this->rights[$r][1] = 'Read contacts'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'contact'; $this->rights[$r][5] = 'lire'; $r++; $this->rights[$r][0] = 282; // id de la permission $this->rights[$r][1] = 'Create and update contact'; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'contact'; $this->rights[$r][5] = 'creer'; $r++; $this->rights[$r][0] = 283; // id de la permission $this->rights[$r][1] = 'Delete contacts'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'contact'; $this->rights[$r][5] = 'supprimer'; $r++; $this->rights[$r][0] = 286; // id de la permission $this->rights[$r][1] = 'Export contacts'; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'contact'; $this->rights[$r][5] = 'export'; @@ -868,7 +868,7 @@ class modSociete extends DolibarrModules 'sr.default_rib' => 'Default', 'sr.rum' => 'RUM', 'sr.frstrecur' => "WithdrawMode", - 'sr.type' => "Type ban is defaut", + 'sr.type' => "Type ban is default", ); $this->import_convertvalue_array[$r] = array( diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index b22f164d6a3..19deac068ba 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -102,7 +102,7 @@ class modStock extends DolibarrModules $r++; $this->const[$r][0] = "MOUVEMENT_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/stocks/mouvements"; + $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/stocks/movements"; $this->const[$r][3] = ""; $this->const[$r][4] = 0; @@ -135,14 +135,14 @@ class modStock extends DolibarrModules $this->rights[2][5] = ''; $this->rights[3][0] = 1004; - $this->rights[3][1] = 'Lire mouvements de stocks'; + $this->rights[3][1] = 'Lire movements de stocks'; $this->rights[3][2] = 'r'; $this->rights[3][3] = 0; $this->rights[3][4] = 'mouvement'; $this->rights[3][5] = 'lire'; $this->rights[4][0] = 1005; - $this->rights[4][1] = 'Creer/modifier mouvements de stocks'; + $this->rights[4][1] = 'Creer/modifier movements de stocks'; $this->rights[4][2] = 'w'; $this->rights[4][3] = 0; $this->rights[4][4] = 'mouvement'; diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index 652ba0480c9..73e4a7c9397 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -157,7 +157,7 @@ class modStockTransfer extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view @@ -440,21 +440,21 @@ class modStockTransfer extends DolibarrModules $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsable du transfert de stocks", 1, NULL, 0)'); + $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsible for stock transfers", 1, NULL, 0)'); } $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STFROM" AND element = "StockTransfer" AND source = "external"'); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact expéditeur transfert de stocks", 1, NULL, 0)'); + $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact sending the stock transfer", 1, NULL, 0)'); } $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "external"'); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact destinataire transfert de stocks", 1, NULL, 0)'); + $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact receiving the stock transfer", 1, NULL, 0)'); } return $this->_init($sql, $options); diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index ae1e47c0d8e..d7c7941d08b 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -107,37 +107,37 @@ class modSupplierProposal extends DolibarrModules $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Read supplier proposals'; // libelle de la permission - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Create/modify supplier proposals'; // libelle de la permission - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Validate supplier proposals'; // libelle de la permission - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'validate_advance'; $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Envoyer les demandes fournisseurs'; // libelle de la permission - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'send_advance'; $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Delete supplier proposals'; // libelle de la permission - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'supprimer'; $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Close supplier price requests'; // libelle de la permission - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'cloturer'; // Main menu entries diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index 06b5b79dbf3..383996d4345 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -142,7 +142,7 @@ class modTakePos extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view @@ -283,7 +283,7 @@ class modTakePos extends DolibarrModules $societe->client = 1; $societe->code_client = -1; $societe->code_fournisseur = -1; - $societe->note_private = "Default customer automaticaly created by Point Of Sale module activation. Can be used as the default generic customer in the Point Of Sale setup. Can also be edited or removed if you don't need a generic customer."; + $societe->note_private = "Default customer automatically created by Point Of Sale module activation. Can be used as the default generic customer in the Point Of Sale setup. Can also be edited or removed if you don't need a generic customer."; $searchcompanyid = $societe->create($user); } @@ -295,11 +295,11 @@ class modTakePos extends DolibarrModules } } - //Create category if not exists + // Create product category DefaultPOSCatLabel if not exists $categories = new Categorie($this->db); $cate_arbo = $categories->get_full_arbo('product', 0, 1); if (is_array($cate_arbo)) { - if (!count($cate_arbo)) { + if (!count($cate_arbo) || !getDolGlobalString('TAKEPOS_ROOT_CATEGORY_ID')) { $category = new Categorie($this->db); $category->label = $langs->trans("DefaultPOSCatLabel"); @@ -308,6 +308,8 @@ class modTakePos extends DolibarrModules $result = $category->create($user); if ($result > 0) { + dolibarr_set_const($this->db, 'TAKEPOS_ROOT_CATEGORY_ID', $result, 'chaine', 0, 'Id of category for products visible in TakePOS', $conf->entity); + /* TODO Create a generic product only if there is no product yet. If 0 product, we create 1. If there is already product, it is better to show a message to ask to add product in the category */ /* $product = new Product($this->db); @@ -323,7 +325,7 @@ class modTakePos extends DolibarrModules } } - //Create cash account if not exists + // Create cash account CASH-POS / DefaultCashPOSLabel if not exists if (!getDolGlobalInt('CASHDESK_ID_BANKACCOUNT_CASH1')) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $cashaccount = new Account($this->db); diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index a5b318d1a2d..667320cdd76 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -22,7 +22,7 @@ /** * \defgroup tax Module taxes - * \brief Module pour inclure des fonctions de saisies des taxes (tva) et charges sociales + * \brief Module pour inclure des functions de saisies des taxes (tva) et charges sociales * \file htdocs/core/modules/modTax.class.php * \ingroup tax * \brief Description and activation file for the module taxes diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 7061a3a9a57..c4539befe3f 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -184,44 +184,44 @@ class modTicket extends DolibarrModules $r = 0; $this->rights[$r][0] = 56001; // id de la permission $this->rights[$r][1] = "Read ticket"; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'read'; $r++; $this->rights[$r][0] = 56002; // id de la permission $this->rights[$r][1] = "Create les tickets"; // libelle de la permission - $this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'w'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'write'; $r++; $this->rights[$r][0] = 56003; // id de la permission $this->rights[$r][1] = "Delete les tickets"; // libelle de la permission - $this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'delete'; $r++; $this->rights[$r][0] = 56004; // id de la permission $this->rights[$r][1] = "Manage tickets"; // libelle de la permission - //$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + //$this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'manage'; $r++; $this->rights[$r][0] = 56006; // id de la permission $this->rights[$r][1] = "Export ticket"; // libelle de la permission - //$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + //$this->rights[$r][2] = 'd'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'export'; /* Seems not used and in conflict with societe->client->voir (see all thirdparties) $r++; $this->rights[$r][0] = 56005; // id de la permission $this->rights[$r][1] = 'See all tickets, even if not assigned to (not effective for external users, always restricted to the thirdpardy they depends on)'; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'view'; $this->rights[$r][5] = 'all'; */ diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index 40c6bfeec1a..d8e5ac36c34 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -181,7 +181,7 @@ class modWebhook extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index bd37c5cceeb..becde5af45c 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -108,8 +108,8 @@ class modWorkflow extends DolibarrModules $r++; $this->rights[$r][0] = 6001; // id de la permission $this->rights[$r][1] = "Lire les workflow"; // libelle de la permission - $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut + $this->rights[$r][2] = 'r'; // type de la permission (deprecated) + $this->rights[$r][3] = 0; // La permission est-elle une permission par default $this->rights[$r][4] = 'read'; */ diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index f7c0919f930..8fa1503a1ae 100644 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -165,7 +165,7 @@ class modWorkstation extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index c89a9603365..b732329f166 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -170,7 +170,7 @@ class modZapier extends DolibarrModules // 'intervention' to add a tab in intervention view // 'invoice' to add a tab in customer invoice view // 'invoice_supplier' to add a tab in supplier invoice view - // 'member' to add a tab in fundation member view + // 'member' to add a tab in foundation member view // 'opensurveypoll' to add a tab in opensurvey poll view // 'order' to add a tab in sales order view // 'order_supplier' to add a tab in supplier order view diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 4d9a837cf5c..0e91c19feda 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -530,7 +530,7 @@ class pdf_standard extends ModelePDFMovement $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // $objp = $this->db->fetch_object($resql); @@ -579,7 +579,7 @@ class pdf_standard extends ModelePDFMovement $pdf->SetXY($this->posxlabel + 0.8, $curY); $pdf->MultiCell($this->posxqty - $this->posxlabel - 0.8, 6, $productstatic->label, 0, 'L'); - // Lot/serie + // Lot/series $pdf->SetXY($this->posxqty, $curY); $pdf->MultiCell($this->posxup - $this->posxqty - 0.8, 3, $productlot->batch, 0, 'R'); @@ -587,7 +587,7 @@ class pdf_standard extends ModelePDFMovement $pdf->SetXY($this->posxup, $curY); $pdf->MultiCell($this->posxunit - $this->posxup - 0.8, 3, $objp->inventorycode, 0, 'R'); - // Label mouvement + // Label movement $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 3, $objp->label, 0, 'R'); $totalvalue += price2num($objp->ppmp * $objp->value, 'MT'); @@ -856,7 +856,7 @@ class pdf_standard extends ModelePDFMovement $pdf->MultiCell($this->posxqty - $this->posxlabel, 2, $outputlangs->transnoentities("Label"), '', 'C'); } - //Lot/serie Product + //Lot/series Product //$pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqty, $tab_top + 1); @@ -870,11 +870,11 @@ class pdf_standard extends ModelePDFMovement $pdf->MultiCell($this->posxunit - $this->posxup, 2, $outputlangs->transnoentities("Inventory Code"), '', 'C'); } - //Label mouvement + //Label movement //$pdf->line($this->posxunit, $tab_top, $this->posxunit, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxunit, $tab_top + 1); - $pdf->MultiCell($this->posxdiscount - $this->posxunit, 2, $outputlangs->transnoentities("Label Mouvement"), '', 'C'); + $pdf->MultiCell($this->posxdiscount - $this->posxunit, 2, $outputlangs->transnoentities("Label Movement"), '', 'C'); } //Origin diff --git a/htdocs/core/modules/movement/modules_movement.php b/htdocs/core/modules/movement/modules_movement.php index 0525793a715..1f95210055f 100644 --- a/htdocs/core/modules/movement/modules_movement.php +++ b/htdocs/core/modules/movement/modules_movement.php @@ -26,12 +26,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; /** - * Parent class to manage warehouse mouvement document templates + * Parent class to manage warehouse movement document templates */ abstract class ModelePDFMovement extends CommonDocGenerator { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index fe403dc402d..ced6b5f73a3 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -297,7 +297,7 @@ class doc_generic_mo_odt extends ModelePDFMo $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index bb507df6109..f77891d4635 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_vinci extends ModelePDFMo { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -116,7 +116,7 @@ class pdf_vinci extends ModelePDFMo } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support durring PDF transition: TODO remove this at the end + $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end } @@ -333,7 +333,7 @@ class pdf_vinci extends ModelePDFMo } - // apply note frame to previus pages + // apply note frame to previous pages $i = $pageposbeforenote; while ($i < $pageposafternote) { $pdf->setPage($i); @@ -565,7 +565,7 @@ class pdf_vinci extends ModelePDFMo $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Quantity // Enough for 6 chars @@ -739,7 +739,7 @@ class pdf_vinci extends ModelePDFMo * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) @@ -1350,18 +1350,18 @@ class pdf_vinci extends ModelePDFMo ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1383,7 +1383,7 @@ class pdf_vinci extends ModelePDFMo 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/oauth/github_oauthcallback.php b/htdocs/core/modules/oauth/github_oauthcallback.php index b1ccd2adabd..81ec4a4cd4c 100644 --- a/htdocs/core/modules/oauth/github_oauthcallback.php +++ b/htdocs/core/modules/oauth/github_oauthcallback.php @@ -128,7 +128,7 @@ if (GETPOST('code')) { // We are coming from oauth provider page //$token = $apiService->requestAccessToken(GETPOST('code'), $state); $token = $apiService->requestAccessToken(GETPOST('code')); - // Github is a service that does not need state to be stored as second paramater of requestAccessToken + // Github is a service that does not need state to be stored as second parameter of requestAccessToken // Into constructor of GitHub, the call // parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri) diff --git a/htdocs/core/modules/oauth/google_oauthcallback.php b/htdocs/core/modules/oauth/google_oauthcallback.php index b48f9ec54da..0c612e7dd4e 100644 --- a/htdocs/core/modules/oauth/google_oauthcallback.php +++ b/htdocs/core/modules/oauth/google_oauthcallback.php @@ -203,7 +203,7 @@ if (!GETPOST('code')) { $url .= '&login_hint='.urlencode(GETPOST('username')); } - // Check that the redirect_uri that wil be used is same than url of current domain + // Check that the redirect_uri that will be used is same than url of current domain // Define $urlwithroot global $dolibarr_main_url_root; @@ -283,7 +283,7 @@ if (!GETPOST('code')) { // Verify that email is a verified email /*if (empty($userinfo['email_verified'])) { - setEventMessages($langs->trans('Bad value for email, emai lwas not verified by Google'), null, 'errors'); + setEventMessages($langs->trans('Bad value for email, email lwas not verified by Google'), null, 'errors'); $errorincheck++; }*/ @@ -343,7 +343,7 @@ if (!GETPOST('code')) { } else { // If call back to url for a OAUTH2 login if ($forlogin) { - $_SESSION["dol_loginmesg"] = "Failed to login using Google. OAuth callback URL retreives a token with non valid data"; + $_SESSION["dol_loginmesg"] = "Failed to login using Google. OAuth callback URL retrieves a token with non valid data"; $errorincheck++; } } diff --git a/htdocs/core/modules/oauth/microsoft_oauthcallback.php b/htdocs/core/modules/oauth/microsoft_oauthcallback.php index fde5371380a..26b083b7c32 100644 --- a/htdocs/core/modules/oauth/microsoft_oauthcallback.php +++ b/htdocs/core/modules/oauth/microsoft_oauthcallback.php @@ -163,7 +163,7 @@ if (GETPOST('code') || GETPOST('error')) { // We are coming from oauth provi //$token = $apiService->requestAccessToken(GETPOST('code'), $state); $token = $apiService->requestAccessToken(GETPOST('code')); - // Microsoft is a service that does not need state to be stored as second paramater of requestAccessToken + // Microsoft is a service that does not need state to be stored as second parameter of requestAccessToken //print $token->getAccessToken().'

    '; //print $token->getExtraParams()['id_token'].'
    '; diff --git a/htdocs/core/modules/oauth/stripelive_oauthcallback.php b/htdocs/core/modules/oauth/stripelive_oauthcallback.php index ba0247d5915..b094b3314d2 100644 --- a/htdocs/core/modules/oauth/stripelive_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripelive_oauthcallback.php @@ -138,7 +138,7 @@ if (GETPOST('code')) { // We are coming from oauth provider page //$token = $apiService->requestAccessToken(GETPOST('code'), $state); $token = $apiService->requestAccessToken(GETPOST('code')); - // Stripe is a service that does not need state to be stored as second paramater of requestAccessToken + // Stripe is a service that does not need state to be stored as second parameter of requestAccessToken setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token diff --git a/htdocs/core/modules/oauth/stripetest_oauthcallback.php b/htdocs/core/modules/oauth/stripetest_oauthcallback.php index 2e54fcbc907..4f6e499c6d2 100644 --- a/htdocs/core/modules/oauth/stripetest_oauthcallback.php +++ b/htdocs/core/modules/oauth/stripetest_oauthcallback.php @@ -134,7 +134,7 @@ if (GETPOST('code')) { // We are coming from oauth provider page //$token = $apiService->requestAccessToken(GETPOST('code'), $state); $token = $apiService->requestAccessToken(GETPOST('code')); - // Stripe is a service that does not need state to be stored as second paramater of requestAccessToken + // Stripe is a service that does not need state to be stored as second parameter of requestAccessToken setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index 14ed5ae52cb..2381defc7b8 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -233,7 +233,7 @@ class printing_printgcp extends PrintingDriver $html .= '
    '; $html .= ''; $html .= ''; - // Defaut + // Default $html .= ''; $html .= ''; $html .= ''; - // Defaut + // Default $html .= ''."\n"; -// Customer Default Langauge +// Customer Default Language if (getDolGlobalInt('MAIN_MULTILANGS')) { print ' 0) $rightpart .= ' fieldrequired'; // No fieldrequired inthe view output + //if ($val['notnull'] > 0) $rightpart .= ' fieldrequired'; // No fieldrequired in the view output if ($val['type'] == 'text' || $val['type'] == 'html') { $rightpart .= ' tdtop'; } diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index d9b01c57bab..b917090f960 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -34,7 +34,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield } // If field is a computed field, we make computation to get value if ($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]) { - $objectoffield = $object; //For compatibily with the computed formula + $objectoffield = $object; //For compatibility with the computed formula $value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '2'); if (is_numeric(price2num($value)) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) { $obj->$tmpkey = price2num($value); diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index 0c3d98f03a6..ff858ef0d29 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -10,7 +10,7 @@ if (empty($extrafieldsobjectkey) && is_object($object)) { $extrafieldsobjectkey = $object->table_element; } -// Loop to complete the sql search criterias from extrafields +// Loop to complete the sql search criteria from extrafields if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($search_array_options)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... if (empty($extrafieldsobjectprefix)) { $extrafieldsobjectprefix = 'ef.'; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 073bd71f479..6f81ec20683 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -81,7 +81,6 @@ $php_self = preg_replace('/(\?|&|&)token=[^&]+/', '\1', $php_self); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second $arrayofjs = array( - '/includes/jstz/jstz.min.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)), '/core/js/dst.js'.(empty($conf->dol_use_jmobile) ? '' : '?version='.urlencode(DOL_VERSION)) ); diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 95538b90bc5..edeff7d71e1 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -295,7 +295,7 @@ if ($massaction == 'presend') { // Array of substitutions $formmail->substit = $substitutionarray; - // Tableau des parametres complementaires du post + // Tableau des parameters complementaires du post $formmail->param['action'] = $action; $formmail->param['models'] = $modelmail; // the filter to know which kind of template emails to show. 'none' means no template suggested. $formmail->param['models_id'] = GETPOST('modelmailselected', 'int') ? GETPOST('modelmailselected', 'int') : '-1'; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index c8a80fba260..c3647f5f316 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -295,7 +295,7 @@ if ($nolinesbefore) { } else { $ajaxoptions = array( // Disabled: This is useless because setting discount and price_ht after a selection is already managed - // by ths page itself with a .change on the combolist '#idprodfournprice' + // by this page itself with a .change on the combolist '#idprodfournprice' //'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key ); $alsoproductwithnosupplierprice = 1; @@ -498,7 +498,7 @@ if ($nolinesbefore) { situation_cycle_ref) && $this->situation_cycle_ref) { $coldisplay++; - print ''; + print ''; $coldisplay++; print ''; } @@ -676,7 +676,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100)); } - $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value + $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formatted value return true; } @@ -788,7 +788,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { console.log("objectline_create.tpl We are in a price per qty context, we do not call ajax/product, init of fields is done few lines later"); } else { - if (isNaN(pbq)) { console.log("We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we could not get the id of pbq from product combo list, so load of price may be 0 if product has differet prices"); } + if (isNaN(pbq)) { console.log("We use experimental option PRODUIT_CUSTOMER_PRICES_BY_QTY or PRODUIT_CUSTOMER_PRICES_BY_QTY but we could not get the id of pbq from product combo list, so load of price may be 0 if product has different prices"); } // Get the price for the product and display it console.log("Load unit price and set it into #price_ht or #price_ttc for product id="+$(this).val()+" socid=socid; ?>"); @@ -807,7 +807,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { $('#date_start').attr('mandatoryperiod', data.mandatory_period); $('#date_end').attr('mandatoryperiod', data.mandatory_period); - // service and we setted mandatory_period to true + // service and we set mandatory_period to true if (data.mandatory_period == 1 && data.type == 1) { jQuery('#date_start').addClass('inputmandatory'); jQuery('#date_end').addClass('inputmandatory'); @@ -876,7 +876,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { var proddesc = data.desc; - console.log("objectline_create.tpl Load desciption into text area : "+proddesc); + console.log("objectline_create.tpl Load description into text area : "+proddesc); if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") @@ -948,13 +948,13 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { { i++; this.price = parseFloat(this.price); // to fix when this.price >0 - // If margin is calculated on best supplier price, we set it by defaut (but only if value is not 0) + // If margin is calculated on best supplier price, we set it by default (but only if value is not 0) //console.log("id="+this.id+"-price="+this.price+"-"+(this.price > 0)); if (bestpricefound == 0 && this.price > 0) { defaultkey = this.id; defaultprice = this.price; bestpriceid = this.id; bestpricevalue = this.price; bestpricefound=1; } // bestpricefound is used to take the first price > 0 } if (this.id == 'pmpprice') { - // If margin is calculated on PMP, we set it by defaut (but only if value is not 0) + // If margin is calculated on PMP, we set it by default (but only if value is not 0) console.log("id="+this.id+"-price="+this.price); if ('pmp' == defaultbuyprice || 'costprice' == defaultbuyprice) { @@ -966,7 +966,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { } if (this.id == 'costprice') { - // If margin is calculated on Cost price, we set it by defaut (but only if value is not 0) + // If margin is calculated on Cost price, we set it by default (but only if value is not 0) console.log("id="+this.id+"-price="+this.price+"-pmppricevalue="+pmppricevalue); if ('costprice' == defaultbuyprice) { @@ -1115,7 +1115,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { var description = $('option:selected', this).attr('data-description'); if (typeof description == 'undefined') { description = jQuery('#idprodfournprice').attr('data-description'); } - console.log("Load desciption into text area : "+description); + console.log("Load description into text area : "+description); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index ca0d6d95f3b..948ee08ae50 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -143,7 +143,7 @@ $coldisplay++; } // Do not allow editing during a situation cycle - // but in some situations that is required (update legal informations for example) + // but in some situations that is required (update legal information for example) if (getDolGlobalString('INVOICE_SITUATION_CAN_FORCE_UPDATE_DESCRIPTION')) { $situationinvoicelinewithparent = 0; } @@ -178,7 +178,7 @@ $coldisplay++; } } - // Show autofill date for recuring invoices + // Show autofill date for recurring invoices if (isModEnabled("service") && $line->product_type == 1 && ($line->element == 'facturedetrec' || $line->element == 'invoice_supplier_det_rec')) { if ($line->element == 'invoice_supplier_det_rec') { $line->date_start_fill = $line->date_start; @@ -321,7 +321,7 @@ $coldisplay++; if ($user->hasRight('margins', 'creer')) { if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { $margin_rate = (GETPOSTISSET("np_marginRate") ? GETPOST("np_marginRate", "alpha", 2) : (($line->pa_ht == 0) ? '' : price($line->marge_tx))); - // if credit note, dont allow to modify margin + // if credit note, don't allow to modify margin if ($line->subprice < 0) { echo ''; } else { @@ -331,7 +331,7 @@ $coldisplay++; } if (getDolGlobalString('DISPLAY_MARK_RATES')) { $mark_rate = (GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : price($line->marque_tx)); - // if credit note, dont allow to modify margin + // if credit note, don't allow to modify margin if ($line->subprice < 0) { echo ''; } else { @@ -469,7 +469,7 @@ if (!empty($usemargins) && $user->hasRight('margins', 'creer')) { else if (npRate == "np_markRate") price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100)); } - $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value + $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formatted value return true; } @@ -515,11 +515,11 @@ jQuery(document).ready(function() if (isModEnabled('margin')) { ?> /* Add rule to clear margin when we change some data, so when we change sell or buy price, margin will be recalculated after submitting form */ - jQuery("#tva_tx").click(function() { /* somtimes field is a text, sometimes a combo */ + jQuery("#tva_tx").click(function() { /* sometimes field is a text, sometimes a combo */ jQuery("input[name='np_marginRate']:first").val(''); jQuery("input[name='np_markRate']:first").val(''); }); - jQuery("#tva_tx").keyup(function() { /* somtimes field is a text, sometimes a combo */ + jQuery("#tva_tx").keyup(function() { /* sometimes field is a text, sometimes a combo */ jQuery("input[name='np_marginRate']:first").val(''); jQuery("input[name='np_markRate']:first").val(''); }); diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 7d243729a09..199dc6aab77 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -342,7 +342,7 @@ if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // must also not be output for most entities (proposal, intervention, ...) //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; - print price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price + print price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formatting role of function price } else { print ' '; } diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 96eb6b0ee3d..5351f59c1b7 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -416,7 +416,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers //Compare array $diff_array = array_diff_assoc($qtyordred, $qtyshipped); if (count($diff_array) == 0) { - //No diff => mean everythings is shipped + //No diff => mean everything is shipped $ret = $order->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE'); if ($ret < 0) { $this->setErrorsFromObject($order); @@ -486,7 +486,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers //Compare array $diff_array = array_diff_assoc($qtyordred, $qtyshipped); if (count($diff_array) == 0) { - //No diff => mean everythings is received + //No diff => mean everything is received $ret = $order->setStatut(CommandeFournisseur::STATUS_RECEIVED_COMPLETELY, null, null, 'SUPPLIER_ORDER_CLOSE'); if ($ret < 0) { $this->setErrorsFromObject($order); diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index b4cd2d2ce53..c129095017f 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -1367,7 +1367,7 @@ class InterfaceActionsAuto extends DolibarrTriggers // TODO Merge all previous cases into this generic one // $action = PASSWORD, BILL_DELETE, TICKET_CREATE, TICKET_MODIFY, TICKET_DELETE, CONTACT_SENTBYMAIL, RECRUITMENTCANDIDATURE_MODIFY, ... // Can also be a value defined by an external module like SENTBYSMS, COMPANY_SENTBYSMS, MEMBER_SENTBYSMS, ... - // Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function). + // Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at beginning of this function). // Note that these key can be set in agenda setup, only if defined into llx_c_action_trigger if (!empty($object->context['actionmsg']) && empty($object->actionmsg)) { // For description $object->actionmsg = $object->context['actionmsg']; @@ -1458,9 +1458,9 @@ class InterfaceActionsAuto extends DolibarrTriggers $now = dol_now(); if (isset($_SESSION['listofnames-'.$object->trackid])) { - $attachs = $_SESSION['listofnames-'.$object->trackid]; - if ($attachs && strpos($action, 'SENTBYMAIL')) { - $object->actionmsg = dol_concatdesc($object->actionmsg, "\n".$langs->transnoentities("AttachedFiles").': '.$attachs); + $attachments = $_SESSION['listofnames-'.$object->trackid]; + if ($attachments && strpos($action, 'SENTBYMAIL')) { + $object->actionmsg = dol_concatdesc($object->actionmsg, "\n".$langs->transnoentities("AttachedFiles").': '.$attachments); } } diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index a515078bc70..87a46036fc9 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -67,7 +67,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers if (!getDolGlobalString('BLOCKEDLOG_ADD_ACTIONS_SUPPORTED') || !in_array($action, explode(',', getDolGlobalString('BLOCKEDLOG_ADD_ACTIONS_SUPPORTED')))) { // If custom actions are not set or if action not into custom actions, we can exclude action if object->elementis not valid $listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription', 'payment_various', 'cashcontrol'); - if (!in_array($object->element, $listofqualifiedelement)) { + if (!is_object($object) || !property_exists($object, 'element') || !in_array($object->element, $listofqualifiedelement)) { return 1; } } diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 7c484c49b49..ccd403aa611 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -260,7 +260,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers } } } elseif ($action == 'USERGROUP_CREATE') { - // Groupes + // Groups dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); if (getDolGlobalString('LDAP_SYNCHRO_ACTIVE') && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') === Ldap::SYNCHRO_DOLIBARR_TO_LDAP) { $ldap = new Ldap(); diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 8b992b79022..bea7284cb01 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -20,12 +20,12 @@ * \file htdocs/core/triggers/interface_80_modStripe_Stripe.class.php * \ingroup core * \brief Fichier - * \remarks Son propre fichier d'actions peut etre cree par recopie de celui-ci: - * - Le nom du fichier doit etre: interface_99_modMymodule_Mytrigger.class.php - * ou: interface_99_all_Mytrigger.class.php - * - Le fichier doit rester stocke dans core/triggers - * - Le nom de la classe doit etre InterfaceMytrigger - * - Le nom de la propriete name doit etre Mytrigger + * \remarks This file can be used as a template for creating your own action file: + * - The file name must be: interface_99_modMymodule_Mytrigger.class.php + * or: interface_99_all_Mytrigger.class.php + * - The file must be located in core/triggers + * - The class name must be InterfaceMytrigger + * - The property name must be Mytrigger */ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; diff --git a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php index ea846616096..983449b23ac 100644 --- a/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modZapier_ZapierTriggers.class.php @@ -195,7 +195,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers // case 'PRODUCT_SET_MULTILANGS': // case 'PRODUCT_DEL_MULTILANGS': - //Stock mouvement + //Stock movement // case 'STOCK_MOVEMENT': //MYECMDIR diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 990f0b5f91d..30dd8e920a8 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -89,7 +89,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontodelete) { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } else { - Header("Location: ".DOL_URL_ROOT.'/cron/list.php'); + header("Location: ".DOL_URL_ROOT.'/cron/list.php'); exit; } } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 5729d136869..1431dc400fd 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2013 Florian Henry + * Copyright (C) 2023 William Mead * * 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 @@ -192,7 +193,7 @@ class Cronjob extends CommonObject /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { @@ -512,16 +513,16 @@ class Cronjob extends CommonObject * Load list of cron jobs in a memory array from the database * @TODO Use object CronJob and not CronJobLine. * - * @param string $sortorder sort order - * @param string $sortfield sort field - * @param int $limit limit page - * @param int $offset page - * @param int $status display active or not - * @param array $filter filter output - * @param int $processing Processing or not - * @return int Return integer <0 if KO, >0 if OK + * @param string $sortorder sort order + * @param string $sortfield sort field + * @param int $limit limit page + * @param int $offset page + * @param int $status display active or not + * @param array $filter filter output + * @param int $processing Processing or not + * @return int Return integer <0 if KO, >0 if OK */ - public function fetchAll($sortorder = 'DESC', $sortfield = 't.rowid', $limit = 0, $offset = 0, $status = 1, $filter = '', $processing = -1) + public function fetchAll($sortorder = 'DESC', $sortfield = 't.rowid', $limit = 0, $offset = 0, $status = 1, $filter = [], $processing = -1) { $this->lines = array(); @@ -1023,7 +1024,7 @@ class Cronjob extends CommonObject } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index aeaede39bb8..3c3cae35e12 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -164,7 +164,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - // Programm next run + // Plan next run $res = $object->reprogram_jobs($user->login, $now); if ($res > 0) { if ($resrunjob >= 0) { // We show the result of reprogram only if no error message already reported @@ -490,7 +490,7 @@ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { } print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder); -print_liste_field_titre("Prority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder); +print_liste_field_titre("Priority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("CronModule", $_SERVER["PHP_SELF"], "t.module_name", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder, 'tdoverflowmax100 '); print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder); diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index 0e30db94d84..805cc537f38 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -102,7 +102,7 @@ class ActionsDatapolicy extends CommonHookActions // FIXME Removed hard coded id, use codes if ($parameters['currentcontext'] == 'thirdpartycard' && $action == 'anonymiser' && (in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8)) { - // on verifie si l'objet est utilisé + // Verify if the object is used if ($object->isObjectUsed(GETPOST('socid'))) { $object->name = $langs->trans('ANONYME'); $object->name_alias = ''; @@ -252,7 +252,7 @@ class ActionsDatapolicy extends CommonHookActions } if (GETPOST('socid')) { - /* Removed due to awful harcoded values + /* Removed due to awful hardcoded values require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $societe = new Societe($this->db); $societe->fetch(GETPOST('socid')); diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index 3693c240285..9ebe9ae4099 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -147,7 +147,7 @@ $authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $p // Check date validity if ($user->isNotIntoValidityDateRange()) { // User validity dates are no more valid - dol_syslog("The user login has a validity between [".$user->datestartvalidity." and ".$user->dateendvalidity."], curren date is ".dol_now()); + dol_syslog("The user login has a validity between [".$user->datestartvalidity." and ".$user->dateendvalidity."], current date is ".dol_now()); return false; } diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index 9b40abdb668..6f9af2136c7 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/db/DoliDB.class.php'; class TraceableDB extends DoliDB { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; // cannot be protected because of parent declaration /** @@ -75,8 +75,8 @@ class TraceableDB extends DoliDB * Format a SQL IF * * @param string $test Test string (example: 'cd.statut=0', 'field IS NULL') - * @param string $resok resultat si test egal - * @param string $resko resultat si test non egal + * @param string $resok resultat si test equal + * @param string $resko resultat si test non equal * @return string SQL string */ public function ifsql($test, $resok, $resko) @@ -102,7 +102,7 @@ class TraceableDB extends DoliDB * Function to use to build INSERT, UPDATE or WHERE predica * * @param int $param Date TMS to convert - * @param mixed $gm 'gmt'=Input informations are GMT values, 'tzserver'=Local to server TZ + * @param mixed $gm 'gmt'=Input information are GMT values, 'tzserver'=Local to server TZ * @return string Date in a string YYYY-MM-DD HH:MM:SS */ public function idate($param, $gm = 'tzserver') @@ -124,7 +124,7 @@ class TraceableDB extends DoliDB * Start transaction * * @param string $textinlog Add a small text into log. '' by default. - * @return int 1 if transaction successfuly opened or already opened, 0 if error + * @return int 1 if transaction successfully opened or already opened, 0 if error */ public function begin($textinlog = '') { @@ -197,7 +197,7 @@ class TraceableDB extends DoliDB * List tables into a database * * @param string $database Name of database - * @param string $table Nmae of table filter ('xxx%') + * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ public function DDLListTables($database, $table = '') @@ -209,7 +209,7 @@ class TraceableDB extends DoliDB * List tables into a database with table info * * @param string $database Name of database - * @param string $table Nmae of table filter ('xxx%') + * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ public function DDLListTablesFull($database, $table = '') @@ -323,7 +323,7 @@ class TraceableDB extends DoliDB * Cancel a transaction and go back to initial data values * * @param string $log Add more log to default log line - * @return resource|int 1 if cancelation is ok or transaction not open, 0 if error + * @return resource|int 1 if cancellation is ok or transaction not open, 0 if error */ public function rollback($log = '') { @@ -387,7 +387,7 @@ class TraceableDB extends DoliDB } /** - * Connexion to server + * Connection to server * * @param string $host database server host * @param string $login login @@ -483,7 +483,7 @@ class TraceableDB extends DoliDB /** * Return generic error code of last operation. * - * @return string Error code (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) + * @return string Error code (Examples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...) */ public function errno() { @@ -533,7 +533,7 @@ class TraceableDB extends DoliDB * * @param string $table Name of table * @param string $field_name Name of field to add - * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parametre][valeur du parametre] + * @param string $field_desc Tableau associatif de description du champ a inserer[nom du parameter][valeur du parameter] * @param string $field_position Optionnel ex.: "after champtruc" * @return int Return integer <0 if KO, >0 if OK */ @@ -614,7 +614,7 @@ class TraceableDB extends DoliDB * * @param string $dolibarr_main_db_host Ip serveur * @param string $dolibarr_main_db_user Nom user a creer - * @param string $dolibarr_main_db_pass Mot de passe user a creer + * @param string $dolibarr_main_db_pass Password user a creer * @param string $dolibarr_main_db_name Database name where user must be granted * @return int Return integer <0 if KO, >=0 if OK */ @@ -630,7 +630,7 @@ class TraceableDB extends DoliDB * 19700101020000 -> 7200 whaterver is TZ if gmt=1 * * @param string $string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS) - * @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ + * @param bool $gm 1=Input information are GMT values, otherwise local to server TZ * @return int|string Date TMS or '' */ public function jdate($string, $gm = false) @@ -667,7 +667,7 @@ class TraceableDB extends DoliDB * List information of columns into a table. * * @param string $table Name of table - * @return array Array with inforation on table + * @return array Array with information on table */ public function DDLInfoTable($table) { @@ -686,9 +686,9 @@ class TraceableDB extends DoliDB } /** - * Close database connexion + * Close database connection * - * @return boolean True if disconnect successfull, false otherwise + * @return boolean True if disconnect successful, false otherwise * @see connect() */ public function close() @@ -707,9 +707,9 @@ class TraceableDB extends DoliDB } /** - * Return connexion ID + * Return connection ID * - * @return string Id connexion + * @return string Id connection */ public function DDLGetConnectId() { diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 442d3df7453..54e1cb1e07f 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -696,11 +696,11 @@ if ($action == 'create') { print ''; } else { /* Expedition non trouvee */ - print "Expedition inexistante ou acces refuse"; + print "Expedition inexistante ou access refuse"; } } else { /* Expedition non trouvee */ - print "Expedition inexistante ou acces refuse"; + print "Expedition inexistante ou access refuse"; } } diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index b9a5aad392a..37c5f3a0a17 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -83,7 +83,7 @@ class Delivery extends CommonObject public $socid; /** - * @var string ref custome + * @var string ref customer */ public $ref_customer; @@ -143,7 +143,7 @@ class Delivery extends CommonObject /** * Create delivery receipt in database * - * @param User $user Objet du user qui cree + * @param User $user Object du user qui cree * @return int Return integer <0 si erreur, id delivery cree si ok */ public function create($user) @@ -991,7 +991,7 @@ class Delivery extends CommonObject } } - // Initialise parametres + // Initialise parameters $this->id = 0; $this->ref = 'SPECIMEN'; $this->specimen = 1; @@ -1040,7 +1040,7 @@ class Delivery extends CommonObject while ($i < $num_lines) { $objSourceLine = $this->db->fetch_object($resultSourceLine); - // Get lines of sources alread delivered + // Get lines of sources already delivered $sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,"; $sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c"; @@ -1082,7 +1082,7 @@ class Delivery extends CommonObject /** * Set the planned delivery date * - * @param User $user Objet utilisateur qui modifie + * @param User $user Object utilisateur qui modifie * @param integer $delivery_date Delivery date * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 2ccfafae0f1..b8e7c01c763 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -442,7 +442,7 @@ if ($action == 'create') { print ''; + print ''; $arraylistofkey = array('hooks', 'js', 'css'); @@ -1505,7 +1505,7 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { // s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur, // on divise la ligne de dispatch en autant de lignes qu’on en a sur la commande pour le produit - // et on met la quantité de la ligne dans la limite du "budget" indiqué par dispatch.qty + // et on met la quantité de la ligne dans la limit du "budget" indiqué par dispatch.qty $remaining_qty = $obj_dispatch->qty; $first_iteration = true; @@ -1596,7 +1596,7 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) { echo ''; } -// Repair llx_commande_fournisseur to eleminate duplicate reference +// Repair llx_commande_fournisseur to eliminate duplicate reference if ($ok && GETPOST('repair_supplier_order_duplicate_ref')) { require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 4ce9551d246..2c53e2e7e9e 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -426,7 +426,7 @@ if (!$error && $db->connected && $action == "set") { } } - // Documents are stored above the web pages root to prevent being downloaded without authentification + // Documents are stored above the web pages root to prevent being downloaded without authentication $dir = array(); $dir[] = $main_data_dir."/mycompany"; $dir[] = $main_data_dir."/medias"; @@ -685,7 +685,7 @@ if (!$error && $db->connected && $action == "set") { // We test access with dolibarr database user (not admin) if (!$error) { dolibarr_install_syslog("step1: connection type=".$conf->db->type." on host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name); - //print "connexion de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name; + //print "connection de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name; $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port); diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index f30f1655e3c..1b1cbe8f103 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -192,7 +192,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { // Create admin user include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; - // Set default encryption to yes, generate a salt and set default encryption algorythm (but only if there is no user yet into database) + // Set default encryption to yes, generate a salt and set default encryption algorithm (but only if there is no user yet into database) $sql = "SELECT u.rowid, u.pass, u.pass_crypted"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $resql = $db->query($sql); @@ -389,7 +389,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) { // Define if we need to update the MAIN_VERSION_LAST_UPGRADE value in database $tagdatabase = false; if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) { - $tagdatabase = true; // We don't know what it was before, so now we consider we are version choosed. + $tagdatabase = true; // We don't know what it was before, so now we consider we at the chosen version. } else { $mainversionlastupgradearray = preg_split('/[.-]/', $conf->global->MAIN_VERSION_LAST_UPGRADE); $targetversionarray = preg_split('/[.-]/', $targetversion); diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 0802f57b9f5..b6d07930c33 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -255,7 +255,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ dolibarr_install_syslog("Clean database from bad named constraints"); // Suppression vieilles contraintes sans noms et en doubles - // Les contraintes indesirables ont un nom qui commence par 0_ ou se termine par ibfk_999 + // Les contraintes indesirables ont un nom qui commence par 0_ ou se determine par ibfk_999 $listtables = array( MAIN_DB_PREFIX.'adherent_options', MAIN_DB_PREFIX.'bank_class', diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index cd8596f26a0..2ba539d80d9 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -136,7 +136,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } } - // $conf is already instanciated inside inc.php + // $conf is already instantiated inside inc.php $conf->db->type = $dolibarr_main_db_type; $conf->db->host = $dolibarr_main_db_host; $conf->db->port = $dolibarr_main_db_port; @@ -2044,7 +2044,7 @@ function migrate_modeles($db, $langs, $conf) include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; $modellist = ModelePDFFactures::liste_modeles($db); if (count($modellist) == 0) { - // Aucun model par defaut. + // Aucun model par default. $sql = " insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('crabe','invoice')"; $resql = $db->query($sql); if (!$resql) { @@ -2057,7 +2057,7 @@ function migrate_modeles($db, $langs, $conf) include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; $modellist = ModelePDFCommandes::liste_modeles($db); if (count($modellist) == 0) { - // Aucun model par defaut. + // Aucun model par default. $sql = " insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('einstein','order')"; $resql = $db->query($sql); if (!$resql) { @@ -2070,7 +2070,7 @@ function migrate_modeles($db, $langs, $conf) include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; $modellist = ModelePdfExpedition::liste_modeles($db); if (count($modellist) == 0) { - // Aucun model par defaut. + // Aucun model par default. $sql = " insert into ".MAIN_DB_PREFIX."document_model(nom,type) values('rouget','shipping')"; $resql = $db->query($sql); if (!$resql) { @@ -2084,7 +2084,7 @@ function migrate_modeles($db, $langs, $conf) /** - * Correspondance des expeditions et des commandes clients dans la table llx_co_exp + * Correspondence des expeditions et des commandes clients dans la table llx_co_exp * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -2149,7 +2149,7 @@ function migrate_commande_expedition($db, $langs, $conf) } /** - * Correspondance des livraisons et des commandes clients dans la table llx_co_liv + * Correspondence des livraisons et des commandes clients dans la table llx_co_liv * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -3433,7 +3433,7 @@ function migrate_clean_association($db, $langs, $conf) $obj = $db->fetch_object($result); if ($obj) { // It table categorie_association exists $couples = array(); - $filles = array(); + $children = array(); $sql = "SELECT fk_categorie_mere, fk_categorie_fille"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_association"; dolibarr_install_syslog("upgrade: search duplicate"); @@ -3441,9 +3441,9 @@ function migrate_clean_association($db, $langs, $conf) if ($resql) { $num = $db->num_rows($resql); while ($obj = $db->fetch_object($resql)) { - if (!isset($filles[$obj->fk_categorie_fille])) { // Only one record as child (a child has only on parent). + if (!isset($children[$obj->fk_categorie_fille])) { // Only one record as child (a child has only on parent). if ($obj->fk_categorie_mere != $obj->fk_categorie_fille) { - $filles[$obj->fk_categorie_fille] = 1; // Set record for this child + $children[$obj->fk_categorie_fille] = 1; // Set record for this child $couples[$obj->fk_categorie_mere.'_'.$obj->fk_categorie_fille] = array('mere'=>$obj->fk_categorie_mere, 'fille'=>$obj->fk_categorie_fille); } } @@ -3560,7 +3560,7 @@ function migrate_categorie_association($db, $langs, $conf) } /** - * Migrate event assignement to owner + * Migrate event assignment to owner * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -3626,7 +3626,7 @@ function migrate_event_assignement($db, $langs, $conf) } /** - * Migrate event assignement to owner + * Migrate event assignment to owner * * @param DoliDB $db Database handler * @param Translate $langs Object langs @@ -4247,7 +4247,7 @@ function migrate_delete_old_dir($db, $langs, $conf) /** - * Disable/Reenable features modules. + * Disable/Re-enable features modules. * We must do this when internal menu of module or permissions has changed * or when triggers have moved. * diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 90723a905d3..3d76b5034d2 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2019-2020 Open-DSI - * Copyright (C) 2020 Frédéric France + * Copyright (C) 2020-2024 Frédéric France * * 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 @@ -138,7 +138,7 @@ class IntracommReport extends CommonObject /** * Generate XML file * - * @param int $mode O for create, R for regenerate (Look always 0 ment toujours 0 within the framework of XML exchanges according to documentation) + * @param string $mode 'O' for create, R for regenerate (Look always 0 meant toujours 0 within the framework of XML exchanges according to documentation) * @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des) * @param string $period_reference Period of reference * @return SimpleXMLElement|int @@ -156,21 +156,21 @@ class IntracommReport extends CommonObject /**************Construction du fichier XML***************************/ $e = new SimpleXMLElement(''); - $enveloppe = $e->addChild('Envelope'); - $enveloppe->addChild('envelopeId', $conf->global->INTRACOMMREPORT_NUM_AGREMENT); - $date_time = $enveloppe->addChild('DateTime'); + $envelope = $e->addChild('Envelope'); + $envelope->addChild('envelopeId', $conf->global->INTRACOMMREPORT_NUM_AGREMENT); + $date_time = $envelope->addChild('DateTime'); $date_time->addChild('date', date('Y-m-d')); $date_time->addChild('time', date('H:i:s')); - $party = $enveloppe->addChild('Party'); + $party = $envelope->addChild('Party'); $party->addAttribute('partyType', $conf->global->INTRACOMMREPORT_TYPE_ACTEUR); $party->addAttribute('partyRole', $conf->global->INTRACOMMREPORT_ROLE_ACTEUR); $party->addChild('partyId', $party_id); $party->addChild('partyName', $declarant); - $enveloppe->addChild('softwareUsed', 'Dolibarr'); - $declaration = $enveloppe->addChild('Declaration'); + $envelope->addChild('softwareUsed', 'Dolibarr'); + $declaration = $envelope->addChild('Declaration'); $declaration->addChild('declarationId', $id_declaration); $declaration->addChild('referencePeriod', $period_reference); - if ($conf->global->INTRACOMMREPORT_TYPE_ACTEUR === 'PSI') { + if (getDolGlobalString('INTRACOMMREPORT_TYPE_ACTEUR') === 'PSI') { $psiId = $party_id; } else { $psiId = 'NA'; diff --git a/htdocs/knowledgemanagement/README.md b/htdocs/knowledgemanagement/README.md index 406e9032154..16454e21114 100644 --- a/htdocs/knowledgemanagement/README.md +++ b/htdocs/knowledgemanagement/README.md @@ -3,7 +3,7 @@ Knowledge Management base A complete knowledge database inside your application. -Store, search and retreive any article to keep your knowledge into a database. It can be used to manage a list of FAQ, or a database +Store, search and retrieve any article to keep your knowledge into a database. It can be used to manage a list of FAQ, or a database of process, or solutions of common problems. If you are using the Ticket module, you can also link each article of your knowledge management database to the main diff --git a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php index b85f363e7d0..0a93db98404 100644 --- a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php +++ b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php @@ -58,7 +58,7 @@ class KnowledgeManagement extends DolibarrApi /** * Get properties of a knowledgerecord object * - * Return an array with knowledgerecord informations + * Return an array with knowledgerecord information * * @param int $id ID of knowledgerecord * @return Object Object with cleaned properties @@ -127,7 +127,7 @@ class KnowledgeManagement extends DolibarrApi * @param int $page Page number * @param int $category Use this param to filter list by category * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - * @param string $properties Restrict the data returned to theses properties. Ignored if empty. Comma separated list of properties names + * @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names * @return array Array of order objects * * @throws RestException @@ -237,7 +237,7 @@ class KnowledgeManagement extends DolibarrApi foreach ($request_data as $field => $value) { if ($field === 'caller') { - // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again whith the caller + // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller $this->knowledgerecord->context['caller'] = $request_data['caller']; continue; } @@ -285,7 +285,7 @@ class KnowledgeManagement extends DolibarrApi continue; } if ($field === 'caller') { - // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again whith the caller + // Add a mention of caller so on trigger called after action, we can filter to avoid a loop if we try to sync back again with the caller $this->knowledgerecord->context['caller'] = $request_data['caller']; continue; } diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index fc1be7ed0b1..5a44a0d939a 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -80,7 +80,7 @@ class KnowledgeRecord extends CommonObject * 'noteditable' says if field is not editable (1 or 0) * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' @@ -184,7 +184,7 @@ class KnowledgeRecord extends CommonObject /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { @@ -228,10 +228,10 @@ class KnowledgeRecord extends CommonObject * Create object into database * * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, Id of created object if OK */ - public function create(User $user, $notrigger = false) + public function create(User $user, $notrigger = 0) { return $this->createCommon($user, $notrigger); } @@ -450,10 +450,10 @@ class KnowledgeRecord extends CommonObject * Update object into database * * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int Return integer <0 if KO, >0 if OK */ - public function update(User $user, $notrigger = false) + public function update(User $user, $notrigger = 0) { return $this->updateCommon($user, $notrigger); } @@ -461,11 +461,11 @@ class KnowledgeRecord extends CommonObject /** * Delete object in database * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ - public function delete(User $user, $notrigger = false) + public function delete(User $user, $notrigger = 0) { $error = 0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement WHERE fk_knowledgemanagement = ".((int) $this->id); @@ -503,10 +503,10 @@ class KnowledgeRecord extends CommonObject * * @param User $user User that delete * @param int $idline Id of line to delete - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int >0 if OK, <0 if KO + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return >0 if OK, <0 if KO */ - public function deleteLine(User $user, $idline, $notrigger = false) + public function deleteLine(User $user, $idline, $notrigger = 0) { if ($this->status < 0) { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; @@ -534,7 +534,7 @@ class KnowledgeRecord extends CommonObject // Protection if ($this->status == self::STATUS_VALIDATED) { - dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); + dol_syslog(get_class($this)."::validate action abandoned: already validated", LOG_WARNING); return 0; } @@ -757,7 +757,7 @@ class KnowledgeRecord extends CommonObject } /** - * Return a link to the object card (with optionaly the picto) + * Return a link to the object card (with optionally the picto) * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) * @param string $option On what the link point to ('nolink', ...) @@ -1048,7 +1048,7 @@ class KnowledgeRecord extends CommonObject * Create a document onto disk according to template module. * * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param Translate $outputlangs object lang a utiliser pour traduction * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref @@ -1186,7 +1186,7 @@ class KnowledgeRecordLine extends CommonObjectLine /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct(DoliDB $db) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index dcb743f5a6a..23f09690b09 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -57,7 +57,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); -// Initialize array of search criterias +// Initialize array of search criteria $search_all = GETPOST("search_all", 'alpha'); $search = array(); foreach ($object->fields as $key => $val) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index dac31532f50..1146776872a 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -97,7 +97,7 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Initialize array of search criterias +// Initialize array of search criteria $search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { @@ -529,7 +529,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
    '; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
    '.$printer_det['status'].''.$langs->trans('STATE_'.$printer_det['connectionStatus']).''.$langs->trans('TYPE_'.$printer_det['type']).''; if ($conf->global->PRINTING_GCP_DEFAULT == $printer_det['id']) { $html .= img_picto($langs->trans("Default"), 'on'); @@ -308,7 +308,7 @@ class printing_printgcp extends PrintingDriver $printers = $responsedata['printers']; // Check if we have printers? if (is_array($printers) && count($printers) == 0) { - // We dont have printers so return blank array + // We don't have printers so return blank array $ret['available'] = array(); } else { // We have printers so returns printers as array diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 8b9bf5c5fc8..e83823777da 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -228,7 +228,7 @@ class printing_printipp extends PrintingDriver //$html.= ''.$printer_det->device_uri->_value0.''.$printer_det->media_default->_value0.''.$langs->trans('MEDIA_IPP_'.$printer_det->media_type_supported->_value1).''; if ($conf->global->PRINTIPP_URI_DEFAULT == $value) { $html .= img_picto($langs->trans("Default"), 'on'); diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index b4b60ec63b2..37a72f76df5 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php * \ingroup core - * \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise + * \brief Fichier de la class permettant d'editer au format PDF des etiquettes au format Avery ou personnalise */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; @@ -225,9 +225,9 @@ class pdf_standardlabel extends CommonStickerGenerator // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Function to build PDF on disk, then output on HTTP strem. + * Function to build PDF on disk, then output on HTTP stream. * - * @param array $arrayofrecords Array of record informations (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) + * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $outputdir Output directory for pdf file @@ -300,7 +300,7 @@ class pdf_standardlabel extends CommonStickerGenerator $pdf->SetAutoPageBreak(false); $this->_Metric_Doc = $this->Tformat['metric']; - // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja servie + // Enable printing the label when the page was already started $posX = 1; $posY = 1; if ($posX > 0) { diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index d0703bd4bb1..4ad68cfe233 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php * \ingroup core - * \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise + * \brief Fichier de la class permettant d'editer au format PDF des etiquettes au format Avery ou personnalise */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; @@ -248,9 +248,9 @@ class pdf_tcpdflabel extends CommonStickerGenerator // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Function to build PDF on disk, then output on HTTP strem. + * Function to build PDF on disk, then output on HTTP stream. * - * @param array $arrayofrecords Array of record informations (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) + * @param array $arrayofrecords Array of record information (array('textleft'=>,'textheader'=>, ..., 'id'=>,'photo'=>) * @param Translate $outputlangs Lang object for output language * @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $outputdir Output directory for pdf file @@ -323,7 +323,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator $pdf->SetAutoPageBreak(false); $this->_Metric_Doc = $this->Tformat['metric']; - // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja servie + // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja service $posX = 1; $posY = 1; if ($posX > 0) { diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index c91ea3d3d9d..d98d6ee8201 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -69,7 +69,7 @@ class ModelePDFLabels * @param DoliDB $db Database handler * @param array $arrayofrecords Array of records * @param string $modele Force le modele a utiliser ('' to not force) - * @param Translate $outputlangs Objet lang a utiliser pour traduction + * @param Translate $outputlangs Object lang a utiliser pour traduction * @param string $outputdir Output directory * @param string $template pdf generenate document class to use default 'standardlabel' * @param string $filename Short file name of PDF output file @@ -126,7 +126,7 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp foreach (array('doc', 'pdf') as $prefix) { $file = $prefix."_".$template.".class.php"; - // On verifie l'emplacement du modele + // Determine the model path and validate that it exists $file = dol_buildpath($reldir."core/modules/printsheet/doc/".$file, 0); if (file_exists($file)) { $filefound = 1; @@ -139,7 +139,7 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp } } - // Charge le modele + // Load the model if ($filefound) { require_once $file; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index da4c655fd63..a619a004b3a 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -306,7 +306,7 @@ class doc_generic_product_odt extends ModelePDFProduct $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 5d28341688f..2ea09bac36d 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_standard extends ModelePDFProduct { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -406,7 +406,7 @@ class pdf_standard extends ModelePDFProduct $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par default // VAT Rate if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) @@ -429,7 +429,7 @@ class pdf_standard extends ModelePDFProduct // Unit if($conf->global->PRODUCT_USE_UNITS) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount-$this->posxunit-0.8, 4, $unit, 0, 'L'); } diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 1304caa7e0b..858a62af001 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -47,7 +47,7 @@ class mod_codeproduct_elephant extends ModeleProductCode public $code_modifiable; // Code modifiable - public $code_modifiable_invalide; // Code modifiable si il est invalide + public $code_modifiable_invalide; // Code modifiable si il est invalid public $code_modifiable_null; // Code modifiables si il est null @@ -142,7 +142,7 @@ class mod_codeproduct_elephant extends ModeleProductCode * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ - public function getExample($langs, $objproduct = 0, $type = -1) + public function getExample($langs, $objproduct = null, $type = -1) { $exampleproduct = $exampleservice = ''; @@ -183,7 +183,7 @@ class mod_codeproduct_elephant extends ModeleProductCode * @param int $type Produit ou service (0:product, 1:service) * @return string Value if OK, '' if module not configured, <0 if KO */ - public function getNextValue($objproduct = 0, $type = -1) + public function getNextValue($objproduct = null, $type = -1) { global $db, $conf; @@ -306,11 +306,11 @@ class mod_codeproduct_elephant extends ModeleProductCode // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoi si un code est pris ou non (par autre tiers) + * Indicate if the code is available or not (by another third party) * - * @param DoliDB $db Handler acces base + * @param DoliDB $db Handler access base * @param string $code Code a verifier - * @param Product $product Objet product + * @param Product $product Object product * @return int 0 if available, <0 if KO */ public function verif_dispo($db, $code, $product) diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index 384fff9a915..c63a321f31d 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/modules/product/mod_codeproduct_leopard.php * \ingroup product - * \brief Fichier de la classe des gestion leopard des codes produits + * \brief Fichier de la class des gestion leopard des codes produits */ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'; @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php' /** * \class mod_codeproduct_leopard - * \brief Classe permettant la gestion leopard des codes produits + * \brief Class permettant la gestion leopard des codes produits */ class mod_codeproduct_leopard extends ModeleProductCode { @@ -52,7 +52,7 @@ class mod_codeproduct_leopard extends ModeleProductCode public $code_modifiable; // Code modifiable - public $code_modifiable_invalide; // Code modifiable si il est invalide + public $code_modifiable_invalide; // Code modifiable si il est invalid public $code_modifiable_null; // Code modifiables si il est null @@ -103,7 +103,7 @@ class mod_codeproduct_leopard extends ModeleProductCode * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ - public function getExample($langs, $objproduct = 0, $type = -1) + public function getExample($langs, $objproduct = null, $type = -1) { return ''; } @@ -115,7 +115,7 @@ class mod_codeproduct_leopard extends ModeleProductCode * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return next value */ - public function getNextValue($objproduct = 0, $type = -1) + public function getNextValue($objproduct = null, $type = -1) { return ''; } diff --git a/htdocs/core/modules/product_batch/mod_lot_free.php b/htdocs/core/modules/product_batch/mod_lot_free.php index bcba82c0ad5..a41cbb0863b 100644 --- a/htdocs/core/modules/product_batch/mod_lot_free.php +++ b/htdocs/core/modules/product_batch/mod_lot_free.php @@ -49,7 +49,7 @@ class mod_lot_free extends ModeleNumRefBatch */ public $code_modifiable; - public $code_modifiable_invalide; // Code modifiable si il est invalide + public $code_modifiable_invalide; // Code modifiable si il est invalid public $code_modifiable_null; // Code modifiables si il est null diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php index c663833b8d4..c4af991cfd7 100644 --- a/htdocs/core/modules/product_batch/mod_sn_free.php +++ b/htdocs/core/modules/product_batch/mod_sn_free.php @@ -27,15 +27,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product_batch/modules_product_batc /** * \class mod_codeproduct_leopard - * \brief Classe permettant la gestion leopard des codes produits + * \brief Class permettant la gestion leopard des codes produits */ class mod_sn_free extends ModeleNumRefBatch { /* - * Attention ce module est utilise par defaut si aucun module n'a - * ete definit dans la configuration - * - * Le fonctionnement de celui-ci doit donc rester le plus ouvert possible + * :warning: + * This module is used by default if none was set in the configuration. + * Therefore, the implementation must remain as open as possible. */ /** @@ -45,7 +44,7 @@ class mod_sn_free extends ModeleNumRefBatch public $code_modifiable; // Code modifiable - public $code_modifiable_invalide; // Code modifiable si il est invalide + public $code_modifiable_invalide; // Code modifiable si il est invalid public $code_modifiable_null; // Code modifiables si il est null diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index ec63bd80adb..26911824813 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -124,7 +124,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { - $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini + $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par default, si n'etait pas defini } } @@ -592,7 +592,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Recipient name $contactobject = null; if (!empty($usecontact)) { - // if we have a PROJECTLEADER contact and we dont use it as recipient we store the contact object for later use + // if we have a PROJECTLEADER contact and we don't use it as recipient we store the contact object for later use $contactobject = $object->contact; } @@ -742,7 +742,7 @@ class doc_generic_project_odt extends ModelePDFProjects } } - //Time ressources + //Time resources $sql = "SELECT t.rowid, t.element_date as task_date, t.element_duration as task_duration, t.fk_user, t.note"; $sql .= ", u.lastname, u.firstname, t.thm"; $sql .= " FROM ".MAIN_DB_PREFIX."element_time as t"; diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 025f53f2ac7..3e7d0967ecd 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_baleine extends ModelePDFProjects { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -210,7 +210,7 @@ class pdf_baleine extends ModelePDFProjects $tplidx = $pdf->importPage(1); } - // Complete object by loading several other informations + // Complete object by loading several other information $task = new Task($this->db); $tasksarray = $task->getTasksArray(0, 0, $object->id); @@ -353,7 +353,7 @@ class pdf_baleine extends ModelePDFProjects $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($pageposafter + 1); - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index e582aec1a5b..ccac883e1ad 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -55,7 +55,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; class pdf_beluga extends ModelePDFProjects { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -241,7 +241,7 @@ class pdf_beluga extends ModelePDFProjects $tplidx = $pdf->importPage(1); } - // Complete object by loading several other informations + // Complete object by loading several other information $task = new Task($this->db); $tasksarray = array(); $tasksarray = $task->getTasksArray(0, 0, $object->id); @@ -435,7 +435,7 @@ class pdf_beluga extends ModelePDFProjects } //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - $elementarray = $object->get_element_list($key, $tablename, $datefieldname, '', '', $projectField); + $elementarray = $object->get_element_list($key, $tablename, $datefieldname, null, null, $projectField); $num = count($elementarray); if ($num >= 0) { @@ -564,7 +564,7 @@ class pdf_beluga extends ModelePDFProjects $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($pageposafter + 1); - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); @@ -598,7 +598,7 @@ class pdf_beluga extends ModelePDFProjects $curY = $tab_top_newpage + $heightoftitleline + 1; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Date if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') { diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 80759f92e81..66f3a9c7890 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; class pdf_timespent extends ModelePDFProjects { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -205,7 +205,7 @@ class pdf_timespent extends ModelePDFProjects $tplidx = $pdf->importPage(1); } - // Complete object by loading several other informations + // Complete object by loading several other information $task = new Task($this->db); $tasksarray = $task->getTasksArray(0, 0, $object->id); @@ -352,7 +352,7 @@ class pdf_timespent extends ModelePDFProjects $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($pageposafter + 1); - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 11a60bc4a4e..d19476d7277 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php'; abstract class ModelePDFProjects extends CommonDocGenerator { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -67,7 +67,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de projets + * Class mere des modeles de numerotation des references de projects */ abstract class ModeleNumRefProjects extends CommonNumRefGenerator { diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index d542d255b4a..25eb9b4c0b0 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -657,7 +657,7 @@ class doc_generic_task_odt extends ModelePDFTask $odfHandler->mergeSegment($listlinestaskres); } - // Time ressources + // Time resources $sql = "SELECT t.rowid, t.element_date as task_date, t.element_duration as task_duration, t.fk_user, t.note"; $sql .= ", u.lastname, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."element_time as t"; diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 91ecf105346..b07f918d279 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -19,14 +19,14 @@ /** * \file htdocs/core/modules/project/mod_project_universal.php * \ingroup project - * \brief Fichier contenant la classe du modele de numerotation de reference de projet Universal + * \brief Fichier contenant la class du modele de numerotation de reference de projet Universal */ require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php'; /** - * Classe du modele de numerotation de reference de projet Universal + * Class du modele de numerotation de reference de projet Universal */ class mod_task_universal extends ModeleNumRefTask { diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 63a85245ca7..a12dd5ed70a 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -343,7 +343,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 53a2b63ec49..f9f40168f75 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_azur extends ModelePDFPropales { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -561,7 +561,7 @@ class pdf_azur extends ModelePDFPropales $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // VAT Rate if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) { @@ -582,7 +582,7 @@ class pdf_azur extends ModelePDFPropales // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } @@ -1061,7 +1061,7 @@ class pdf_azur extends ModelePDFPropales * @param Propal $object Object propal * @param int $deja_regle Amount already paid * @param int $posy Start position - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param Translate $outputlangsbis Object lang for output bis * @return int Position for continuation */ @@ -1732,7 +1732,7 @@ class pdf_azur extends ModelePDFPropales * @param TCPDF $pdf Object PDF * @param Propal $object Object invoice * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _signature_area(&$pdf, $object, $posy, $outputlangs) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index fcb5d64c92f..29c317bb131 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_cyan extends ModelePDFPropales { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -124,7 +124,7 @@ class pdf_cyan extends ModelePDFPropales } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // used for notes ans other stuff + $this->posxdesc = $this->marge_gauche + 1; // used for notes and other stuff $this->tabTitleHeight = 5; // default height @@ -671,7 +671,7 @@ class pdf_cyan extends ModelePDFPropales // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } @@ -1153,7 +1153,7 @@ class pdf_cyan extends ModelePDFPropales * @param Propal $object Object proposal * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param Translate $outputlangsbis Object lang for output bis * @return int Position pour suite */ @@ -1799,7 +1799,7 @@ class pdf_cyan extends ModelePDFPropales * @param TCPDF $pdf Object PDF * @param Propal $object Object proposal * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function drawSignatureArea(&$pdf, $object, $posy, $outputlangs) @@ -1854,18 +1854,18 @@ class pdf_cyan extends ModelePDFPropales ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1877,7 +1877,7 @@ class pdf_cyan extends ModelePDFPropales 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index b897e029969..9b20d84c164 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -23,8 +23,8 @@ /** * \file htdocs/core/modules/propale/modules_propale.php * \ingroup propale - * \brief Fichier contenant la classe mere de generation des propales en PDF - * et la classe mere de numerotation des propales + * \brief Fichier contenant la class mere de generation des propales en PDF + * et la class mere de numerotation des propales */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis /** - * Classe mere des modeles de propale + * Class mere des modeles de propale */ abstract class ModelePDFPropales extends CommonDocGenerator { diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index e877ef29be2..a230e3e5aa9 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -66,7 +66,7 @@ class pdf_paiement extends CommonDocGenerator /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php index f5af4dd8776..de5e25de9e7 100644 --- a/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement_fourn.class.php @@ -26,14 +26,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement.class.php'; /** - * Classe permettant de generer les rapports de paiement + * Class permettant de generer les rapports de paiement */ class pdf_paiement_fourn extends pdf_paiement { /** * Constructor * - * @param DoliDb $db Database handler + * @param DoliDB $db Database handler */ public function __construct($db) { diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 3dd7619e4f2..88431592811 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -302,7 +302,7 @@ class doc_generic_reception_odt extends ModelePdfReception $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 95163db7bbc..157dc628c6a 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/modules/reception/doc/pdf_squille.modules.php * \ingroup reception - * \brief Fichier de la classe permettant de generer les bordereaux envoi au modele Squille + * \brief Fichier de la class permettant de generer les bordereaux envoi au modele Squille */ require_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php'; @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; /** - * Classe permettant de generer les borderaux envoi au modele Squille + * Class permettant de generer les borderaux envoi au modele Squille */ class pdf_squille extends ModelePdfReception { @@ -498,7 +498,7 @@ class pdf_squille extends ModelePdfReception $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Description $pdf->SetXY($this->posxweightvol, $curY); @@ -640,7 +640,7 @@ class pdf_squille extends ModelePdfReception * @param Reception $object Object reception * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @param int $totalOrdered Total ordered * @param int $totalAmount Total amount * @return int Position pour suite diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index 66621512b54..d3ce46cd83d 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -57,7 +57,7 @@ class modGeneratePassNone extends ModeleGenPassword * @param DoliDB $db Database handler * @param Conf $conf Handler de conf * @param Translate $langs Handler de langue - * @param User $user Handler du user connecte + * @param User $user Handler du user connected */ public function __construct($db, $conf, $langs, $user) { diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index 09458d884c6..6c858c43fa4 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -59,7 +59,7 @@ class modGeneratePassPerso extends ModeleGenPassword public $NbRepeat; /** - * Flag to 1 if we must clean ambiguous charaters for the autogeneration of password (List of ambiguous char is in $this->Ambi) + * Flag to 1 if we must clean ambiguous characters for the autogeneration of password (List of ambiguous char is in $this->Ambi) * * @var integer */ @@ -78,7 +78,7 @@ class modGeneratePassPerso extends ModeleGenPassword * @param DoliDB $db Database handler * @param Conf $conf Handler de conf * @param Translate $langs Handler de langue - * @param User $user Handler du user connecte + * @param User $user Handler du user connected */ public function __construct($db, $conf, $langs, $user) { diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 0bab8e8b32b..7eb0746fd8f 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -57,7 +57,7 @@ class modGeneratePassStandard extends ModeleGenPassword * @param DoliDB $db Database handler * @param Conf $conf Handler de conf * @param Translate $langs Handler de langue - * @param User $user Handler du user connecte + * @param User $user Handler du user connected */ public function __construct($db, $conf, $langs, $user) { diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php index 4f5aedc7684..ec17cac6e9b 100644 --- a/htdocs/core/modules/security/generate/modules_genpassword.php +++ b/htdocs/core/modules/security/generate/modules_genpassword.php @@ -32,7 +32,7 @@ abstract class ModeleGenPassword public $picto = 'generic'; /** - * Flag to 1 if we must clean ambiguous charaters for the autogeneration of password (List of ambiguous char is in $this->Ambi) + * Flag to 1 if we must clean ambiguous characters for the autogeneration of password (List of ambiguous char is in $this->Ambi) * * @var integer */ diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index fdc1f870c41..c06fecc1af4 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -46,7 +46,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode public $code_modifiable; /** - * @var int Code modifiable si il est invalide + * @var int Code modifiable si il est invalid */ public $code_modifiable_invalide; @@ -94,6 +94,8 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode */ public function __construct($db) { + $this->db = $db; + $this->code_null = 0; $this->code_modifiable = 1; $this->code_modifiable_invalide = 1; @@ -344,11 +346,11 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoi si un code est pris ou non (par autre tiers) + * Indicate if the code is available or not (by another third party) * - * @param DoliDB $db Handler acces base + * @param DoliDB $db Handler access base * @param string $code Code a verifier - * @param Societe $soc Objet societe + * @param Societe $soc Object societe * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if available, <0 if KO */ diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php index 18bb5dcf5fe..5330b6c1f54 100644 --- a/htdocs/core/modules/societe/mod_codeclient_leopard.php +++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/modules/societe/mod_codeclient_leopard.php * \ingroup societe - * \brief Fichier de la classe des gestion leopard des codes clients + * \brief Fichier de la class des gestion leopard des codes clients */ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'; @@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php' class mod_codeclient_leopard extends ModeleThirdPartyCode { /* - * Attention ce module est utilise par defaut si aucun module n'a - * ete definit dans la configuration + * Attention ce module est utilise par default si aucun module n'a + * ete definite dans la configuration * * Le fonctionnement de celui-ci doit donc rester le plus ouvert possible */ @@ -45,7 +45,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode public $code_modifiable; // Code modifiable - public $code_modifiable_invalide; // Code modifiable si il est invalide + public $code_modifiable_invalide; // Code modifiable si il est invalid public $code_modifiable_null; // Code modifiables si il est null @@ -70,6 +70,8 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode */ public function __construct($db) { + $this->db = $db; + $this->code_null = 1; $this->code_modifiable = 1; $this->code_modifiable_invalide = 1; @@ -112,7 +114,6 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode */ public function getNextValue($objsoc = 0, $type = -1) { - global $langs; return ''; } @@ -132,8 +133,6 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode */ public function verif($db, &$code, $soc, $type) { - global $conf; - $result = 0; $code = trim($code); diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index 5e788514204..f8f4235e81b 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -21,14 +21,14 @@ /** * \file htdocs/core/modules/societe/mod_codeclient_monkey.php * \ingroup societe - * \brief Fichier de la classe des gestion lion des codes clients + * \brief Fichier de la class des gestion lion des codes clients */ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'; /** - * Classe permettant la gestion monkey des codes tiers + * Class permettant la gestion monkey des codes tiers */ class mod_codeclient_monkey extends ModeleThirdPartyCode { @@ -39,7 +39,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode public $code_modifiable; // Code modifiable - public $code_modifiable_invalide; // Code modifiable si il est invalide + public $code_modifiable_invalide; // Code modifiable si il est invalid public $code_modifiable_null; // Code modifiables si il est null @@ -70,6 +70,8 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode */ public function __construct($db) { + $this->db = $db; + $this->code_null = 1; $this->code_modifiable = 1; $this->code_modifiable_invalide = 1; @@ -114,7 +116,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode */ public function getNextValue($objsoc = 0, $type = -1) { - global $db, $conf, $mc; + global $db; $field = ''; $prefix = ''; @@ -128,7 +130,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode return -1; } - // First, we get the max value (reponse immediate car champ indexe) + // First, we get the max value (response immediate car champ indexe) $posindice = strlen($prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(".$field." FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $sql .= " FROM ".MAIN_DB_PREFIX."societe"; @@ -178,8 +180,6 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode */ public function verif($db, &$code, $soc, $type) { - global $conf; - $result = 0; $code = strtoupper(trim($code)); @@ -211,19 +211,17 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoi si un code est pris ou non (par autre tiers) + * Indicates if the code is available or not (by another third party) * - * @param DoliDB $db Handler acces base + * @param DoliDB $db Handler access base * @param string $code Code a verifier - * @param Societe $soc Objet societe + * @param Societe $soc Object societe * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if available, <0 if KO */ public function verif_dispo($db, $code, $soc, $type = 0) { // phpcs:enable - global $conf, $mc; - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; if ($type == 1) { $sql .= " WHERE code_fournisseur = '".$db->escape($code)."'"; @@ -251,7 +249,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Renvoi si un code respecte la syntaxe + * Renvoi si un code respecte la syntax * * @param string $code Code a verifier * @return int 0 si OK, <0 si KO diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 0d4a9d69dcd..9899db44b21 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -309,7 +309,7 @@ class doc_generic_stock_odt extends ModelePDFStock $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index e2cb7c6c17a..da930624da1 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -347,7 +347,7 @@ class pdf_standard extends ModelePDFStock $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default $productstatic->id = $objp->rowid; $productstatic->ref = $objp->ref; diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php index e0acbea66e5..cd5ad31db44 100644 --- a/htdocs/core/modules/stock/modules_stock.php +++ b/htdocs/core/modules/stock/modules_stock.php @@ -24,7 +24,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; abstract class ModelePDFStock extends CommonDocGenerator { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 7f42f2e83c2..304a2218647 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; class pdf_eagle extends ModelePDFStockTransfer { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -74,8 +74,20 @@ class pdf_eagle extends ModelePDFStockTransfer * @var int posx weightvol */ public $posxweightvol; + + /** + * @var int posx warehousesource + */ public $posxwarehousesource; + + /** + * @var int posx warehousedestination + */ public $posxwarehousedestination; + + /** + * @var int at Least One Batch + */ public $atLeastOneBatch; /** @@ -83,7 +95,7 @@ class pdf_eagle extends ModelePDFStockTransfer * * @param DoliDB $db Database handler */ - public function __construct($db = 0) + public function __construct($db) { global $conf, $langs, $mysoc; @@ -534,7 +546,7 @@ class pdf_eagle extends ModelePDFStockTransfer $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Lot / série if (isModEnabled('productbatch')) { @@ -699,7 +711,7 @@ class pdf_eagle extends ModelePDFStockTransfer * @param StockTransfer $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index 8e2c7c64979..7973c3425f9 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_eagle_proforma extends ModelePDFCommandes { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -629,7 +629,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } @@ -889,7 +889,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes $posy=$pdf->GetY()+1; }*/ - // Show planed date of delivery + // Show planned date of delivery if (!empty($object->delivery_date)) { $outputlangs->load("sendings"); $pdf->SetFont('', 'B', $default_font_size - 2); @@ -1000,7 +1000,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs) @@ -1488,18 +1488,18 @@ class pdf_eagle_proforma extends ModelePDFCommandes ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1511,7 +1511,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php index 36ff93a744a..46d41a2f480 100644 --- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -306,7 +306,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index a6bdd688a07..96e637adca2 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_canelle extends ModelePDFSuppliersInvoices { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -444,7 +444,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } @@ -610,7 +610,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * @param FactureFournisseur $object Object invoice * @param int $deja_regle Amount already paid (in the currency of invoice) * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position of cursor after output */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 5193d053b5d..36be92a41ba 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -302,7 +302,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index a9146dd35e1..61681bc51e0 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_cornas extends ModelePDFSuppliersOrders { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -119,7 +119,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support durring PDF transition: TODO remove this at the end + $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end $this->tabTitleHeight = 5; // default height @@ -409,7 +409,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } - // apply note frame to previus pages + // apply note frame to previous pages $i = $pageposbeforenote; while ($i < $pageposafternote) { $pdf->setPage($i); @@ -578,7 +578,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // VAT Rate if ($this->getColumnStatus('vat')) { @@ -605,7 +605,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } @@ -910,7 +910,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) @@ -1474,18 +1474,18 @@ class pdf_cornas extends ModelePDFSuppliersOrders ); /* - * For exemple + * For example $this->cols['theColKey'] = array( 'rank' => $rank, // int : use for ordering columns 'width' => 20, // the column width in mm 'title' => array( 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label 'label' => ' ', // the final label : used fore final generated text - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), 'content' => array( - 'align' => 'L', // text alignement : R,C,L + 'align' => 'L', // text alignment : R,C,L 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left ), ); @@ -1497,7 +1497,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 1bbb8cbf623..91a780c6c4a 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_muscadet extends ModelePDFSuppliersOrders { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -482,7 +482,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // VAT Rate if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) { @@ -505,7 +505,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } @@ -788,7 +788,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 3f03b6c1b16..35aec96e909 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -20,14 +20,14 @@ /** * \file htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php * \ingroup commande - * \brief Fichier contenant la classe du modele de numerotation de reference de commande fournisseur Muguet + * \brief Fichier contenant la class du modele de numerotation de reference de commande fournisseur Muguet */ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php'; /** - * Classe du modele de numerotation de reference de commande fournisseur Muguet + * Class du modele de numerotation de reference de commande fournisseur Muguet */ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders { diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 9132d35c8a2..7535fab0482 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -21,14 +21,14 @@ /** * \file htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php * \ingroup commande - * \brief Fichier contenant la classe du modele de numerotation de reference de commande fournisseur Orchidee + * \brief File for class for 'orchidee' type numbering the supplier orders */ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefournisseur.php'; /** - * Classe du modele de numerotation de reference de commande fournisseur Orchidee + * Class providing the 'Orchidee' numbering models for supplier orders */ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders { diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index 9f4e77a2b97..c5319938818 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; class pdf_standard extends ModelePDFSuppliersPayments { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -353,7 +353,7 @@ class pdf_standard extends ModelePDFSuppliersPayments $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // ref fourn $pdf->SetXY($this->posxreffacturefourn, $curY); @@ -487,7 +487,7 @@ class pdf_standard extends ModelePDFSuppliersPayments * @param TCPDF $pdf Object PDF * @param PaiementFourn $object Object PaiementFourn * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_cheque(&$pdf, $object, $posy, $outputlangs) diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 4130df223c4..1f2ee456924 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -330,7 +330,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index e84248c114f..532a02a469f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_aurore extends ModelePDFSupplierProposal { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -480,7 +480,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); @@ -489,7 +489,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Unit if (getDolGlobalInt('PRODUCT_USE_UNITS')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxunit, $curY); $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0, 'L'); } @@ -868,7 +868,7 @@ class pdf_aurore extends ModelePDFSupplierProposal * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 8364b587e6d..f7db023cd8f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; class pdf_zenith extends ModelePDFSupplierProposal { /** - * @var DoliDb Database handler + * @var DoliDB Database handler */ public $db; @@ -118,7 +118,7 @@ class pdf_zenith extends ModelePDFSupplierProposal } // Define position of columns - $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support durring PDF transition: TODO remove this at the end + $this->posxdesc = $this->marge_gauche + 1; // For module retrocompatibility support during PDF transition: TODO remove this at the end $this->tabTitleHeight = 5; // default height @@ -408,7 +408,7 @@ class pdf_zenith extends ModelePDFSupplierProposal } - // apply note frame to previus pages + // apply note frame to previous pages $i = $pageposbeforenote; while ($i < $pageposafternote) { $pdf->setPage($i); @@ -577,7 +577,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $curY = $tab_top_newpage; } - $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par default // VAT Rate if ($this->getColumnStatus('vat')) { @@ -604,7 +604,7 @@ class pdf_zenith extends ModelePDFSupplierProposal // Unit if ($this->getColumnStatus('unit')) { - $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager); + $unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails); $this->printStdColumnContent($pdf, $curY, 'unit', $unit); $nexY = max($pdf->GetY(), $nexY); } @@ -909,7 +909,7 @@ class pdf_zenith extends ModelePDFSupplierProposal * @param Facture $object Object invoice * @param int $deja_regle Montant deja regle * @param int $posy Position depart - * @param Translate $outputlangs Objet langs + * @param Translate $outputlangs Object langs * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) @@ -1476,7 +1476,7 @@ class pdf_zenith extends ModelePDFSupplierProposal 'width' => false, // only for desc 'status' => true, 'title' => array( - 'textkey' => 'Designation', // use lang key is usefull in somme case with module + 'textkey' => 'Designation', // use lang key is useful in somme case with module 'align' => 'L', // 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label // 'label' => ' ', // the final label diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index d54b9629178..84517038a74 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -23,8 +23,8 @@ /** * \file htdocs/core/modules/propale/modules_propale.php * \ingroup propale - * \brief Fichier contenant la classe mere de generation des propales en PDF - * et la classe mere de numerotation des propales + * \brief File for the parent class of PDF proposal generation + * and parent class of proposals and proposal numbering */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requis /** - * Classe mere des modeles de propale + * Perent class of the Proposal models */ abstract class ModelePDFSupplierProposal extends CommonDocGenerator { @@ -60,7 +60,7 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de propales + * Parent class of the Proposal numbering model classes */ abstract class ModeleNumRefSupplierProposal extends CommonNumRefGenerator { diff --git a/htdocs/core/modules/takepos/modules_takepos.php b/htdocs/core/modules/takepos/modules_takepos.php index 7a296d85f15..88894d4fa8a 100644 --- a/htdocs/core/modules/takepos/modules_takepos.php +++ b/htdocs/core/modules/takepos/modules_takepos.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php'; /** - * Classe mere des modeles de numerotation des tickets de caisse + * Parent Class of the models to number the cash register receipts */ abstract class ModeleNumRefTakepos extends CommonNumRefGenerator { diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index 5f45b253c2e..6904febfe28 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -296,7 +296,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/ticket/modules_ticket.php b/htdocs/core/modules/ticket/modules_ticket.php index b8c2754ad12..0278ade325d 100644 --- a/htdocs/core/modules/ticket/modules_ticket.php +++ b/htdocs/core/modules/ticket/modules_ticket.php @@ -57,7 +57,7 @@ abstract class ModelePDFTicket extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de projets + * Parent Class of the project reference numbering model classes */ abstract class ModeleNumRefTicket extends CommonNumRefGenerator { diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index fa746b86c61..c4a13084560 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -327,7 +327,7 @@ class doc_generic_user_odt extends ModelePDFUser $socobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index d25b59ed894..8830d63a554 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -330,7 +330,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $contactobject = $object->contact; } else { $socobject = $object->thirdparty; - // if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use + // if we have a CUSTOMER contact and we don't use it as thirdparty recipient we store the contact object for later use $contactobject = $object->contact; } } else { diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 7eb1dd464bc..78db690f00b 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -242,7 +242,7 @@ print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman print ''."\n"; print '
    '.$langs->trans("DefaultLang"); if (!empty($array_query['cust_language'])) { diff --git a/htdocs/core/tpl/bloc_showhide.tpl.php b/htdocs/core/tpl/bloc_showhide.tpl.php index 047e09a1e93..267c56e42a7 100644 --- a/htdocs/core/tpl/bloc_showhide.tpl.php +++ b/htdocs/core/tpl/bloc_showhide.tpl.php @@ -73,4 +73,4 @@ print '
    email.">"; } else { - // For exemple if element is project + // For example if element is project if (!empty($object->socid) && $object->socid > 0 && !is_object($object->thirdparty) && method_exists($object, 'fetch_thirdparty')) { $object->fetch_thirdparty(); } diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 48642f29135..9f8c49198ec 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -151,7 +151,7 @@ foreach ($object->fields as $key => $val) { $rightpart .= '
    %%'.$margin_rate.'%'.$mark_rate.'%'; $filter = '((s.client:IN:1,2,3) AND (status:=:1))'; print $form->select_company($soc->id, 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); - // Option to reload page to retrieve customer informations. Note, this clear other input + // Option to reload page to retrieve customer information. Note, this clear other input if (getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) { print '__N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N____N____N____N____N__
    __N__
    __N__
    __N__
    __N__
    __N__
    __N__

    Say Hi

    __N____N__ We are happy to get in touch with you__N__
    __N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__ __N__
    __N__
    __N__
    __N__
    __N__

    Leave a message

    __N__
    __N____N__
    __N__ __N__ __N__ \">__N__ __N__
    __N__
    __N____N__
    __N__ trans(\"Phone\"); ?>__N____N__ __N__
    __N____N__
    __N__ trans(\"Email\"); ?>__N____N__ __N____N__ trans(\"Message\"); ?>__N____N__ __N__
    __N____N__
    __N__ __N__
    __N__ __N__
    __N____N__
    __N__
    Weekdays
    __N____N__
    __N__ $day : \" .getDolGlobalString(\"MAIN_INFO_OPENINGHOURS_$day\") .\"

    \"; __N__ }__N__ ?>__N__
    __N____N__
    Weekends
    __N____N__
    __N__

    Saturday and Sunday

    __N____N__

    to be determined !

    __N__
    __N__
    __N____N__
    __N__

    __N__ __N__

    __N__ getFullAddress() ?>__N__

    __N____N__ __N__
    __N__
    __N__ __N__
    __N__
    __N__
    __N__
    __N__
    __N__
    __N____N____N__ __N__ __N__ __N__
    __N__
    __N__
    __N__

    Reserve a table

    __N____N__ __N__
    __N____N__ __N__
    __N__ __N__ \" />__N__ __N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__ __N__
    __N__ __N__
    __N__
    __N____N__
    __N__
    __N__ __N__ __N____N__
    __N____N____N____N____N__', '', 0); +INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(2__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'contact', '', 'Contact us', '', '', '', '', '1', '2022-08-16 14:40:51', '2022-11-20 14:50:10', null, '', 'page', '', '__N__email;__N__ $message = GETPOST(\'message\', \'alpha\');__N__ $cmail = new CMailFile(\'Contact from website\', $to, $from, $message);__N__ if ($cmail->sendfile()) {__N__ ?>__N__ __N__ trans(\"ErrorFailedToSendMail\", $from, $to).\'. \'.$cmail->error;__N__ }__N__}__N__?>__N____N____N____N____N__
    __N__
    __N__
    __N__
    __N__
    __N__
    __N__

    Say Hi

    __N____N__ We are happy to get in touch with you__N__
    __N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__ __N__
    __N__
    __N__
    __N__
    __N__

    Leave a message

    __N__
    __N____N__
    __N__ __N__ __N__ \">__N__ __N__
    __N__
    __N____N__
    __N__ trans(\"Phone\"); ?>__N____N__ __N__
    __N____N__
    __N__ trans(\"Email\"); ?>__N____N__ __N____N__ trans(\"Message\"); ?>__N____N__ __N__
    __N____N__
    __N__ __N__
    __N__ __N__
    __N____N__
    __N__
    Weekdays
    __N____N__
    __N__ $day : \" .getDolGlobalString(\"MAIN_INFO_OPENINGHOURS_$day\") .\"

    \"; __N__ }__N__ ?>__N__
    __N____N__
    Weekends
    __N____N__
    __N__

    Saturday and Sunday

    __N____N__

    to be determined !

    __N__
    __N__
    __N____N__
    __N__

    __N__ __N__

    __N__ getFullAddress() ?>__N__

    __N____N__ __N__
    __N__
    __N__ __N__
    __N__
    __N__
    __N__
    __N__
    __N__
    __N____N____N__ __N__ __N__ __N__
    __N__
    __N__
    __N__

    Reserve a table

    __N____N__ __N__
    __N____N__ __N__
    __N__ __N__ \" />__N__ __N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__
    __N____N__
    __N__ __N__
    __N__ __N__
    __N__
    __N____N__
    __N__
    __N__ __N__ __N____N__
    __N____N____N____N____N__', '', 0); -- File generated by Dolibarr 17.0.0-beta -- 2022-11-20 14:10:56 UTC --; -- Page ID 252 -> 3__+MAX_llx_website_page__ - Aliases footer --; INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias, allowed_in_frames) VALUES(3__+MAX_llx_website_page__, null, __WEBSITE_ID__, 'footer', '', 'Footer', '', '', '', '', '1', '2022-11-20 12:51:50', '2022-11-20 14:07:39', null, '', 'other', '', '__N__
    __N__ __N__ __N__
    __N__', '', 0); diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php index 43664b7984b..bd1eda51e55 100644 --- a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php +++ b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page23.tpl.php @@ -126,7 +126,7 @@ ob_start(); 1,024 Nullam -

    Nam elementum nisl et mi a commodo porttitor. Morbi sit amet nisl eu arcu faucibus hendrerit vel a risus. Nam a orci mi, elementum ac arcu sit amet, fermentum pellentesque et purus. Integer maximus varius lorem, sed convallis diam accumsan sed. Etiam porttitor placerat sapien, sed eleifend a enim pulvinar faucibus semper quis ut arcu. Ut non nisl a mollis est efficitur vestibulum. Integer eget purus nec nulla mattis et accumsan ut magna libero. Morbi auctor iaculis porttitor. Sed ut magna ac risus et hendrerit scelerisque. Praesent eleifend lacus in lectus aliquam porta. Cras eu ornare dui curabitur lacinia.

    +

    Nim elementum nisl et mi a commodo porttitor. Morbi sit amet nisl eu arcu faucibus hendrerit vel a risus. Nim a orci mi, elementum ac arcu sit amet, fermentum pellentesque et purus. Integer maximus varias lorem, sed convallis diam accumsan sed. Etiam porttitor placerat sapien, sed eleifend a enim pulvinar faucibus semper quis ut arcu. Ut non nisl a mollis est efficitur vestibulum. Integer eget purus nec nulla mattis et accumsan ut magna libero. Morbi auctor iaculis porttitor. Sed ut magna ac risus et hendrerit scelerisque. Praesent eleifend lacus in lectus aliquam porta. Cras eu ornare dui curabitur lacinia.

    • Learn More
    • diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 5a2dcbc0c77..7d211faae21 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -94,7 +94,7 @@ if (@file_exists($forcedfile)) { * View */ -session_start(); // To be able to keep info into session (used for not losing pass during navigation. pass must not transit through parmaeters) +session_start(); // To be able to keep info into session (used for not losing pass during navigation. pass must not transit through parameters) pHeader($langs->trans("ConfigurationFile"), "step1", "set", "", (empty($force_dolibarr_js_JQUERY) ? '' : $force_dolibarr_js_JQUERY.'/'), 'main-inside-bis'); @@ -322,7 +322,6 @@ if (!empty($force_install_noedit)) { } // Version min of database - $versionbasemin = explode('.', $class::VERSIONMIN); $note = '('.$class::LABEL.' >= '.$class::VERSIONMIN.')'; // Switch to mysql if mysqli is not present @@ -731,7 +730,7 @@ jQuery(document).ready(function() { // TODO Test $( window ).load(function() to close(); Not database connexion yet +// $db->close(); Not database connection yet dolibarr_install_syslog("- fileconf: end"); pFooter($err, $setuplang, 'jscheckparam'); diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 5080b8c05fb..e488120440b 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -248,7 +248,7 @@ if (!isset($dolibarr_main_db_prefix) || !$dolibarr_main_db_prefix) { } define('MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix : '')); -define('DOL_CLASS_PATH', 'class/'); // Filsystem path to class dir +define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir define('DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root : DOL_DOCUMENT_ROOT.'/../documents')); define('DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root : '')); // URL relative root $uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http* diff --git a/htdocs/install/install.forced.sample.php b/htdocs/install/install.forced.sample.php index 1e986e4a446..a2dfc8f95e9 100644 --- a/htdocs/install/install.forced.sample.php +++ b/htdocs/install/install.forced.sample.php @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -/** @var boolean $force_install_nophpinfo Hide PHP informations */ +/** @var boolean $force_install_nophpinfo Hide PHP information */ $force_install_nophpinfo = true; /** @var int $force_install_noedit 1 = Lock and hide environment variables, 2 = Lock all set variables */ diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index e6363ba41eb..c9a280690a3 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -201,3 +201,7 @@ CREATE TABLE llx_c_product_thirdparty_relation_type ALTER TABLE llx_c_tva ADD COLUMN type_vat smallint NOT NULL DEFAULT 0 AFTER fk_pays; +ALTER TABLE llx_categorie ADD COLUMN position integer DEFAULT 0 AFTER color; + +ALTER TABLE llx_product DROP COLUMN onportal; + diff --git a/htdocs/install/mysql/tables/llx_categorie.sql b/htdocs/install/mysql/tables/llx_categorie.sql index 29cb5a260e6..9c8f8beb186 100644 --- a/htdocs/install/mysql/tables/llx_categorie.sql +++ b/htdocs/install/mysql/tables/llx_categorie.sql @@ -29,6 +29,7 @@ create table llx_categorie type integer DEFAULT 1 NOT NULL, -- category type (product, supplier, customer, member) description text, -- description of the category color varchar(8), -- color + position integer DEFAULT 0, -- position fk_soc integer DEFAULT NULL, -- not used by default. Used when option CATEGORY_ASSIGNED_TO_A_CUSTOMER is set. visible tinyint DEFAULT 1 NOT NULL, -- determine if the products are visible or not date_creation datetime, -- date creation diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index f63a4145569..0dd84d550f5 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -59,7 +59,6 @@ create table llx_product fk_user_modif integer, -- user making last change tosell tinyint DEFAULT 1, -- Product you sell tobuy tinyint DEFAULT 1, -- Product you buy - onportal tinyint DEFAULT 0, -- If it is a product you sell and you want to sell it from internal portal (module 'portal') tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch management (eat-by or lot management) sell_or_eat_by_mandatory tinyint DEFAULT 0 NOT NULL, -- Make sell-by or eat-by date mandatory batch_mask varchar(32) DEFAULT NULL, -- If the product has batch feature, you may want to use a batch mask per product diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation-workstation.key.sql b/htdocs/install/mysql/tables/llx_workstation_workstation-workstation.key.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation-workstation.sql b/htdocs/install/mysql/tables/llx_workstation_workstation-workstation.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation_resource-workstation.sql b/htdocs/install/mysql/tables/llx_workstation_workstation_resource-workstation.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/mysql/tables/llx_workstation_workstation_usergroup-workstation.sql b/htdocs/install/mysql/tables/llx_workstation_workstation_usergroup-workstation.sql old mode 100755 new mode 100644 diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 2b427923e8c..5d7596889fc 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1113,7 +1113,7 @@ if ($ok && GETPOST('set_empty_time_spent_amount', 'alpha')) { // force_disable_of_modules_not_found if ($ok && GETPOST('force_disable_of_modules_not_found', 'alpha')) { - print '

    *** Force modules not found physicaly to be disabled (only modules adding js, css or hooks can be detected as removed physicaly)

    *** Force modules not found physically to be disabled (only modules adding js, css or hooks can be detected as removed physically)
    '.join('
    ', $errors).'
    '."\n"; diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 7939e82498d..1d9215fdedd 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -446,8 +446,8 @@ AccountancyOneUnletteringModifiedSuccessfully=One unreconcile successfully modif AccountancyUnletteringModifiedSuccessfully=%s unreconcile successfully modified ## Closure -AccountancyClosureStep1=Step 1 : Validate and lock movements -AccountancyClosureStep2=Step 2 : Close fiscal period +AccountancyClosureStep1=Step 1 : Validate and lock the movements +AccountancyClosureStep2=Step 2 : Close the fiscal period AccountancyClosureStep3=Step 3 : Extract entries (Optional) AccountancyClosureClose=Close fiscal period AccountancyClosureAccountingReversal=Extract and record "Retained earnings" entries diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a1871dd23c8..aa9bb7328e9 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2396,7 +2396,7 @@ RECEPTION_PDF_HIDE_ORDERED=Hide the quantity ordered on the generated documents MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents for receptions WarningDisabled=Warning disabled LimitsAndMitigation=Access limits and mitigation -RecommendMitigationOnURL=It is recommanded to activate mitigation on critical URL. This is list of fail2ban rules you can use for the main important URLs. +RecommendMitigationOnURL=It is recommended to activate mitigation on critical URL. This is list of fail2ban rules you can use for the main important URLs. DesktopsOnly=Desktops only DesktopsAndSmartphones=Desktops et smartphones AllowOnlineSign=Allow online signing @@ -2437,4 +2437,4 @@ ExtraFieldsSupplierInvoicesLinesRec=Complementary attributes (template invoice l ParametersForTestEnvironment=Parameters for test environment TryToKeepOnly=Try to keep only %s RecommendedForProduction=Recommended for Production -RecommendedForDebug=Recommended for Debug \ No newline at end of file +RecommendedForDebug=Recommended for Debug diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 8c40379b67b..227b546ba74 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1095,7 +1095,7 @@ KeyboardShortcut=Keyboard shortcut AssignedTo=Assigned to Deletedraft=Delete draft ConfirmMassDraftDeletion=Draft mass delete confirmation -FileSharedViaALink=File shared with a public link +FileSharedViaALink=Public file shared via link SelectAThirdPartyFirst=Select a third party first... YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode Inventory=Inventory diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 7127e4b9a1c..3af40c06384 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -60,10 +60,11 @@ NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
    You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

    You can also include content of another Page/Container with the following syntax:
    <?php includeContainer('alias_of_container_to_include'); ?>

    You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
    <?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

    To add a link to another page, use the syntax:
    <a href="alias_of_page_to_link_to.php">mylink<a>

    To include a link to download a file stored into the documents directory, use the document.php wrapper:
    Example, for a file into documents/ecm (need to be logged), syntax is:
    <a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
    For a file into documents/medias (open directory for public access), syntax is:
    <a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
    For a file shared with a share link (open access using the sharing hash key of file), syntax is:
    <a href="/document.php?hashp=publicsharekeyoffile">

    To include an image stored into the documents directory, use the viewimage.php wrapper:
    Example, for an image into documents/medias (open directory for public access), syntax is:
    <img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
    -#YouCanEditHtmlSource2=
    To include a image shared publicly, use the viewimage.php wrapper:
    Example with a shared key 123456789, syntax is:
    <img src="/viewimage.php?hashp=12345679012...">
    +YouCanEditHtmlSource=
    You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

    You can also include content of another Page/Container with the following syntax:
    <?php includeContainer('alias_of_container_to_include'); ?>

    You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
    <?php redirectToContainer('alias_of_container_to_redirect_to'); ?>

    To add a link to another page, use the syntax:
    <a href="alias_of_page_to_link_to.php">mylink<a>

    To include a link to download a file stored into the documents directory, use the document.php wrapper:
    Example, for a file into documents/ecm (need to be logged), syntax is:
    <a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
    For a file into documents/medias (open directory for public access), syntax is:
    <a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
    For a file shared with a share link (open access using the sharing hash key of file), syntax is:
    <a href="/document.php?hashp=publicsharekeyoffile">
    +YouCanEditHtmlSource1=
    To include an image stored into the documents directory, use the viewimage.php wrapper.
    Example, for an image into documents/medias (open directory for public access), syntax is:
    <img src="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
    YouCanEditHtmlSource2=For an image shared with a share link (open access using the sharing hash key of file), syntax is:
    <img src="/viewimage.php?hashp=12345679012...">
    -YouCanEditHtmlSourceMore=
    More examples of HTML or dynamic code available on the wiki documentation
    . +YouCanEditHtmlSource3=To get the URL of the image of a PHP object, use
    <img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
    +YouCanEditHtmlSourceMore=
    More examples of HTML or dynamic code available on the wiki documentation.
    ClonePage=Clone page/container CloneSite=Clone site SiteAdded=Website added diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 61627ee39c8..23b7a975312 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -60,10 +60,11 @@ NoPageYet=Pas de page pour l'instant YouCanCreatePageOrImportTemplate=Vous pouvez créer une nouvelle page ou importer un modèle de site Web complet. SyntaxHelp=Aide sur quelques astuces spécifiques de syntaxe YouCanEditHtmlSourceckeditor=Vous pouvez éditer le code source en activant l'éditeur HTML avec le bouton "Source". -YouCanEditHtmlSource=
    Vous pouvez inclure du code PHP dans cette source en utilisant les balises <?php ?>. Les variables globales suivantes sont disponibles: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

    Vous pouvez également inclure le contenu d'une autre page / conteneur avec la syntaxe suivante:
    <?php includeContainer ('alias_of_container_to_include'); ?>

    Vous pouvez créer une redirection vers une autre page / conteneur avec la syntaxe suivante (Remarque: ne pas afficher de contenu avant une redirection):
    <?php redirectToContainer ('alias_of_container_to_redirect_to'); ?>

    Pour ajouter un lien vers une autre page, utilisez la syntaxe:
    <a href="alias_of_page_to_link_to.php">mylink<a>

    Pour inclure un lien pour télécharger un fichier stocké dans le répertoire des documents , utilisez l'encapsuleur document.php :
    Exemple, pour un fichier dans documents/ecm (besoin d'être loggué), la syntaxe est:
    <a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
    Pour un fichier dans des documents/medias (répertoire ouvert pour accès public), la syntaxe est:
    <a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
    Pour un fichier partagé avec un lien de partage (accès ouvert en utilisant la clé de partage du fichier), la syntaxe est la suivante:
    <a href="/document.php?hashp=publicsharekeyoffile">

    Pour inclure une image stockée dans le répertoire documents, utilisez le wrapper viewimage.php :
    Exemple, pour une image dans des documents/medias (répertoire ouvert), la syntaxe est:
    <img src = "/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
    -#YouCanEditHtmlSource2=
    To include a image shared publicly, use the viewimage.php wrapper:
    Example with a shared key 123456789, syntax is:
    <img src="/viewimage.php?hashp=12345679012...">
    +YouCanEditHtmlSource=
    Vous pouvez inclure du code PHP dans cette source en utilisant les balises <?php ?>. Les variables globales suivantes sont disponibles: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

    Vous pouvez également inclure le contenu d'une autre page / conteneur avec la syntaxe suivante:
    <?php includeContainer ('alias_of_container_to_include'); ?>

    Vous pouvez créer une redirection vers une autre page / conteneur avec la syntaxe suivante (Remarque: ne pas afficher de contenu avant une redirection):
    <?php redirectToContainer ('alias_of_container_to_redirect_to'); ?>

    Pour ajouter un lien vers une autre page, utilisez la syntaxe:
    <a href="alias_of_page_to_link_to.php">mylink<a>

    Pour inclure un lien pour télécharger un fichier stocké dans le répertoire des documents , utilisez l'encapsuleur document.php :
    Exemple, pour un fichier dans documents/ecm (besoin d'être loggué), la syntaxe est:
    <a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
    Pour un fichier dans des documents/medias (répertoire ouvert pour accès public), la syntaxe est:
    <a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
    Pour un fichier partagé avec un lien de partage (accès ouvert en utilisant la clé de partage du fichier), la syntaxe est la suivante:
    <a href="/document.php?hashp=publicsharekeyoffile">
    +YouCanEditHtmlSource1=
    Pour inclure une image stockée dans le répertoire documents, utilisez le wrapper viewimage.php.
    Exemple, pour une image dans des documents/medias (répertoire ouvert), la syntaxe est:
    <img src = "/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
    YouCanEditHtmlSource2=Pour une image partagée avec un lien de partage (accès ouvert à l'aide de la clé de partage du fichier), la syntaxe est la suivante:
    <img src = "/viewimage.php?hashp=12345679012...">
    -YouCanEditHtmlSourceMore=
    Plus d'exemples de code HTML ou dynamique disponible sur la documentation wiki
    . +YouCanEditHtmlSource3=Pour afficher l'image d'un object dans du code PHP, utilisez
    <img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
    +YouCanEditHtmlSourceMore=
    Plus d'exemples de code HTML ou dynamique disponible sur la documentation wiki .
    ClonePage=Cloner la page/container CloneSite=Cloner le site SiteAdded=Site web ajouté diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 1f167bab403..3a19d530054 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -668,7 +668,7 @@ if ($id > 0) { $total_interest = 0; $total_capital = 0; - print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '
    '; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
    '; print ''; print ''; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 4830cca6d2e..099db8e418c 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -475,7 +475,7 @@ class Loan extends CommonObject * Return label of loan status (unpaid, paid) * * @param int $mode 0=label, 1=short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label - * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) * @return string Label */ public function getLibStatut($mode = 0, $alreadypaid = -1) @@ -489,7 +489,7 @@ class Loan extends CommonObject * * @param int $status Id status * @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto - * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount paid if you have it, 1 otherwise) + * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommend to put here amount paid if you have it, 1 otherwise) * @return string Label */ public function LibStatut($status, $mode = 0, $alreadypaid = -1) diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 7ade6bb92af..d7487780413 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -323,7 +323,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
    '; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
    '.$langs->trans("RefPayment").'
    '."\n"; // Fields title search diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 2310dfb89a6..da6159fb493 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -39,7 +39,7 @@ $confirm = GETPOST('confirm'); if ($user->socid) { $socid = $user->socid; } -// TODO ajouter regle pour restreindre acces paiement +// TODO ajouter regle pour restreindre access paiement //$result = restrictedArea($user, 'facture', $id,''); $payment = new PaymentLoan($db); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 1285b09c9cc..fd66843f7b5 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -70,7 +70,7 @@ if ($res > 0) { } } -// Set current line with last unpaid line (only if shedule is used) +// Set current line with last unpaid line (only if schedule is used) if (!empty($line_id)) { $line = new LoanSchedule($db); $res = $line->fetch($line_id); @@ -125,7 +125,7 @@ if ($action == 'add_payment') { $remaindertopay = price2num(GETPOST('remaindertopay')); $amount = $pay_amount_capital + $pay_amount_insurance + $pay_amount_interest; - // This term is allready paid + // This term is already paid if (!empty($line) && !empty($line->fk_bank)) { setEventMessages($langs->trans('TermPaidAllreadyPaid'), null, 'errors'); $error++; diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index fda8d22c792..e4a9424c21c 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -198,7 +198,7 @@ $(document).ready(function() { var idcap=echeance-1; idcap = '#hi_capital'+idcap; var capital=price2numjs($(idcap).val()); - console.log("Change montly amount echeance="+echeance+" idcap="+idcap+" capital="+capital); + console.log("Change monthly amount echeance="+echeance+" idcap="+idcap+" capital="+capital); $.ajax({ method: "GET", dataType: 'json', diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 8fe6da4726f..b7ef7d99eb9 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -238,7 +238,7 @@ class MailmanSpip // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Fonction qui dit si cet utilisateur est un redacteur existant dans spip + * Indicate if the user is an existing editor in spip * * @param object $object Object with data (->login) * @return int 1=exists, 0=does not exists, -1=error @@ -257,11 +257,11 @@ class MailmanSpip if ($result) { if ($mydb->num_rows($result)) { - // nous avons au moins une reponse + // At least one result for the login query $mydb->close(); return 1; } else { - // nous n'avons pas de reponse => n'existe pas + // No result for the login query $mydb->close(); return 0; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7fc2ca7777d..1fe210bd0a6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -80,7 +80,7 @@ function realCharForNumericEntities($matches) /** * Security: WAF layer for SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF). * Warning: Such a protection can't be enough. It is not reliable as it will always be possible to bypass this. Good protection can - * only be guaranted by escaping data during output. + * only be guaranteed by escaping data during output. * * @param string $val Brute value found into $_GET, $_POST or PHP_SELF * @param string $type 0=POST, 1=GET, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test) @@ -176,6 +176,7 @@ function testSqlAndScriptInject($val, $type) $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)[a-z]*\s*=/i', $val); $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)[a-z]*\s*=/i', $val); // More not into the previous list + $inj += preg_match('/on(repeat|begin|finish|beforeinput)[a-z]*\s*=/i', $val); // We refuse html into html because some hacks try to obfuscate evil strings by inserting HTML into HTML. Example: error=alert(1) to bypass test on onerror @@ -746,7 +747,7 @@ if (!defined('NOLOGIN')) { // Check code if (!$ok) { - dol_syslog('Bad value for code, connexion refused', LOG_NOTICE); + dol_syslog('Bad value for code, connection refused', LOG_NOTICE); // Load translation files required by page $langs->loadLangs(array('main', 'errors')); @@ -854,7 +855,7 @@ if (!defined('NOLOGIN')) { } if (!$login) { - dol_syslog('Bad password, connexion refused (see a previous notice message for more info)', LOG_NOTICE); + dol_syslog('Bad password, connection refused (see a previous notice message for more info)', LOG_NOTICE); // Load translation files required by page $langs->loadLangs(array('main', 'errors')); @@ -888,12 +889,12 @@ if (!defined('NOLOGIN')) { } // End test login / passwords - if (!$login || (in_array('ldap', $authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connexion is a success. + if (!$login || (in_array('ldap', $authmode) && empty($passwordtotest))) { // With LDAP we refused empty password because some LDAP are "opened" for anonymous access so connection is a success. // No data to test login, so we show the login page. dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." - action=".GETPOST('action', 'aZ09')." - actionlogin=".GETPOST('actionlogin', 'aZ09')." - showing the login form and exit", LOG_NOTICE); if (defined('NOREDIRECTBYMAINTOLOGIN')) { // When used with NOREDIRECTBYMAINTOLOGIN set, the http header must already be set when including the main. - // See example with selectsearchbox.php. This case is reserverd for the selectesearchbox.php so we can + // See example with selectsearchbox.php. This case is reserved for the selectesearchbox.php so we can // report a message to ask to login when search ajax component is used after a timeout. //top_httphead(); return 'ERROR_NOT_LOGGED'; @@ -908,7 +909,7 @@ if (!defined('NOLOGIN')) { $resultFetchUser = $user->fetch('', $login, '', 1, ($entitytotest > 0 ? $entitytotest : -1)); // value for $login was retrieved previously when checking password. if ($resultFetchUser <= 0 || $user->isNotIntoValidityDateRange()) { - dol_syslog('User not found or not valid, connexion refused'); + dol_syslog('User not found or not valid, connection refused'); session_destroy(); session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie session_name($sessionname); @@ -994,7 +995,7 @@ if (!defined('NOLOGIN')) { dol_syslog("The user login is disabled"); } else { // User validity dates are no more valid - dol_syslog("The user login has a validity between [".$user->datestartvalidity." and ".$user->dateendvalidity."], curren date is ".dol_now()); + dol_syslog("The user login has a validity between [".$user->datestartvalidity." and ".$user->dateendvalidity."], current date is ".dol_now()); } session_destroy(); session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie @@ -1109,7 +1110,7 @@ if (!defined('NOLOGIN')) { } // Is it a new session that has started ? - // If we are here, this means authentication was successfull. + // If we are here, this means authentication was successful. if (!isset($_SESSION["dol_login"])) { // New session for this login has started. $error = 0; @@ -1165,7 +1166,7 @@ if (!defined('NOLOGIN')) { } // End call triggers - // Hooks on successfull login + // Hooks on successful login $action = ''; $hookmanager->initHooks(array('login')); $parameters = array('dol_authmode'=>$dol_authmode, 'dol_loginfo'=>$loginfo); @@ -1296,7 +1297,7 @@ if (!empty($conf->browser->layout) && $conf->browser->layout != 'classic') { $conf->dol_no_mouse_hover = 1; } -// If on smartphone or optmized for small screen +// If on smartphone or optimized for small screen if ((!empty($conf->browser->layout) && $conf->browser->layout == 'phone') || (!empty($_SESSION['dol_screenwidth']) && $_SESSION['dol_screenwidth'] < 400) || (!empty($_SESSION['dol_screenheight']) && $_SESSION['dol_screenheight'] < 400 @@ -1440,7 +1441,7 @@ if (!function_exists("llxHeader")) { /** * Show HTML header HTML + BODY + Top menu + left menu + DIV * - * @param string $head Optionnal head lines + * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage @@ -1651,10 +1652,10 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0) } /** - * Ouput html header of a page. It calls also top_httphead() + * Output html header of a page. It calls also top_httphead() * This code is also duplicated into security2.lib.php::dol_loginfunction * - * @param string $head Optionnal head lines + * @param string $head Optional head lines * @param string $title HTML title * @param int $disablejs Disable js output * @param int $disablehead Disable head output @@ -1719,6 +1720,13 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr // Mobile appli like icon $manifest = DOL_URL_ROOT.'/theme/'.$conf->theme.'/manifest.json.php'; + $parameters = array('manifest'=>$manifest); + $resHook = $hookmanager->executeHooks('hookSetManifest', $parameters); // Note that $action and $object may have been modified by some hooks + if ($resHook > 0) { + $manifest = $hookmanager->resPrint; // Replace manifest.json + } else { + $manifest .= $hookmanager->resPrint; // Concat to actual manifest declaration + } if (!empty($manifest)) { print ''."\n"; } @@ -1763,7 +1771,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print "\n"; if (GETPOST('version', 'int')) { - $ext = 'version='.GETPOST('version', 'int'); // usefull to force no cache on css/js + $ext = 'version='.GETPOST('version', 'int'); // useful to force no cache on css/js } // Refresh value of MAIN_IHM_PARAMS_REV before forging the parameter line. if (GETPOST('dol_resetcache')) { @@ -2179,14 +2187,25 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $toprightmenu .= $form->textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2); } - // Link to print main content area + // Link to print main content area (optioncss=print) if (!getDolGlobalString('MAIN_PRINT_DISABLELINK') && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { $qs = dol_escape_htmltag($_SERVER["QUERY_STRING"]); if (isset($_POST) && is_array($_POST)) { foreach ($_POST as $key => $value) { - if ($key !== 'action' && $key !== 'password' && !is_array($value)) { - $qs .= '&'.$key.'='.urlencode($value); + if (in_array($key, array('action', 'massaction', 'password'))) { + continue; + } + if (!is_array($value)) { + if ($value !== '') { + $qs .= '&'.$key.'='.urlencode($value); + } + } else { + foreach ($value as $value2) { + if ($value2 !== '') { + $qs .= '&'.$key.'[]='.urlencode($value2); + } + } } } } @@ -2556,12 +2575,12 @@ function top_menu_user($hideloginname = 0, $urllogout = '') }); jQuery("#topmenulogincompanyinfo-btn").on("click", function() { - console.log("Clik on #topmenulogincompanyinfo-btn"); + console.log("Click on #topmenulogincompanyinfo-btn"); jQuery("#topmenulogincompanyinfo").slideToggle(); }); jQuery("#topmenuloginmoreinfo-btn").on("click", function() { - console.log("Clik on #topmenuloginmoreinfo-btn"); + console.log("Click on #topmenuloginmoreinfo-btn"); jQuery("#topmenuloginmoreinfo").slideToggle(); });'; } @@ -2983,7 +3002,7 @@ function top_menu_search()