From 4706b5d1fee9469ca758b6c09fe5f1d53daccd52 Mon Sep 17 00:00:00 2001 From: noec764 <58433943+noec764@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:59:07 +0100 Subject: [PATCH 01/31] Fix: Plain MSG Can be empty with \n (#32003) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Noé --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 25cc8a45fe7..7275ff3f2ef 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1800,7 +1800,7 @@ class EmailCollector extends CommonObject if ($imapemail->hasHTMLBody()) { $htmlmsg = $imapemail->getHTMLBody(); } - if ($imapemail->hasTextBody()) { + if ($imapemail->hasTextBody() && $imapemail->getTextBody() != "\n") { $plainmsg = $imapemail->getTextBody(); } if ($imapemail->hasAttachments()) { From d420d035defaf98cf2e5b549e9aa14f08e2ec5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 Nov 2024 13:02:14 +0100 Subject: [PATCH 02/31] Update pr-18.yaml (#32024) * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml --------- Co-authored-by: Laurent Destailleur --- .github/workflows/pr-18.yaml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 376bf29454f..3464d60fd03 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -4,17 +4,32 @@ on: - opened branches: - "18.0" + push: + branches: + - "18.0" jobs: run: runs-on: ubuntu-22.04 permissions: - pull-requests: write + pull-requests: write steps: - name: Create PR review request + continue-on-error: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} + # GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }} url: ${{ github.event.pull_request.html_url }} run: | - gh pr edit "$url" --add-assignee lvessiller-opendsi,rycks --add-reviewer lvessiller-opendsi,rycks - gh pr merge "$url" --merge --auto + # https://cli.github.com/manual/gh_api + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ + -f "reviewers[]=eldy" + #gh pr edit "$url" --add-assignee lvessiller-opendsi,rycks --add-reviewer lvessiller-opendsi,rycks + #gh pr merge "$url" --merge --auto From 877fd003533d144cbeacdbc5af81b1592ad0efdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2024 13:21:58 +0100 Subject: [PATCH 03/31] Update pr-18.yaml --- .github/workflows/pr-18.yaml | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 3464d60fd03..e78a72217b6 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -11,25 +11,25 @@ on: jobs: run: runs-on: ubuntu-22.04 - permissions: - pull-requests: write steps: - - name: Create PR review request - continue-on-error: true - env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN: ${{ github.token }} - # GH_TOKEN: ${{ github.token }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GH_TOKEN: ${{ secrets.AUTOMATION_TOKEN }} - url: ${{ github.event.pull_request.html_url }} - run: | - # https://cli.github.com/manual/gh_api - gh api \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \ - -f "reviewers[]=eldy" - #gh pr edit "$url" --add-assignee lvessiller-opendsi,rycks --add-reviewer lvessiller-opendsi,rycks - #gh pr merge "$url" --merge --auto + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install GitHub CLI + run: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 && \ + sudo apt-add-repository https://cli.github.com/packages && \ + sudo apt update && \ + sudo apt install gh -y + + - name: Authenticate GitHub CLI + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: gh auth login --with-token <<< "$GH_TOKEN" + + - name: Assign reviewer + env: + REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer + run: | + pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) + gh pr edit $pr_number --add-reviewer "$REVIEWER" From 991f53db9ebfb7cb3a98d34fa9c407c8df94835d Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 21 Nov 2024 17:46:54 +0100 Subject: [PATCH 04/31] FIX: use tax with code on supplier order line give tax code missing in supplier invoice (#32018) * FIX: use vat with code on supplier order result code missing in supplier invoice * FIX: use vat with code on supplier order result code missing in supplier invoice --- htdocs/fourn/commande/list.php | 8 +++++++- htdocs/fourn/facture/card.php | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 454af465920..60518e789fb 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -496,10 +496,16 @@ if (empty($reshook)) { if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) { $fk_parent_line = 0; } + + $tva_tx = $lines[$i]->tva_tx; + if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) { + $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; + } + $result = $objecttmp->addline( $desc, $lines[$i]->subprice, - $lines[$i]->tva_tx, + $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->qty, diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 23b9be4300c..6f90af4ba22 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1255,6 +1255,11 @@ if (empty($reshook)) { $date_end = $lines[$i]->date_end; } + $tva_tx = $lines[$i]->tva_tx; + if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) { + $tva_tx .= ' ('.$lines[$i]->vat_src_code.')'; + } + // FIXME Missing special_code into addline and updateline methods $object->special_code = $lines[$i]->special_code; @@ -1271,7 +1276,7 @@ if (empty($reshook)) { $result = $object->addline( $desc, $pu, - $lines[$i]->tva_tx, + $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->qty, From c12a7e144a5babe9feebc003d05682c2e92f16e5 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Thu, 21 Nov 2024 19:07:58 +0100 Subject: [PATCH 05/31] FIX TakePos barcode rule (#31857) * FIX TakePos barcode rule * Keep last test confition on barcode rule --- htdocs/takepos/ajax/ajax.php | 4 ++-- htdocs/takepos/index.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 249cdc04ed9..b196ed4a9f3 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -212,7 +212,7 @@ if ($action == 'getProducts') { if (isset($barcode_value_list['qd'])) { $qty_str .= '.' . $barcode_value_list['qd']; } - $qty = floatval($qty_str); + $qty = (float) $qty_str; } $objProd = new Product($db); @@ -241,7 +241,7 @@ if ($action == 'getProducts') { 'label' => $obj->label, 'tosell' => $obj->tosell, 'tobuy' => $obj->tobuy, - 'barcode' => $obj->barcode, + 'barcode' => $term, // there is only one product matches the barcode rule and so the term is considered as the barcode of this product, 'price' => empty($objProd->multiprices[$pricelevel]) ? $obj->price : $objProd->multiprices[$pricelevel], 'price_ttc' => empty($objProd->multiprices_ttc[$pricelevel]) ? $obj->price_ttc : $objProd->multiprices_ttc[$pricelevel], 'object' => 'product', diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 5ddd0e59b94..c18da67daca 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -731,7 +731,7 @@ function Search2(keyCodeForEnter, moreorless) { console.log("There is only 1 answer with barcode matching the search, so we change the thirdparty "+data[0]['rowid']); ChangeThirdparty(data[0]['rowid']); } - else if ($('#search').val() == data[0]['barcode'] && 'product' == data[0]['object']) { + else if ('product' == data[0]['object'] && $('#search').val() == data[0]['barcode']) { console.log("There is only 1 answer and we found search on a barcode, so we add the product in basket, qty="+data[0]['qty']); ClickProduct(0, data[0]['qty']); } From 240c5bb3115e7428ec1a1fd7e92c41f4234b5c08 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Thu, 21 Nov 2024 23:00:41 +0100 Subject: [PATCH 06/31] fix: buyer and sellers in supplier invoice and supplier order list are not corectly defined (#32028) * fix: buyer and sellers in supplier invoice and supplier order list are not corectly defined * chore: revert bad changes --- htdocs/fourn/commande/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 60518e789fb..33c59ea0330 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -391,6 +391,7 @@ if (empty($reshook)) { $societe = new Societe($db); $societe->fetch($cmd->socid); $objecttmp->vat_reverse_charge = $societe->vat_reverse_charge; + $objecttmp->thirdparty = $societe; } $objecttmp->socid = $cmd->socid; $objecttmp->type = $objecttmp::TYPE_STANDARD; From ec93f508631ab4c2a0d21df645af1c97f679aae3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 00:15:14 +0100 Subject: [PATCH 07/31] Test --- .github/workflows/pr-18.yaml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index 376bf29454f..11188dc974d 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,20 +1,29 @@ on: pull_request: - types: - - opened + types: [opened, reopened] branches: - "18.0" jobs: run: - runs-on: ubuntu-22.04 - permissions: - pull-requests: write + runs-on: ubuntu-latest steps: - - name: Create PR review request - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - url: ${{ github.event.pull_request.html_url }} - run: | - gh pr edit "$url" --add-assignee lvessiller-opendsi,rycks --add-reviewer lvessiller-opendsi,rycks - gh pr merge "$url" --merge --auto + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install GitHub CLI + run: | + sudo apt update + sudo apt install gh -y + + - name: Authenticate GitHub CLI + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: gh auth login --with-token <<< "$GH_TOKEN" + + - name: Assign reviewer + env: + REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer + run: | + pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) + gh pr edit $pr_number --add-reviewer "$REVIEWER" From c2a037842d502b79ebada741434b284a1b3b859b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 00:22:26 +0100 Subject: [PATCH 08/31] Add test --- .github/workflows/test.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000000..f49494c5522 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,18 @@ +on: + workflow_dispatch: +jobs: + demo_app_authentication: + runs-on: ubuntu-latest + steps: + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ vars.CIAPPID }} + private-key: ${{ secrets.CIAPPPRIKEY }} + + - name: Use the token + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + gh api dolibarr From 53ffe42f9235cce3d3287b87fbbd911a82adcd61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 00:27:58 +0100 Subject: [PATCH 09/31] Test CI --- .github/workflows/test.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f49494c5522..1fb89b8cb96 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,6 +4,9 @@ jobs: demo_app_authentication: runs-on: ubuntu-latest steps: + - name: Log + run: echo "CIAPPID ${{ vars.CIAPPID }}" + - name: Generate a token id: generate-token uses: actions/create-github-app-token@v1 From 682544ad45506539fe702e10e85e7bd96d49152c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 13:08:56 +0100 Subject: [PATCH 10/31] Update test.yaml (#32054) * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update pr-18.yaml * Update pr-18.yaml * Update pr-18.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update test.yaml * Update pr-18.yaml * Update test.yaml --- .github/workflows/pr-18.yaml | 18 ++++++++++++------ .github/workflows/test.yaml | 26 ++++++++++++-------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index a0c2579dc0d..d60a225a455 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -1,15 +1,18 @@ on: pull_request: - types: [opened, reopened] + types: [opened, synchronize, reopened] branches: - "18.0" push: branches: - "18.0" +permissions: write-all + jobs: run: runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -19,15 +22,18 @@ jobs: sudo apt update sudo apt install gh -y - - name: Authenticate GitHub CLI - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: gh auth login --with-token <<< "$GH_TOKEN" + #- name: Authenticate GitHub CLI + # env: + # GH_TOKEN: ${{ secrets.GH_TOKEN }} + # run: gh auth login --with-token <<< "$GH_TOKEN" - name: Assign reviewer env: + GH_TOKEN: ${{ github.token }} + #GH_TOKEN: ${{ secrets.GH_TOKEN }} #REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer run: | + echo "GH_TOKEN=$GH_TOKEN" pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) - gh pr edit $pr_number --add-reviewer "$REVIEWER" + #gh pr edit $pr_number --add-reviewer "$REVIEWER" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1fb89b8cb96..cf263dd0b57 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,21 +1,19 @@ on: workflow_dispatch: + pull_request: + types: [opened, reopened, synchronize] + branches: + - "18.0" + +permissions: write-all + jobs: - demo_app_authentication: + testjob: runs-on: ubuntu-latest steps: - name: Log - run: echo "CIAPPID ${{ vars.CIAPPID }}" - - - name: Generate a token - id: generate-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ vars.CIAPPID }} - private-key: ${{ secrets.CIAPPPRIKEY }} - - - name: Use the token - env: - GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | - gh api dolibarr + echo "variable org: ${{vars.AAA}}" + echo "env prg: ${{env.AAA}}" + echo "secret org: ${{secrets.BBB}}" + echo "variable repository of orga: ${{vars.CCC}}" From e35b534ee282bfa0657557d9b5ba146e3ae5bca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 22 Nov 2024 13:22:05 +0100 Subject: [PATCH 11/31] fix ajax tooltip lib_foot.js.php (#32044) Co-authored-by: Laurent Destailleur --- htdocs/core/js/lib_foot.js.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 5ed7dfb2eb1..4f2ca935115 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -110,8 +110,10 @@ if (empty($conf->dol_no_mouse_hover)) { success: function(response){ // Setting content option console.log("ajax success"); - elemfortooltip.tooltip("option","content",response); - elemfortooltip.tooltip("open"); + if (elemfortooltip.is(":hover")) { + elemfortooltip.tooltip("option","content",response); + elemfortooltip.tooltip("open"); + } } }); }, opendelay)); From 9cd7d381a64968126581e298e4f757235ed474e5 Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Fri, 22 Nov 2024 13:25:25 +0100 Subject: [PATCH 12/31] flip supplier proposal and orders to show up as negative in the project Profit overview (#32048) Co-authored-by: Jon Bendtsen --- htdocs/projet/element.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 614d9d3c39f..ed14a6791bf 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -909,7 +909,7 @@ foreach ($listofreferent as $key => $value) { $total_ttc_by_line = $element->total_ttc; } - // Change sign of $total_ht_by_line and $total_ttc_by_line for some cases + // Change sign of $total_ht_by_line and $total_ttc_by_line for various payments if ($tablename == 'payment_various') { if ($element->sens == 1) { $total_ht_by_line = -$total_ht_by_line; @@ -917,6 +917,12 @@ foreach ($listofreferent as $key => $value) { } } + // Change sign of $total_ht_by_line and $total_ttc_by_line for supplier proposal and supplier order + if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_proposal') { + $total_ht_by_line = -$total_ht_by_line; + $total_ttc_by_line = -$total_ttc_by_line; + } + // Add total if we have to if ($qualifiedfortotal) { $total_ht = $total_ht + $total_ht_by_line; From 32b18d6bfd497d54a8c89108deb1033660019d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2024 15:22:22 +0100 Subject: [PATCH 13/31] Execute --- .github/workflows/pr-18.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-18.yaml b/.github/workflows/pr-18.yaml index d60a225a455..2682e99df38 100644 --- a/.github/workflows/pr-18.yaml +++ b/.github/workflows/pr-18.yaml @@ -13,6 +13,10 @@ jobs: run: runs-on: ubuntu-latest + env: + # GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ github.token }} + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -23,17 +27,16 @@ jobs: sudo apt install gh -y #- name: Authenticate GitHub CLI - # env: - # GH_TOKEN: ${{ secrets.GH_TOKEN }} - # run: gh auth login --with-token <<< "$GH_TOKEN" + # run: | + # echo "GH_TOKEN=$GH_TOKEN" + # gh auth login --with-token <<< "$GH_TOKEN" - name: Assign reviewer env: - GH_TOKEN: ${{ github.token }} - #GH_TOKEN: ${{ secrets.GH_TOKEN }} #REVIEWER: "eldy,lvessiller-opendsi,rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer REVIEWER: "rycks" # Remplacez par le nom d'utilisateur GitHub du reviewer run: | echo "GH_TOKEN=$GH_TOKEN" pr_number=$(jq --raw-output .number < $GITHUB_EVENT_PATH) - #gh pr edit $pr_number --add-reviewer "$REVIEWER" + gh pr edit $pr_number --add-reviewer "$REVIEWER" + continue-on-error: true From acdab170a7b0445102ceefab05e95e44fc5ae48a Mon Sep 17 00:00:00 2001 From: "Thomas C." <56068416+Thomas905@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:58:21 +0100 Subject: [PATCH 14/31] fix (#32012) --- htdocs/fourn/facture/card.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6f90af4ba22..d2699019a63 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3030,14 +3030,12 @@ if ($action == 'create') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1); } - if (!$formconfirm) { - $parameters = array('formConfirm' => $formconfirm, 'lineid'=>$lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $formconfirm .= $hookmanager->resPrint; - } elseif ($reshook > 0) { - $formconfirm = $hookmanager->resPrint; - } + $parameters = array('formConfirm' => $formconfirm, 'lineid'=>$lineid); + $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $formconfirm .= $hookmanager->resPrint; + } elseif ($reshook > 0) { + $formconfirm = $hookmanager->resPrint; } // Print form confirm From 7b160390840001c1cad74e8c916ef13eb00686fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 27 Nov 2024 18:02:59 +0100 Subject: [PATCH 15/31] fix test (#32110) --- htdocs/admin/mails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 73096056f98..cf0a1451c42 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -42,7 +42,7 @@ if (!$user->admin) { $usersignature = $user->signature; // For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html. -if ($action == 'test' || ($action == 'send' && $trackid = 'test')) { +if ($action == 'test' || ($action == 'send' && $trackid == 'test')) { $usersignature = dol_string_nohtmltag($usersignature, 2); } From e9009ede870c1a1a329f3c22f8ddc5a6120f618d Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Wed, 27 Nov 2024 22:02:29 +0100 Subject: [PATCH 16/31] Fix double hook printFieldPreListTitle in command list (#32108) * Fix command list : remove double hook printFieldPreListTitle * Remove files --- htdocs/commande/list.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ab99e305871..f82da9ce6f4 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1492,9 +1492,6 @@ if (empty($reshook)) { if (!empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters = array(); - $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; print '
'; } From 1080d0718c3c62ee4028d28435f5b4f16c3b145f Mon Sep 17 00:00:00 2001 From: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:03:25 +0100 Subject: [PATCH 17/31] Fix no display of extrafields in bankentries_list (#32149) * Fix no display of extrafields in bankentries_list * fix error * fix comment --------- Co-authored-by: Hystepik --- htdocs/compta/bank/bankentries_list.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index da6630f77e3..13bdf1441d2 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -597,9 +597,9 @@ $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappr $sql .= " b.fk_account, b.fk_type, b.fk_bordereau,"; $sql .= " ba.rowid as bankid, ba.ref as bankref"; // Add fields from extrafields -if (!empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); +if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label'])) { + foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); } } // Add fields from hooks @@ -612,8 +612,8 @@ if ($search_bid > 0) { } $sql .= " ".MAIN_DB_PREFIX."bank_account as ba,"; $sql .= " ".MAIN_DB_PREFIX."bank as b"; -if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)"; +if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$extrafieldsobjectkey."_extrafields as ef on (b.rowid = ef.fk_object)"; } // Add fields from hooks @@ -1831,6 +1831,7 @@ if ($resql) { } // Extra fields + $obj = $objp; // Because extrafield template use $obj and not $objp as object variable name include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters=array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray); From 53f566e9f13629b383c1c25944e163fc531d6bd4 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Sat, 30 Nov 2024 13:02:58 +0100 Subject: [PATCH 18/31] Fix #32145 (#32162) Parameter is always "1" or "0" --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 718419e3491..349d6e77951 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -470,7 +470,7 @@ if (empty($reshook)) { // Action to add a message (private or not, with email or not). // This may also send an email (concatenated with email_intro and email footer if checkbox was selected) if ($action == 'add_message' && GETPOSTISSET('btn_add_message') && $permissiontoread) { - $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "on" ? 1 : 0), 0); + $ret = $object->newMessage($user, $action, (GETPOST('private_message', 'alpha') == "1" ? 1 : 0), 0); if ($ret > 0) { if (!empty($backtopage)) { From 18775c06ea9bed16c8590f9b0590a96c7cd0e531 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Sat, 30 Nov 2024 13:06:36 +0100 Subject: [PATCH 19/31] FIX #31890 store empty line extrafields (#32152) * FIX #31890 store empty line extrafields If a line extrafield had originally some contents, after deleting it and submitting it as empty, the extrafield was not stored but the original contents kept * corrected whitespace --- htdocs/core/class/extrafields.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d58bcdc5743..a1b1151a15d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2017 Nicolas ZABOURI * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2022 Antonin MARCHAL + * Copyright (C) 2024 Joachim Kueter * * 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 @@ -2415,10 +2416,13 @@ class ExtraFields } $value_key = dol_htmlcleanlastbr(GETPOST($keysuffix."options_".$key.$keyprefix, 'restricthtml')); } else { - if (!GETPOST($keysuffix."options_".$key.$keyprefix)) { + if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. } $value_key = GETPOST($keysuffix."options_".$key.$keyprefix); + if ($value_key === '') { + $value_key = null; + } } $array_options[$keysuffix."options_".$key] = $value_key; // No keyprefix here. keyprefix is used only for read. From 6e4ca0b8518ddfefb6156ae64cb58e9bd074f381 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sat, 30 Nov 2024 16:27:00 +0100 Subject: [PATCH 20/31] FIX with no perm on supplier, must not see supplier of the best price --- htdocs/fourn/class/fournisseur.product.class.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 089bfbefdb5..5edfa06eae1 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -1078,12 +1078,12 @@ class ProductFournisseur extends Product public function display_price_product_fournisseur($showunitprice = 1, $showsuptitle = 1, $maxlen = 0, $notooltip = 0, $productFournList = array()) { // phpcs:enable - global $conf, $langs; + global $conf, $langs, $user; $out = ''; $langs->load("suppliers"); if (count($productFournList) > 0) { - $out .= ''; + $out .= '
'; $out .= ''; $out .= ''; $out .= ''; @@ -1096,9 +1096,12 @@ class ProductFournisseur extends Product } $out .= '
'.($showunitprice ? $langs->trans("Price").' '.$langs->trans("HT") : '').''.($showunitprice ? $langs->trans("QtyMin") : '').''.$langs->trans("Supplier").'
'; } else { - $out = ($showunitprice ? price($this->fourn_unitprice * (1 - $this->fourn_remise_percent / 100) + $this->fourn_remise, 0, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT").'   (' : ''); - $out .= ($showsuptitle ? ''.$langs->trans("Supplier").': ' : '').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->ref_supplier; - $out .= ($showunitprice ? ')' : ''); + $out = ($showunitprice ? price($this->fourn_unitprice * (1 - $this->fourn_remise_percent / 100) + $this->fourn_remise, 0, $langs, 1, -1, -1, $conf->currency).' '.$langs->trans("HT") : ''); + if ($user->hasRight("fournisseur", "read")) { // Without permission, never show the best supplier seller + $out .= ($showunitprice ? '   (' : ''); + $out .= ($showsuptitle ? ''.$langs->trans("Supplier").': ' : '').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->ref_supplier; + $out .= ($showunitprice ? ')' : ''); + } } return $out; } From 769027970b1093b6031264c25bdcd8748e32ec96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Sat, 30 Nov 2024 17:18:18 +0100 Subject: [PATCH 21/31] Fix #32155 (#32156) Error forging a SQL request on page eventorganization/conferenceorboothattendee_list.php Co-authored-by: Laurent Destailleur --- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 6e3a3d99bd0..29079ce513d 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -203,7 +203,7 @@ class ConferenceOrBoothAttendee extends CommonObject if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE) && getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '' && getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '-1') { - $this->fields['fk_soc']['type'] .= ' AND client = '.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0)); + $this->fields['fk_soc']['type'] .= ' AND (client:=:'.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0) . ')'); } // Example to show how to set values of fields definition dynamically From b02742ebe1c2832af79a29f44c105386f6ba8f48 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Sun, 1 Dec 2024 23:03:08 +0100 Subject: [PATCH 22/31] FIX #32178: repair.php: fix missing 'as' with Postgres (#32179) Fix the following SQL error when executing the repair script on 19.0.x and above. Error DB_ERROR_SYNTAX (Req 159): create table tmp_bank_url_expense_user (select e.fk_user_author, bu2.fk_bank from llx_expensereport as e, llx_bank_url as bu2 where bu2.url_id = e.rowid and bu2.type = 'payment_expensereport'); ERROR: 42601: syntax error at or near "select" LINE 1: create table tmp_bank_url_expense_user (select e.fk_user_aut... ^ LOCATION: scanner_yyerror, scan.l:1145 --- htdocs/install/mysql/migration/repair.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index ef8989f34da..a41f197f70b 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -410,7 +410,7 @@ drop table tmp_c_shipment_mode; -- Restore id of user on link for payment of expense report drop table tmp_bank_url_expense_user; -create table tmp_bank_url_expense_user (select e.fk_user_author, bu2.fk_bank from llx_expensereport as e, llx_bank_url as bu2 where bu2.url_id = e.rowid and bu2.type = 'payment_expensereport'); +create table tmp_bank_url_expense_user as (select e.fk_user_author, bu2.fk_bank from llx_expensereport as e, llx_bank_url as bu2 where bu2.url_id = e.rowid and bu2.type = 'payment_expensereport'); update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_url_expense_user as e where e.fk_bank = bu.fk_bank) where (bu.url_id = 0 OR bu.url_id IS NULL) and bu.type ='user'; drop table tmp_bank_url_expense_user; From 5565b153b2c202ddeef4f762854213d899c3ecef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Sun, 1 Dec 2024 23:15:58 +0100 Subject: [PATCH 23/31] Fix #32176 (#32177) --- htdocs/eventorganization/conferenceorboothattendee_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index afa3205f81a..fb6b219df07 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -603,7 +603,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { // Show message $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...'); + $message .= '&exportkey='.(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY') ? urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) : '...'); $message .= "&project=".$projectstatic->id.'&module='.urlencode('conforbooth@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'&output=file">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; print ""; From cf0d945daa10f36ad1448ddf0c08fbb5c58e2503 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Sun, 1 Dec 2024 23:16:38 +0100 Subject: [PATCH 24/31] FIX #32171 (#32172) State of reverse charge checkbox in create form not persisted after reload due to validation error --- htdocs/fourn/facture/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a748f4ad218..88916572746 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2691,7 +2691,9 @@ if ($action == 'create') { require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; print '' . $langs->trans('VATReverseCharge') . ''; // Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed - if ($vat_reverse_charge == 1 || $societe->vat_reverse_charge == 1 || ($societe->country_code != 'FR' && isInEEC($societe) && !empty($societe->tva_intra))) { + if (GETPOSTISSET('vat_reverse_charge')) { // Check if form was submitted previously + $vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0; + } elseif ($vat_reverse_charge == 1 || $societe->vat_reverse_charge == 1 || ($societe->country_code != 'FR' && isInEEC($societe) && !empty($societe->tva_intra))) { $vat_reverse_charge = 1; } else { $vat_reverse_charge = 0; From 13fdf790d6eb368b5db74ce764d232d93eb3735f Mon Sep 17 00:00:00 2001 From: Gregor Ljubic <50360097+ITResitve@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:17:00 +0100 Subject: [PATCH 25/31] Update list.php (#32164) Co-authored-by: Laurent Destailleur --- htdocs/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c1960a0c5e9..3db787bbcc2 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1050,8 +1050,8 @@ if ($search_fk_input_reason > 0) { if ($search_user > 0) { $sql .= " AND EXISTS ("; $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; - $sql .= " FROM llx_element_contact as ec"; - $sql .= " INNER JOIN llx_c_type_contact as tc"; + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal'"; $sql .= " WHERE ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } From 2ad3001ccb871430c752dc1f4b721f0fd03dc699 Mon Sep 17 00:00:00 2001 From: Gregor Ljubic <50360097+ITResitve@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:17:37 +0100 Subject: [PATCH 26/31] Update list.php (#32165) * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1cd7f22552e..9ad46ac19d6 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -735,8 +735,8 @@ if ($search_note_public) { if ($search_user > 0) { $sql .= " AND EXISTS ("; $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; - $sql .= " FROM llx_element_contact as ec"; - $sql .= " INNER JOIN llx_c_type_contact as tc"; + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal'"; $sql .= " WHERE ec.element_id = p.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } From 6337a987d88b64013eab90dc6183c4af3ed7415e Mon Sep 17 00:00:00 2001 From: Mathieu Moulin Date: Sun, 1 Dec 2024 23:28:49 +0100 Subject: [PATCH 27/31] Fix handling of boolean extrafields in list filters (#32109) * Fix show payment URL in massaction context when not one email per recipient * Debug v20 - fix param for filter on boolean * FIX : Fix case when the value of a extrafields of the type 'boolean', 'select' or other have an option with a value equal to '0'. It's not reselected when the filter is set. * Revert "Fix show payment URL in massaction context when not one email per recipient" This reverts commit 0986d487f1946dd90686dc9c38f89a5f04a37162. --------- Co-authored-by: Laurent Destailleur Co-authored-by: kkhelifa --- .../tpl/extrafields_list_search_input.tpl.php | 2 +- .../tpl/extrafields_list_search_param.tpl.php | 20 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index f57101b81e6..3f90715cbea 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -47,7 +47,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table if (in_array($typeofextrafield, array('link', 'sellist', 'text', 'html'))) { $morecss = 'maxwidth200'; } - echo $extrafields->showInputField($key, (empty($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); + echo $extrafields->showInputField($key, (!isset($search_array_options[$search_options_pattern.$tmpkey]) ? '' : $search_array_options[$search_options_pattern.$tmpkey]), '', '', $search_options_pattern, $morecss, 0, $extrafieldsobjectkey, 1); } print ''; } diff --git a/htdocs/core/tpl/extrafields_list_search_param.tpl.php b/htdocs/core/tpl/extrafields_list_search_param.tpl.php index 7e58e106882..da123939c68 100644 --- a/htdocs/core/tpl/extrafields_list_search_param.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_param.tpl.php @@ -31,8 +31,24 @@ if (!empty($search_array_options) && is_array($search_array_options)) { // $extr $param .= '&'.$search_options_pattern.$tmpkey.'_endmin='.dol_print_date($val['end'], '%M'); $val = ''; } - if ($val != '') { - $param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val); + if ($val !== '') { + if (is_array($val)) { + foreach ($val as $val2) { + $param .= '&'.$search_options_pattern.$tmpkey.'[]='.urlencode($val2); + } + } else { + // test if we have checkbox type, we add the _multiselect needed into param + $tmpkey = preg_replace('/'.$search_options_pattern.'/', '', $key); + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('checkbox', 'chkbxlst'))) { + $param .= '&'.$search_options_pattern.$tmpkey.'_multiselect='.urlencode($val); + } + // test if we have boolean type, we add the _booleand needed into param + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('boolean'))) { + $param .= '&'.$search_options_pattern.$tmpkey.'_boolean='.urlencode($val); + } + + $param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val); + } } } } From 06808b38b5e54956b66badb392767f4150d2f114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Sun, 1 Dec 2024 23:29:42 +0100 Subject: [PATCH 28/31] Fix #27223 (#32173) --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 7275ff3f2ef..24a7eb38926 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1748,7 +1748,7 @@ class EmailCollector extends CommonObject // Note: we can have // Message-ID=A, In-Reply-To=B, References=B and message can BE an answer or NOT (a transfer rewriten) $isanswer = 0; - if (preg_match('/Re\s*:\s+/i', $headers['Subject'])) { + if (preg_match('/^(回复|回覆|SV|Antw|VS|RE|Re|AW|Aw|ΑΠ|השב| תשובה | הועבר|Vá|R|RIF|BLS|Atb|RES|Odp|பதில்|YNT|ATB)\s*:\s+/i', $headers['Subject'])) { $isanswer = 1; } //if ($headers['In-Reply-To'] != $headers['Message-ID'] && empty($headers['References'])) $isanswer = 1; // If in-reply-to differs of message-id, this is a reply From 4962dd1a8147c2d7e2b4d9c8362ff811b5c44a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Lukas?= Date: Mon, 2 Dec 2024 00:48:13 +0100 Subject: [PATCH 29/31] Fix #29353 (#32151) Hidden extrafields are NULL on update. Can only happen with extrafields in positions of commercial elements (facture, propal, commande, etc) --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 355a6dc7684..055a24ac5fd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8210,6 +8210,10 @@ abstract class CommonObject if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) { continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list } elseif (($mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3 && abs($visibility) != 4) { + // We need to make sure, that the values of hidden extrafields are also part of $_POST. Otherwise, they would be empty after an update of the object. See also getOptionalsFromPost + $ef_name = 'options_' . $key; + $ef_value = $this->array_options[$ef_name]; + $out .= '' . "\n"; continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list and <> 4 = not visible at the creation } elseif ($mode == 'view' && empty($visibility)) { continue; From ea52f679c7da00fcfab0c0e091d60794cd219b0a Mon Sep 17 00:00:00 2001 From: Gregor Ljubic <50360097+ITResitve@users.noreply.github.com> Date: Mon, 2 Dec 2024 00:49:13 +0100 Subject: [PATCH 30/31] Fix #32147 (#32159) Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 4eed51ebbbf..29225c9e178 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -875,8 +875,8 @@ if (!empty($search_fac_rec_source_title)) { if ($search_user > 0) { $sql .= " AND EXISTS ("; $sql .= " SELECT ec.fk_c_type_contact, ec.element_id, ec.fk_socpeople"; - $sql .= " FROM llx_element_contact as ec"; - $sql .= " INNER JOIN llx_c_type_contact as tc"; + $sql .= " FROM ".MAIN_DB_PREFIX."element_contact as ec"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_type_contact as tc"; $sql .= " ON ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal'"; $sql .= " WHERE ec.element_id = f.rowid AND ec.fk_socpeople = ".((int) $search_user).")"; } From 3284f21e912d12b108f16355e2b23f5ae6b8ae32 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Mon, 2 Dec 2024 01:30:13 +0100 Subject: [PATCH 31/31] Fix remind for expired membership ko when date of renewal does not end with 00:00:00 --- htdocs/adherents/class/adherent.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3aeb87792f0..39bda3d854c 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3045,11 +3045,13 @@ class Adherent extends CommonObject $tmp = dol_getdate($now); $datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year'], 'tzserver'), $daysbeforeend, 'd'); + $datetosearchforend = dol_time_plus_duree(dol_mktime(23, 59, 59, $tmp['mon'], $tmp['mday'], $tmp['year'], 'tzserver'), $daysbeforeend, 'd'); $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent'; $sql .= " WHERE entity = ".((int) $conf->entity); // Do not use getEntity('adherent').")" here, we want the batch to be on its entity only; $sql .= " AND statut = 1"; - $sql .= " AND datefin = '".$this->db->idate($datetosearchfor)."'"; + $sql .= " AND datefin >= '".$this->db->idate($datetosearchfor)."'"; + $sql .= " AND datefin <= '".$this->db->idate($datetosearchforend)."'"; //$sql .= " LIMIT 10000"; $resql = $this->db->query($sql);