diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 0451cd31d..f3ef08023 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -2430,7 +2430,6 @@ {strip} {addJsDef max_child_age=$max_child_age} - {addJsDef max_child_in_room=$max_child_in_room} {addJsDefL name='select_age_txt'}{l s='Select age' js=1}{/addJsDefL} {addJsDefL name='under_1_age'}{l s='Under 1' js=1}{/addJsDefL} {addJsDefL name='room_txt'}{l s='Room' js=1}{/addJsDefL} diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index c0c841758..7f9046cdf 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -1335,7 +1335,6 @@ {addJsDefL name='invalid_occupancy_txt'}{l s='Invalid occupancy(adults/children) found.' js=1}{/addJsDefL} {addJsDefL name='select_room_txt'}{l s='Select room' js=1}{/addJsDefL} {addJsDef max_child_age=$max_child_age|escape:'quotes':'UTF-8'} - {addJsDef max_child_in_room=$max_child_in_room|escape:'quotes':'UTF-8'} {addJsDef ROOM_STATUS_CHECKED_IN=$ROOM_STATUS_CHECKED_IN|escape:'quotes':'UTF-8'} {addJsDef ROOM_STATUS_CHECKED_OUT=$ROOM_STATUS_CHECKED_OUT|escape:'quotes':'UTF-8'} {addJsDef ALLOTMENT_MANUAL=$ALLOTMENT_MANUAL|escape:'quotes':'UTF-8'} diff --git a/cache/smarty/cache/index.php b/cache/smarty/cache/index.php index 369a7a3f3..ffdebb428 100644 --- a/cache/smarty/cache/index.php +++ b/cache/smarty/cache/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2014 PrestaShop SA +* @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/cache/smarty/compile/index.php b/cache/smarty/compile/index.php index 369a7a3f3..ffdebb428 100644 --- a/cache/smarty/compile/index.php +++ b/cache/smarty/compile/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2014 PrestaShop SA +* @copyright 2007-2015 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 6885395fc..5252400ca 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -498,7 +498,6 @@ class FrontControllerCore extends Controller 'is_occupancy_wise_search' => $isOccupancyWiseSearch, 'occupancy_required_for_booking' => $occupancyRequiredForBooking, 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), - 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'show_full_date' => $this->show_full_date )); diff --git a/config/defines.inc.php b/config/defines.inc.php index f16e93903..d78f92763 100644 --- a/config/defines.inc.php +++ b/config/defines.inc.php @@ -26,7 +26,7 @@ /* Debug only */ if (!defined('_PS_MODE_DEV_')) { - define('_PS_MODE_DEV_', false); + define('_PS_MODE_DEV_', true); } /* Compatibility warning */ define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 30026bcca..438490de3 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -443,7 +443,6 @@ class AdminOrdersControllerCore extends AdminController 'payment_types' => $paymentTypes, 'PAYMENT_TYPE_PAY_AT_HOTEL' => OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL, 'currency' => new Currency((int)$cart->id_currency), - 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), 'occupancy_required_for_booking' => $occupancyRequiredForBooking, )); @@ -3626,7 +3625,6 @@ class AdminOrdersControllerCore extends AdminController 'htl_booking_order_data' => $bookingOrderInfo, 'hotel_order_status' => $htlOrderStatus, 'order_detail_data' => $order_detail_data, - 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), 'hotel_service_products' => $orderHotelServiceProducts, 'standalone_service_products' => $orderStandaloneServiceProducts, diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 0a7acb76f..6c6b7fc4e 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3407,10 +3407,6 @@ class AdminProductsControllerCore extends AdminController } if ($baseChildren == '' || !Validate::isUnsignedInt($baseChildren)) { $this->errors[] = Tools::displayError('Invalid base children'); - } else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) { - if ($baseChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) { - $this->errors[] = sprintf(Tools::displayError('Base children cannot be greater than max childern allowed in the room of this room type (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')); - } } if (!$maxAdults || !Validate::isUnsignedInt($maxAdults)) { $this->errors[] = Tools::displayError('Invalid maximum number of adults'); @@ -3425,10 +3421,6 @@ class AdminProductsControllerCore extends AdminController $this->errors[] = Tools::displayError('Maximum number of children cannot be less than base children'); } elseif ($maxChildren >= $maxGuests) { $this->errors[] = Tools::displayError('Maximum number of children cannot be more or equal than maximum number of guests.(1 adult is mandatory in a room)'); - } else if (Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) { - if ($maxChildren > Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')) { - $this->errors[] = sprintf(Tools::displayError('Maximum number of children cannot be greater than max childern allowed in the room of this room type (Max: %s)'), Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM')); - } } if (!$maxGuests || !Validate::isUnsignedInt($maxGuests)) { $this->errors[] = Tools::displayError('Invalid maximum number of guests'); diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index a196694f5..0070f18e8 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1063,7 +1063,7 @@ class HotelHelper Configuration::updateValue('WK_ADVANCED_PAYMENT_INC_TAX', 1); Configuration::updateValue('WK_GLOBAL_CHILD_MAX_AGE', 15); - Configuration::updateValue('WK_GLOBAL_MAX_CHILD_IN_ROOM', 0); + Configuration::updateValue('QLO_GLOBAL_MAX_INFANT_AGE', 1); Configuration::updateValue('PS_MAX_CHECKOUT_OFFSET', 365); Configuration::updateValue('PS_MIN_BOOKING_OFFSET', 0); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index e18ab1f4a..75f2bca2d 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -378,13 +378,12 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'hint' => $this->l('Enter the age of the guest, which that guest will be considered as child.'), 'class' => 'fixed-width-xxl', ), - 'WK_GLOBAL_MAX_CHILD_IN_ROOM' => array( - 'title' => $this->l('Maximum children allowed in a room'), + 'QLO_GLOBAL_MAX_INFANT_AGE' => array( + 'title' => $this->l('Consider guest as Infant below age'), 'type' => 'text', 'required' => true, 'validation' => 'isUnsignedInt', - 'hint' => $this->l('Enter number of the child allowed in a room.'), - 'desc' => $this->l('Set as 0 if you do not want to limit children in a room.'), + 'hint' => $this->l('Enter number of the infant age.'), 'class' => 'fixed-width-xxl', ), ), @@ -531,13 +530,25 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController // Validation for the occupancy settings // max age of infant after which guest will considered as child // below 18 $globalChildMaxAge = Tools::getValue('WK_GLOBAL_CHILD_MAX_AGE'); - $globalMaxChildInRoom = Tools::getValue('WK_GLOBAL_MAX_CHILD_IN_ROOM'); + $globalInfantAge = Tools::getValue('QLO_GLOBAL_MAX_INFANT_AGE'); + if (!Validate::isUnsignedInt($globalChildMaxAge)) { $this->errors[] = $this->l('Invalid value for "Consider guest as child below age".'); } else if ($globalChildMaxAge <= 0) { $this->errors[] = $this->l('The value for "Consider guest as child below age" must be at least 1.'); } + if ($globalInfantAge) { + if (!Validate::isUnsignedInt($globalInfantAge)) { + $this->context->controller->errors[] = $this->l('Invalid infant age'); + } elseif ($globalInfantAge >= Configuration::get('WK_GLOBAL_CHILD_MAX_AGE')) { + $this->context->controller->errors[] = sprintf($this->l('The infant age cannot be greater than the Global child age (%s years)'), Configuration::get('WK_GLOBAL_CHILD_MAX_AGE')); + } else { + Configuration::updateValue('QLO_GLOBAL_MAX_INFANT_AGE', $globalInfantAge); + } + } else { + $this->context->controller->errors[] = $this->l('Infant age is required'); + } // End occupancy fields validation if (!$hotelNameSearchThreshold && $hotelNameSearchThreshold !== '0') { diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index fac60d468..87c31f89b 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -384,7 +384,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController 'date_to' => $this->date_to, 'occupancy_required_for_booking' => $occupancyRequiredForBooking, 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), - 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'link' => $this->context->link, 'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL, )); @@ -981,7 +980,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController 'SELLING_PREFERENCE_WITH_ROOM_TYPE' => Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 'SELLING_PREFERENCE_STANDALONE' => Product::SELLING_PREFERENCE_STANDALONE, 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), - 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'occupancy_required_for_booking' => $occupancyRequiredForBooking, 'rooms_reallocation_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'), 'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'), diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl index 7c68db350..00e73e233 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl @@ -74,7 +74,7 @@