From 3260a036d86fd087a7e32ce60ea55f30c7445b7c Mon Sep 17 00:00:00 2001
From: "florian.azizian" <florian.azizian@maarch.org>
Date: Wed, 13 Sep 2017 15:15:11 +0100
Subject: [PATCH] =?UTF-8?q?FIX=20#5491=20prendre=20en=20compte=20cat=C3=A9?=
 =?UTF-8?q?gorie=20et=20clause=20where=20pour=20afficher=20les=20actions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../indexing_searching/change_category_actions.php             | 2 +-
 modules/basket/class/class_modules_tools_Abstract.php          | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/apps/maarch_entreprise/indexing_searching/change_category_actions.php b/apps/maarch_entreprise/indexing_searching/change_category_actions.php
index 4ba0179fa4e..3976db13a93 100755
--- a/apps/maarch_entreprise/indexing_searching/change_category_actions.php
+++ b/apps/maarch_entreprise/indexing_searching/change_category_actions.php
@@ -7,7 +7,7 @@ $b = new basket();
 $_SESSION['category_id'] = $_REQUEST['category_id'];
 
 $actions = $b->get_actions_from_current_basket(
-    $_REQUEST['resId'], $_REQUEST['collId'], 'PAGE_USE', false
+    $_REQUEST['resId'], $_REQUEST['collId'], 'PAGE_USE', true
 );
 if (count($actions) > 0) {
     //$frmStr .= '<b>' . _ACTIONS . ' : </b>';
diff --git a/modules/basket/class/class_modules_tools_Abstract.php b/modules/basket/class/class_modules_tools_Abstract.php
index e4d871ee32b..078743e28ca 100755
--- a/modules/basket/class/class_modules_tools_Abstract.php
+++ b/modules/basket/class/class_modules_tools_Abstract.php
@@ -679,7 +679,6 @@ abstract class basket_Abstract extends Database
                         strtoupper($mode) == 'PAGE_USE' 
                         && $_SESSION['current_basket']['actions'][$i]['PAGE_USE'] == 'Y' 
                         && $testWhere && strtoupper($resId) != 'NONE'
-                        && ($_SESSION['current_basket']['actions'][$i]['id'] <> 'IndexingBasket')
                     ) {
                         $where = ' where res_id = ' . $resId;
                         if (!empty($_SESSION['current_basket']['actions'][$i]['WHERE'])) {
@@ -689,7 +688,7 @@ abstract class basket_Abstract extends Database
                         if ($stmt->rowCount() > 0) {
                             $arr[] = ['VALUE' => $_SESSION['current_basket']['actions'][$i]['ID'], 'LABEL' => $_SESSION['current_basket']['actions'][$i]['LABEL']];
                         }
-                    } else if (strtoupper($mode) == 'PAGE_USE' && $_SESSION['current_basket']['actions'][$i]['PAGE_USE'] == 'Y' && !$testWhere) {
+                    } else if (strtoupper($mode) == 'PAGE_USE' && $_SESSION['current_basket']['actions'][$i]['PAGE_USE'] == 'Y') {
                         $arr[] = ['VALUE' => $_SESSION['current_basket']['actions'][$i]['ID'], 'LABEL' => $_SESSION['current_basket']['actions'][$i]['LABEL']];
                     } else if (strtoupper($mode) == 'MASS_USE' && $_SESSION['current_basket']['actions'][$i]['MASS_USE'] == 'Y') {
                         // If "MASS_USE" adding the actions in the array
-- 
GitLab