diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000000..fbe406e6c46 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,16 @@ +# Workflow run order + +To reduce run minutes, the following order is put in place: + +On PR & Merge, always run: + +- pre-commit; +- phan. + +When both succeed, start: + +- phpstan; +- Windows-ci; +- travis. + +See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..39edbc3496b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: "CI" + +on: [push, pull_request] +jobs: + pre-commit: + uses: ./.github/workflows/pre-commit.yml + secrets: inherit + with: + gh_event: ${{ github.event_name }} + phan: + uses: ./.github/workflows/phan.yml + secrets: inherit + with: + gh_event: ${{ github.event_name }} + phpstan: + uses: ./.github/workflows/phpstan.yml + secrets: inherit + needs: [pre-commit, phan] + with: + gh_event: ${{ github.event_name }} + windows-ci: + needs: [pre-commit, phan] + secrets: inherit + uses: ./.github/workflows/windows-ci.yml + with: + gh_event: ${{ github.event_name }} + gh-travis: # Runs travis script on github runner (not on travis) + if: false + # needs: [pre-commit, phan] + # needs: [windows-ci] + secrets: inherit + uses: ./.github/workflows/gh-travis.yml + with: + gh_event: ${{ github.event_name }} + + +# Note (not tested, from https://github.com/orgs/community/discussions/38361) +# To cancel jobs if one failes, the following action may help +# - if: "failure()" +# uses: "andymckay/cancel-action@0.3" diff --git a/.github/workflows/gh-travis.yml b/.github/workflows/gh-travis.yml new file mode 100644 index 00000000000..30c10765f07 --- /dev/null +++ b/.github/workflows/gh-travis.yml @@ -0,0 +1,49 @@ +--- +# This runs a travis script inside a github runner +name: Travis +# Controls when the workflow will run +on: + # push: + # pull_request: + workflow_call: + inputs: + gh_event: + required: true + type: string + workflow_dispatch: + +concurrency: + group: travis-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref + }} + cancel-in-progress: true +env: + gh_event: ${{ inputs.gh_event || github.event_name }} + GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action +# 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 + gh-travis: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + fail-fast: false + # matrix: + # php-version: + # # PHPStan requires PHP >= 7.2. + # #- "7.2" + # - "8.2" + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Checkout travis file + uses: actions/checkout@v4 + - name: Run .travis.yml build script + uses: ktomk/run-travis-yml@v1 + with: + # run-job: travis # name of a job in travis file + allow-failure: false + # file: .travis.yml + # steps: | # Default: setup, before_install, install, before_script, script, after_script, before_deploy + # install + # script + # env: + # TRAVIS_PHP_VERSION: ${{ matrix.php-version }} diff --git a/.github/workflows/phan.yml b/.github/workflows/phan.yml index 67bec077a13..f233c24907c 100644 --- a/.github/workflows/phan.yml +++ b/.github/workflows/phan.yml @@ -1,16 +1,22 @@ --- on: - pull_request: - push: - schedule: - # execute once a day, the 1st - - cron: 10 9 * * * + # pull_request: + # push: + # schedule: + # # execute once a day, the 1st + # - cron: 10 9 * * * + workflow_call: + inputs: + gh_event: + required: true + type: string workflow_dispatch: + concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: phan-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: - # Do pull analysis on schedule or manual dispatch + gh_event: ${{ inputs.gh_event || github.event_name }} PHAN_CONFIG: > ${{ ( github.event.schedule || github.event_name == 'workflow_dispatch' ) @@ -21,6 +27,7 @@ env: PHAN_MIN_PHP: 7.0 PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }} GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action + name: phan jobs: phan: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index cbe0f4b2732..c638ee83e50 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,16 +1,25 @@ +--- # This is a basic workflow to check code with PHPSTAN tool - -name: "PHPStan" - +name: PHPStan # Controls when the workflow will run -on: [push, pull_request] -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true +on: + # push: + # pull_request: + workflow_call: + inputs: + gh_event: + required: true + type: string + workflow_dispatch: +concurrency: + group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref + }} + cancel-in-progress: true env: - CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} - GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action + gh_event: ${{ inputs.gh_event || github.event_name }} + CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} + GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action # 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 @@ -23,7 +32,7 @@ jobs: php-version: # PHPStan requires PHP >= 7.2. #- "7.2" - - "8.2" + - '8.2' # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -34,9 +43,10 @@ jobs: id: setup-php uses: shivammathur/setup-php@v2 with: - php-version: "${{ matrix.php-version }}" + php-version: ${{ matrix.php-version }} tools: phpstan, cs2pr - extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap, mysql, pgsql, sqlite3, ldap, xml, mcrypt + extensions: calendar, json, imagick, gd, zip, mbstring, intl, opcache, imap, + mysql, pgsql, sqlite3, ldap, xml, mcrypt # Restore old cache - name: Restore phpstan cache @@ -44,7 +54,8 @@ jobs: uses: actions/cache/restore@v4 with: path: ./.github/tmp - key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{ github.run_id }} + key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{ + github.run_id }} restore-keys: | phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}- phpstan-cache-${{ matrix.php-version }}-${{ github.head_ref }}- @@ -61,12 +72,13 @@ jobs: # continue-on-error: true # Save cache - - name: "Save phpstan cache" + - name: Save phpstan cache uses: actions/cache/save@v4 if: ${{ success() || ( ! cancelled() && steps.cache.outputs.cache-hit != 'true' ) }} with: path: ./.github/tmp - key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{ github.run_id }} + key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{ + github.run_id }} - name: Provide phpstan log as artifact uses: actions/upload-artifact@v4 if: ${{ always() }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 671a266c767..f113a8a7a36 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,8 +1,17 @@ --- name: pre-commit on: - pull_request: - push: + # pull_request: + # push: + workflow_call: + inputs: + gh_event: + required: true + type: string + workflow_dispatch: + +env: + gh_event: ${{ inputs.gh_event || github.event_name }} jobs: pre-commit: runs-on: ubuntu-latest @@ -20,7 +29,7 @@ jobs: - name: Get all changed php files (if PR) id: changed-php uses: tj-actions/changed-files@v43 - if: github.event_name == 'pull_request' + if: env.gh_event == 'pull_request' with: files: | **.php @@ -58,7 +67,7 @@ jobs: # - name: Get all changed php files (if PR) # id: changed-php # uses: tj-actions/changed-files@v43 - # if: github.event_name == 'pull_request' + # if: env.gh_event == 'pull_request' # with: # files: | # **.php @@ -72,7 +81,7 @@ jobs: steps.changed-php.outputs.any_changed == 'true' || ( - github.event_name == 'push' + env.gh_event == 'push' && ( github.event.ref == 'refs/heads/develop' || endsWith(github.event.ref, '.0') @@ -94,7 +103,7 @@ jobs: - name: Run some pre-commit hooks on all files on push to "main" branches if: | - github.event_name == 'push' + env.gh_event == 'push' && ( github.event.ref == 'refs/heads/develop' || endsWith(github.event.ref, '.0') diff --git a/.github/workflows/windows-ci.yaml b/.github/workflows/windows-ci.yml similarity index 94% rename from .github/workflows/windows-ci.yaml rename to .github/workflows/windows-ci.yml index cb467055156..f85ad2535be 100644 --- a/.github/workflows/windows-ci.yaml +++ b/.github/workflows/windows-ci.yml @@ -2,19 +2,26 @@ name: Win CI # yamllint disable-line rule:truthy on: - push: - pull_request: + # push: + # pull_request: + workflow_call: + inputs: + gh_event: + required: true + type: string workflow_dispatch: + concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref + group: win-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: + gh_event: ${{ inputs.gh_event || github.event_name }} PHPUNIT_LOG: phpunit_tests.log DOLIBARR_LOG: documents/dolibarr.log PHPSERVER_LOG: phpserver.log PHPSERVER_DOMAIN_PORT: 127.0.0.1:8000 # could be 127.0.0.1:8000 if config modified - CACHE_KEY_PART: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} + CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }} PHP_INI_SCAN_DIR: C:\myphpini CKEY: win-ci-2 GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action diff --git a/COPYRIGHT b/COPYRIGHT index e6525d5ccb2..a94d93ede38 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -68,7 +68,7 @@ jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes jQuery jquerytreeview 1.4.1 MIT License Yes JS library for filetree 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) +jsGanttImproved 2.8.10 BSD License Yes JS library (to build Gantt reports) SwaggerUI 2.2.10 GPL-2+ Yes JS library to offer the REST API explorer Image libraries: diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 58723960150..3f62333d5e8 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -31,7 +31,7 @@ Replace: d.items&& With d&&d.items&& - + ESCPOS: ------- @@ -55,8 +55,8 @@ NUSOAP: * Line 1257 of file nusoap.php. Add: libxml_disable_entity_loader(true); // Avoid load of external entities (security problem). Required only for libxml < 2. - - + + * Line 4346 of file nusoap.php $rev = array(); @@ -128,13 +128,13 @@ with if (!@TCPDF_STATIC::file_exists($file)) { // DOL CHANGE If we keep this, the image is not visible on pages after the first one. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file))); - //return false; + //return false; $tfile = str_replace(' ', '%20', $file); if (@TCPDF_STATIC::file_exists($tfile)) { $file = $tfile; } } - + * Replace in tcpdf.php: if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { with @@ -174,7 +174,7 @@ with imagesetpixel($imgalpha, $xpx, $ypx, $alpha); into imagesetpixel($imgalpha, $xpx, $ypx, (int) $alpha); - + * Removed useless directories ("examples", "tools") * Optionally, removed all fonts except @@ -243,7 +243,7 @@ with: with foreach ($value[1] as $k => $v) { -* Fix by replacing +* Fix by replacing if ($res[0] == PDF_TYPE_OBJECT) with if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT) @@ -253,23 +253,16 @@ with JSGANTT: -------- * Replace in function JSGantt.taskLink - var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth); + window.open(pRef, 'newwin', 'height=' + vHeight + ',width=' + vWidth); with - // LDR To open in same window + // @CHANGE DOLI To open in same window //var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth); window.location.href=pRef -* Replace - vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource()); -with - var vTmpNode=this.newNode(vTmpCell, 'div', null, ''); - vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']); - vTmpNode.setAttribute('href',vTaskList[i].getLink()); - * Replace '% Comp.' to have a smaller text column header - 'comp':'% Comp.' + 'comp': '%...' with - 'comp':'%' + 'comp': '%' @@ -307,19 +300,19 @@ RESTLER: // @CHANGE LDR if (!is_string($haystack)) return false; -* Replace +* Replace $loaders = array_unique(static::$rogueLoaders); - - with - + + with + $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); - + * Replace CommentParser.php line 423 elseif (count($value) && is_numeric($value[0])) - + with - + elseif (count($value) && isset($value[0]) && is_numeric($value[0])) * Add CommentParser.php line 406 & 407 to remove a warning on api request in php 8.1 @@ -417,5 +410,3 @@ Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: .select2-hidden-accessible { margin: -10000px !important; /* line to restore */ } - - diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index f39b1262064..52c70f4f641 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -47,7 +47,7 @@ return [ 'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanRedefineFunctionInternal'], 'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition'], 'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'], - 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'], + 'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidRightOperandOfAdd'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch'], 'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'], 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 01043b3adc3..5de8de73754 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -463,7 +463,7 @@ return [ // 'PhanTypeMismatchPropertyProbablyReal', // 'PhanPluginNoCommentOnPrivateMethod', 'PhanPluginUnknownArrayFunctionReturnType', - 'PhanTypeInvalidLeftOperandOfAdd', + // 'PhanTypeInvalidLeftOperandOfAdd', // 'PhanPluginNoCommentOnPrivateProperty', // 'PhanPluginNoCommentOnFunction', 'PhanPluginUnknownArrayFunctionParamType', @@ -473,14 +473,14 @@ return [ // 'PhanPluginRedundantAssignment', 'PhanTypeExpectedObjectPropAccess', - 'PhanTypeInvalidRightOperandOfNumericOp', + // 'PhanTypeInvalidRightOperandOfNumericOp', // 'PhanPluginInlineHTML', // 'PhanPluginInlineHTMLTrailing', // 'PhanPluginUnknownFunctionReturnType', // 'PhanPluginDescriptionlessCommentOnProtectedProperty', 'PhanPluginRedundantAssignmentInGlobalScope', // 'PhanTypeMismatchDeclaredParamNullable', - 'PhanTypeInvalidRightOperandOfAdd', + // 'PhanTypeInvalidRightOperandOfAdd', // 'PhanPluginDescriptionlessCommentOnPrivateProperty', // 'PhanUndeclaredVariableDim', // Array initialisation on undeclared var: $abc['x']='ab' 'PhanTypeInvalidPropertyName', @@ -600,7 +600,7 @@ return [ // 'PhanPluginUnreachableCode', // 'PhanTypeMismatchArgumentInternal', // 'PhanPluginAlwaysReturnMethod', - 'PhanUndeclaredClassMethod', + // 'PhanUndeclaredClassMethod', 'PhanUndeclaredMethod', 'PhanTypeMismatchArgumentProbablyReal', 'PhanPluginDuplicateExpressionAssignmentOperation', // Suggestions for optimisation @@ -608,7 +608,7 @@ return [ // 'PhanPluginAlwaysReturnMethod', // 'PhanPluginMissingReturnMethod', // 'PhanUndeclaredTypeReturnType', - 'PhanUndeclaredClassProperty', + // 'PhanUndeclaredClassProperty', 'PhanTypeArraySuspiciousNullable', // 'PhanPluginInconsistentReturnMethod', 'PhanTypeExpectedObjectPropAccessButGotNull', @@ -643,11 +643,13 @@ return [ 'ftp' => PHAN_DIR . '/stubs/ftp.phan_php', 'gd' => PHAN_DIR . '/stubs/gd.phan_php', 'geoip' => PHAN_DIR . '/stubs/geoip.phan_php', + 'imagick' => PHAN_DIR . '/stubs/imagick.phan_php', 'imap' => PHAN_DIR . '/stubs/imap.phan_php', 'intl' => PHAN_DIR . '/stubs/intl.phan_php', 'ldap' => PHAN_DIR . '/stubs/ldap.phan_php', 'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php', 'memcache' => PHAN_DIR . '/stubs/memcache.phan_php', + 'memcached' => PHAN_DIR . '/stubs/memcached.phan_php', 'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php', 'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php', 'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php', @@ -658,6 +660,7 @@ return [ 'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php', 'soap' => PHAN_DIR . '/stubs/soap.phan_php', 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', + 'tidy' => PHAN_DIR . '/stubs/tidy.phan_php', 'zip' => PHAN_DIR . '/stubs/zip.phan_php', ], ]; diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index b5f0123526c..6fdb39c0621 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -397,10 +397,12 @@ return [ 'gd' => PHAN_DIR . '/stubs/gd.phan_php', 'geoip' => PHAN_DIR . '/stubs/geoip.phan_php', 'imap' => PHAN_DIR . '/stubs/imap.phan_php', + 'imagick' => PHAN_DIR . '/stubs/imagick.phan_php', 'intl' => PHAN_DIR . '/stubs/intl.phan_php', 'ldap' => PHAN_DIR . '/stubs/ldap.phan_php', 'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php', 'memcache' => PHAN_DIR . '/stubs/memcache.phan_php', + 'memcached' => PHAN_DIR . '/stubs/memcached.phan_php', 'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php', 'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php', 'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php', @@ -411,6 +413,7 @@ return [ 'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php', 'soap' => PHAN_DIR . '/stubs/soap.phan_php', 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', + 'tidy' => PHAN_DIR . '/stubs/tidy.phan_php', 'zip' => PHAN_DIR . '/stubs/zip.phan_php', ], diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index b12c94d6468..5df01eb7ae6 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -228,10 +228,12 @@ return [ 'gd' => PHAN_DIR . '/stubs/gd.phan_php', 'geoip' => PHAN_DIR . '/stubs/geoip.phan_php', 'imap' => PHAN_DIR . '/stubs/imap.phan_php', + 'imagick' => PHAN_DIR . '/stubs/imagick.phan_php', 'intl' => PHAN_DIR . '/stubs/intl.phan_php', 'ldap' => PHAN_DIR . '/stubs/ldap.phan_php', 'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php', 'memcache' => PHAN_DIR . '/stubs/memcache.phan_php', + 'memcached' => PHAN_DIR . '/stubs/memcached.phan_php', 'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php', 'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php', 'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php', @@ -241,6 +243,7 @@ return [ 'session' => PHAN_DIR . '/stubs/session.phan_php', 'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php', 'soap' => PHAN_DIR . '/stubs/soap.phan_php', + 'tidy' => PHAN_DIR . '/stubs/tidy.phan_php', 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', 'zip' => PHAN_DIR . '/stubs/zip.phan_php', ], diff --git a/dev/tools/phan/stubs/imagick.phan_php b/dev/tools/phan/stubs/imagick.phan_php new file mode 100644 index 00000000000..e9bb9db450a --- /dev/null +++ b/dev/tools/phan/stubs/imagick.phan_php @@ -0,0 +1,1216 @@ + + */ +class ActionsMulticompany +{ + /** + * @param DoliDB $db + */ + public function __construct($db) + { + } + /** @ver string */ + public $id; + /** @ver string */ + public $label; + /** @var array{stock:string[],referent:string} */ + public $sharings; + /** @ver DoliDB */ + public $db; +} diff --git a/dev/tools/phan/stubs/tidy.phan_php b/dev/tools/phan/stubs/tidy.phan_php new file mode 100644 index 00000000000..5ac1bc69f4e --- /dev/null +++ b/dev/tools/phan/stubs/tidy.phan_php @@ -0,0 +1,244 @@ +trans(\$key.'SomeString')." echo "## You can add such dynamic keys to $(basename "$DYNAMIC_KEYS_SRC_FILE")" echo "## so that they are ignored for this report." - echo "## :warning: Unused Translations may be commented in the code" + echo "## :warning: Unused Translations may also be commented in the code" echo "## You can add such 'disabled' keys to $(basename "$EXCLUDE_KEYS_SRC_FILE")" echo "## so that they are ignored for this report." echo diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 188915b0ec0..5e30c3d0a50 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -44,7 +44,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ac $search_subaccount = GETPOST('search_subaccount', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$search_type = GETPOSTINT('search_type'); +$search_type = GETPOST('search_type', 'intcomma'); // Security check if ($user->socid > 0) { @@ -128,6 +128,7 @@ $form = new Form($db); // Page Header $help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration'; $title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger'); + llxHeader('', $title, $help_url); @@ -300,14 +301,17 @@ if ($resql) { if ($limit > 0 && $limit != $conf->liste_limit) { $param .= '&limit='.((int) $limit); } + if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); + } if ($search_subaccount) { $param .= '&search_subaccount='.urlencode($search_subaccount); } if ($search_label) { $param .= '&search_label='.urlencode($search_label); } - if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); + if ($search_type) { + $param .= '&search_type='.urlencode($search_type); } // List of mass actions available @@ -373,7 +377,7 @@ if ($resql) { print '
| '; + print ' | '; print ' | '; print ' | ';
print ' ';
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 84128d37f94..eedb807e396 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -55,7 +55,7 @@ $mesCasesCochees = GETPOST('toselect', 'array');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
-$search_lineid = GETPOSTINT('search_lineid');
+$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
$search_ref = GETPOST('search_ref', 'alpha');
$search_invoice = GETPOST('search_invoice', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php
index 60f08f4992d..cb0317d5c01 100644
--- a/htdocs/accountancy/expensereport/lines.php
+++ b/htdocs/accountancy/expensereport/lines.php
@@ -39,9 +39,10 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "pro
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
-$account_parent = GETPOSTINT('account_parent');
+$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
// Search Getpost
+$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
$search_login = GETPOST('search_login', 'alpha');
$search_expensereport = GETPOST('search_expensereport', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
@@ -101,6 +102,7 @@ $formaccounting = new FormAccounting($db);
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
+ $search_lineid = '';
$search_login = '';
$search_expensereport = '';
$search_label = '';
@@ -203,6 +205,9 @@ $sql .= " WHERE erd.fk_code_ventilation > 0";
$sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
// Add search filter like
+if (strlen($search_lineid)) {
+ $sql .= natural_search("fd.rowid", $search_lineid, 1);
+}
if (strlen(trim($search_login))) {
$sql .= natural_search("u.login", $search_login);
}
@@ -314,7 +319,7 @@ if ($result) {
print ' ';
$moreforfilter = '';
@@ -322,8 +327,8 @@ if ($result) {
print ''.$langs->trans("ChangeAccount").' ';
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
- print ' ';
+ print '
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||