From 72305a92188d5dd09598d0981a594ffa0ffe7490 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 5 Feb 2024 13:35:20 +0100 Subject: [PATCH 1/3] Qual: pre-commit: run phpcs on all files in 'main' branches. (#28018) This change to the workflow will run phpcs on all files in develop, 17.0, 18.0, ... (rule== branch ends in .0). This ensures that phpcs is run in a github workflow for fast phpcs issue detection in the develop and other main branches. Ultimately, this means that the PHPCS action can be disabled in branches where it is active. But I propose to verify that the updated action does the job as expected (tested in a fork it is ok). --- .github/workflows/pre-commit.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5853729bdd0..e37cecf0a43 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -65,7 +65,17 @@ jobs: - name: Setup PHPCS uses: shivammathur/setup-php@v2 - if: steps.changed-php.outputs.any_changed == 'true' + # Install when we're going to run phpcs + if: | + steps.changed-php.outputs.any_changed == 'true' + || + ( + github.event_name == 'push' + && ( + github.event.ref == 'refs/heads/develop' + || endsWith(github.event.ref, '.0') + ) + ) with: php-version: 8.1 coverage: none # disable xdebug, pcov @@ -79,6 +89,17 @@ jobs: set -o pipefail pre-commit run php-cs --files ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG} + - name: Run some pre-commit hooks on all files on push to "main" branches + if: | + github.event_name == 'push' + && ( + github.event.ref == 'refs/heads/develop' + || endsWith(github.event.ref, '.0') + ) + run: | + set -o pipefail + pre-commit run -a php-cs | tee -a ${RAW_LOG} + # If error, we convert log in the checkstyle format - name: Convert Raw Log to CheckStyle format if: ${{ failure() }} From 015546b07cfc6936e1b1c6e67877fab1d4f1640d Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:20:34 +0100 Subject: [PATCH 2/3] FIX: line special_code never saved (#28051) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: NoƩ --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 800ef87b319..ecd8bb390f2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1968,7 +1968,7 @@ class CommandeFournisseur extends CommonOrder $this->line->total_localtax2 = $total_localtax2; $this->line->total_ttc = $total_ttc; $this->line->product_type = $type; - $this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0); + $this->line->special_code = (!empty($special_code) ? $special_code : 0); $this->line->origin = $origin; $this->line->origin_id = $origin_id; $this->line->fk_unit = $fk_unit; From cdad15bae374bb1cdb379e4adb5c13b6d337bd31 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Wed, 7 Feb 2024 16:28:12 +0100 Subject: [PATCH 3/3] FIX user filter in per user view of event list (#28049) --- htdocs/comm/action/peruser.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index aaf9ae7d8ca..3e5a17c3c9a 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -921,6 +921,9 @@ while ($currentdaytoshow < $lastdaytoshow) { $sql .= " WHERE u.entity IN (".getEntity('user').")"; } $sql .= " AND u.statut = 1"; + if ($filtert > 0) { + $sql .= " AND u.rowid = ".((int) $filtert); + } if ($usergroup > 0) { $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); }