From 60811dff426cb1e09cc095f6e8b78b1df5f9d470 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 18 Jul 2024 19:09:36 +0530 Subject: [PATCH] Fixed hotel permission issue when creating a hotel --- .../classes/HotelBranchInformation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelBranchInformation.php b/modules/hotelreservationsystem/classes/HotelBranchInformation.php index 9463c8cd0..92b7bbe1d 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchInformation.php +++ b/modules/hotelreservationsystem/classes/HotelBranchInformation.php @@ -183,10 +183,10 @@ class HotelBranchInformation extends ObjectModel /* Query definition */ $query = 'REPLACE INTO `'._DB_PREFIX_.'htl_access` (`id_profile`, `id_hotel`, `access`)'; - $query .= ' VALUES '.'(1, '.(int)$idHotel.', 1)'; + $query .= ' VALUES '.'('.(int) _PS_ADMIN_PROFILE_.', '.(int)$idHotel.', 1)'; /* Profile selection */ - $profiles = Db::getInstance()->executeS('SELECT `id_profile` FROM '._DB_PREFIX_.'profile WHERE `id_profile` != 1'); - if (!$profiles || empty($profiles)) { + $profiles = Db::getInstance()->executeS('SELECT `id_profile` FROM '._DB_PREFIX_.'profile WHERE `id_profile` != '.(int) _PS_ADMIN_PROFILE_); + if ($profiles) { foreach ($profiles as $profile) { $access = 0; if (isset($context->employee->id_profile)) {