Add profile access restriction when adding room types

This commit is contained in:
Abhishek Kumar
2022-01-05 16:27:47 +05:30
parent 8a5c66f1b6
commit 15575f040d

View File

@@ -4609,7 +4609,16 @@ class AdminProductsControllerCore extends AdminController
$objRoomType = new HotelRoomType();
$objHotelInfo = new HotelBranchInformation();
$data->assign('htl_info', $objHotelInfo->hotelsNameAndId());
$idsHotel = $objHotelInfo->getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
$hotelsInfo = array();
foreach ($idsHotel as $idHotel) {
$objHotelBranchInfo = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelsInfo[] = array(
'id' => (int)$idHotel,
'hotel_name' => $objHotelBranchInfo->hotel_name,
);
}
$data->assign('htl_info', $hotelsInfo);
if ($hotelRoomType = $objRoomType->getRoomTypeInfoByIdProduct($product->id)) {
$data->assign('htl_room_type', $hotelRoomType);
$hotelFullInfo = $objHotelInfo->hotelBranchInfoById($hotelRoomType['id_hotel']);